From f6b4495fbc52fadc30928a12e501e7f04cc7abc2 Mon Sep 17 00:00:00 2001 From: Matthias Simon Date: Mon, 15 Aug 2022 15:41:29 +0200 Subject: [PATCH] Copy updates from Andras --- .../NegSem_0501_Identifier_001.ttcn | 0 .../NegSyn_0501_Identifier_001.ttcn | 0 .../Syn_0501_Identifier_001.ttcn | 0 .../Sem_050201_Scope_of_parameters_001.ttcn | 0 .../NegSem_050202_Uniqueness_001.ttcn | 0 .../NegSem_050202_Uniqueness_004.ttcn | 0 .../NegSem_050202_Uniqueness_005.ttcn | 0 .../NegSem_050202_Uniqueness_006.ttcn | 0 .../NegSem_050202_Uniqueness_007.ttcn | 0 .../NegSem_050202_Uniqueness_008.ttcn | 0 .../NegSem_050202_Uniqueness_009.ttcn | 0 .../NegSem_050202_Uniqueness_010.ttcn | 0 .../NegSem_050202_Uniqueness_011.ttcn | 0 .../NegSem_050202_Uniqueness_012.ttcn | 0 .../Sem_050202_Uniqueness_001.ttcn | 0 .../Sem_050202_Uniqueness_002.ttcn | 0 .../Sem_050202_Uniqueness_003.ttcn | 0 .../0502_toplevel/NegSem_0502_Scope_001.ttcn | 0 .../0502_toplevel/NegSem_0502_Scope_002.ttcn | 0 .../0502_toplevel/Sem_0502_Scope_001.ttcn | 0 .../0502_toplevel/Sem_0502_Scope_002.ttcn | 0 .../0502_toplevel/Sem_0502_Scope_003.ttcn | 0 .../0502_toplevel/Sem_0502_Scope_004.ttcn | 0 .../0502_toplevel/Sem_0502_Scope_008.ttcn | 0 .../0502_toplevel/Syn_0502_Scope_001.ttcn | 0 .../NegSem_0503_Ordering_001.ttcn | 0 .../Sem_0503_Ordering_001.ttcn | 0 .../Sem_0503_Ordering_003.ttcn | 36 ++++ .../Sem_0503_Ordering_004.ttcn | 36 ++++ .../Sem_0503_Ordering_005.ttcn | 0 ...05040101_parameters_of_kind_value_008.ttcn | 28 +++ ...05040101_parameters_of_kind_value_010.ttcn | 33 ++++ ...05040101_parameters_of_kind_value_018.ttcn | 44 +++-- ...05040101_parameters_of_kind_value_019.ttcn | 38 ++++ ...05040101_parameters_of_kind_value_020.ttcn | 28 +++ ...05040101_parameters_of_kind_value_021.ttcn | 31 +++ ...05040101_parameters_of_kind_value_022.ttcn | 33 ++++ ...05040101_parameters_of_kind_value_023.ttcn | 34 ++++ ...05040101_parameters_of_kind_value_024.ttcn | 27 +++ ...05040101_parameters_of_kind_value_025.ttcn | 33 ++++ ...05040101_parameters_of_kind_value_026.ttcn | 24 +++ ...05040101_parameters_of_kind_value_027.ttcn | 24 +++ ...05040101_parameters_of_kind_value_028.ttcn | 30 +++ ...05040101_parameters_of_kind_value_029.ttcn | 27 +++ ...05040101_parameters_of_kind_value_030.ttcn | 36 ++++ ...05040101_parameters_of_kind_value_031.ttcn | 33 ++++ ...05040101_parameters_of_kind_value_032.ttcn | 33 ++++ ...05040101_parameters_of_kind_value_026.ttcn | 35 ++++ ...05040101_parameters_of_kind_value_027.ttcn | 34 ++++ ...05040101_parameters_of_kind_value_028.ttcn | 111 +++++++++++ ...05040101_parameters_of_kind_value_029.ttcn | 34 ++++ ...05040101_parameters_of_kind_value_030.ttcn | 32 ++++ ...05040101_parameters_of_kind_value_031.ttcn | 43 +++++ ...05040101_parameters_of_kind_value_032.ttcn | 98 ++++++++++ ...05040101_parameters_of_kind_value_033.ttcn | 28 +++ ...05040101_parameters_of_kind_value_034.ttcn | 32 ++++ ...05040101_parameters_of_kind_value_035.ttcn | 34 ++++ ...05040101_parameters_of_kind_value_036.ttcn | 29 +++ ...40102_parameters_of_kind_template_004.ttcn | 2 +- ...40102_parameters_of_kind_template_008.ttcn | 28 +++ ...40102_parameters_of_kind_template_010.ttcn | 33 ++++ ...40102_parameters_of_kind_template_020.ttcn | 36 ++++ ...40102_parameters_of_kind_template_021.ttcn | 36 ++++ ...40102_parameters_of_kind_template_042.ttcn | 36 ++++ ...40102_parameters_of_kind_template_043.ttcn | 36 ++++ .../Sem_050401_top_level_030.ttcn | 29 +++ .../Sem_050401_top_level_031.ttcn | 29 +++ .../Sem_050401_top_level_032.ttcn | 29 +++ .../Sem_050401_top_level_033.ttcn | 29 +++ .../NegSem_050402_actual_parameters_103.ttcn | 6 +- .../NegSem_050402_actual_parameters_104.ttcn | 6 +- .../NegSem_050402_actual_parameters_184.ttcn | 41 ++++ .../NegSem_050402_actual_parameters_185.ttcn | 41 ++++ .../NegSem_050402_actual_parameters_186.ttcn | 40 ++++ .../NegSem_050402_actual_parameters_187.ttcn | 41 ++++ .../NegSem_050402_actual_parameters_188.ttcn | 41 ++++ .../NegSem_050402_actual_parameters_189.ttcn | 46 +++++ .../NegSem_050402_actual_parameters_190.ttcn | 49 +++++ .../NegSem_050402_actual_parameters_191.ttcn | 49 +++++ .../NegSem_050402_actual_parameters_192.ttcn | 49 +++++ .../NegSem_050402_actual_parameters_193.ttcn | 49 +++++ .../NegSem_050402_actual_parameters_194.ttcn | 46 +++++ .../NegSem_050402_actual_parameters_195.ttcn | 46 +++++ .../NegSem_050402_actual_parameters_196.ttcn | 41 ++++ .../NegSem_050402_actual_parameters_197.ttcn | 41 ++++ .../NegSem_050402_actual_parameters_198.ttcn | 41 ++++ .../NegSem_050402_actual_parameters_199.ttcn | 41 ++++ .../NegSem_050402_actual_parameters_200.ttcn | 41 ++++ .../NegSem_050402_actual_parameters_201.ttcn | 42 ++++ .../NegSem_050402_actual_parameters_202.ttcn | 43 +++++ .../NegSem_050402_actual_parameters_203.ttcn | 43 +++++ .../NegSem_050402_actual_parameters_204.ttcn | 51 +++++ .../NegSem_050402_actual_parameters_205.ttcn | 56 ++++++ .../NegSem_050402_actual_parameters_206.ttcn | 57 ++++++ .../NegSem_050402_actual_parameters_207.ttcn | 58 ++++++ .../NegSem_050402_actual_parameters_208.ttcn | 56 ++++++ .../NegSem_050402_actual_parameters_209.ttcn | 58 ++++++ .../NegSem_050402_actual_parameters_210.ttcn | 43 +++++ .../NegSem_050402_actual_parameters_211.ttcn | 41 ++++ .../NegSem_050402_actual_parameters_212.ttcn | 41 ++++ .../NegSem_050402_actual_parameters_213.ttcn | 41 ++++ .../NegSem_050402_actual_parameters_214.ttcn | 43 +++++ .../NegSem_050402_actual_parameters_215.ttcn | 40 ++++ .../NegSem_050402_actual_parameters_216.ttcn | 41 ++++ .../NegSem_050402_actual_parameters_217.ttcn | 43 +++++ .../NegSem_050402_actual_parameters_218.ttcn | 42 ++++ .../NegSem_050402_actual_parameters_219.ttcn | 42 ++++ .../NegSem_050402_actual_parameters_220.ttcn | 42 ++++ .../NegSem_050402_actual_parameters_221.ttcn | 48 +++++ .../NegSem_050402_actual_parameters_222.ttcn | 40 ++++ .../NegSem_050402_actual_parameters_223.ttcn | 42 ++++ .../NegSem_050402_actual_parameters_224.ttcn | 46 +++++ .../NegSem_050402_actual_parameters_225.ttcn | 46 +++++ .../NegSem_050402_actual_parameters_226.ttcn | 40 ++++ .../NegSem_050402_actual_parameters_227.ttcn | 44 +++++ .../NegSem_050402_actual_parameters_228.ttcn | 46 +++++ .../NegSem_050402_actual_parameters_229.ttcn | 44 +++++ .../NegSem_050402_actual_parameters_230.ttcn | 41 ++++ .../NegSem_050402_actual_parameters_231.ttcn | 44 +++++ .../NegSem_050402_actual_parameters_232.ttcn | 40 ++++ .../05_toplevel/NegSyn_05_TopLevel_001.ttcn | 0 ...Sem_06010101_AccessStringElements_001.ttcn | 8 +- .../Sem_060101_TopLevel_007.ttcn | 0 .../Sem_06010203_Ranges_009.ttcn | 28 +++ .../NegSyn_06010205_StringPattern_001.ttcn | 0 .../NegSyn_06010205_StringPattern_002.ttcn | 0 .../Sem_06010205_StringPattern_003.ttcn | 0 .../Sem_0601020602_StringMixing_007.ttcn | 0 .../Sem_060201_RecordTypeValues_005.ttcn | 39 ++++ .../Sem_060202_SetTypeValues_009.ttcn | 46 +++++ ...060204_enumerated_type_and_values_014.ttcn | 28 +++ ...060204_enumerated_type_and_values_015.ttcn | 31 +++ ...060204_enumerated_type_and_values_008.ttcn | 35 ++++ ...060204_enumerated_type_and_values_009.ttcn | 37 ++++ ...060204_enumerated_type_and_values_003.ttcn | 19 ++ ...060204_enumerated_type_and_values_004.ttcn | 18 ++ ..._referencing_fields_of_union_type_009.ttcn | 51 +++++ ..._referencing_fields_of_union_type_010.ttcn | 50 +++++ ..._referencing_fields_of_union_type_011.ttcn | 55 ++++++ ..._referencing_fields_of_union_type_012.ttcn | 54 ++++++ .../NegSem_060205_top_level_006.ttcn | 29 +++ .../NegSem_060205_top_level_007.ttcn | 33 ++++ .../NegSem_060205_top_level_008.ttcn | 33 ++++ .../Sem_060205_top_level_002.ttcn | 29 +++ .../Sem_060205_top_level_003.ttcn | 32 ++++ .../Sem_060205_top_level_004.ttcn | 34 ++++ .../NegSyn_060206_anytype_004.ttcn | 41 ++++ .../NegSyn_060206_anytype_005.ttcn | 39 ++++ .../060207_arrays/Sem_060207_arrays_024.ttcn | 33 ++++ .../060207_arrays/Sem_060207_arrays_025.ttcn | 39 ++++ ...Syn_060209_CommunicationPortTypes_001.ttcn | 35 ++++ ...Syn_060209_CommunicationPortTypes_002.ttcn | 37 ++++ ...Syn_060209_CommunicationPortTypes_003.ttcn | 36 ++++ ...Syn_060209_CommunicationPortTypes_004.ttcn | 36 ++++ ...Syn_060209_CommunicationPortTypes_005.ttcn | 28 +++ ...Syn_060209_CommunicationPortTypes_006.ttcn | 34 ++++ ...Syn_060209_CommunicationPortTypes_007.ttcn | 36 ++++ ...Syn_060209_CommunicationPortTypes_008.ttcn | 35 ++++ ...Syn_060209_CommunicationPortTypes_009.ttcn | 35 ++++ ...Sem_060209_CommunicationPortTypes_005.ttcn | 0 ...6021001_component_type_definition_001.ttcn | 23 +++ ...6021001_component_type_definition_002.ttcn | 19 ++ ...6021001_component_type_definition_003.ttcn | 26 +++ ...gSyn_060210_ReuseofComponentTypes_001.ttcn | 0 ...gSyn_060210_ReuseofComponentTypes_002.ttcn | 0 ...gSyn_060210_ReuseofComponentTypes_003.ttcn | 0 .../Sem_060210_ReuseofComponentTypes_001.ttcn | 0 .../Sem_060210_ReuseofComponentTypes_002.ttcn | 0 .../Sem_060210_ReuseofComponentTypes_003.ttcn | 0 ...60212_AddressingEntitiesInsideSut_002.ttcn | 0 ...60212_AddressingEntitiesInsideSut_003.ttcn | 0 ...60212_AddressingEntitiesInsideSut_004.ttcn | 0 .../NegSem_06021302_ListSubtyping_003.ttcn | 33 ++++ .../Sem_06021302_ListSubtyping_004.ttcn | 46 +++++ .../Sem_060214_timer_type_001.ttcn | 28 +++ .../Syn_060214_timer_type_001.ttcn | 14 ++ ...gSem_06021501_map_type_definition_001.ttcn | 17 ++ ...gSem_06021501_map_type_definition_002.ttcn | 21 ++ ...gSem_06021501_map_type_definition_003.ttcn | 29 +++ ...gSem_06021501_map_type_definition_004.ttcn | 32 ++++ .../Sem_06021501_map_type_definition_001.ttcn | 14 ++ .../Sem_06021501_map_type_definition_002.ttcn | 16 ++ ...21502_indexed_assignment_notation_001.ttcn | 24 +++ ...21502_indexed_assignment_notation_002.ttcn | 24 +++ ...21502_indexed_assignment_notation_003.ttcn | 26 +++ ...21502_indexed_assignment_notation_001.ttcn | 28 +++ ...21502_indexed_assignment_notation_002.ttcn | 30 +++ ...21502_indexed_assignment_notation_003.ttcn | 30 +++ .../NegSem_06021503_unmapping_keys_001.ttcn | 30 +++ .../NegSem_06021503_unmapping_keys_002.ttcn | 26 +++ .../Sem_06021503_unmapping_keys_001.ttcn | 29 +++ .../Sem_06021503_unmapping_keys_002.ttcn | 28 +++ .../NegSem_06021504_index_notation_001.ttcn | 26 +++ .../NegSem_06021504_index_notation_002.ttcn | 26 +++ .../NegSem_06021504_index_notation_003.ttcn | 30 +++ .../NegSem_06021504_index_notation_004.ttcn | 31 +++ .../NegSem_06021504_index_notation_005.ttcn | 26 +++ .../NegSem_06021504_index_notation_006.ttcn | 27 +++ .../Sem_06021504_index_notation_001.ttcn | 30 +++ .../Sem_06021504_index_notation_002.ttcn | 29 +++ .../Sem_06021504_index_notation_003.ttcn | 29 +++ .../Sem_06021504_index_notation_004.ttcn | 28 +++ .../Sem_06021504_index_notation_005.ttcn | 28 +++ .../Sem_06021504_index_notation_006.ttcn | 28 +++ .../Sem_06021505_accessing_the_keys_001.ttcn | 16 ++ .../Sem_06021505_accessing_the_keys_002.ttcn | 31 +++ ...Sem_06021506_accessing_the_values_001.ttcn | 16 ++ ...Sem_06021506_accessing_the_values_002.ttcn | 31 +++ ..._06021507_referencing_of_elements_001.ttcn | 35 ++++ ..._06021507_referencing_of_elements_002.ttcn | 39 ++++ ..._06021508_nested_type_definitions_001.ttcn | 17 ++ ..._06021508_nested_type_definitions_002.ttcn | 17 ++ .../NegSem_060216__the_open_type_001.ttcn | 22 +++ .../NegSem_060216__the_open_type_002.ttcn | 25 +++ .../NegSem_060216__the_open_type_003.ttcn | 22 +++ .../NegSem_060216__the_open_type_004.ttcn | 22 +++ .../NegSem_060216__the_open_type_005.ttcn | 22 +++ .../NegSem_060216__the_open_type_006.ttcn | 22 +++ .../NegSem_060216__the_open_type_007.ttcn | 29 +++ .../NegSem_060216__the_open_type_008.ttcn | 34 ++++ .../NegSem_060216__the_open_type_009.ttcn | 29 +++ .../NegSem_060216__the_open_type_010.ttcn | 29 +++ .../Sem_060216_the_open_type_001.ttcn | 26 +++ .../NegSem_0602_TopLevel_005.ttcn | 39 ++++ .../NegSem_0602_TopLevel_006.ttcn | 38 ++++ .../NegSem_0602_TopLevel_007.ttcn | 37 ++++ .../NegSem_0602_TopLevel_008.ttcn | 37 ++++ .../NegSem_0602_TopLevel_009.ttcn | 28 +++ .../NegSem_0602_TopLevel_010.ttcn | 42 ++++ .../0602_toplevel/Sem_0602_TopLevel_015.ttcn | 47 +++++ .../0602_toplevel/Sem_0602_TopLevel_016.ttcn | 48 +++++ .../0602_toplevel/Sem_0602_TopLevel_017.ttcn | 41 ++++ .../0602_toplevel/Sem_0602_TopLevel_018.ttcn | 44 +++++ .../0602_toplevel/Sem_0602_TopLevel_019.ttcn | 44 +++++ .../0602_toplevel/Sem_0602_TopLevel_20.ttcn | 40 ++++ .../0602_toplevel/Sem_0602_TopLevel_21.ttcn | 39 ++++ .../0602_toplevel/Sem_0602_TopLevel_22.ttcn | 48 +++++ .../0602_toplevel/Sem_0602_TopLevel_23.ttcn | 48 +++++ .../0602_toplevel/Sem_0602_TopLevel_24.ttcn | 35 ++++ .../Sem_060302_structured_types_007.ttcn | 51 +++++ .../Sem_060302_structured_types_008.ttcn | 51 +++++ .../Sem_060302_structured_types_009.ttcn | 31 +++ .../Sem_060302_structured_types_010.ttcn | 51 +++++ ...60306_compatibility_of_port_types_001.ttcn | 28 +++ ...60306_compatibility_of_port_types_002.ttcn | 33 ++++ ...60306_compatibility_of_port_types_001.ttcn | 29 +++ ...60306_compatibility_of_port_types_002.ttcn | 31 +++ ...0307_compatibility_of_timer_types_001.ttcn | 29 +++ ...0307_compatibility_of_timer_types_001.ttcn | 25 +++ ...060308_compatibility_of_map_types_001.ttcn | 29 +++ ...060308_compatibility_of_map_types_002.ttcn | 40 ++++ ...060308_compatibility_of_map_types_003.ttcn | 40 ++++ ...060308_compatibility_of_map_types_001.ttcn | 41 ++++ .../Sem_070103_RelationalOperators_051.ttcn | 46 +++++ .../Sem_070103_RelationalOperators_052.ttcn | 35 ++++ .../Sem_070103_RelationalOperators_053.ttcn | 35 ++++ .../Sem_07010801_ispresent_operator_001.ttcn | 63 ++++++ .../Sem_07010801_ispresent_operator_002.ttcn | 41 ++++ .../Sem_07010801_ispresent_operator_003.ttcn | 41 ++++ .../Sem_07010801_ispresent_operator_004.ttcn | 43 +++++ .../Sem_07010802_ischosen_operator_001.ttcn | 33 ++++ .../Sem_07010802_ischosen_operator_002.ttcn | 33 ++++ .../Sem_07010802_ischosen_operator_003.ttcn | 36 ++++ .../Sem_07010802_ischosen_operator_004.ttcn | 38 ++++ .../Sem_07010803_isvalue_operator_001.ttcn | 32 ++++ .../Sem_07010803_isvalue_operator_002.ttcn | 39 ++++ .../Sem_07010803_isvalue_operator_003.ttcn | 39 ++++ .../Sem_07010803_isvalue_operator_004.ttcn | 41 ++++ .../Sem_07010803_isvalue_operator_005.ttcn | 38 ++++ .../Sem_07010803_isvalue_operator_006.ttcn | 39 ++++ .../Sem_07010803_isvalue_operator_007.ttcn | 47 +++++ .../Sem_07010803_isvalue_operator_008.ttcn | 47 +++++ .../Sem_07010804_isbound_operator_001.ttcn | 36 ++++ .../Sem_07010804_isbound_operator_002.ttcn | 32 ++++ .../Sem_07010804_isbound_operator_003.ttcn | 56 ++++++ .../Sem_07010804_isbound_operator_004.ttcn | 72 +++++++ ...gSem_0703_decoded_field_reference_001.ttcn | 58 ++++++ ...gSem_0703_decoded_field_reference_002.ttcn | 53 ++++++ ...gSem_0703_decoded_field_reference_003.ttcn | 52 +++++ .../Sem_0703_decoded_field_reference_001.ttcn | 56 ++++++ .../Sem_0703_decoded_field_reference_002.ttcn | 56 ++++++ .../Sem_0703_decoded_field_reference_003.ttcn | 56 ++++++ .../Sem_0703_decoded_field_reference_004.ttcn | 54 ++++++ .../Sem_0703_decoded_field_reference_005.ttcn | 56 ++++++ .../Sem_0703_decoded_field_reference_006.ttcn | 55 ++++++ .../Sem_0703_decoded_field_reference_007.ttcn | 55 ++++++ .../Sem_0703_decoded_field_reference_008.ttcn | 55 ++++++ .../Sem_0703_decoded_field_reference_009.ttcn | 55 ++++++ .../Sem_0703_decoded_field_reference_010.ttcn | 55 ++++++ .../Sem_0703_decoded_field_reference_011.ttcn | 55 ++++++ .../Sem_0801_DefinitionOfAModule_001.ttcn | 21 ++ .../Syn_0801_DefinitionOfAModule_011.ttcn | 10 + .../Syn_0801_DefinitionOfAModule_012.ttcn | 10 + .../Syn_0801_DefinitionOfAModule_013.ttcn | 10 + .../Syn_0801_DefinitionOfAModule_014.ttcn | 10 + .../Syn_0801_DefinitionOfAModule_015.ttcn | 10 + .../NegSem_080201_ModuleParameters_007.ttcn | 30 +++ .../NegSem_080201_ModuleParameters_008.ttcn | 30 +++ .../NegSem_080201_ModuleParameters_009.ttcn | 37 ++++ .../NegSem_080201_ModuleParameters_010.ttcn | 29 +++ .../Syn_080201_ModuleParameters_004.ttcn | 13 ++ ...em_08020301_GeneralFormatOfImport_041.ttcn | 31 +++ ...em_08020301_GeneralFormatOfImport_042.ttcn | 34 ++++ ...em_08020301_GeneralFormatOfImport_021.ttcn | 31 +++ ..._ImportingAllDefinitionsOfAModule_003.ttcn | 31 +++ ..._ImportingAllDefinitionsOfAModule_004.ttcn | 32 ++++ .../NegSem_0901_Communication_ports_008.ttcn | 0 .../Sem_0901_Communication_ports_009.ttcn | 0 .../Sem_0901_Communication_ports_010.ttcn | 0 .../Sem_0901_Communication_ports_011.ttcn | 0 .../10_constants/NegSem_10_Constants_004.ttcn | 0 .../10_constants/NegSem_10_Constants_005.ttcn | 0 .../10_constants/Sem_10_Constants_010.ttcn | 44 +++++ .../10_constants/Sem_10_Constants_011.ttcn | 45 +++++ .../10_constants/Sem_10_Constants_012.ttcn | 39 ++++ .../10_constants/Sem_10_Constants_013.ttcn | 40 ++++ .../NegSem_1101_ValueVars_003.ttcn | 0 .../NegSem_1101_ValueVars_004.ttcn | 0 .../Sem_1101_ValueVars_007.ttcn | 35 ++++ .../NegSem_1102_TemplateVars_003.ttcn | 0 .../NegSem_1102_TemplateVars_004.ttcn | 0 .../Sem_1102_TemplateVars_004.ttcn | 52 +++++ .../Sem_1102_TemplateVars_005.ttcn | 50 +++++ .../Sem_1102_TemplateVars_006.ttcn | 54 ++++++ .../NegSem_1400_procedure_signatures_003.ttcn | 79 ++++++++ .../1500_general/NegSem_1500_general_001.ttcn | 38 ++++ .../1500_general/NegSem_1500_general_002.ttcn | 38 ++++ .../1500_general/NegSem_1500_general_003.ttcn | 37 ++++ .../1500_general/NegSem_1500_general_004.ttcn | 38 ++++ .../1500_general/NegSem_1500_general_005.ttcn | 38 ++++ .../1500_general/NegSem_1500_general_006.ttcn | 43 +++++ .../1500_general/NegSem_1500_general_007.ttcn | 46 +++++ .../1500_general/NegSem_1500_general_008.ttcn | 46 +++++ .../1500_general/NegSem_1500_general_009.ttcn | 46 +++++ .../1500_general/NegSem_1500_general_010.ttcn | 46 +++++ .../1500_general/NegSem_1500_general_011.ttcn | 43 +++++ .../1500_general/NegSem_1500_general_012.ttcn | 43 +++++ .../1500_general/NegSem_1500_general_013.ttcn | 38 ++++ .../1500_general/NegSem_1500_general_014.ttcn | 38 ++++ .../1500_general/NegSem_1500_general_015.ttcn | 38 ++++ .../1500_general/NegSem_1500_general_016.ttcn | 38 ++++ .../1500_general/NegSem_1500_general_017.ttcn | 38 ++++ .../1500_general/NegSem_1500_general_018.ttcn | 39 ++++ .../1500_general/NegSem_1500_general_019.ttcn | 40 ++++ .../1500_general/NegSem_1500_general_020.ttcn | 40 ++++ .../1500_general/NegSem_1500_general_021.ttcn | 48 +++++ .../1500_general/NegSem_1500_general_022.ttcn | 53 ++++++ .../1500_general/NegSem_1500_general_023.ttcn | 54 ++++++ .../1500_general/NegSem_1500_general_024.ttcn | 55 ++++++ .../1500_general/NegSem_1500_general_025.ttcn | 53 ++++++ .../1500_general/NegSem_1500_general_026.ttcn | 55 ++++++ .../1500_general/NegSem_1500_general_027.ttcn | 40 ++++ .../1500_general/NegSem_1500_general_028.ttcn | 38 ++++ .../1500_general/NegSem_1500_general_029.ttcn | 38 ++++ .../1500_general/NegSem_1500_general_030.ttcn | 38 ++++ .../1500_general/NegSem_1500_general_031.ttcn | 40 ++++ .../1500_general/NegSem_1500_general_032.ttcn | 37 ++++ .../1500_general/NegSem_1500_general_033.ttcn | 38 ++++ .../1500_general/NegSem_1500_general_034.ttcn | 40 ++++ .../1500_general/NegSem_1500_general_035.ttcn | 39 ++++ .../1500_general/NegSem_1500_general_036.ttcn | 39 ++++ .../1500_general/NegSem_1500_general_037.ttcn | 39 ++++ .../1500_general/NegSem_1500_general_038.ttcn | 45 +++++ .../1500_general/NegSem_1500_general_039.ttcn | 37 ++++ .../1500_general/NegSem_1500_general_040.ttcn | 39 ++++ .../1500_general/NegSem_1500_general_041.ttcn | 43 +++++ .../1500_general/NegSem_1500_general_042.ttcn | 43 +++++ .../1500_general/NegSem_1500_general_043.ttcn | 37 ++++ .../1500_general/NegSem_1500_general_044.ttcn | 41 ++++ .../1500_general/NegSem_1500_general_045.ttcn | 43 +++++ .../1500_general/NegSem_1500_general_046.ttcn | 41 ++++ .../1500_general/NegSem_1500_general_047.ttcn | 38 ++++ .../1500_general/NegSem_1500_general_048.ttcn | 41 ++++ .../1500_general/NegSem_1500_general_049.ttcn | 37 ++++ .../1500_general/NegSem_1500_general_050.ttcn | 26 +++ .../1500_general/NegSem_1500_general_051.ttcn | 31 +++ ...gSem_1503_GlobalAndLocalTemplates_007.ttcn | 94 +++++++++ ...gSem_1503_GlobalAndLocalTemplates_008.ttcn | 92 +++++++++ ...gSyn_1503_GlobalAndLocalTemplates_005.ttcn | 39 ++++ ...gSyn_1503_GlobalAndLocalTemplates_006.ttcn | 23 +++ .../Sem_1503_GlobalAndLocalTemplates_007.ttcn | 46 +++++ .../Sem_1503_GlobalAndLocalTemplates_010.ttcn | 108 +++++++++++ .../Syn_1503_GlobalAndLocalTemplates_007.ttcn | 34 ++++ .../Syn_1503_GlobalAndLocalTemplates_008.ttcn | 33 ++++ .../Syn_1503_GlobalAndLocalTemplates_009.ttcn | 24 +++ .../Syn_1503_GlobalAndLocalTemplates_010.ttcn | 23 +++ .../Syn_1503_GlobalAndLocalTemplates_011.ttcn | 23 +++ .../Syn_1503_GlobalAndLocalTemplates_012.ttcn | 23 +++ .../NegSem_1505_ModifiedTemplates_008.ttcn | 44 +++++ .../NegSem_1505_ModifiedTemplates_009.ttcn | 44 +++++ .../Sem_1505_ModifiedTemplates_008.ttcn | 4 +- .../Sem_1505_ModifiedTemplates_011.ttcn | 35 ++++ .../Sem_1505_ModifiedTemplates_012.ttcn | 43 +++++ .../Sem_1505_ModifiedTemplates_013.ttcn | 45 +++++ .../Sem_1505_ModifiedTemplates_014.ttcn | 44 +++++ .../Sem_1505_ModifiedTemplates_015.ttcn | 51 +++++ .../Sem_1505_ModifiedTemplates_016.ttcn | 52 +++++ .../Sem_1505_ModifiedTemplates_017.ttcn | 38 ++++ .../Syn_1505_ModifiedTemplates_005.ttcn | 28 +++ .../NegSem_1508_TemplateRestrictions_052.ttcn | 38 ++++ .../NegSem_1508_TemplateRestrictions_053.ttcn | 38 ++++ .../NegSem_1508_TemplateRestrictions_054.ttcn | 38 ++++ .../NegSem_1508_TemplateRestrictions_055.ttcn | 40 ++++ .../NegSem_1508_TemplateRestrictions_056.ttcn | 40 ++++ .../NegSem_1508_TemplateRestrictions_057.ttcn | 40 ++++ .../NegSem_1508_TemplateRestrictions_058.ttcn | 40 ++++ .../NegSem_1508_TemplateRestrictions_059.ttcn | 40 ++++ .../NegSem_1508_TemplateRestrictions_060.ttcn | 40 ++++ .../NegSem_1508_TemplateRestrictions_061.ttcn | 40 ++++ .../Sem_1508_TemplateRestrictions_027.ttcn | 2 - .../Sem_1509_MatchOperation_009.ttcn | 36 ++++ .../Sem_1509_MatchOperation_013.ttcn | 4 +- ...tingTemplatesOfStringAndListTypes_004.ttcn | 2 +- ...tingTemplatesOfStringAndListTypes_016.ttcn | 39 ++++ ...tingTemplatesOfStringAndListTypes_017.ttcn | 36 ++++ ...tingTemplatesOfStringAndListTypes_018.ttcn | 36 ++++ ...tingTemplatesOfStringAndListTypes_019.ttcn | 36 ++++ ...tingTemplatesOfStringAndListTypes_020.ttcn | 38 ++++ ...tingTemplatesOfStringAndListTypes_021.ttcn | 38 ++++ ...tingTemplatesOfStringAndListTypes_022.ttcn | 38 ++++ ...tingTemplatesOfStringAndListTypes_023.ttcn | 38 ++++ ...tingTemplatesOfStringAndListTypes_024.ttcn | 38 ++++ ...tingTemplatesOfStringAndListTypes_025.ttcn | 38 ++++ ...tingTemplatesOfStringAndListTypes_026.ttcn | 38 ++++ ...tingTemplatesOfStringAndListTypes_027.ttcn | 38 ++++ ...tingTemplatesOfStringAndListTypes_028.ttcn | 38 ++++ ...tingTemplatesOfStringAndListTypes_029.ttcn | 38 ++++ ...tingTemplatesOfStringAndListTypes_030.ttcn | 38 ++++ ...tingTemplatesOfStringAndListTypes_031.ttcn | 38 ++++ ...tingTemplatesOfStringAndListTypes_032.ttcn | 38 ++++ ...tingTemplatesOfStringAndListTypes_033.ttcn | 30 +++ ...tingTemplatesOfStringAndListTypes_034.ttcn | 45 +++++ .../NegSem_1512_TheOmitOperation_001.ttcn | 35 ++++ .../NegSem_1512_TheOmitOperation_002.ttcn | 35 ++++ .../Sem_1512_TheOmitOperation_001.ttcn | 42 ++++ .../Sem_1512_TheOmitOperation_002.ttcn | 42 ++++ .../NegSem_1512_ThePresentOperation_001.ttcn | 35 ++++ .../NegSem_1512_ThePresentOperation_002.ttcn | 35 ++++ .../Sem_1512_ThePresentOperation_001.ttcn | 38 ++++ ...egSem_160102_predefined_functions_036.ttcn | 0 ...egSem_160102_predefined_functions_037.ttcn | 0 ...egSem_160102_predefined_functions_038.ttcn | 0 ...egSem_160102_predefined_functions_041.ttcn | 28 +++ ...egSem_160102_predefined_functions_042.ttcn | 28 +++ ...egSem_160102_predefined_functions_043.ttcn | 28 +++ ...egSem_160102_predefined_functions_044.ttcn | 28 +++ ...egSem_160102_predefined_functions_045.ttcn | 33 ++++ ...egSem_160102_predefined_functions_046.ttcn | 33 ++++ ...egSem_160102_predefined_functions_047.ttcn | 31 +++ ...egSem_160102_predefined_functions_048.ttcn | 29 +++ ...egSem_160102_predefined_functions_049.ttcn | 29 +++ ...egSem_160102_predefined_functions_050.ttcn | 29 +++ ...egSem_160102_predefined_functions_051.ttcn | 29 +++ ...egSem_160102_predefined_functions_052.ttcn | 32 ++++ ...egSem_160102_predefined_functions_053.ttcn | 34 ++++ ...egSem_160102_predefined_functions_054.ttcn | 31 +++ ...egSem_160102_predefined_functions_055.ttcn | 28 +++ ...egSem_160102_predefined_functions_056.ttcn | 28 +++ ...egSem_160102_predefined_functions_057.ttcn | 28 +++ ...egSem_160102_predefined_functions_058.ttcn | 28 +++ ...egSem_160102_predefined_functions_059.ttcn | 33 ++++ ...egSem_160102_predefined_functions_060.ttcn | 33 ++++ ...egSem_160102_predefined_functions_061.ttcn | 30 +++ ...egSem_160102_predefined_functions_062.ttcn | 32 ++++ ...egSem_160102_predefined_functions_063.ttcn | 32 ++++ .../Sem_160102_predefined_functions_026.ttcn | 0 .../Sem_160102_predefined_functions_027.ttcn | 0 .../Sem_160102_predefined_functions_028.ttcn | 0 .../Sem_160102_predefined_functions_029.ttcn | 0 .../Sem_160102_predefined_functions_034.ttcn | 0 .../Sem_160102_predefined_functions_035.ttcn | 0 .../Sem_160102_predefined_functions_036.ttcn | 0 .../Sem_160102_predefined_functions_037.ttcn | 0 .../Sem_160102_predefined_functions_042.ttcn | 0 .../Sem_160102_predefined_functions_043.ttcn | 0 .../Sem_160102_predefined_functions_044.ttcn | 0 .../Sem_160102_predefined_functions_045.ttcn | 0 .../Sem_160102_predefined_functions_046.ttcn | 4 +- .../Sem_160102_predefined_functions_047.ttcn | 0 .../Sem_160102_predefined_functions_048.ttcn | 0 .../Sem_160102_predefined_functions_049.ttcn | 0 .../Sem_160102_predefined_functions_050.ttcn | 0 .../Sem_160102_predefined_functions_051.ttcn | 0 .../Sem_160102_predefined_functions_052.ttcn | 0 .../Sem_160102_predefined_functions_053.ttcn | 0 .../Sem_160102_predefined_functions_054.ttcn | 0 .../Sem_160102_predefined_functions_055.ttcn | 0 .../Sem_160102_predefined_functions_056.ttcn | 0 .../Sem_160102_predefined_functions_057.ttcn | 0 .../Sem_160102_predefined_functions_058.ttcn | 0 .../Sem_160102_predefined_functions_059.ttcn | 0 .../Sem_160102_predefined_functions_060.ttcn | 0 .../Sem_160102_predefined_functions_061.ttcn | 0 .../Sem_160102_predefined_functions_063.ttcn | 0 .../Sem_160102_predefined_functions_064.ttcn | 0 .../Sem_160102_predefined_functions_065.ttcn | 0 .../Sem_160102_predefined_functions_066.ttcn | 0 .../Sem_160102_predefined_functions_067.ttcn | 0 .../Sem_160102_predefined_functions_068.ttcn | 0 .../Sem_160102_predefined_functions_069.ttcn | 0 .../Sem_160102_predefined_functions_070.ttcn | 0 .../Sem_160102_predefined_functions_071.ttcn | 0 .../Sem_160102_predefined_functions_072.ttcn | 0 .../Sem_160102_predefined_functions_073.ttcn | 0 .../Sem_160102_predefined_functions_074.ttcn | 0 .../Sem_160102_predefined_functions_075.ttcn | 0 .../Sem_160102_predefined_functions_076.ttcn | 0 .../Sem_160102_predefined_functions_077.ttcn | 0 .../Sem_160102_predefined_functions_078.ttcn | 0 .../Sem_160102_predefined_functions_079.ttcn | 0 .../Sem_160102_predefined_functions_080.ttcn | 0 .../Sem_160102_predefined_functions_081.ttcn | 0 .../Sem_160102_predefined_functions_082.ttcn | 0 .../Sem_160102_predefined_functions_090.ttcn | 0 .../Sem_160102_predefined_functions_091.ttcn | 0 .../Sem_160102_predefined_functions_092.ttcn | 0 .../Sem_160102_predefined_functions_100.ttcn | 6 +- .../Sem_160102_predefined_functions_101.ttcn | 52 +++-- .../Sem_160102_predefined_functions_102.ttcn | 47 +++-- .../Sem_160102_predefined_functions_103.ttcn | 53 +++--- .../Sem_160102_predefined_functions_104.ttcn | 54 ++++-- .../Sem_160102_predefined_functions_105.ttcn | 53 +++--- .../Sem_160102_predefined_functions_106.ttcn | 48 +++-- .../Sem_160102_predefined_functions_107.ttcn | 62 +++--- .../Sem_160102_predefined_functions_108.ttcn | 51 ++--- .../Sem_160102_predefined_functions_109.ttcn | 41 ++++ .../Sem_160102_predefined_functions_110.ttcn | 51 +++++ .../Sem_160102_predefined_functions_111.ttcn | 43 +++++ .../Sem_160102_predefined_functions_112.ttcn | 49 +++++ .../Sem_160102_predefined_functions_113.ttcn | 38 ++++ .../Sem_160102_predefined_functions_114.ttcn | 38 ++++ .../Sem_160102_predefined_functions_115.ttcn | 39 ++++ .../Sem_160102_predefined_functions_116.ttcn | 41 ++++ .../Sem_160102_predefined_functions_117.ttcn | 33 ++++ .../Sem_160102_predefined_functions_118.ttcn | 49 +++++ .../Sem_160103_external_functions_003.ttcn | 26 +++ .../Sem_160103_external_functions_004.ttcn | 24 +++ .../Sem_160103_external_functions_005.ttcn | 23 +++ ...ng_functions_from_specific_places_296.ttcn | 2 +- ...ng_functions_from_specific_places_297.ttcn | 2 +- ...ng_functions_from_specific_places_326.ttcn | 51 +++++ ...ng_functions_from_specific_places_327.ttcn | 51 +++++ ...160105_explicit_control_functions_001.ttcn | 28 +++ ...160105_explicit_control_functions_002.ttcn | 33 ++++ ...160105_explicit_control_functions_003.ttcn | 36 ++++ ...160105_explicit_control_functions_004.ttcn | 37 ++++ ...160105_explicit_control_functions_005.ttcn | 37 ++++ ...160105_explicit_control_functions_006.ttcn | 37 ++++ ...160105_explicit_control_functions_007.ttcn | 28 +++ ...160105_explicit_control_functions_008.ttcn | 28 +++ ...160105_explicit_control_functions_009.ttcn | 33 ++++ ...160105_explicit_control_functions_001.ttcn | 25 +++ ...160105_explicit_control_functions_002.ttcn | 33 ++++ .../NegSem_1601_toplevel_007.ttcn | 37 ++++ .../NegSem_1601_toplevel_008.ttcn | 37 ++++ .../NegSem_1601_toplevel_009.ttcn | 43 +++++ .../NegSyn_160201_invoking_altsteps_001.ttcn | 36 ++++ .../Sem_160201_invoking_altsteps_005.ttcn | 67 +++++++ .../NegSem_1602_toplevel_053.ttcn | 56 ++++++ .../NegSem_1602_toplevel_054.ttcn | 41 ++++ .../NegSem_1602_toplevel_055.ttcn | 46 +++++ .../1602_toplevel/Sem_1602_toplevel_004.ttcn | 64 +++++++ .../NegSyn_1603_testcases_001.ttcn | 27 +++ .../NegSyn_1603_testcases_002.ttcn | 27 +++ .../NegSyn_1603_testcases_003.ttcn | 22 +++ .../NegSyn_1603_testcases_004.ttcn | 30 +++ .../NegSyn_1603_testcases_005.ttcn | 35 ++++ .../NegSyn_1603_testcases_006.ttcn | 38 ++++ .../Syn_1603_testcases_002.ttcn | 27 +++ .../Syn_1603_testcases_003.ttcn | 23 +++ .../Sem_1901_assignments_005.ttcn | 45 +++++ .../Sem_1901_assignments_006.ttcn | 44 +++++ ...gSem_190301_select_case_statement_002.ttcn | Bin 0 -> 4096 bytes ...gSem_190301_select_case_statement_002.ttcn | 6 +- ...Sem_190301_select_union_statement_007.ttcn | 42 ++++ ...Sem_190302_select_union_statement_001.ttcn | 2 +- .../NegSem_1908_goto_statement_004.ttcn | 29 +++ .../Sem_1911_log_statement_006.ttcn | 37 ++++ .../Sem_1911_log_statement_007.ttcn | 37 ++++ .../Sem_1911_log_statement_008.ttcn | 31 +++ .../Sem_1911_log_statement_009.ttcn | 26 +++ .../Sem_1911_log_statement_010.ttcn | 26 +++ .../Sem_1911_log_statement_011.ttcn | 25 +++ .../Sem_2002_TheAltStatement_015.ttcn | 46 +++++ .../Sem_2002_TheAltStatement_016.ttcn | 49 +++++ .../Sem_2002_TheAltStatement_017.ttcn | 44 +++++ .../Sem_2002_TheAltStatement_018.ttcn | 48 +++++ .../Sem_2002_TheAltStatement_019.ttcn | 48 +++++ .../Sem_2002_TheAltStatement_020.ttcn | 38 ++++ .../Sem_2002_TheAltStatement_021.ttcn | 43 +++++ .../Sem_2002_TheAltStatement_022.ttcn | 51 +++++ ...._NegSem_2004_InterleaveStatement_002.ttcn | Bin 0 -> 4096 bytes .../._Sem_2004_InterleaveStatement_004.ttcn | Bin 0 -> 4096 bytes .../._Sem_2004_InterleaveStatement_005.ttcn | Bin 0 -> 4096 bytes .../Sem_2004_InterleaveStatement_004.ttcn | 2 + .../Sem_2004_InterleaveStatement_011.ttcn | 39 ++++ .../Sem_2004_InterleaveStatement_012.ttcn | 42 ++++ .../Sem_2004_InterleaveStatement_013.ttcn | 54 ++++++ ...Sem_200502_the_activate_operation_003.ttcn | 2 +- ...Sem_200502_the_activate_operation_007.ttcn | 37 ++++ ...Sem_200502_the_activate_operation_008.ttcn | 53 ++++++ ...Sem_200502_the_activate_operation_009.ttcn | 57 ++++++ ...210101_connect_and_map_operations_015.ttcn | 33 ++++ ...210101_connect_and_map_operations_016.ttcn | 37 ++++ ...210101_connect_and_map_operations_017.ttcn | 43 +++++ ...210101_connect_and_map_operations_018.ttcn | 48 +++++ ...210101_connect_and_map_operations_019.ttcn | 39 ++++ ...210101_connect_and_map_operations_020.ttcn | 40 ++++ ...2_disconnect_and_unmap_operations_015.ttcn | 32 ++++ .../NegSyn_210307_done_operation_005.ttcn | 33 ++++ .../Sem_210307_done_operation_013.ttcn | 35 ++++ .../Sem_210307_done_operation_014.ttcn | 37 ++++ .../NegSyn_210308_killed_operation_005.ttcn | 35 ++++ .../Sem_210308_killed_operation_015.ttcn | 32 ++++ ...310_call_test_component_operation_001.ttcn | 28 +++ ...310_call_test_component_operation_002.ttcn | 31 +++ ...310_call_test_component_operation_003.ttcn | 30 +++ ...310_call_test_component_operation_004.ttcn | 28 +++ ...310_call_test_component_operation_005.ttcn | 32 ++++ ...310_call_test_component_operation_006.ttcn | 33 ++++ ...310_call_test_component_operation_007.ttcn | 30 +++ ...310_call_test_component_operation_008.ttcn | 30 +++ ...310_call_test_component_operation_009.ttcn | 36 ++++ ...310_call_test_component_operation_010.ttcn | 33 ++++ ...310_call_test_component_operation_011.ttcn | 33 ++++ ...310_call_test_component_operation_012.ttcn | 33 ++++ ...310_call_test_component_operation_013.ttcn | 30 +++ ...310_call_test_component_operation_014.ttcn | 30 +++ ...310_call_test_component_operation_015.ttcn | 36 ++++ ...310_call_test_component_operation_016.ttcn | 33 ++++ ...310_call_test_component_operation_017.ttcn | 33 ++++ ...310_call_test_component_operation_018.ttcn | 28 +++ ...310_call_test_component_operation_019.ttcn | 29 +++ ...310_call_test_component_operation_020.ttcn | 30 +++ ...310_call_test_component_operation_021.ttcn | 29 +++ ...310_call_test_component_operation_022.ttcn | 33 ++++ ...310_call_test_component_operation_001.ttcn | 37 ++++ ...310_call_test_component_operation_002.ttcn | 42 ++++ ...310_call_test_component_operation_003.ttcn | 37 ++++ ...310_call_test_component_operation_004.ttcn | 37 ++++ ...310_call_test_component_operation_005.ttcn | 40 ++++ ...310_call_test_component_operation_006.ttcn | 37 ++++ ...310_call_test_component_operation_007.ttcn | 45 +++++ ...310_call_test_component_operation_008.ttcn | 36 ++++ ...310_call_test_component_operation_009.ttcn | 35 ++++ ...310_call_test_component_operation_010.ttcn | 37 ++++ ...310_call_test_component_operation_011.ttcn | 35 ++++ ...310_call_test_component_operation_012.ttcn | 35 ++++ .../NegSem_220201_SendOperation_012.ttcn | 28 +++ .../NegSem_220201_SendOperation_013.ttcn | 36 ++++ .../NegSem_220202_ReceiveOperation_025.ttcn | 45 +++++ .../NegSem_220202_ReceiveOperation_026.ttcn | 46 +++++ .../NegSem_220202_ReceiveOperation_027.ttcn | 44 +++++ .../NegSem_220202_ReceiveOperation_028.ttcn | 44 +++++ .../Sem_220202_ReceiveOperation_031.ttcn | 48 +++++ .../NegSem_220203_TriggerOperation_025.ttcn | 42 ++++ .../NegSem_220203_TriggerOperation_026.ttcn | 45 +++++ .../Sem_220203_TriggerOperation_029.ttcn | 50 +++++ .../NegSem_220301_CallOperation_021.ttcn | 29 +++ .../NegSem_220302_getcall_operation_020.ttcn | 44 +++++ .../NegSyn_220302_getcall_operation_003.ttcn | 44 +++++ .../Sem_220302_getcall_operation_023.ttcn | 40 ++++ .../NegSem_220304_getreply_operation_023.ttcn | 44 +++++ .../NegSyn_220304_getreply_operation_003.ttcn | 46 +++++ .../Sem_220304_getreply_operation_024.ttcn | 49 +++++ .../NegSem_220305_raise_operation_011.ttcn | 41 ++++ .../NegSyn_220306_catch_operation_004.ttcn | 48 +++++ .../Sem_220306_catch_operation_018.ttcn | 47 +++++ .../NegSem_2204_the_check_operation_006.ttcn | 36 ++++ .../NegSyn_2204_the_check_operation_001.ttcn | 35 ++++ .../Sem_2204_the_check_operation_121.ttcn | 52 +++++ .../NegSem_2302_timer_start_005.ttcn | 24 +++ .../NegSem_2303_timer_stop_001.ttcn | 23 +++ ...Sem_2304_the_read_timer_operation_001.ttcn | 23 +++ ..._2305_the_running_timer_operation_001.ttcn | 23 +++ ...NegSem_2306_the_timeout_operation_001.ttcn | 23 +++ .../NegSyn_2306_timer_timeout_008.ttcn | 32 ++++ .../NegSyn_2306_timer_timeout_009.ttcn | 30 +++ .../Sem_2306_timer_timeout_010.ttcn | 28 +++ .../NegSem_270101_ScopeOfAttributes_001.ttcn | 20 ++ .../Syn_270101_ScopeOfAttributes_005.ttcn | 2 +- .../Sem_27010200_general_001.ttcn | 36 ++++ .../Sem_27010200_general_002.ttcn | 39 ++++ .../Sem_27010200_general_003.ttcn | 41 ++++ .../Sem_27010200_general_004.ttcn | 33 ++++ .../Sem_27010200_general_005.ttcn | 43 +++++ .../Sem_27010200_general_006.ttcn | 43 +++++ .../Sem_27010200_general_007.ttcn | 42 ++++ .../Sem_27010200_general_008.ttcn | 42 ++++ .../Sem_27010200_general_009.ttcn | 43 +++++ .../Sem_27010200_general_010.ttcn | 42 ++++ .../Sem_27010200_general_011.ttcn | 40 ++++ .../Sem_27010200_general_012.ttcn | 41 ++++ .../Sem_27010200_general_013.ttcn | 44 +++++ .../Sem_27010200_general_014.ttcn | 44 +++++ .../Sem_27010200_general_015.ttcn | 43 +++++ .../Sem_27010200_general_016.ttcn | 49 +++++ ...0201_rules_for_variant_attributes_001.ttcn | 43 +++++ ...0201_rules_for_variant_attributes_002.ttcn | 38 ++++ ...0201_rules_for_variant_attributes_003.ttcn | 38 ++++ ...0202_rules_for_multiple_encodings_001.ttcn | 48 +++++ ...0202_rules_for_multiple_encodings_002.ttcn | 47 +++++ .../Sem_2705_variant_attributes_002.ttcn | 4 +- .../Sem_2707_OptionalAttributes_009.ttcn | 105 ++++++++++ ..._2708_Retrieving_attribute_values_001.ttcn | 56 ++++++ ..._2708_Retrieving_attribute_values_001.ttcn | 20 ++ ..._2708_Retrieving_attribute_values_001.ttcn | 52 +++++ ..._2708_Retrieving_attribute_values_002.ttcn | 56 ++++++ ..._2708_Retrieving_attribute_values_003.ttcn | 64 +++++++ ..._2708_Retrieving_attribute_values_004.ttcn | 54 ++++++ .../Sem_B010206_superset_009.ttcn | 49 +++++ .../Sem_B010206_superset_010.ttcn | 49 +++++ .../Sem_B010206_superset_011.ttcn | 49 +++++ .../Sem_B010207_subset_009.ttcn | 57 ++++++ .../Sem_B010207_subset_010.ttcn | 57 ++++++ .../Sem_B010207_subset_011.ttcn | 57 ++++++ .../Sem_B010207_subset_012.ttcn | 57 ++++++ .../Sem_B010207_subset_013.ttcn | 57 ++++++ .../._NegSem_B010303_permutation_006.ttcn | Bin 0 -> 4096 bytes .../NegSem_B010303_permutation_006.ttcn | 13 +- .../Sem_B010303_permutation_009.ttcn | 8 +- .../Sem_B010401_length_restrictions_005.ttcn | 42 ++++ .../Sem_B010501_set_expression_006.ttcn | 0 .../Sem_B010502_reference_expression_010.ttcn | 0 .../Sem_B010502_reference_expression_011.ttcn | 0 ...Syn_B010505_pattern_compatibility_001.ttcn | 0 ...6_case_sensitive_pattern_matching_001.ttcn | 0 ...6_case_sensitive_pattern_matching_002.ttcn | 0 .../Sem_B0105_toplevel_002.ttcn | 0 .../Sem_C0602_The_hostid_function_001.ttcn | 0 .../0602_validation_of_json_values/Note.txt | 1 + .../Pos_0603_name_conversion_rules_001.json | 6 + .../Pos_0603_name_conversion_rules_001.ttcn | 113 +++++++++++ .../Pos_0603_name_conversion_rules_002.json | 6 + .../Pos_0603_name_conversion_rules_002.ttcn | 107 +++++++++++ .../Pos_0603_name_conversion_rules_003.json | 6 + .../Pos_0603_name_conversion_rules_003.ttcn | 107 +++++++++++ .../Pos_0603_name_conversion_rules_004.json | 6 + .../Pos_0603_name_conversion_rules_004.ttcn | 107 +++++++++++ .../Pos_0603_name_conversion_rules_005.json | 5 + .../Pos_0603_name_conversion_rules_005.ttcn | 103 ++++++++++ .../Pos_0603_name_conversion_rules_006.json | 7 + .../Pos_0603_name_conversion_rules_006.ttcn | 115 +++++++++++ .../Pos_0603_name_conversion_rules_007.json | 5 + .../Pos_0603_name_conversion_rules_007.ttcn | 103 ++++++++++ .../Neg_0600401_json_numbers_001.ttcn | 59 ++++++ .../Neg_0600401_json_numbers_002.json | 3 + .../Neg_0600401_json_numbers_002.ttcn | 18 ++ .../Neg_0600401_json_numbers_003.json | 3 + .../Neg_0600401_json_numbers_003.ttcn | 18 ++ .../Neg_0600401_json_numbers_004.ttcn | 18 ++ .../Pos_0600401_json_numbers_007.json | 3 + .../Pos_0600401_json_numbers_001.json | 3 + .../Pos_0600401_json_numbers_001.ttcn | 85 +++++++++ .../Pos_0600401_json_numbers_002.json | 3 + .../Pos_0600401_json_numbers_002.ttcn | 86 +++++++++ .../Pos_0600401_json_numbers_003.json | 3 + .../Pos_0600401_json_numbers_003.ttcn | 83 ++++++++ .../Pos_0600401_json_numbers_004.json | 3 + .../Pos_0600401_json_numbers_004.ttcn | 88 +++++++++ .../Pos_0600402_json_strings_001.json | 3 + .../Pos_0600402_json_strings_001.ttcn | 86 +++++++++ .../Pos_0600402_json_strings_002.json | 3 + .../Pos_0600402_json_strings_002.ttcn | 95 +++++++++ .../Pos_060403_json_arrays_001.json | 3 + .../Pos_060403_json_arrays_001.ttcn | 90 +++++++++ .../Pos_060403_json_arrays_002.json | 3 + .../Pos_060403_json_arrays_002.ttcn | 82 ++++++++ .../Pos_060403_json_arrays_003.json | 3 + .../Pos_060403_json_arrays_003.ttcn | 82 ++++++++ .../Pos_060403_json_arrays_004.json | 3 + .../Pos_060403_json_arrays_004.ttcn | 82 ++++++++ .../Pos_060403_json_arrays_005.json | 3 + .../Pos_060403_json_arrays_005.ttcn | 82 ++++++++ .../Pos_060403_json_arrays_006.json | 3 + .../Pos_060403_json_arrays_006.ttcn | 88 +++++++++ .../Pos_060404_json_objects_001.json | 6 + .../Pos_060404_json_objects_001.ttcn | 93 +++++++++ .../Pos_060405_json_literals_001.json | 3 + .../Pos_060405_json_literals_001.ttcn | 83 ++++++++ .../Pos_060405_json_literals_002.json | 3 + .../Pos_060405_json_literals_002.ttcn | 83 ++++++++ .../Pos_060405_json_literals_003.json | 3 + .../Pos_060405_json_literals_003.ttcn | 83 ++++++++ .../Pos_0702010_union_and_anytype_001.json | 5 + .../Pos_0702010_union_and_anytype_001.ttcn | 93 +++++++++ .../Pos_0702010_union_and_anytype_002.json | 5 + .../Pos_0702010_union_and_anytype_002.ttcn | 89 +++++++++ .../Pos_0702011_object_identifiers_001.json | 3 + .../Pos_0702011_object_identifiers_001.ttcn | 89 +++++++++ .../Pos_070201_character_strings_001.json | 3 + .../Pos_070201_character_strings_001.ttcn | 84 ++++++++ .../Pos_070201_character_strings_002.json | 3 + .../Pos_070201_character_strings_002.ttcn | 85 +++++++++ .../Pos_070201_character_strings_003.json | 3 + .../Pos_070201_character_strings_003.ttcn | 85 +++++++++ .../Pos_070201_character_strings_004.json | 3 + .../Pos_070201_character_strings_004.ttcn | 83 ++++++++ .../Pos_070201_character_strings_005.json | 3 + .../Pos_070201_character_strings_005.ttcn | 83 ++++++++ .../Pos_070202_binary_strings_001.json | 3 + .../Pos_070202_binary_strings_001.ttcn | 83 ++++++++ .../Pos_070202_binary_strings_002.json | 3 + .../Pos_070202_binary_strings_002.ttcn | 83 ++++++++ .../Pos_070202_binary_strings_003.json | 3 + .../Pos_070202_binary_strings_003.ttcn | 83 ++++++++ .../Pos_070202_binary_strings_004.json | 3 + .../Pos_070202_binary_strings_004.ttcn | 87 +++++++++ .../Pos_070202_binary_strings_005.json | 3 + .../Pos_070202_binary_strings_005.ttcn | 87 +++++++++ .../Pos_070202_binary_strings_006.json | 3 + .../Pos_070202_binary_strings_006.ttcn | 84 ++++++++ .../Pos_070203_integer_001.json | 3 + .../Pos_070203_integer_001.ttcn | 84 ++++++++ .../Pos_070203_integer_002.json | 3 + .../Pos_070203_integer_002.ttcn | 84 ++++++++ .../Pos_070204_float_001.json | 3 + .../Pos_070204_float_001.ttcn | 84 ++++++++ .../Pos_070204_float_002.json | 3 + .../Pos_070204_float_002.ttcn | 84 ++++++++ .../Pos_070204_float_003.json | 3 + .../Pos_070204_float_003.ttcn | 84 ++++++++ .../Pos_070204_float_004.json | 3 + .../Pos_070204_float_004.ttcn | 84 ++++++++ .../Pos_070205_boolean_001.json | 3 + .../Pos_070205_boolean_001.ttcn | 84 ++++++++ .../Pos_070205_boolean_002.json | 3 + .../Pos_070205_boolean_002.ttcn | 84 ++++++++ .../Pos_070206_enumerated_001.json | 3 + .../Pos_070206_enumerated_001.ttcn | 91 +++++++++ .../Pos_070207_verdicttype_001.json | 3 + .../Pos_070207_verdicttype_001.ttcn | 86 +++++++++ .../Pos_070207_verdicttype_002.json | 3 + .../Pos_070207_verdicttype_002.ttcn | 86 +++++++++ .../Pos_070207_verdicttype_003.json | 3 + .../Pos_070207_verdicttype_003.ttcn | 86 +++++++++ .../Pos_070207_verdicttype_004.json | 3 + .../Pos_070207_verdicttype_004.ttcn | 86 +++++++++ .../Pos_070208_record_and_set_001.json | 6 + .../Pos_070208_record_and_set_001.ttcn | 97 ++++++++++ .../Pos_070208_record_and_set_002.json | 6 + .../Pos_070208_record_and_set_002.ttcn | 98 ++++++++++ .../Pos_070208_record_and_set_003.json | 7 + .../Pos_070208_record_and_set_003.ttcn | 97 ++++++++++ .../Pos_070208_record_and_set_004.json | 6 + .../Pos_070208_record_and_set_004.ttcn | 98 ++++++++++ ...70209_record_of_set_of_and_arrays_001.json | 3 + ...70209_record_of_set_of_and_arrays_001.ttcn | 91 +++++++++ ...70209_record_of_set_of_and_arrays_002.json | 3 + ...70209_record_of_set_of_and_arrays_002.ttcn | 91 +++++++++ ...70209_record_of_set_of_and_arrays_003.json | 3 + ...70209_record_of_set_of_and_arrays_003.ttcn | 91 +++++++++ json/A_ttcn3_module_json/Note.txt | 1 + .../B1_toplevel/Note.txt | 1 + .../Pos_B2_the_json_encode_attribute_001.json | 3 + .../Pos_B2_the_json_encode_attribute_001.ttcn | 85 +++++++++ .../Pos_B2_the_json_encode_attribute_002.json | 1 + .../Pos_B2_the_json_encode_attribute_002.ttcn | 85 +++++++++ .../Pos_B2_the_json_encode_attribute_003.json | 3 + .../Pos_B2_the_json_encode_attribute_003.ttcn | 88 +++++++++ .../Pos_B2_the_json_encode_attribute_004.json | 3 + .../Pos_B2_the_json_encode_attribute_004.ttcn | 88 +++++++++ .../B301_toplevel/Note.txt | 1 + ...Pos_B302_json_type_identification_001.json | 3 + ...Pos_B302_json_type_identification_001.ttcn | 87 +++++++++ .../Pos_B303_normalizing_json_values_001.json | 2 + .../Pos_B303_normalizing_json_values_001.ttcn | 82 ++++++++ .../Pos_B304_name_as_001.json | 6 + .../Pos_B304_name_as_001.ttcn | 93 +++++++++ ...os_B305_number_of_fraction_digits_001.json | 3 + ...os_B305_number_of_fraction_digits_001.ttcn | 81 ++++++++ ...os_B305_number_of_fraction_digits_002.json | 3 + ...os_B305_number_of_fraction_digits_002.ttcn | 81 ++++++++ .../Pos_B306_use_the_minus_sign_001.json | 3 + .../Pos_B306_use_the_minus_sign_001.ttcn | 86 +++++++++ .../Pos_B306_use_the_minus_sign_002.json | 3 + .../Pos_B306_use_the_minus_sign_002.ttcn | 83 ++++++++ .../Pos_B307_escape_as_001.json | 3 + .../Pos_B307_escape_as_001.ttcn | 85 +++++++++ .../Pos_B307_escape_as_002.json | 3 + .../Pos_B307_escape_as_002.ttcn | 84 ++++++++ .../Pos_B307_escape_as_003.json | 3 + .../Pos_B307_escape_as_003.ttcn | 84 ++++++++ .../Pos_B308_omit_as_null_001.json | 7 + .../Pos_B308_omit_as_null_001.ttcn | 96 ++++++++++ .../Pos_B308_omit_as_null_002.json | 7 + .../Pos_B308_omit_as_null_002.ttcn | 96 ++++++++++ .../Pos_B309_default_001.json | 6 + .../Pos_B309_default_001.ttcn | 96 ++++++++++ .../Pos_B309_default_002.json | 6 + .../Pos_B309_default_002.ttcn | 97 ++++++++++ .../Pos_B310_as_value_001.json | 3 + .../Pos_B310_as_value_001.ttcn | 91 +++++++++ .../Pos_B310_as_value_002.json | 11 ++ .../Pos_B310_as_value_002.ttcn | 93 +++++++++ .../Pos_B311_no_type_001.json | 1 + .../Pos_B311_no_type_001.ttcn | 85 +++++++++ .../Pos_B311_no_type_002.json | 1 + .../Pos_B311_no_type_002.ttcn | 86 +++++++++ .../Pos_B311_no_type_003.json | 1 + .../Pos_B311_no_type_003.ttcn | 84 ++++++++ .../Pos_B311_no_type_004.json | 1 + .../Pos_B311_no_type_004.ttcn | 84 ++++++++ .../Pos_B311_no_type_005.json | 1 + .../Pos_B311_no_type_005.ttcn | 84 ++++++++ .../Pos_B311_no_type_006.json | 1 + .../Pos_B311_no_type_006.ttcn | 84 ++++++++ .../Pos_B311_no_type_007.json | 1 + .../Pos_B311_no_type_007.ttcn | 84 ++++++++ .../Pos_B311_no_type_008.json | 1 + .../Pos_B311_no_type_008.ttcn | 84 ++++++++ .../Pos_B311_no_type_009.json | 1 + .../Pos_B311_no_type_009.ttcn | 84 ++++++++ .../Pos_B311_no_type_010.json | 1 + .../Pos_B311_no_type_010.ttcn | 83 ++++++++ .../Pos_B311_no_type_011.json | 1 + .../Pos_B311_no_type_011.ttcn | 83 ++++++++ .../Pos_B311_no_type_012.json | 1 + .../Pos_B311_no_type_012.ttcn | 92 +++++++++ .../Pos_B311_no_type_013.json | 1 + .../Pos_B311_no_type_013.ttcn | 84 ++++++++ .../Pos_B311_no_type_014.json | 4 + .../Pos_B311_no_type_014.ttcn | 89 +++++++++ .../Pos_B311_no_type_015.json | 4 + .../Pos_B311_no_type_015.ttcn | 89 +++++++++ .../Pos_B311_no_type_016.json | 1 + .../Pos_B311_no_type_016.ttcn | 86 +++++++++ .../Pos_B311_no_type_017.json | 1 + .../Pos_B311_no_type_017.ttcn | 86 +++++++++ .../Pos_B311_no_type_018.json | 1 + .../Pos_B311_no_type_018.ttcn | 85 +++++++++ .../Pos_B311_no_type_019.json | 3 + .../Pos_B311_no_type_019.ttcn | 90 +++++++++ .../Pos_B311_no_type_020.json | 3 + .../Pos_B311_no_type_020.ttcn | 86 +++++++++ .../Pos_B311_no_type_021.json | 1 + .../Pos_B311_no_type_021.ttcn | 86 +++++++++ .../Pos_B312_use_order_001.json | 7 + .../Pos_B312_use_order_001.ttcn | 86 +++++++++ .../Pos_B313_error_behaviour_001.ttcn | 56 ++++++ .../Pos_B313_error_behaviour_002.ttcn | 64 +++++++ .../Pos_B313_error_behaviour_003.ttcn | 52 +++++ .../Pos_B313_error_behaviour_004.ttcn | 52 +++++ .../Pos_B313_error_behaviour_005.ttcn | 58 ++++++ .../Pos_B313_error_behaviour_006.ttcn | 58 ++++++ .../NegSem_5010101_scopeRules_001.ttcn | 33 ++++ .../Sem_5010101_scopeRules_001.ttcn | 39 ++++ .../Sem_5010101_scopeRules_002.ttcn | 32 ++++ .../NegSem_5010102_abstractClasses_001.ttcn | 32 ++++ .../Sem_5010102_abstractClasses_001.ttcn | 36 ++++ .../Java_Int_List.jar | Bin 0 -> 1183 bytes .../NegSem_5010103_externalClasses_001.ttcn | 25 +++ .../Sem_5010103_externalClasses_001.ttcn | 37 ++++ .../Sem_5010103_externalClasses_002.ttcn | 30 +++ .../NegSem_5010104_finalClasses_002.ttcn | 30 +++ .../Sem_5010104_finalClasses_001.ttcn | 30 +++ .../NegSem_5010105_Constructors_001.ttcn | 27 +++ .../NegSem_5010105_Constructors_002.ttcn | 27 +++ .../NegSem_5010105_Constructors_003.ttcn | 25 +++ .../NegSem_5010105_Constructors_004.ttcn | 32 ++++ .../NegSem_5010105_Constructors_005.ttcn | 32 ++++ .../NegSem_5010105_Constructors_006.ttcn | 32 ++++ .../NegSem_5010105_Constructors_007.ttcn | 36 ++++ .../NegSem_5010105_Constructors_008.ttcn | 28 +++ .../NegSem_5010105_Constructors_009.ttcn | 28 +++ .../NegSem_5010105_Constructors_010.ttcn | 24 +++ .../NegSem_5010105_Constructors_011.ttcn | 25 +++ .../Sem_5010105_Constructors_001.ttcn | 42 ++++ .../Sem_5010105_Constructors_002.ttcn | 44 +++++ ...Sem_5010106_ConstructorInvocation_001.ttcn | 46 +++++ ...Sem_5010106_ConstructorInvocation_002.ttcn | 46 +++++ ...Sem_5010106_ConstructorInvocation_001.ttcn | 44 +++++ ...Sem_5010106_ConstructorInvocation_002.ttcn | 46 +++++ ...Sem_5010106_ConstructorInvocation_003.ttcn | 33 ++++ .../Sem_5010107_Destructors_001.ttcn | 48 +++++ .../NegSem_5010107_Methods_001.ttcn | 39 ++++ .../NegSem_5010107_Methods_003.ttcn | 42 ++++ .../Sem_5010107_Methods_001.ttcn | 37 ++++ .../Sem_5010107_Methods_002.ttcn | 39 ++++ .../Sem_5010107_Methods_003.ttcn | 36 ++++ .../Sem_5010108_MethodInvocation_001.ttcn | 32 ++++ .../NegSem_5010108_Methods_002.ttcn | 39 ++++ .../NegSem_5010108_Methods_003.ttcn | 44 +++++ .../NegSem_5010108_Methods_004.ttcn | 39 ++++ .../NegSem_5010108_Methods_005.ttcn | 39 ++++ .../NegSem_5010108_Methods_006.ttcn | 39 ++++ .../Sem_5010108_Methods_001.ttcn | 37 ++++ .../Sem_5010108_Methods_002.ttcn | 39 ++++ .../Sem_5010108_Methods_003.ttcn | 36 ++++ .../NegSem_5010109_MethodInvocation_001.ttcn | 38 ++++ .../Sem_5010109_MethodInvocation_001.ttcn | 32 ++++ .../Sem_5010109_MethodInvocation_002.ttcn | 39 ++++ .../NegSem_5010110_Visibility_001.ttcn | 28 +++ .../NegSem_5010110_Visibility_002.ttcn | 34 ++++ .../NegSem_5010110_Visibility_003.ttcn | 39 ++++ .../NegSem_5010110_Visibility_004.ttcn | 28 +++ .../Sem_50101010_Visibility_001.ttcn | 35 ++++ .../Sem_50101010_Visibility_002.ttcn | 32 ++++ .../Sem_5010110_Visibility_003.ttcn | 39 ++++ .../Sem_5010110_Visibility_004.ttcn | 35 ++++ .../NegSem_5010112_NestedClasses_001.ttcn | 29 +++ .../NegSem_5010112_NestedClasses_002.ttcn | 29 +++ .../NegSem_5010112_NestedClasses_003.ttcn | 36 ++++ .../NegSem_5010112_NestedClasses_004.ttcn | 38 ++++ .../NegSem_5010112_NestedClasses_005.ttcn | 37 ++++ .../Sem_5010112_NestedClasses_001.ttcn | 30 +++ .../Sem_5010112_NestedClasses_002.ttcn | 38 ++++ .../Sem_5010112_NestedClasses_003.ttcn | 37 ++++ .../Sem_5010112_NestedClasses_004.ttcn | 42 ++++ .../NegSem_50101_top_level_001.ttcn | 30 +++ .../NegSem_50101_top_level_002.ttcn | 33 ++++ .../NegSem_50101_top_level_003.ttcn | 33 ++++ .../NegSem_50101_top_level_004.ttcn | 42 ++++ .../NegSem_50101_top_level_005.ttcn | 25 +++ .../NegSem_50101_top_level_006.ttcn | 35 ++++ .../NegSem_50101_top_level_007.ttcn | 26 +++ .../NegSem_50101_top_level_008.ttcn | 52 +++++ .../NegSem_50101_top_level_009.ttcn | 40 ++++ .../NegSem_50101_top_level_010.ttcn | 45 +++++ .../NegSem_50101_top_level_011.ttcn | 58 ++++++ .../Sem_50101_top_level_001.ttcn | 67 +++++++ .../Sem_50101_top_level_002.ttcn | 34 ++++ .../Sem_50101_top_level_003.ttcn | 32 ++++ .../Sem_50101_top_level_004.ttcn | 34 ++++ .../Sem_50101_top_level_005.ttcn | 28 +++ .../Sem_50101_top_level_006.ttcn | 23 +++ .../Sem_50101_top_level_007.ttcn | 36 ++++ .../Sem_50101_top_level_008.ttcn | 63 ++++++ .../NegSem_5010202_ObjectReferences_001.ttcn | 41 ++++ .../NegSem_5010202_ObjectReferences_002.ttcn | 42 ++++ .../Sem_5010202_ObjectReferences_001.ttcn | 38 ++++ .../Sem_5010203_NullReference_001.ttcn | 31 +++ ...gSem_5010204_SelectClassStatement_001.ttcn | 31 +++ .../Sem_5010204_SelectClassStatement_001.ttcn | 36 ++++ .../Sem_5010204_SelectClassStatement_002.ttcn | 37 ++++ .../Sem_5010205_OfOperator_001.ttcn | 32 ++++ .../NegSem_5010206_Casting_001.ttcn | 37 ++++ .../Sem_5010206_Casting_001.ttcn | 33 ++++ .../Sem_50201_Functions_001.ttcn | 38 ++++ .../Sem_50202_ExternalFunctions_001.ttcn | 24 +++ .../Sem_50203_invoking_functions_001.ttcn | 36 ++++ .../Sem_50204_altsteps_001.ttcn | 40 ++++ .../Sem_50205_test_cases_001.ttcn | 28 +++ .../Pos_050101_namespaces_005.ttcn | 92 +++++++++ .../Pos_050101_namespaces_005.xml | 2 + .../Pos_050101_namespaces_005.xsd | 5 + .../Pos_050202_name_conversion_rules_026.ttcn | 89 +++++++++ .../Pos_050202_name_conversion_rules_026.xml | 4 + .../Pos_050202_name_conversion_rules_026.xsd | 14 ++ .../Pos_050202_name_conversion_rules_027.ttcn | 87 +++++++++ .../Pos_050202_name_conversion_rules_027.xml | 2 + .../Pos_050202_name_conversion_rules_027.xsd | 13 ++ .../Pos_050202_name_conversion_rules_028.ttcn | 93 +++++++++ .../Pos_050202_name_conversion_rules_028.xml | 7 + .../Pos_050202_name_conversion_rules_028.xsd | 21 ++ ...8_anytype_and_anysimpletype_types_006.ttcn | 126 ++++++------ ...8_anytype_and_anysimpletype_types_007.ttcn | 126 ++++++------ ...8_anytype_and_anysimpletype_types_008.ttcn | 101 ++++++++++ ...08_anytype_and_anysimpletype_types_008.xml | 2 + ...08_anytype_and_anysimpletype_types_008.xsd | 9 + .../Pos_070101_id_001/Pos_070101_id_001.ttcn | 174 ++++++++--------- .../Pos_070101_id_002/Pos_070101_id_002.ttcn | 180 +++++++++--------- .../Pos_070503_derivation_by_union_007.ttcn | 162 ++++++++-------- .../Pos_070503_derivation_by_union_008.ttcn | 162 ++++++++-------- .../Pos_070701_the_any_element_007.ttcn | 126 ++++++------ ...s_070702_the_anyattribute_element_006.ttcn | 126 ++++++------ 1066 files changed, 36653 insertions(+), 822 deletions(-) mode change 100755 => 100644 core_language/05_basic_language_elements/0501_identifiers_and_keywords/NegSem_0501_Identifier_001.ttcn mode change 100755 => 100644 core_language/05_basic_language_elements/0501_identifiers_and_keywords/NegSyn_0501_Identifier_001.ttcn mode change 100755 => 100644 core_language/05_basic_language_elements/0501_identifiers_and_keywords/Syn_0501_Identifier_001.ttcn mode change 100755 => 100644 core_language/05_basic_language_elements/0502_scope_rules/050201_Scope_of_parameters/Sem_050201_Scope_of_parameters_001.ttcn mode change 100755 => 100644 core_language/05_basic_language_elements/0502_scope_rules/050202_Uniqueness_of_identifiers/NegSem_050202_Uniqueness_001.ttcn mode change 100755 => 100644 core_language/05_basic_language_elements/0502_scope_rules/050202_Uniqueness_of_identifiers/NegSem_050202_Uniqueness_004.ttcn mode change 100755 => 100644 core_language/05_basic_language_elements/0502_scope_rules/050202_Uniqueness_of_identifiers/NegSem_050202_Uniqueness_005.ttcn mode change 100755 => 100644 core_language/05_basic_language_elements/0502_scope_rules/050202_Uniqueness_of_identifiers/NegSem_050202_Uniqueness_006.ttcn mode change 100755 => 100644 core_language/05_basic_language_elements/0502_scope_rules/050202_Uniqueness_of_identifiers/NegSem_050202_Uniqueness_007.ttcn mode change 100755 => 100644 core_language/05_basic_language_elements/0502_scope_rules/050202_Uniqueness_of_identifiers/NegSem_050202_Uniqueness_008.ttcn mode change 100755 => 100644 core_language/05_basic_language_elements/0502_scope_rules/050202_Uniqueness_of_identifiers/NegSem_050202_Uniqueness_009.ttcn mode change 100755 => 100644 core_language/05_basic_language_elements/0502_scope_rules/050202_Uniqueness_of_identifiers/NegSem_050202_Uniqueness_010.ttcn mode change 100755 => 100644 core_language/05_basic_language_elements/0502_scope_rules/050202_Uniqueness_of_identifiers/NegSem_050202_Uniqueness_011.ttcn mode change 100755 => 100644 core_language/05_basic_language_elements/0502_scope_rules/050202_Uniqueness_of_identifiers/NegSem_050202_Uniqueness_012.ttcn mode change 100755 => 100644 core_language/05_basic_language_elements/0502_scope_rules/050202_Uniqueness_of_identifiers/Sem_050202_Uniqueness_001.ttcn mode change 100755 => 100644 core_language/05_basic_language_elements/0502_scope_rules/050202_Uniqueness_of_identifiers/Sem_050202_Uniqueness_002.ttcn mode change 100755 => 100644 core_language/05_basic_language_elements/0502_scope_rules/050202_Uniqueness_of_identifiers/Sem_050202_Uniqueness_003.ttcn mode change 100755 => 100644 core_language/05_basic_language_elements/0502_scope_rules/0502_toplevel/NegSem_0502_Scope_001.ttcn mode change 100755 => 100644 core_language/05_basic_language_elements/0502_scope_rules/0502_toplevel/NegSem_0502_Scope_002.ttcn mode change 100755 => 100644 core_language/05_basic_language_elements/0502_scope_rules/0502_toplevel/Sem_0502_Scope_001.ttcn mode change 100755 => 100644 core_language/05_basic_language_elements/0502_scope_rules/0502_toplevel/Sem_0502_Scope_002.ttcn mode change 100755 => 100644 core_language/05_basic_language_elements/0502_scope_rules/0502_toplevel/Sem_0502_Scope_003.ttcn mode change 100755 => 100644 core_language/05_basic_language_elements/0502_scope_rules/0502_toplevel/Sem_0502_Scope_004.ttcn mode change 100755 => 100644 core_language/05_basic_language_elements/0502_scope_rules/0502_toplevel/Sem_0502_Scope_008.ttcn mode change 100755 => 100644 core_language/05_basic_language_elements/0502_scope_rules/0502_toplevel/Syn_0502_Scope_001.ttcn mode change 100755 => 100644 core_language/05_basic_language_elements/0503_ordering_of_declarations/NegSem_0503_Ordering_001.ttcn mode change 100755 => 100644 core_language/05_basic_language_elements/0503_ordering_of_declarations/Sem_0503_Ordering_001.ttcn create mode 100644 core_language/05_basic_language_elements/0503_ordering_of_declarations/Sem_0503_Ordering_003.ttcn create mode 100644 core_language/05_basic_language_elements/0503_ordering_of_declarations/Sem_0503_Ordering_004.ttcn mode change 100755 => 100644 core_language/05_basic_language_elements/0503_ordering_of_declarations/Sem_0503_Ordering_005.ttcn create mode 100644 core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_008.ttcn create mode 100644 core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_010.ttcn create mode 100644 core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_019.ttcn create mode 100644 core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_020.ttcn create mode 100644 core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_021.ttcn create mode 100644 core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_022.ttcn create mode 100644 core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_023.ttcn create mode 100644 core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_024.ttcn create mode 100644 core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_025.ttcn create mode 100644 core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_026.ttcn create mode 100644 core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_027.ttcn create mode 100644 core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_028.ttcn create mode 100644 core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_029.ttcn create mode 100644 core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_030.ttcn create mode 100644 core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_031.ttcn create mode 100644 core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_032.ttcn create mode 100644 core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_026.ttcn create mode 100644 core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_027.ttcn create mode 100644 core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_028.ttcn create mode 100644 core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_029.ttcn create mode 100644 core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_030.ttcn create mode 100644 core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_031.ttcn create mode 100644 core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_032.ttcn create mode 100644 core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_033.ttcn create mode 100644 core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_034.ttcn create mode 100644 core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_035.ttcn create mode 100644 core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_036.ttcn create mode 100644 core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/NegSem_05040102_parameters_of_kind_template_008.ttcn create mode 100644 core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/NegSem_05040102_parameters_of_kind_template_010.ttcn create mode 100644 core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/NegSem_05040102_parameters_of_kind_template_020.ttcn create mode 100644 core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/NegSem_05040102_parameters_of_kind_template_021.ttcn create mode 100644 core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_042.ttcn create mode 100644 core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_043.ttcn create mode 100644 core_language/05_basic_language_elements/0504_parametrization/050401_top_level/Sem_050401_top_level_030.ttcn create mode 100644 core_language/05_basic_language_elements/0504_parametrization/050401_top_level/Sem_050401_top_level_031.ttcn create mode 100644 core_language/05_basic_language_elements/0504_parametrization/050401_top_level/Sem_050401_top_level_032.ttcn create mode 100644 core_language/05_basic_language_elements/0504_parametrization/050401_top_level/Sem_050401_top_level_033.ttcn create mode 100644 core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_184.ttcn create mode 100644 core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_185.ttcn create mode 100644 core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_186.ttcn create mode 100644 core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_187.ttcn create mode 100644 core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_188.ttcn create mode 100644 core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_189.ttcn create mode 100644 core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_190.ttcn create mode 100644 core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_191.ttcn create mode 100644 core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_192.ttcn create mode 100644 core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_193.ttcn create mode 100644 core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_194.ttcn create mode 100644 core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_195.ttcn create mode 100644 core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_196.ttcn create mode 100644 core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_197.ttcn create mode 100644 core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_198.ttcn create mode 100644 core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_199.ttcn create mode 100644 core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_200.ttcn create mode 100644 core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_201.ttcn create mode 100644 core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_202.ttcn create mode 100644 core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_203.ttcn create mode 100644 core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_204.ttcn create mode 100644 core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_205.ttcn create mode 100644 core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_206.ttcn create mode 100644 core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_207.ttcn create mode 100644 core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_208.ttcn create mode 100644 core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_209.ttcn create mode 100644 core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_210.ttcn create mode 100644 core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_211.ttcn create mode 100644 core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_212.ttcn create mode 100644 core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_213.ttcn create mode 100644 core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_214.ttcn create mode 100644 core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_215.ttcn create mode 100644 core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_216.ttcn create mode 100644 core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_217.ttcn create mode 100644 core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_218.ttcn create mode 100644 core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_219.ttcn create mode 100644 core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_220.ttcn create mode 100644 core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_221.ttcn create mode 100644 core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_222.ttcn create mode 100644 core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_223.ttcn create mode 100644 core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_224.ttcn create mode 100644 core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_225.ttcn create mode 100644 core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_226.ttcn create mode 100644 core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_227.ttcn create mode 100644 core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_228.ttcn create mode 100644 core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_229.ttcn create mode 100644 core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_230.ttcn create mode 100644 core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_231.ttcn create mode 100644 core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_232.ttcn mode change 100755 => 100644 core_language/05_basic_language_elements/05_toplevel/NegSyn_05_TopLevel_001.ttcn mode change 100755 => 100644 core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/060101_toplevel/Sem_060101_TopLevel_007.ttcn create mode 100644 core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010203_ranges/Sem_06010203_Ranges_009.ttcn mode change 100755 => 100644 core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010205_pattern_subtyping_of_character_string_types/NegSyn_06010205_StringPattern_001.ttcn mode change 100755 => 100644 core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010205_pattern_subtyping_of_character_string_types/NegSyn_06010205_StringPattern_002.ttcn mode change 100755 => 100644 core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010205_pattern_subtyping_of_character_string_types/Sem_06010205_StringPattern_003.ttcn mode change 100755 => 100644 core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010206_mixing_subtyping_mechanisms/0601020602_using_length_restriction_with_other_constraints/Sem_0601020602_StringMixing_007.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/060201_toplevel/Sem_060201_RecordTypeValues_005.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/060202_set_type_and_values/Sem_060202_SetTypeValues_009.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/060204_enumerated_type_and_values/NegSem_060204_enumerated_type_and_values_014.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/060204_enumerated_type_and_values/NegSem_060204_enumerated_type_and_values_015.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/060204_enumerated_type_and_values/Sem_060204_enumerated_type_and_values_008.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/060204_enumerated_type_and_values/Sem_060204_enumerated_type_and_values_009.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/060204_enumerated_type_and_values/Syn_060204_enumerated_type_and_values_003.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/060204_enumerated_type_and_values/Syn_060204_enumerated_type_and_values_004.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/06020501_referencing_fields_of_union_type/Sem_06020501_referencing_fields_of_union_type_009.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/06020501_referencing_fields_of_union_type/Sem_06020501_referencing_fields_of_union_type_010.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/06020501_referencing_fields_of_union_type/Sem_06020501_referencing_fields_of_union_type_011.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/06020501_referencing_fields_of_union_type/Sem_06020501_referencing_fields_of_union_type_012.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/060205_toplevel/NegSem_060205_top_level_006.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/060205_toplevel/NegSem_060205_top_level_007.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/060205_toplevel/NegSem_060205_top_level_008.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/060205_toplevel/Sem_060205_top_level_002.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/060205_toplevel/Sem_060205_top_level_003.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/060205_toplevel/Sem_060205_top_level_004.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/060206_anytype/NegSyn_060206_anytype_004.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/060206_anytype/NegSyn_060206_anytype_005.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/Sem_060207_arrays_024.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/Sem_060207_arrays_025.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/NegSyn_060209_CommunicationPortTypes_001.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/NegSyn_060209_CommunicationPortTypes_002.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/NegSyn_060209_CommunicationPortTypes_003.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/NegSyn_060209_CommunicationPortTypes_004.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/NegSyn_060209_CommunicationPortTypes_005.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/NegSyn_060209_CommunicationPortTypes_006.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/NegSyn_060209_CommunicationPortTypes_007.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/NegSyn_060209_CommunicationPortTypes_008.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/NegSyn_060209_CommunicationPortTypes_009.ttcn mode change 100755 => 100644 core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/Sem_060209_CommunicationPortTypes_005.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/060210_component_types/06021001_component_type_definition/Syn_06021001_component_type_definition_001.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/060210_component_types/06021001_component_type_definition/Syn_06021001_component_type_definition_002.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/060210_component_types/06021001_component_type_definition/Syn_06021001_component_type_definition_003.ttcn mode change 100755 => 100644 core_language/06_types_and_values/0602_structured_types_and_values/060210_component_types/06021002_reuse_component_type/NegSyn_060210_ReuseofComponentTypes_001.ttcn mode change 100755 => 100644 core_language/06_types_and_values/0602_structured_types_and_values/060210_component_types/06021002_reuse_component_type/NegSyn_060210_ReuseofComponentTypes_002.ttcn mode change 100755 => 100644 core_language/06_types_and_values/0602_structured_types_and_values/060210_component_types/06021002_reuse_component_type/NegSyn_060210_ReuseofComponentTypes_003.ttcn mode change 100755 => 100644 core_language/06_types_and_values/0602_structured_types_and_values/060210_component_types/06021002_reuse_component_type/Sem_060210_ReuseofComponentTypes_001.ttcn mode change 100755 => 100644 core_language/06_types_and_values/0602_structured_types_and_values/060210_component_types/06021002_reuse_component_type/Sem_060210_ReuseofComponentTypes_002.ttcn mode change 100755 => 100644 core_language/06_types_and_values/0602_structured_types_and_values/060210_component_types/06021002_reuse_component_type/Sem_060210_ReuseofComponentTypes_003.ttcn mode change 100755 => 100644 core_language/06_types_and_values/0602_structured_types_and_values/060212_addressing_entities_inside_sut/NegSem_060212_AddressingEntitiesInsideSut_002.ttcn mode change 100755 => 100644 core_language/06_types_and_values/0602_structured_types_and_values/060212_addressing_entities_inside_sut/NegSem_060212_AddressingEntitiesInsideSut_003.ttcn mode change 100755 => 100644 core_language/06_types_and_values/0602_structured_types_and_values/060212_addressing_entities_inside_sut/NegSem_060212_AddressingEntitiesInsideSut_004.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/060213_subtyping_of_structured_types/06021302_list_subtyping/NegSem_06021302_ListSubtyping_003.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/060213_subtyping_of_structured_types/06021302_list_subtyping/Sem_06021302_ListSubtyping_004.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/060214_timer_type/Sem_060214_timer_type_001.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/060214_timer_type/Syn_060214_timer_type_001.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021501_map_type_definition/NegSem_06021501_map_type_definition_001.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021501_map_type_definition/NegSem_06021501_map_type_definition_002.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021501_map_type_definition/NegSem_06021501_map_type_definition_003.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021501_map_type_definition/NegSem_06021501_map_type_definition_004.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021501_map_type_definition/Sem_06021501_map_type_definition_001.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021501_map_type_definition/Sem_06021501_map_type_definition_002.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021502_indexed_assignment_notation/NegSem_06021502_indexed_assignment_notation_001.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021502_indexed_assignment_notation/NegSem_06021502_indexed_assignment_notation_002.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021502_indexed_assignment_notation/NegSem_06021502_indexed_assignment_notation_003.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021502_indexed_assignment_notation/Sem_06021502_indexed_assignment_notation_001.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021502_indexed_assignment_notation/Sem_06021502_indexed_assignment_notation_002.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021502_indexed_assignment_notation/Sem_06021502_indexed_assignment_notation_003.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021503_unmapping_keys/NegSem_06021503_unmapping_keys_001.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021503_unmapping_keys/NegSem_06021503_unmapping_keys_002.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021503_unmapping_keys/Sem_06021503_unmapping_keys_001.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021503_unmapping_keys/Sem_06021503_unmapping_keys_002.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021504_index_notation/NegSem_06021504_index_notation_001.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021504_index_notation/NegSem_06021504_index_notation_002.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021504_index_notation/NegSem_06021504_index_notation_003.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021504_index_notation/NegSem_06021504_index_notation_004.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021504_index_notation/NegSem_06021504_index_notation_005.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021504_index_notation/NegSem_06021504_index_notation_006.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021504_index_notation/Sem_06021504_index_notation_001.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021504_index_notation/Sem_06021504_index_notation_002.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021504_index_notation/Sem_06021504_index_notation_003.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021504_index_notation/Sem_06021504_index_notation_004.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021504_index_notation/Sem_06021504_index_notation_005.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021504_index_notation/Sem_06021504_index_notation_006.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021505_accessing_the_keys/Sem_06021505_accessing_the_keys_001.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021505_accessing_the_keys/Sem_06021505_accessing_the_keys_002.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021506_accessing_the_values/Sem_06021506_accessing_the_values_001.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021506_accessing_the_values/Sem_06021506_accessing_the_values_002.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021507_referencing_of_elements/Sem_06021507_referencing_of_elements_001.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021507_referencing_of_elements/Sem_06021507_referencing_of_elements_002.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021508_nested_type_definitions/Sem_06021508_nested_type_definitions_001.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021508_nested_type_definitions/Sem_06021508_nested_type_definitions_002.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/060216_the_open_type/NegSem_060216__the_open_type_001.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/060216_the_open_type/NegSem_060216__the_open_type_002.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/060216_the_open_type/NegSem_060216__the_open_type_003.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/060216_the_open_type/NegSem_060216__the_open_type_004.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/060216_the_open_type/NegSem_060216__the_open_type_005.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/060216_the_open_type/NegSem_060216__the_open_type_006.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/060216_the_open_type/NegSem_060216__the_open_type_007.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/060216_the_open_type/NegSem_060216__the_open_type_008.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/060216_the_open_type/NegSem_060216__the_open_type_009.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/060216_the_open_type/NegSem_060216__the_open_type_010.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/060216_the_open_type/Sem_060216_the_open_type_001.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/NegSem_0602_TopLevel_005.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/NegSem_0602_TopLevel_006.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/NegSem_0602_TopLevel_007.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/NegSem_0602_TopLevel_008.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/NegSem_0602_TopLevel_009.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/NegSem_0602_TopLevel_010.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/Sem_0602_TopLevel_015.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/Sem_0602_TopLevel_016.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/Sem_0602_TopLevel_017.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/Sem_0602_TopLevel_018.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/Sem_0602_TopLevel_019.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/Sem_0602_TopLevel_20.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/Sem_0602_TopLevel_21.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/Sem_0602_TopLevel_22.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/Sem_0602_TopLevel_23.ttcn create mode 100644 core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/Sem_0602_TopLevel_24.ttcn create mode 100644 core_language/06_types_and_values/0603_type_compatibility/060302_structured_types/Sem_060302_structured_types_007.ttcn create mode 100644 core_language/06_types_and_values/0603_type_compatibility/060302_structured_types/Sem_060302_structured_types_008.ttcn create mode 100644 core_language/06_types_and_values/0603_type_compatibility/060302_structured_types/Sem_060302_structured_types_009.ttcn create mode 100644 core_language/06_types_and_values/0603_type_compatibility/060302_structured_types/Sem_060302_structured_types_010.ttcn create mode 100644 core_language/06_types_and_values/0603_type_compatibility/060306_compatibility_of_port_types/NegSem_060306_compatibility_of_port_types_001.ttcn create mode 100644 core_language/06_types_and_values/0603_type_compatibility/060306_compatibility_of_port_types/NegSem_060306_compatibility_of_port_types_002.ttcn create mode 100644 core_language/06_types_and_values/0603_type_compatibility/060306_compatibility_of_port_types/Sem_060306_compatibility_of_port_types_001.ttcn create mode 100644 core_language/06_types_and_values/0603_type_compatibility/060306_compatibility_of_port_types/Sem_060306_compatibility_of_port_types_002.ttcn create mode 100644 core_language/06_types_and_values/0603_type_compatibility/060307_compatibility_of_timer_types/NegSem_060307_compatibility_of_timer_types_001.ttcn create mode 100644 core_language/06_types_and_values/0603_type_compatibility/060307_compatibility_of_timer_types/Sem_060307_compatibility_of_timer_types_001.ttcn create mode 100644 core_language/06_types_and_values/0603_type_compatibility/060308_compatibility_of_map_types/NegSem_060308_compatibility_of_map_types_001.ttcn create mode 100644 core_language/06_types_and_values/0603_type_compatibility/060308_compatibility_of_map_types/NegSem_060308_compatibility_of_map_types_002.ttcn create mode 100644 core_language/06_types_and_values/0603_type_compatibility/060308_compatibility_of_map_types/NegSem_060308_compatibility_of_map_types_003.ttcn create mode 100644 core_language/06_types_and_values/0603_type_compatibility/060308_compatibility_of_map_types/Sem_060308_compatibility_of_map_types_001.ttcn create mode 100644 core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_051.ttcn create mode 100644 core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_052.ttcn create mode 100644 core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_053.ttcn create mode 100644 core_language/07_expressions/0701_operators/070108_presence_checking_operators/07010801_ispresent_operator/Sem_07010801_ispresent_operator_001.ttcn create mode 100644 core_language/07_expressions/0701_operators/070108_presence_checking_operators/07010801_ispresent_operator/Sem_07010801_ispresent_operator_002.ttcn create mode 100644 core_language/07_expressions/0701_operators/070108_presence_checking_operators/07010801_ispresent_operator/Sem_07010801_ispresent_operator_003.ttcn create mode 100644 core_language/07_expressions/0701_operators/070108_presence_checking_operators/07010801_ispresent_operator/Sem_07010801_ispresent_operator_004.ttcn create mode 100644 core_language/07_expressions/0701_operators/070108_presence_checking_operators/07010802_ischosen_operator/Sem_07010802_ischosen_operator_001.ttcn create mode 100644 core_language/07_expressions/0701_operators/070108_presence_checking_operators/07010802_ischosen_operator/Sem_07010802_ischosen_operator_002.ttcn create mode 100644 core_language/07_expressions/0701_operators/070108_presence_checking_operators/07010802_ischosen_operator/Sem_07010802_ischosen_operator_003.ttcn create mode 100644 core_language/07_expressions/0701_operators/070108_presence_checking_operators/07010802_ischosen_operator/Sem_07010802_ischosen_operator_004.ttcn create mode 100644 core_language/07_expressions/0701_operators/070108_presence_checking_operators/07010803_isvalue_operator/Sem_07010803_isvalue_operator_001.ttcn create mode 100644 core_language/07_expressions/0701_operators/070108_presence_checking_operators/07010803_isvalue_operator/Sem_07010803_isvalue_operator_002.ttcn create mode 100644 core_language/07_expressions/0701_operators/070108_presence_checking_operators/07010803_isvalue_operator/Sem_07010803_isvalue_operator_003.ttcn create mode 100644 core_language/07_expressions/0701_operators/070108_presence_checking_operators/07010803_isvalue_operator/Sem_07010803_isvalue_operator_004.ttcn create mode 100644 core_language/07_expressions/0701_operators/070108_presence_checking_operators/07010803_isvalue_operator/Sem_07010803_isvalue_operator_005.ttcn create mode 100644 core_language/07_expressions/0701_operators/070108_presence_checking_operators/07010803_isvalue_operator/Sem_07010803_isvalue_operator_006.ttcn create mode 100644 core_language/07_expressions/0701_operators/070108_presence_checking_operators/07010803_isvalue_operator/Sem_07010803_isvalue_operator_007.ttcn create mode 100644 core_language/07_expressions/0701_operators/070108_presence_checking_operators/07010803_isvalue_operator/Sem_07010803_isvalue_operator_008.ttcn create mode 100644 core_language/07_expressions/0701_operators/070108_presence_checking_operators/07010804_isbound_operator/Sem_07010804_isbound_operator_001.ttcn create mode 100644 core_language/07_expressions/0701_operators/070108_presence_checking_operators/07010804_isbound_operator/Sem_07010804_isbound_operator_002.ttcn create mode 100644 core_language/07_expressions/0701_operators/070108_presence_checking_operators/07010804_isbound_operator/Sem_07010804_isbound_operator_003.ttcn create mode 100644 core_language/07_expressions/0701_operators/070108_presence_checking_operators/07010804_isbound_operator/Sem_07010804_isbound_operator_004.ttcn create mode 100644 core_language/07_expressions/0703_decoded_field_reference/NegSem_0703_decoded_field_reference_001.ttcn create mode 100644 core_language/07_expressions/0703_decoded_field_reference/NegSem_0703_decoded_field_reference_002.ttcn create mode 100644 core_language/07_expressions/0703_decoded_field_reference/NegSem_0703_decoded_field_reference_003.ttcn create mode 100644 core_language/07_expressions/0703_decoded_field_reference/Sem_0703_decoded_field_reference_001.ttcn create mode 100644 core_language/07_expressions/0703_decoded_field_reference/Sem_0703_decoded_field_reference_002.ttcn create mode 100644 core_language/07_expressions/0703_decoded_field_reference/Sem_0703_decoded_field_reference_003.ttcn create mode 100644 core_language/07_expressions/0703_decoded_field_reference/Sem_0703_decoded_field_reference_004.ttcn create mode 100644 core_language/07_expressions/0703_decoded_field_reference/Sem_0703_decoded_field_reference_005.ttcn create mode 100644 core_language/07_expressions/0703_decoded_field_reference/Sem_0703_decoded_field_reference_006.ttcn create mode 100644 core_language/07_expressions/0703_decoded_field_reference/Sem_0703_decoded_field_reference_007.ttcn create mode 100644 core_language/07_expressions/0703_decoded_field_reference/Sem_0703_decoded_field_reference_008.ttcn create mode 100644 core_language/07_expressions/0703_decoded_field_reference/Sem_0703_decoded_field_reference_009.ttcn create mode 100644 core_language/07_expressions/0703_decoded_field_reference/Sem_0703_decoded_field_reference_010.ttcn create mode 100644 core_language/07_expressions/0703_decoded_field_reference/Sem_0703_decoded_field_reference_011.ttcn create mode 100644 core_language/08_modules/0801_definition_of_a_module/Sem_0801_DefinitionOfAModule_001.ttcn create mode 100644 core_language/08_modules/0801_definition_of_a_module/Syn_0801_DefinitionOfAModule_011.ttcn create mode 100644 core_language/08_modules/0801_definition_of_a_module/Syn_0801_DefinitionOfAModule_012.ttcn create mode 100644 core_language/08_modules/0801_definition_of_a_module/Syn_0801_DefinitionOfAModule_013.ttcn create mode 100644 core_language/08_modules/0801_definition_of_a_module/Syn_0801_DefinitionOfAModule_014.ttcn create mode 100644 core_language/08_modules/0801_definition_of_a_module/Syn_0801_DefinitionOfAModule_015.ttcn create mode 100644 core_language/08_modules/0802_module_definitions_part/080201_module_parameters/NegSem_080201_ModuleParameters_007.ttcn create mode 100644 core_language/08_modules/0802_module_definitions_part/080201_module_parameters/NegSem_080201_ModuleParameters_008.ttcn create mode 100644 core_language/08_modules/0802_module_definitions_part/080201_module_parameters/NegSem_080201_ModuleParameters_009.ttcn create mode 100644 core_language/08_modules/0802_module_definitions_part/080201_module_parameters/NegSem_080201_ModuleParameters_010.ttcn create mode 100644 core_language/08_modules/0802_module_definitions_part/080201_module_parameters/Syn_080201_ModuleParameters_004.ttcn create mode 100644 core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_041.ttcn create mode 100644 core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_042.ttcn create mode 100644 core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/Sem_08020301_GeneralFormatOfImport_021.ttcn create mode 100644 core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020305_importing_all_definitions_of_a_module/Sem_08020305_ImportingAllDefinitionsOfAModule_003.ttcn create mode 100644 core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020305_importing_all_definitions_of_a_module/Sem_08020305_ImportingAllDefinitionsOfAModule_004.ttcn mode change 100755 => 100644 core_language/09_test_configurations/0901_communication_ports/NegSem_0901_Communication_ports_008.ttcn mode change 100755 => 100644 core_language/09_test_configurations/0901_communication_ports/Sem_0901_Communication_ports_009.ttcn mode change 100755 => 100644 core_language/09_test_configurations/0901_communication_ports/Sem_0901_Communication_ports_010.ttcn mode change 100755 => 100644 core_language/09_test_configurations/0901_communication_ports/Sem_0901_Communication_ports_011.ttcn mode change 100755 => 100644 core_language/10_constants/NegSem_10_Constants_004.ttcn mode change 100755 => 100644 core_language/10_constants/NegSem_10_Constants_005.ttcn create mode 100644 core_language/10_constants/Sem_10_Constants_010.ttcn create mode 100644 core_language/10_constants/Sem_10_Constants_011.ttcn create mode 100644 core_language/10_constants/Sem_10_Constants_012.ttcn create mode 100644 core_language/10_constants/Sem_10_Constants_013.ttcn mode change 100755 => 100644 core_language/11_variables/1101_value_variables/NegSem_1101_ValueVars_003.ttcn mode change 100755 => 100644 core_language/11_variables/1101_value_variables/NegSem_1101_ValueVars_004.ttcn create mode 100644 core_language/11_variables/1101_value_variables/Sem_1101_ValueVars_007.ttcn mode change 100755 => 100644 core_language/11_variables/1102_template_variables/NegSem_1102_TemplateVars_003.ttcn mode change 100755 => 100644 core_language/11_variables/1102_template_variables/NegSem_1102_TemplateVars_004.ttcn create mode 100644 core_language/11_variables/1102_template_variables/Sem_1102_TemplateVars_004.ttcn create mode 100644 core_language/11_variables/1102_template_variables/Sem_1102_TemplateVars_005.ttcn create mode 100644 core_language/11_variables/1102_template_variables/Sem_1102_TemplateVars_006.ttcn create mode 100644 core_language/14_procedure_signatures/NegSem_1400_procedure_signatures_003.ttcn create mode 100644 core_language/15_templates/1500_general/NegSem_1500_general_001.ttcn create mode 100644 core_language/15_templates/1500_general/NegSem_1500_general_002.ttcn create mode 100644 core_language/15_templates/1500_general/NegSem_1500_general_003.ttcn create mode 100644 core_language/15_templates/1500_general/NegSem_1500_general_004.ttcn create mode 100644 core_language/15_templates/1500_general/NegSem_1500_general_005.ttcn create mode 100644 core_language/15_templates/1500_general/NegSem_1500_general_006.ttcn create mode 100644 core_language/15_templates/1500_general/NegSem_1500_general_007.ttcn create mode 100644 core_language/15_templates/1500_general/NegSem_1500_general_008.ttcn create mode 100644 core_language/15_templates/1500_general/NegSem_1500_general_009.ttcn create mode 100644 core_language/15_templates/1500_general/NegSem_1500_general_010.ttcn create mode 100644 core_language/15_templates/1500_general/NegSem_1500_general_011.ttcn create mode 100644 core_language/15_templates/1500_general/NegSem_1500_general_012.ttcn create mode 100644 core_language/15_templates/1500_general/NegSem_1500_general_013.ttcn create mode 100644 core_language/15_templates/1500_general/NegSem_1500_general_014.ttcn create mode 100644 core_language/15_templates/1500_general/NegSem_1500_general_015.ttcn create mode 100644 core_language/15_templates/1500_general/NegSem_1500_general_016.ttcn create mode 100644 core_language/15_templates/1500_general/NegSem_1500_general_017.ttcn create mode 100644 core_language/15_templates/1500_general/NegSem_1500_general_018.ttcn create mode 100644 core_language/15_templates/1500_general/NegSem_1500_general_019.ttcn create mode 100644 core_language/15_templates/1500_general/NegSem_1500_general_020.ttcn create mode 100644 core_language/15_templates/1500_general/NegSem_1500_general_021.ttcn create mode 100644 core_language/15_templates/1500_general/NegSem_1500_general_022.ttcn create mode 100644 core_language/15_templates/1500_general/NegSem_1500_general_023.ttcn create mode 100644 core_language/15_templates/1500_general/NegSem_1500_general_024.ttcn create mode 100644 core_language/15_templates/1500_general/NegSem_1500_general_025.ttcn create mode 100644 core_language/15_templates/1500_general/NegSem_1500_general_026.ttcn create mode 100644 core_language/15_templates/1500_general/NegSem_1500_general_027.ttcn create mode 100644 core_language/15_templates/1500_general/NegSem_1500_general_028.ttcn create mode 100644 core_language/15_templates/1500_general/NegSem_1500_general_029.ttcn create mode 100644 core_language/15_templates/1500_general/NegSem_1500_general_030.ttcn create mode 100644 core_language/15_templates/1500_general/NegSem_1500_general_031.ttcn create mode 100644 core_language/15_templates/1500_general/NegSem_1500_general_032.ttcn create mode 100644 core_language/15_templates/1500_general/NegSem_1500_general_033.ttcn create mode 100644 core_language/15_templates/1500_general/NegSem_1500_general_034.ttcn create mode 100644 core_language/15_templates/1500_general/NegSem_1500_general_035.ttcn create mode 100644 core_language/15_templates/1500_general/NegSem_1500_general_036.ttcn create mode 100644 core_language/15_templates/1500_general/NegSem_1500_general_037.ttcn create mode 100644 core_language/15_templates/1500_general/NegSem_1500_general_038.ttcn create mode 100644 core_language/15_templates/1500_general/NegSem_1500_general_039.ttcn create mode 100644 core_language/15_templates/1500_general/NegSem_1500_general_040.ttcn create mode 100644 core_language/15_templates/1500_general/NegSem_1500_general_041.ttcn create mode 100644 core_language/15_templates/1500_general/NegSem_1500_general_042.ttcn create mode 100644 core_language/15_templates/1500_general/NegSem_1500_general_043.ttcn create mode 100644 core_language/15_templates/1500_general/NegSem_1500_general_044.ttcn create mode 100644 core_language/15_templates/1500_general/NegSem_1500_general_045.ttcn create mode 100644 core_language/15_templates/1500_general/NegSem_1500_general_046.ttcn create mode 100644 core_language/15_templates/1500_general/NegSem_1500_general_047.ttcn create mode 100644 core_language/15_templates/1500_general/NegSem_1500_general_048.ttcn create mode 100644 core_language/15_templates/1500_general/NegSem_1500_general_049.ttcn create mode 100644 core_language/15_templates/1500_general/NegSem_1500_general_050.ttcn create mode 100644 core_language/15_templates/1500_general/NegSem_1500_general_051.ttcn create mode 100644 core_language/15_templates/1503_global_and_local_templates/NegSem_1503_GlobalAndLocalTemplates_007.ttcn create mode 100644 core_language/15_templates/1503_global_and_local_templates/NegSem_1503_GlobalAndLocalTemplates_008.ttcn create mode 100644 core_language/15_templates/1503_global_and_local_templates/NegSyn_1503_GlobalAndLocalTemplates_005.ttcn create mode 100644 core_language/15_templates/1503_global_and_local_templates/NegSyn_1503_GlobalAndLocalTemplates_006.ttcn create mode 100644 core_language/15_templates/1503_global_and_local_templates/Sem_1503_GlobalAndLocalTemplates_007.ttcn create mode 100644 core_language/15_templates/1503_global_and_local_templates/Sem_1503_GlobalAndLocalTemplates_010.ttcn create mode 100644 core_language/15_templates/1503_global_and_local_templates/Syn_1503_GlobalAndLocalTemplates_007.ttcn create mode 100644 core_language/15_templates/1503_global_and_local_templates/Syn_1503_GlobalAndLocalTemplates_008.ttcn create mode 100644 core_language/15_templates/1503_global_and_local_templates/Syn_1503_GlobalAndLocalTemplates_009.ttcn create mode 100644 core_language/15_templates/1503_global_and_local_templates/Syn_1503_GlobalAndLocalTemplates_010.ttcn create mode 100644 core_language/15_templates/1503_global_and_local_templates/Syn_1503_GlobalAndLocalTemplates_011.ttcn create mode 100644 core_language/15_templates/1503_global_and_local_templates/Syn_1503_GlobalAndLocalTemplates_012.ttcn create mode 100644 core_language/15_templates/1505_modified_templates/NegSem_1505_ModifiedTemplates_008.ttcn create mode 100644 core_language/15_templates/1505_modified_templates/NegSem_1505_ModifiedTemplates_009.ttcn create mode 100644 core_language/15_templates/1505_modified_templates/Sem_1505_ModifiedTemplates_011.ttcn create mode 100644 core_language/15_templates/1505_modified_templates/Sem_1505_ModifiedTemplates_012.ttcn create mode 100644 core_language/15_templates/1505_modified_templates/Sem_1505_ModifiedTemplates_013.ttcn create mode 100644 core_language/15_templates/1505_modified_templates/Sem_1505_ModifiedTemplates_014.ttcn create mode 100644 core_language/15_templates/1505_modified_templates/Sem_1505_ModifiedTemplates_015.ttcn create mode 100644 core_language/15_templates/1505_modified_templates/Sem_1505_ModifiedTemplates_016.ttcn create mode 100644 core_language/15_templates/1505_modified_templates/Sem_1505_ModifiedTemplates_017.ttcn create mode 100644 core_language/15_templates/1505_modified_templates/Syn_1505_ModifiedTemplates_005.ttcn create mode 100644 core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_052.ttcn create mode 100644 core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_053.ttcn create mode 100644 core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_054.ttcn create mode 100644 core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_055.ttcn create mode 100644 core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_056.ttcn create mode 100644 core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_057.ttcn create mode 100644 core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_058.ttcn create mode 100644 core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_059.ttcn create mode 100644 core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_060.ttcn create mode 100644 core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_061.ttcn create mode 100644 core_language/15_templates/1509_match_operation/Sem_1509_MatchOperation_009.ttcn create mode 100644 core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_016.ttcn create mode 100644 core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_017.ttcn create mode 100644 core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_018.ttcn create mode 100644 core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_019.ttcn create mode 100644 core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_020.ttcn create mode 100644 core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_021.ttcn create mode 100644 core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_022.ttcn create mode 100644 core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_023.ttcn create mode 100644 core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_024.ttcn create mode 100644 core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_025.ttcn create mode 100644 core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_026.ttcn create mode 100644 core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_027.ttcn create mode 100644 core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_028.ttcn create mode 100644 core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_029.ttcn create mode 100644 core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_030.ttcn create mode 100644 core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_031.ttcn create mode 100644 core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_032.ttcn create mode 100644 core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_033.ttcn create mode 100644 core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_034.ttcn create mode 100644 core_language/15_templates/1512_the_omit_operation/NegSem_1512_TheOmitOperation_001.ttcn create mode 100644 core_language/15_templates/1512_the_omit_operation/NegSem_1512_TheOmitOperation_002.ttcn create mode 100644 core_language/15_templates/1512_the_omit_operation/Sem_1512_TheOmitOperation_001.ttcn create mode 100644 core_language/15_templates/1512_the_omit_operation/Sem_1512_TheOmitOperation_002.ttcn create mode 100644 core_language/15_templates/1513_the_present_operation/NegSem_1512_ThePresentOperation_001.ttcn create mode 100644 core_language/15_templates/1513_the_present_operation/NegSem_1512_ThePresentOperation_002.ttcn create mode 100644 core_language/15_templates/1513_the_present_operation/Sem_1512_ThePresentOperation_001.ttcn mode change 100755 => 100644 core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_036.ttcn mode change 100755 => 100644 core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_037.ttcn mode change 100755 => 100644 core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_038.ttcn create mode 100644 core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_041.ttcn create mode 100644 core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_042.ttcn create mode 100644 core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_043.ttcn create mode 100644 core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_044.ttcn create mode 100644 core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_045.ttcn create mode 100644 core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_046.ttcn create mode 100644 core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_047.ttcn create mode 100644 core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_048.ttcn create mode 100644 core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_049.ttcn create mode 100644 core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_050.ttcn create mode 100644 core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_051.ttcn create mode 100644 core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_052.ttcn create mode 100644 core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_053.ttcn create mode 100644 core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_054.ttcn create mode 100644 core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_055.ttcn create mode 100644 core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_056.ttcn create mode 100644 core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_057.ttcn create mode 100644 core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_058.ttcn create mode 100644 core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_059.ttcn create mode 100644 core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_060.ttcn create mode 100644 core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_061.ttcn create mode 100644 core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_062.ttcn create mode 100644 core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_063.ttcn mode change 100755 => 100644 core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_026.ttcn mode change 100755 => 100644 core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_027.ttcn mode change 100755 => 100644 core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_028.ttcn mode change 100755 => 100644 core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_029.ttcn mode change 100755 => 100644 core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_034.ttcn mode change 100755 => 100644 core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_035.ttcn mode change 100755 => 100644 core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_036.ttcn mode change 100755 => 100644 core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_037.ttcn mode change 100755 => 100644 core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_042.ttcn mode change 100755 => 100644 core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_043.ttcn mode change 100755 => 100644 core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_044.ttcn mode change 100755 => 100644 core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_045.ttcn mode change 100755 => 100644 core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_047.ttcn mode change 100755 => 100644 core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_048.ttcn mode change 100755 => 100644 core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_049.ttcn mode change 100755 => 100644 core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_050.ttcn mode change 100755 => 100644 core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_051.ttcn mode change 100755 => 100644 core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_052.ttcn mode change 100755 => 100644 core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_053.ttcn mode change 100755 => 100644 core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_054.ttcn mode change 100755 => 100644 core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_055.ttcn mode change 100755 => 100644 core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_056.ttcn mode change 100755 => 100644 core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_057.ttcn mode change 100755 => 100644 core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_058.ttcn mode change 100755 => 100644 core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_059.ttcn mode change 100755 => 100644 core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_060.ttcn mode change 100755 => 100644 core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_061.ttcn mode change 100755 => 100644 core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_063.ttcn mode change 100755 => 100644 core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_064.ttcn mode change 100755 => 100644 core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_065.ttcn mode change 100755 => 100644 core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_066.ttcn mode change 100755 => 100644 core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_067.ttcn mode change 100755 => 100644 core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_068.ttcn mode change 100755 => 100644 core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_069.ttcn mode change 100755 => 100644 core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_070.ttcn mode change 100755 => 100644 core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_071.ttcn mode change 100755 => 100644 core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_072.ttcn mode change 100755 => 100644 core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_073.ttcn mode change 100755 => 100644 core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_074.ttcn mode change 100755 => 100644 core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_075.ttcn mode change 100755 => 100644 core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_076.ttcn mode change 100755 => 100644 core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_077.ttcn mode change 100755 => 100644 core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_078.ttcn mode change 100755 => 100644 core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_079.ttcn mode change 100755 => 100644 core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_080.ttcn mode change 100755 => 100644 core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_081.ttcn mode change 100755 => 100644 core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_082.ttcn mode change 100755 => 100644 core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_090.ttcn mode change 100755 => 100644 core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_091.ttcn mode change 100755 => 100644 core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_092.ttcn create mode 100644 core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_109.ttcn create mode 100644 core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_110.ttcn create mode 100644 core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_111.ttcn create mode 100644 core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_112.ttcn create mode 100644 core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_113.ttcn create mode 100644 core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_114.ttcn create mode 100644 core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_115.ttcn create mode 100644 core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_116.ttcn create mode 100644 core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_117.ttcn create mode 100644 core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_118.ttcn create mode 100644 core_language/16_functions_altsteps_testcases/1601_functions/160103_external_functions/Sem_160103_external_functions_003.ttcn create mode 100644 core_language/16_functions_altsteps_testcases/1601_functions/160103_external_functions/Sem_160103_external_functions_004.ttcn create mode 100644 core_language/16_functions_altsteps_testcases/1601_functions/160103_external_functions/Sem_160103_external_functions_005.ttcn create mode 100644 core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_326.ttcn create mode 100644 core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_327.ttcn create mode 100644 core_language/16_functions_altsteps_testcases/1601_functions/160105_explicit_control_functions/NegSem_160105_explicit_control_functions_001.ttcn create mode 100644 core_language/16_functions_altsteps_testcases/1601_functions/160105_explicit_control_functions/NegSem_160105_explicit_control_functions_002.ttcn create mode 100644 core_language/16_functions_altsteps_testcases/1601_functions/160105_explicit_control_functions/NegSem_160105_explicit_control_functions_003.ttcn create mode 100644 core_language/16_functions_altsteps_testcases/1601_functions/160105_explicit_control_functions/NegSem_160105_explicit_control_functions_004.ttcn create mode 100644 core_language/16_functions_altsteps_testcases/1601_functions/160105_explicit_control_functions/NegSem_160105_explicit_control_functions_005.ttcn create mode 100644 core_language/16_functions_altsteps_testcases/1601_functions/160105_explicit_control_functions/NegSem_160105_explicit_control_functions_006.ttcn create mode 100644 core_language/16_functions_altsteps_testcases/1601_functions/160105_explicit_control_functions/NegSem_160105_explicit_control_functions_007.ttcn create mode 100644 core_language/16_functions_altsteps_testcases/1601_functions/160105_explicit_control_functions/NegSem_160105_explicit_control_functions_008.ttcn create mode 100644 core_language/16_functions_altsteps_testcases/1601_functions/160105_explicit_control_functions/NegSem_160105_explicit_control_functions_009.ttcn create mode 100644 core_language/16_functions_altsteps_testcases/1601_functions/160105_explicit_control_functions/Sem_160105_explicit_control_functions_001.ttcn create mode 100644 core_language/16_functions_altsteps_testcases/1601_functions/160105_explicit_control_functions/Sem_160105_explicit_control_functions_002.ttcn create mode 100644 core_language/16_functions_altsteps_testcases/1601_functions/1601_toplevel/NegSem_1601_toplevel_007.ttcn create mode 100644 core_language/16_functions_altsteps_testcases/1601_functions/1601_toplevel/NegSem_1601_toplevel_008.ttcn create mode 100644 core_language/16_functions_altsteps_testcases/1601_functions/1601_toplevel/NegSem_1601_toplevel_009.ttcn create mode 100644 core_language/16_functions_altsteps_testcases/1602_altsteps/160201_invoking_altsteps/NegSyn_160201_invoking_altsteps_001.ttcn create mode 100644 core_language/16_functions_altsteps_testcases/1602_altsteps/160201_invoking_altsteps/Sem_160201_invoking_altsteps_005.ttcn create mode 100644 core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_053.ttcn create mode 100644 core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_054.ttcn create mode 100644 core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_055.ttcn create mode 100644 core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/Sem_1602_toplevel_004.ttcn create mode 100644 core_language/16_functions_altsteps_testcases/1603_testcases/NegSyn_1603_testcases_001.ttcn create mode 100644 core_language/16_functions_altsteps_testcases/1603_testcases/NegSyn_1603_testcases_002.ttcn create mode 100644 core_language/16_functions_altsteps_testcases/1603_testcases/NegSyn_1603_testcases_003.ttcn create mode 100644 core_language/16_functions_altsteps_testcases/1603_testcases/NegSyn_1603_testcases_004.ttcn create mode 100644 core_language/16_functions_altsteps_testcases/1603_testcases/NegSyn_1603_testcases_005.ttcn create mode 100644 core_language/16_functions_altsteps_testcases/1603_testcases/NegSyn_1603_testcases_006.ttcn create mode 100644 core_language/16_functions_altsteps_testcases/1603_testcases/Syn_1603_testcases_002.ttcn create mode 100644 core_language/16_functions_altsteps_testcases/1603_testcases/Syn_1603_testcases_003.ttcn create mode 100644 core_language/19_basic_program_statements/1901_assignments/Sem_1901_assignments_005.ttcn create mode 100644 core_language/19_basic_program_statements/1901_assignments/Sem_1901_assignments_006.ttcn create mode 100644 core_language/19_basic_program_statements/1903_select_statements/190301_select_case_statement/._NegSem_190301_select_case_statement_002.ttcn create mode 100644 core_language/19_basic_program_statements/1903_select_statements/190301_select_case_statement/Sem_190301_select_union_statement_007.ttcn create mode 100644 core_language/19_basic_program_statements/1908_goto_statement/NegSem_1908_goto_statement_004.ttcn create mode 100644 core_language/19_basic_program_statements/1911_log_statement/Sem_1911_log_statement_006.ttcn create mode 100644 core_language/19_basic_program_statements/1911_log_statement/Sem_1911_log_statement_007.ttcn create mode 100644 core_language/19_basic_program_statements/1911_log_statement/Sem_1911_log_statement_008.ttcn create mode 100644 core_language/19_basic_program_statements/1911_log_statement/Sem_1911_log_statement_009.ttcn create mode 100644 core_language/19_basic_program_statements/1911_log_statement/Sem_1911_log_statement_010.ttcn create mode 100644 core_language/19_basic_program_statements/1911_log_statement/Sem_1911_log_statement_011.ttcn create mode 100644 core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/Sem_2002_TheAltStatement_015.ttcn create mode 100644 core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/Sem_2002_TheAltStatement_016.ttcn create mode 100644 core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/Sem_2002_TheAltStatement_017.ttcn create mode 100644 core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/Sem_2002_TheAltStatement_018.ttcn create mode 100644 core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/Sem_2002_TheAltStatement_019.ttcn create mode 100644 core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/Sem_2002_TheAltStatement_020.ttcn create mode 100644 core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/Sem_2002_TheAltStatement_021.ttcn create mode 100644 core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/Sem_2002_TheAltStatement_022.ttcn create mode 100644 core_language/20_statement_and_operations_for_alt/2004_the_interleave_statement/._NegSem_2004_InterleaveStatement_002.ttcn create mode 100644 core_language/20_statement_and_operations_for_alt/2004_the_interleave_statement/._Sem_2004_InterleaveStatement_004.ttcn create mode 100644 core_language/20_statement_and_operations_for_alt/2004_the_interleave_statement/._Sem_2004_InterleaveStatement_005.ttcn create mode 100644 core_language/20_statement_and_operations_for_alt/2004_the_interleave_statement/Sem_2004_InterleaveStatement_011.ttcn create mode 100644 core_language/20_statement_and_operations_for_alt/2004_the_interleave_statement/Sem_2004_InterleaveStatement_012.ttcn create mode 100644 core_language/20_statement_and_operations_for_alt/2004_the_interleave_statement/Sem_2004_InterleaveStatement_013.ttcn create mode 100644 core_language/20_statement_and_operations_for_alt/2005_default_handling/200502_the_activate_operation/Sem_200502_the_activate_operation_007.ttcn create mode 100644 core_language/20_statement_and_operations_for_alt/2005_default_handling/200502_the_activate_operation/Sem_200502_the_activate_operation_008.ttcn create mode 100644 core_language/20_statement_and_operations_for_alt/2005_default_handling/200502_the_activate_operation/Sem_200502_the_activate_operation_009.ttcn create mode 100644 core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/NegSem_210101_connect_and_map_operations_015.ttcn create mode 100644 core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/NegSem_210101_connect_and_map_operations_016.ttcn create mode 100644 core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/NegSem_210101_connect_and_map_operations_017.ttcn create mode 100644 core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/NegSem_210101_connect_and_map_operations_018.ttcn create mode 100644 core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/NegSem_210101_connect_and_map_operations_019.ttcn create mode 100644 core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/NegSem_210101_connect_and_map_operations_020.ttcn create mode 100644 core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/NegSem_210102_disconnect_and_unmap_operations_015.ttcn create mode 100644 core_language/21_configuration_operations/2103_test_component_operations/210307_done_operation/NegSyn_210307_done_operation_005.ttcn create mode 100644 core_language/21_configuration_operations/2103_test_component_operations/210307_done_operation/Sem_210307_done_operation_013.ttcn create mode 100644 core_language/21_configuration_operations/2103_test_component_operations/210307_done_operation/Sem_210307_done_operation_014.ttcn create mode 100644 core_language/21_configuration_operations/2103_test_component_operations/210308_killed_operation/NegSyn_210308_killed_operation_005.ttcn create mode 100644 core_language/21_configuration_operations/2103_test_component_operations/210308_killed_operation/Sem_210308_killed_operation_015.ttcn create mode 100644 core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/NegSem_210310_call_test_component_operation_001.ttcn create mode 100644 core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/NegSem_210310_call_test_component_operation_002.ttcn create mode 100644 core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/NegSem_210310_call_test_component_operation_003.ttcn create mode 100644 core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/NegSem_210310_call_test_component_operation_004.ttcn create mode 100644 core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/NegSem_210310_call_test_component_operation_005.ttcn create mode 100644 core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/NegSem_210310_call_test_component_operation_006.ttcn create mode 100644 core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/NegSem_210310_call_test_component_operation_007.ttcn create mode 100644 core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/NegSem_210310_call_test_component_operation_008.ttcn create mode 100644 core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/NegSem_210310_call_test_component_operation_009.ttcn create mode 100644 core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/NegSem_210310_call_test_component_operation_010.ttcn create mode 100644 core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/NegSem_210310_call_test_component_operation_011.ttcn create mode 100644 core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/NegSem_210310_call_test_component_operation_012.ttcn create mode 100644 core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/NegSem_210310_call_test_component_operation_013.ttcn create mode 100644 core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/NegSem_210310_call_test_component_operation_014.ttcn create mode 100644 core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/NegSem_210310_call_test_component_operation_015.ttcn create mode 100644 core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/NegSem_210310_call_test_component_operation_016.ttcn create mode 100644 core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/NegSem_210310_call_test_component_operation_017.ttcn create mode 100644 core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/NegSem_210310_call_test_component_operation_018.ttcn create mode 100644 core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/NegSem_210310_call_test_component_operation_019.ttcn create mode 100644 core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/NegSem_210310_call_test_component_operation_020.ttcn create mode 100644 core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/NegSem_210310_call_test_component_operation_021.ttcn create mode 100644 core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/NegSem_210310_call_test_component_operation_022.ttcn create mode 100644 core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/Sem_210310_call_test_component_operation_001.ttcn create mode 100644 core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/Sem_210310_call_test_component_operation_002.ttcn create mode 100644 core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/Sem_210310_call_test_component_operation_003.ttcn create mode 100644 core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/Sem_210310_call_test_component_operation_004.ttcn create mode 100644 core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/Sem_210310_call_test_component_operation_005.ttcn create mode 100644 core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/Sem_210310_call_test_component_operation_006.ttcn create mode 100644 core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/Sem_210310_call_test_component_operation_007.ttcn create mode 100644 core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/Sem_210310_call_test_component_operation_008.ttcn create mode 100644 core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/Sem_210310_call_test_component_operation_009.ttcn create mode 100644 core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/Sem_210310_call_test_component_operation_010.ttcn create mode 100644 core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/Sem_210310_call_test_component_operation_011.ttcn create mode 100644 core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/Sem_210310_call_test_component_operation_012.ttcn create mode 100644 core_language/22_communication_operations/2202_message_based_communication/220201_send_operation/NegSem_220201_SendOperation_012.ttcn create mode 100644 core_language/22_communication_operations/2202_message_based_communication/220201_send_operation/NegSem_220201_SendOperation_013.ttcn create mode 100644 core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/NegSem_220202_ReceiveOperation_025.ttcn create mode 100644 core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/NegSem_220202_ReceiveOperation_026.ttcn create mode 100644 core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/NegSem_220202_ReceiveOperation_027.ttcn create mode 100644 core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/NegSem_220202_ReceiveOperation_028.ttcn create mode 100644 core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/Sem_220202_ReceiveOperation_031.ttcn create mode 100644 core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/NegSem_220203_TriggerOperation_025.ttcn create mode 100644 core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/NegSem_220203_TriggerOperation_026.ttcn create mode 100644 core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/Sem_220203_TriggerOperation_029.ttcn create mode 100644 core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/NegSem_220301_CallOperation_021.ttcn create mode 100644 core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/NegSem_220302_getcall_operation_020.ttcn create mode 100644 core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/NegSyn_220302_getcall_operation_003.ttcn create mode 100644 core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/Sem_220302_getcall_operation_023.ttcn create mode 100644 core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/NegSem_220304_getreply_operation_023.ttcn create mode 100644 core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/NegSyn_220304_getreply_operation_003.ttcn create mode 100644 core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/Sem_220304_getreply_operation_024.ttcn create mode 100644 core_language/22_communication_operations/2203_procedure_based_communication/220305_raise_operation/NegSem_220305_raise_operation_011.ttcn create mode 100644 core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/NegSyn_220306_catch_operation_004.ttcn create mode 100644 core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/Sem_220306_catch_operation_018.ttcn create mode 100644 core_language/22_communication_operations/2204_the_check_operation/NegSem_2204_the_check_operation_006.ttcn create mode 100644 core_language/22_communication_operations/2204_the_check_operation/NegSyn_2204_the_check_operation_001.ttcn create mode 100644 core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_121.ttcn create mode 100644 core_language/23_timer_operations/2302_the_start_timer_operataion/NegSem_2302_timer_start_005.ttcn create mode 100644 core_language/23_timer_operations/2303_the_stop_timer_operation/NegSem_2303_timer_stop_001.ttcn create mode 100644 core_language/23_timer_operations/2304_the_read_timer_operation/NegSem_2304_the_read_timer_operation_001.ttcn create mode 100644 core_language/23_timer_operations/2305_the_running_timer_operation/NegSem_2305_the_running_timer_operation_001.ttcn create mode 100644 core_language/23_timer_operations/2306_the_timeout_operation/NegSem_2306_the_timeout_operation_001.ttcn create mode 100644 core_language/23_timer_operations/2306_the_timeout_operation/NegSyn_2306_timer_timeout_008.ttcn create mode 100644 core_language/23_timer_operations/2306_the_timeout_operation/NegSyn_2306_timer_timeout_009.ttcn create mode 100644 core_language/23_timer_operations/2306_the_timeout_operation/Sem_2306_timer_timeout_010.ttcn create mode 100644 core_language/27_specifying_attributes/2701_attribute_mechanism/270101_scope_of_attributes/NegSem_270101_ScopeOfAttributes_001.ttcn create mode 100644 core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules_for_attributes/27010200_general/Sem_27010200_general_001.ttcn create mode 100644 core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules_for_attributes/27010200_general/Sem_27010200_general_002.ttcn create mode 100644 core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules_for_attributes/27010200_general/Sem_27010200_general_003.ttcn create mode 100644 core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules_for_attributes/27010200_general/Sem_27010200_general_004.ttcn create mode 100644 core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules_for_attributes/27010200_general/Sem_27010200_general_005.ttcn create mode 100644 core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules_for_attributes/27010200_general/Sem_27010200_general_006.ttcn create mode 100644 core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules_for_attributes/27010200_general/Sem_27010200_general_007.ttcn create mode 100644 core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules_for_attributes/27010200_general/Sem_27010200_general_008.ttcn create mode 100644 core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules_for_attributes/27010200_general/Sem_27010200_general_009.ttcn create mode 100644 core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules_for_attributes/27010200_general/Sem_27010200_general_010.ttcn create mode 100644 core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules_for_attributes/27010200_general/Sem_27010200_general_011.ttcn create mode 100644 core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules_for_attributes/27010200_general/Sem_27010200_general_012.ttcn create mode 100644 core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules_for_attributes/27010200_general/Sem_27010200_general_013.ttcn create mode 100644 core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules_for_attributes/27010200_general/Sem_27010200_general_014.ttcn create mode 100644 core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules_for_attributes/27010200_general/Sem_27010200_general_015.ttcn create mode 100644 core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules_for_attributes/27010200_general/Sem_27010200_general_016.ttcn create mode 100644 core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules_for_attributes/27010201_rules_for_variant_attributes/Sem_27010201_rules_for_variant_attributes_001.ttcn create mode 100644 core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules_for_attributes/27010201_rules_for_variant_attributes/Sem_27010201_rules_for_variant_attributes_002.ttcn create mode 100644 core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules_for_attributes/27010201_rules_for_variant_attributes/Sem_27010201_rules_for_variant_attributes_003.ttcn create mode 100644 core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules_for_attributes/27010202_rules_for_multiple_encodings/Sem_27010202_rules_for_multiple_encodings_001.ttcn create mode 100644 core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules_for_attributes/27010202_rules_for_multiple_encodings/Sem_27010202_rules_for_multiple_encodings_002.ttcn create mode 100644 core_language/27_specifying_attributes/2707_optional_attributes/Sem_2707_OptionalAttributes_009.ttcn create mode 100644 core_language/27_specifying_attributes/2708_Retrieving_attribute_values/NegSem_2708_Retrieving_attribute_values_001.ttcn create mode 100644 core_language/27_specifying_attributes/2708_Retrieving_attribute_values/NegSyn_2708_Retrieving_attribute_values_001.ttcn create mode 100644 core_language/27_specifying_attributes/2708_Retrieving_attribute_values/Sem_2708_Retrieving_attribute_values_001.ttcn create mode 100644 core_language/27_specifying_attributes/2708_Retrieving_attribute_values/Sem_2708_Retrieving_attribute_values_002.ttcn create mode 100644 core_language/27_specifying_attributes/2708_Retrieving_attribute_values/Sem_2708_Retrieving_attribute_values_003.ttcn create mode 100644 core_language/27_specifying_attributes/2708_Retrieving_attribute_values/Sem_2708_Retrieving_attribute_values_004.ttcn create mode 100644 core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010206_superset/Sem_B010206_superset_009.ttcn create mode 100644 core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010206_superset/Sem_B010206_superset_010.ttcn create mode 100644 core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010206_superset/Sem_B010206_superset_011.ttcn create mode 100644 core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010207_subset/Sem_B010207_subset_009.ttcn create mode 100644 core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010207_subset/Sem_B010207_subset_010.ttcn create mode 100644 core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010207_subset/Sem_B010207_subset_011.ttcn create mode 100644 core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010207_subset/Sem_B010207_subset_012.ttcn create mode 100644 core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010207_subset/Sem_B010207_subset_013.ttcn create mode 100644 core_language/B_matching_incoming_values/B01_template_matching/B0103_matching_inside_values/B010303_permutation/._NegSem_B010303_permutation_006.ttcn create mode 100644 core_language/B_matching_incoming_values/B01_template_matching/B0104_matching_attributes_of_values/B010401_length_restrictions/Sem_B010401_length_restrictions_005.ttcn mode change 100755 => 100644 core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010501_set_expression/Sem_B010501_set_expression_006.ttcn mode change 100755 => 100644 core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010502_reference_expression/Sem_B010502_reference_expression_010.ttcn mode change 100755 => 100644 core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010502_reference_expression/Sem_B010502_reference_expression_011.ttcn mode change 100755 => 100644 core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010505_pattern_compatibility/NegSyn_B010505_pattern_compatibility_001.ttcn mode change 100755 => 100644 core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010506_case_sensitive_pattern_matching/Sem_B010506_case_sensitive_pattern_matching_001.ttcn mode change 100755 => 100644 core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010506_case_sensitive_pattern_matching/Sem_B010506_case_sensitive_pattern_matching_002.ttcn mode change 100755 => 100644 core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B0105_toplevel/Sem_B0105_toplevel_002.ttcn mode change 100755 => 100644 core_language/C_predefined_functions/C06_Other_functions/C0602_The_testcasename_function/Sem_C0602_The_hostid_function_001.ttcn create mode 100644 json/06_using_ttcn3_as_json_schema/0602_validation_of_json_values/Note.txt create mode 100644 json/06_using_ttcn3_as_json_schema/0603_name_conversion_rules/Pos_0603_name_conversion_rules_001/Pos_0603_name_conversion_rules_001.json create mode 100644 json/06_using_ttcn3_as_json_schema/0603_name_conversion_rules/Pos_0603_name_conversion_rules_001/Pos_0603_name_conversion_rules_001.ttcn create mode 100644 json/06_using_ttcn3_as_json_schema/0603_name_conversion_rules/Pos_0603_name_conversion_rules_002/Pos_0603_name_conversion_rules_002.json create mode 100644 json/06_using_ttcn3_as_json_schema/0603_name_conversion_rules/Pos_0603_name_conversion_rules_002/Pos_0603_name_conversion_rules_002.ttcn create mode 100644 json/06_using_ttcn3_as_json_schema/0603_name_conversion_rules/Pos_0603_name_conversion_rules_003/Pos_0603_name_conversion_rules_003.json create mode 100644 json/06_using_ttcn3_as_json_schema/0603_name_conversion_rules/Pos_0603_name_conversion_rules_003/Pos_0603_name_conversion_rules_003.ttcn create mode 100644 json/06_using_ttcn3_as_json_schema/0603_name_conversion_rules/Pos_0603_name_conversion_rules_004/Pos_0603_name_conversion_rules_004.json create mode 100644 json/06_using_ttcn3_as_json_schema/0603_name_conversion_rules/Pos_0603_name_conversion_rules_004/Pos_0603_name_conversion_rules_004.ttcn create mode 100644 json/06_using_ttcn3_as_json_schema/0603_name_conversion_rules/Pos_0603_name_conversion_rules_005/Pos_0603_name_conversion_rules_005.json create mode 100644 json/06_using_ttcn3_as_json_schema/0603_name_conversion_rules/Pos_0603_name_conversion_rules_005/Pos_0603_name_conversion_rules_005.ttcn create mode 100644 json/06_using_ttcn3_as_json_schema/0603_name_conversion_rules/Pos_0603_name_conversion_rules_006/Pos_0603_name_conversion_rules_006.json create mode 100644 json/06_using_ttcn3_as_json_schema/0603_name_conversion_rules/Pos_0603_name_conversion_rules_006/Pos_0603_name_conversion_rules_006.ttcn create mode 100644 json/06_using_ttcn3_as_json_schema/0603_name_conversion_rules/Pos_0603_name_conversion_rules_007/Pos_0603_name_conversion_rules_007.json create mode 100644 json/06_using_ttcn3_as_json_schema/0603_name_conversion_rules/Pos_0603_name_conversion_rules_007/Pos_0603_name_conversion_rules_007.ttcn create mode 100644 json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060401_json_numbers/Neg_0600401_json_numbers_001/Neg_0600401_json_numbers_001.ttcn create mode 100644 json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060401_json_numbers/Neg_0600401_json_numbers_002/Neg_0600401_json_numbers_002.json create mode 100644 json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060401_json_numbers/Neg_0600401_json_numbers_002/Neg_0600401_json_numbers_002.ttcn create mode 100644 json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060401_json_numbers/Neg_0600401_json_numbers_003/Neg_0600401_json_numbers_003.json create mode 100644 json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060401_json_numbers/Neg_0600401_json_numbers_003/Neg_0600401_json_numbers_003.ttcn create mode 100644 json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060401_json_numbers/Neg_0600401_json_numbers_004/Neg_0600401_json_numbers_004.ttcn create mode 100644 json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060401_json_numbers/Neg_0600401_json_numbers_004/Pos_0600401_json_numbers_007.json create mode 100644 json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060401_json_numbers/Pos_0600401_json_numbers_001/Pos_0600401_json_numbers_001.json create mode 100644 json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060401_json_numbers/Pos_0600401_json_numbers_001/Pos_0600401_json_numbers_001.ttcn create mode 100644 json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060401_json_numbers/Pos_0600401_json_numbers_002/Pos_0600401_json_numbers_002.json create mode 100644 json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060401_json_numbers/Pos_0600401_json_numbers_002/Pos_0600401_json_numbers_002.ttcn create mode 100644 json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060401_json_numbers/Pos_0600401_json_numbers_003/Pos_0600401_json_numbers_003.json create mode 100644 json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060401_json_numbers/Pos_0600401_json_numbers_003/Pos_0600401_json_numbers_003.ttcn create mode 100644 json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060401_json_numbers/Pos_0600401_json_numbers_004/Pos_0600401_json_numbers_004.json create mode 100644 json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060401_json_numbers/Pos_0600401_json_numbers_004/Pos_0600401_json_numbers_004.ttcn create mode 100644 json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060402_json_ strings/Pos_0600402_json_strings_001/Pos_0600402_json_strings_001.json create mode 100644 json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060402_json_ strings/Pos_0600402_json_strings_001/Pos_0600402_json_strings_001.ttcn create mode 100644 json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060402_json_ strings/Pos_0600402_json_strings_002/Pos_0600402_json_strings_002.json create mode 100644 json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060402_json_ strings/Pos_0600402_json_strings_002/Pos_0600402_json_strings_002.ttcn create mode 100644 json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060403_json_arrays/Pos_060403_json_arrays_001/Pos_060403_json_arrays_001.json create mode 100644 json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060403_json_arrays/Pos_060403_json_arrays_001/Pos_060403_json_arrays_001.ttcn create mode 100644 json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060403_json_arrays/Pos_060403_json_arrays_002/Pos_060403_json_arrays_002.json create mode 100644 json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060403_json_arrays/Pos_060403_json_arrays_002/Pos_060403_json_arrays_002.ttcn create mode 100644 json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060403_json_arrays/Pos_060403_json_arrays_003/Pos_060403_json_arrays_003.json create mode 100644 json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060403_json_arrays/Pos_060403_json_arrays_003/Pos_060403_json_arrays_003.ttcn create mode 100644 json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060403_json_arrays/Pos_060403_json_arrays_004/Pos_060403_json_arrays_004.json create mode 100644 json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060403_json_arrays/Pos_060403_json_arrays_004/Pos_060403_json_arrays_004.ttcn create mode 100644 json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060403_json_arrays/Pos_060403_json_arrays_005/Pos_060403_json_arrays_005.json create mode 100644 json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060403_json_arrays/Pos_060403_json_arrays_005/Pos_060403_json_arrays_005.ttcn create mode 100644 json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060403_json_arrays/Pos_060403_json_arrays_006/Pos_060403_json_arrays_006.json create mode 100644 json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060403_json_arrays/Pos_060403_json_arrays_006/Pos_060403_json_arrays_006.ttcn create mode 100644 json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060404_json_objects/Pos_060404_json_objects_001/Pos_060404_json_objects_001.json create mode 100644 json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060404_json_objects/Pos_060404_json_objects_001/Pos_060404_json_objects_001.ttcn create mode 100644 json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060405_json_literals/Pos_060405_json_literals_001/Pos_060405_json_literals_001.json create mode 100644 json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060405_json_literals/Pos_060405_json_literals_001/Pos_060405_json_literals_001.ttcn create mode 100644 json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060405_json_literals/Pos_060405_json_literals_002/Pos_060405_json_literals_002.json create mode 100644 json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060405_json_literals/Pos_060405_json_literals_002/Pos_060405_json_literals_002.ttcn create mode 100644 json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060405_json_literals/Pos_060405_json_literals_003/Pos_060405_json_literals_003.json create mode 100644 json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060405_json_literals/Pos_060405_json_literals_003/Pos_060405_json_literals_003.ttcn create mode 100644 json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/0702010_union_and_anytype/Pos_0702010_union_and_anytype_001/Pos_0702010_union_and_anytype_001.json create mode 100644 json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/0702010_union_and_anytype/Pos_0702010_union_and_anytype_001/Pos_0702010_union_and_anytype_001.ttcn create mode 100644 json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/0702010_union_and_anytype/Pos_0702010_union_and_anytype_002/Pos_0702010_union_and_anytype_002.json create mode 100644 json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/0702010_union_and_anytype/Pos_0702010_union_and_anytype_002/Pos_0702010_union_and_anytype_002.ttcn create mode 100644 json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/0702011_object_identifiers/Pos_0702011_object_identifiers_001/Pos_0702011_object_identifiers_001.json create mode 100644 json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/0702011_object_identifiers/Pos_0702011_object_identifiers_001/Pos_0702011_object_identifiers_001.ttcn create mode 100644 json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070201_character_strings/Pos_070201_character_strings_001/Pos_070201_character_strings_001.json create mode 100644 json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070201_character_strings/Pos_070201_character_strings_001/Pos_070201_character_strings_001.ttcn create mode 100644 json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070201_character_strings/Pos_070201_character_strings_002/Pos_070201_character_strings_002.json create mode 100644 json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070201_character_strings/Pos_070201_character_strings_002/Pos_070201_character_strings_002.ttcn create mode 100644 json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070201_character_strings/Pos_070201_character_strings_003/Pos_070201_character_strings_003.json create mode 100644 json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070201_character_strings/Pos_070201_character_strings_003/Pos_070201_character_strings_003.ttcn create mode 100644 json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070201_character_strings/Pos_070201_character_strings_004/Pos_070201_character_strings_004.json create mode 100644 json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070201_character_strings/Pos_070201_character_strings_004/Pos_070201_character_strings_004.ttcn create mode 100644 json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070201_character_strings/Pos_070201_character_strings_005/Pos_070201_character_strings_005.json create mode 100644 json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070201_character_strings/Pos_070201_character_strings_005/Pos_070201_character_strings_005.ttcn create mode 100644 json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070202_binary_strings/Pos_070202_binary_strings_001/Pos_070202_binary_strings_001.json create mode 100644 json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070202_binary_strings/Pos_070202_binary_strings_001/Pos_070202_binary_strings_001.ttcn create mode 100644 json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070202_binary_strings/Pos_070202_binary_strings_002/Pos_070202_binary_strings_002.json create mode 100644 json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070202_binary_strings/Pos_070202_binary_strings_002/Pos_070202_binary_strings_002.ttcn create mode 100644 json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070202_binary_strings/Pos_070202_binary_strings_003/Pos_070202_binary_strings_003.json create mode 100644 json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070202_binary_strings/Pos_070202_binary_strings_003/Pos_070202_binary_strings_003.ttcn create mode 100644 json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070202_binary_strings/Pos_070202_binary_strings_004/Pos_070202_binary_strings_004.json create mode 100644 json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070202_binary_strings/Pos_070202_binary_strings_004/Pos_070202_binary_strings_004.ttcn create mode 100644 json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070202_binary_strings/Pos_070202_binary_strings_005/Pos_070202_binary_strings_005.json create mode 100644 json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070202_binary_strings/Pos_070202_binary_strings_005/Pos_070202_binary_strings_005.ttcn create mode 100644 json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070202_binary_strings/Pos_070202_binary_strings_006/Pos_070202_binary_strings_006.json create mode 100644 json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070202_binary_strings/Pos_070202_binary_strings_006/Pos_070202_binary_strings_006.ttcn create mode 100644 json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070203_integer/Pos_070203_integer_001/Pos_070203_integer_001.json create mode 100644 json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070203_integer/Pos_070203_integer_001/Pos_070203_integer_001.ttcn create mode 100644 json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070203_integer/Pos_070203_integer_002/Pos_070203_integer_002.json create mode 100644 json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070203_integer/Pos_070203_integer_002/Pos_070203_integer_002.ttcn create mode 100644 json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070204_float/Pos_070204_float_001/Pos_070204_float_001.json create mode 100644 json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070204_float/Pos_070204_float_001/Pos_070204_float_001.ttcn create mode 100644 json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070204_float/Pos_070204_float_002/Pos_070204_float_002.json create mode 100644 json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070204_float/Pos_070204_float_002/Pos_070204_float_002.ttcn create mode 100644 json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070204_float/Pos_070204_float_003/Pos_070204_float_003.json create mode 100644 json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070204_float/Pos_070204_float_003/Pos_070204_float_003.ttcn create mode 100644 json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070204_float/Pos_070204_float_004/Pos_070204_float_004.json create mode 100644 json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070204_float/Pos_070204_float_004/Pos_070204_float_004.ttcn create mode 100644 json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070205_boolean/Pos_070205_boolean_001/Pos_070205_boolean_001.json create mode 100644 json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070205_boolean/Pos_070205_boolean_001/Pos_070205_boolean_001.ttcn create mode 100644 json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070205_boolean/Pos_070205_boolean_002/Pos_070205_boolean_002.json create mode 100644 json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070205_boolean/Pos_070205_boolean_002/Pos_070205_boolean_002.ttcn create mode 100644 json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070206_enumerated/Pos_070206_enumerated_001/Pos_070206_enumerated_001.json create mode 100644 json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070206_enumerated/Pos_070206_enumerated_001/Pos_070206_enumerated_001.ttcn create mode 100644 json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070207_verdicttype/Pos_070207_verdicttype_001/Pos_070207_verdicttype_001.json create mode 100644 json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070207_verdicttype/Pos_070207_verdicttype_001/Pos_070207_verdicttype_001.ttcn create mode 100644 json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070207_verdicttype/Pos_070207_verdicttype_002/Pos_070207_verdicttype_002.json create mode 100644 json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070207_verdicttype/Pos_070207_verdicttype_002/Pos_070207_verdicttype_002.ttcn create mode 100644 json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070207_verdicttype/Pos_070207_verdicttype_003/Pos_070207_verdicttype_003.json create mode 100644 json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070207_verdicttype/Pos_070207_verdicttype_003/Pos_070207_verdicttype_003.ttcn create mode 100644 json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070207_verdicttype/Pos_070207_verdicttype_004/Pos_070207_verdicttype_004.json create mode 100644 json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070207_verdicttype/Pos_070207_verdicttype_004/Pos_070207_verdicttype_004.ttcn create mode 100644 json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070208_record_and_set/Pos_070208_record_and_set_001/Pos_070208_record_and_set_001.json create mode 100644 json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070208_record_and_set/Pos_070208_record_and_set_001/Pos_070208_record_and_set_001.ttcn create mode 100644 json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070208_record_and_set/Pos_070208_record_and_set_002/Pos_070208_record_and_set_002.json create mode 100644 json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070208_record_and_set/Pos_070208_record_and_set_002/Pos_070208_record_and_set_002.ttcn create mode 100644 json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070208_record_and_set/Pos_070208_record_and_set_003/Pos_070208_record_and_set_003.json create mode 100644 json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070208_record_and_set/Pos_070208_record_and_set_003/Pos_070208_record_and_set_003.ttcn create mode 100644 json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070208_record_and_set/Pos_070208_record_and_set_004/Pos_070208_record_and_set_004.json create mode 100644 json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070208_record_and_set/Pos_070208_record_and_set_004/Pos_070208_record_and_set_004.ttcn create mode 100644 json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070209_record_of_set_of_and_arrays/Pos_070209_record_of_set_of_and_arrays_001/Pos_070209_record_of_set_of_and_arrays_001.json create mode 100644 json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070209_record_of_set_of_and_arrays/Pos_070209_record_of_set_of_and_arrays_001/Pos_070209_record_of_set_of_and_arrays_001.ttcn create mode 100644 json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070209_record_of_set_of_and_arrays/Pos_070209_record_of_set_of_and_arrays_002/Pos_070209_record_of_set_of_and_arrays_002.json create mode 100644 json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070209_record_of_set_of_and_arrays/Pos_070209_record_of_set_of_and_arrays_002/Pos_070209_record_of_set_of_and_arrays_002.ttcn create mode 100644 json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070209_record_of_set_of_and_arrays/Pos_070209_record_of_set_of_and_arrays_003/Pos_070209_record_of_set_of_and_arrays_003.json create mode 100644 json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070209_record_of_set_of_and_arrays/Pos_070209_record_of_set_of_and_arrays_003/Pos_070209_record_of_set_of_and_arrays_003.ttcn create mode 100644 json/A_ttcn3_module_json/Note.txt create mode 100644 json/B_encoding_instructions/B1_toplevel/Note.txt create mode 100644 json/B_encoding_instructions/B2_the_json_encode_attribute/Pos_B2_the_json_encode_attribute_001/Pos_B2_the_json_encode_attribute_001.json create mode 100644 json/B_encoding_instructions/B2_the_json_encode_attribute/Pos_B2_the_json_encode_attribute_001/Pos_B2_the_json_encode_attribute_001.ttcn create mode 100644 json/B_encoding_instructions/B2_the_json_encode_attribute/Pos_B2_the_json_encode_attribute_002/Pos_B2_the_json_encode_attribute_002.json create mode 100644 json/B_encoding_instructions/B2_the_json_encode_attribute/Pos_B2_the_json_encode_attribute_002/Pos_B2_the_json_encode_attribute_002.ttcn create mode 100644 json/B_encoding_instructions/B2_the_json_encode_attribute/Pos_B2_the_json_encode_attribute_003/Pos_B2_the_json_encode_attribute_003.json create mode 100644 json/B_encoding_instructions/B2_the_json_encode_attribute/Pos_B2_the_json_encode_attribute_003/Pos_B2_the_json_encode_attribute_003.ttcn create mode 100644 json/B_encoding_instructions/B2_the_json_encode_attribute/Pos_B2_the_json_encode_attribute_004/Pos_B2_the_json_encode_attribute_004.json create mode 100644 json/B_encoding_instructions/B2_the_json_encode_attribute/Pos_B2_the_json_encode_attribute_004/Pos_B2_the_json_encode_attribute_004.ttcn create mode 100644 json/B_encoding_instructions/B3_ecoding_instructions/B301_toplevel/Note.txt create mode 100644 json/B_encoding_instructions/B3_ecoding_instructions/B302_json_type_identification/Pos_B302_json_type_identification_001/Pos_B302_json_type_identification_001.json create mode 100644 json/B_encoding_instructions/B3_ecoding_instructions/B302_json_type_identification/Pos_B302_json_type_identification_001/Pos_B302_json_type_identification_001.ttcn create mode 100644 json/B_encoding_instructions/B3_ecoding_instructions/B303_normalizing_json_values/Pos_B303_normalizing_json_values_001/Pos_B303_normalizing_json_values_001.json create mode 100644 json/B_encoding_instructions/B3_ecoding_instructions/B303_normalizing_json_values/Pos_B303_normalizing_json_values_001/Pos_B303_normalizing_json_values_001.ttcn create mode 100644 json/B_encoding_instructions/B3_ecoding_instructions/B304_name_as/Pos_B304_name_as_001/Pos_B304_name_as_001.json create mode 100644 json/B_encoding_instructions/B3_ecoding_instructions/B304_name_as/Pos_B304_name_as_001/Pos_B304_name_as_001.ttcn create mode 100644 json/B_encoding_instructions/B3_ecoding_instructions/B305_number_of_fraction_digits/Pos_B305_number_of_fraction_digits_001/Pos_B305_number_of_fraction_digits_001.json create mode 100644 json/B_encoding_instructions/B3_ecoding_instructions/B305_number_of_fraction_digits/Pos_B305_number_of_fraction_digits_001/Pos_B305_number_of_fraction_digits_001.ttcn create mode 100644 json/B_encoding_instructions/B3_ecoding_instructions/B305_number_of_fraction_digits/Pos_B305_number_of_fraction_digits_002/Pos_B305_number_of_fraction_digits_002.json create mode 100644 json/B_encoding_instructions/B3_ecoding_instructions/B305_number_of_fraction_digits/Pos_B305_number_of_fraction_digits_002/Pos_B305_number_of_fraction_digits_002.ttcn create mode 100644 json/B_encoding_instructions/B3_ecoding_instructions/B306_use_the_minus_sign/Pos_B306_use_the_minus_sign_001/Pos_B306_use_the_minus_sign_001.json create mode 100644 json/B_encoding_instructions/B3_ecoding_instructions/B306_use_the_minus_sign/Pos_B306_use_the_minus_sign_001/Pos_B306_use_the_minus_sign_001.ttcn create mode 100644 json/B_encoding_instructions/B3_ecoding_instructions/B306_use_the_minus_sign/Pos_B306_use_the_minus_sign_002/Pos_B306_use_the_minus_sign_002.json create mode 100644 json/B_encoding_instructions/B3_ecoding_instructions/B306_use_the_minus_sign/Pos_B306_use_the_minus_sign_002/Pos_B306_use_the_minus_sign_002.ttcn create mode 100644 json/B_encoding_instructions/B3_ecoding_instructions/B307_escape_as/Pos_B307_escape_as_001/Pos_B307_escape_as_001.json create mode 100644 json/B_encoding_instructions/B3_ecoding_instructions/B307_escape_as/Pos_B307_escape_as_001/Pos_B307_escape_as_001.ttcn create mode 100644 json/B_encoding_instructions/B3_ecoding_instructions/B307_escape_as/Pos_B307_escape_as_002/Pos_B307_escape_as_002.json create mode 100644 json/B_encoding_instructions/B3_ecoding_instructions/B307_escape_as/Pos_B307_escape_as_002/Pos_B307_escape_as_002.ttcn create mode 100644 json/B_encoding_instructions/B3_ecoding_instructions/B307_escape_as/Pos_B307_escape_as_003/Pos_B307_escape_as_003.json create mode 100644 json/B_encoding_instructions/B3_ecoding_instructions/B307_escape_as/Pos_B307_escape_as_003/Pos_B307_escape_as_003.ttcn create mode 100644 json/B_encoding_instructions/B3_ecoding_instructions/B308_omit_as_null/Pos_B308_omit_as_null_001/Pos_B308_omit_as_null_001.json create mode 100644 json/B_encoding_instructions/B3_ecoding_instructions/B308_omit_as_null/Pos_B308_omit_as_null_001/Pos_B308_omit_as_null_001.ttcn create mode 100644 json/B_encoding_instructions/B3_ecoding_instructions/B308_omit_as_null/Pos_B308_omit_as_null_002/Pos_B308_omit_as_null_002.json create mode 100644 json/B_encoding_instructions/B3_ecoding_instructions/B308_omit_as_null/Pos_B308_omit_as_null_002/Pos_B308_omit_as_null_002.ttcn create mode 100644 json/B_encoding_instructions/B3_ecoding_instructions/B309_default/Pos_B309_default_001/Pos_B309_default_001.json create mode 100644 json/B_encoding_instructions/B3_ecoding_instructions/B309_default/Pos_B309_default_001/Pos_B309_default_001.ttcn create mode 100644 json/B_encoding_instructions/B3_ecoding_instructions/B309_default/Pos_B309_default_002/Pos_B309_default_002.json create mode 100644 json/B_encoding_instructions/B3_ecoding_instructions/B309_default/Pos_B309_default_002/Pos_B309_default_002.ttcn create mode 100644 json/B_encoding_instructions/B3_ecoding_instructions/B310_as_value/Pos_B310_as_value_001/Pos_B310_as_value_001.json create mode 100644 json/B_encoding_instructions/B3_ecoding_instructions/B310_as_value/Pos_B310_as_value_001/Pos_B310_as_value_001.ttcn create mode 100644 json/B_encoding_instructions/B3_ecoding_instructions/B310_as_value/Pos_B310_as_value_002/Pos_B310_as_value_002.json create mode 100644 json/B_encoding_instructions/B3_ecoding_instructions/B310_as_value/Pos_B310_as_value_002/Pos_B310_as_value_002.ttcn create mode 100644 json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_001/Pos_B311_no_type_001.json create mode 100644 json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_001/Pos_B311_no_type_001.ttcn create mode 100644 json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_002/Pos_B311_no_type_002.json create mode 100644 json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_002/Pos_B311_no_type_002.ttcn create mode 100644 json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_003/Pos_B311_no_type_003.json create mode 100644 json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_003/Pos_B311_no_type_003.ttcn create mode 100644 json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_004/Pos_B311_no_type_004.json create mode 100644 json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_004/Pos_B311_no_type_004.ttcn create mode 100644 json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_005/Pos_B311_no_type_005.json create mode 100644 json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_005/Pos_B311_no_type_005.ttcn create mode 100644 json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_006/Pos_B311_no_type_006.json create mode 100644 json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_006/Pos_B311_no_type_006.ttcn create mode 100644 json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_007/Pos_B311_no_type_007.json create mode 100644 json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_007/Pos_B311_no_type_007.ttcn create mode 100644 json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_008/Pos_B311_no_type_008.json create mode 100644 json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_008/Pos_B311_no_type_008.ttcn create mode 100644 json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_009/Pos_B311_no_type_009.json create mode 100644 json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_009/Pos_B311_no_type_009.ttcn create mode 100644 json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_010/Pos_B311_no_type_010.json create mode 100644 json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_010/Pos_B311_no_type_010.ttcn create mode 100644 json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_011/Pos_B311_no_type_011.json create mode 100644 json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_011/Pos_B311_no_type_011.ttcn create mode 100644 json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_012/Pos_B311_no_type_012.json create mode 100644 json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_012/Pos_B311_no_type_012.ttcn create mode 100644 json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_013/Pos_B311_no_type_013.json create mode 100644 json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_013/Pos_B311_no_type_013.ttcn create mode 100644 json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_014/Pos_B311_no_type_014.json create mode 100644 json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_014/Pos_B311_no_type_014.ttcn create mode 100644 json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_015/Pos_B311_no_type_015.json create mode 100644 json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_015/Pos_B311_no_type_015.ttcn create mode 100644 json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_016/Pos_B311_no_type_016.json create mode 100644 json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_016/Pos_B311_no_type_016.ttcn create mode 100644 json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_017/Pos_B311_no_type_017.json create mode 100644 json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_017/Pos_B311_no_type_017.ttcn create mode 100644 json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_018/Pos_B311_no_type_018.json create mode 100644 json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_018/Pos_B311_no_type_018.ttcn create mode 100644 json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_019/Pos_B311_no_type_019.json create mode 100644 json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_019/Pos_B311_no_type_019.ttcn create mode 100644 json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_020/Pos_B311_no_type_020.json create mode 100644 json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_020/Pos_B311_no_type_020.ttcn create mode 100644 json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_021/Pos_B311_no_type_021.json create mode 100644 json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_021/Pos_B311_no_type_021.ttcn create mode 100644 json/B_encoding_instructions/B3_ecoding_instructions/B312_use _order/Pos_B312_use _order_001/Pos_B312_use_order_001.json create mode 100644 json/B_encoding_instructions/B3_ecoding_instructions/B312_use _order/Pos_B312_use _order_001/Pos_B312_use_order_001.ttcn create mode 100644 json/B_encoding_instructions/B3_ecoding_instructions/B313_error_behaviour/Pos_B313_error_behaviour_001/Pos_B313_error_behaviour_001.ttcn create mode 100644 json/B_encoding_instructions/B3_ecoding_instructions/B313_error_behaviour/Pos_B313_error_behaviour_002/Pos_B313_error_behaviour_002.ttcn create mode 100644 json/B_encoding_instructions/B3_ecoding_instructions/B313_error_behaviour/Pos_B313_error_behaviour_003/Pos_B313_error_behaviour_003.ttcn create mode 100644 json/B_encoding_instructions/B3_ecoding_instructions/B313_error_behaviour/Pos_B313_error_behaviour_004/Pos_B313_error_behaviour_004.ttcn create mode 100644 json/B_encoding_instructions/B3_ecoding_instructions/B313_error_behaviour/Pos_B313_error_behaviour_005/Pos_B313_error_behaviour_005.ttcn create mode 100644 json/B_encoding_instructions/B3_ecoding_instructions/B313_error_behaviour/Pos_B313_error_behaviour_006/Pos_B313_error_behaviour_006.ttcn create mode 100755 oo/501_classes_and_objects/50101_classes/5010101_scope_rules/NegSem_5010101_scopeRules_001.ttcn create mode 100755 oo/501_classes_and_objects/50101_classes/5010101_scope_rules/Sem_5010101_scopeRules_001.ttcn create mode 100755 oo/501_classes_and_objects/50101_classes/5010101_scope_rules/Sem_5010101_scopeRules_002.ttcn create mode 100755 oo/501_classes_and_objects/50101_classes/5010102_abstract_classes/NegSem_5010102_abstractClasses_001.ttcn create mode 100755 oo/501_classes_and_objects/50101_classes/5010102_abstract_classes/Sem_5010102_abstractClasses_001.ttcn create mode 100755 oo/501_classes_and_objects/50101_classes/5010103_external_classes/Java_Int_List.jar create mode 100644 oo/501_classes_and_objects/50101_classes/5010103_external_classes/NegSem_5010103_externalClasses_001.ttcn create mode 100755 oo/501_classes_and_objects/50101_classes/5010103_external_classes/Sem_5010103_externalClasses_001.ttcn create mode 100644 oo/501_classes_and_objects/50101_classes/5010103_external_classes/Sem_5010103_externalClasses_002.ttcn create mode 100644 oo/501_classes_and_objects/50101_classes/5010104_final_classes/NegSem_5010104_finalClasses_002.ttcn create mode 100755 oo/501_classes_and_objects/50101_classes/5010104_final_classes/Sem_5010104_finalClasses_001.ttcn create mode 100644 oo/501_classes_and_objects/50101_classes/5010105_constructors/NegSem_5010105_Constructors_001.ttcn create mode 100644 oo/501_classes_and_objects/50101_classes/5010105_constructors/NegSem_5010105_Constructors_002.ttcn create mode 100644 oo/501_classes_and_objects/50101_classes/5010105_constructors/NegSem_5010105_Constructors_003.ttcn create mode 100644 oo/501_classes_and_objects/50101_classes/5010105_constructors/NegSem_5010105_Constructors_004.ttcn create mode 100644 oo/501_classes_and_objects/50101_classes/5010105_constructors/NegSem_5010105_Constructors_005.ttcn create mode 100644 oo/501_classes_and_objects/50101_classes/5010105_constructors/NegSem_5010105_Constructors_006.ttcn create mode 100644 oo/501_classes_and_objects/50101_classes/5010105_constructors/NegSem_5010105_Constructors_007.ttcn create mode 100644 oo/501_classes_and_objects/50101_classes/5010105_constructors/NegSem_5010105_Constructors_008.ttcn create mode 100644 oo/501_classes_and_objects/50101_classes/5010105_constructors/NegSem_5010105_Constructors_009.ttcn create mode 100644 oo/501_classes_and_objects/50101_classes/5010105_constructors/NegSem_5010105_Constructors_010.ttcn create mode 100644 oo/501_classes_and_objects/50101_classes/5010105_constructors/NegSem_5010105_Constructors_011.ttcn create mode 100755 oo/501_classes_and_objects/50101_classes/5010105_constructors/Sem_5010105_Constructors_001.ttcn create mode 100755 oo/501_classes_and_objects/50101_classes/5010105_constructors/Sem_5010105_Constructors_002.ttcn create mode 100644 oo/501_classes_and_objects/50101_classes/5010106_constructor_invocation/NegSem_5010106_ConstructorInvocation_001.ttcn create mode 100644 oo/501_classes_and_objects/50101_classes/5010106_constructor_invocation/NegSem_5010106_ConstructorInvocation_002.ttcn create mode 100644 oo/501_classes_and_objects/50101_classes/5010106_constructor_invocation/Sem_5010106_ConstructorInvocation_001.ttcn create mode 100644 oo/501_classes_and_objects/50101_classes/5010106_constructor_invocation/Sem_5010106_ConstructorInvocation_002.ttcn create mode 100644 oo/501_classes_and_objects/50101_classes/5010106_constructor_invocation/Sem_5010106_ConstructorInvocation_003.ttcn create mode 100755 oo/501_classes_and_objects/50101_classes/5010107_destructors/Sem_5010107_Destructors_001.ttcn create mode 100755 oo/501_classes_and_objects/50101_classes/5010107_methods/NegSem_5010107_Methods_001.ttcn create mode 100755 oo/501_classes_and_objects/50101_classes/5010107_methods/NegSem_5010107_Methods_003.ttcn create mode 100755 oo/501_classes_and_objects/50101_classes/5010107_methods/Sem_5010107_Methods_001.ttcn create mode 100755 oo/501_classes_and_objects/50101_classes/5010107_methods/Sem_5010107_Methods_002.ttcn create mode 100755 oo/501_classes_and_objects/50101_classes/5010107_methods/Sem_5010107_Methods_003.ttcn create mode 100755 oo/501_classes_and_objects/50101_classes/5010108_method_invocation/Sem_5010108_MethodInvocation_001.ttcn create mode 100644 oo/501_classes_and_objects/50101_classes/5010108_methods/NegSem_5010108_Methods_002.ttcn create mode 100644 oo/501_classes_and_objects/50101_classes/5010108_methods/NegSem_5010108_Methods_003.ttcn create mode 100644 oo/501_classes_and_objects/50101_classes/5010108_methods/NegSem_5010108_Methods_004.ttcn create mode 100644 oo/501_classes_and_objects/50101_classes/5010108_methods/NegSem_5010108_Methods_005.ttcn create mode 100644 oo/501_classes_and_objects/50101_classes/5010108_methods/NegSem_5010108_Methods_006.ttcn create mode 100644 oo/501_classes_and_objects/50101_classes/5010108_methods/Sem_5010108_Methods_001.ttcn create mode 100644 oo/501_classes_and_objects/50101_classes/5010108_methods/Sem_5010108_Methods_002.ttcn create mode 100644 oo/501_classes_and_objects/50101_classes/5010108_methods/Sem_5010108_Methods_003.ttcn create mode 100644 oo/501_classes_and_objects/50101_classes/5010109_method_invocation/NegSem_5010109_MethodInvocation_001.ttcn create mode 100644 oo/501_classes_and_objects/50101_classes/5010109_method_invocation/Sem_5010109_MethodInvocation_001.ttcn create mode 100644 oo/501_classes_and_objects/50101_classes/5010109_method_invocation/Sem_5010109_MethodInvocation_002.ttcn create mode 100755 oo/501_classes_and_objects/50101_classes/5010110_visibility/NegSem_5010110_Visibility_001.ttcn create mode 100644 oo/501_classes_and_objects/50101_classes/5010110_visibility/NegSem_5010110_Visibility_002.ttcn create mode 100755 oo/501_classes_and_objects/50101_classes/5010110_visibility/NegSem_5010110_Visibility_003.ttcn create mode 100755 oo/501_classes_and_objects/50101_classes/5010110_visibility/NegSem_5010110_Visibility_004.ttcn create mode 100755 oo/501_classes_and_objects/50101_classes/5010110_visibility/Sem_50101010_Visibility_001.ttcn create mode 100755 oo/501_classes_and_objects/50101_classes/5010110_visibility/Sem_50101010_Visibility_002.ttcn create mode 100755 oo/501_classes_and_objects/50101_classes/5010110_visibility/Sem_5010110_Visibility_003.ttcn create mode 100644 oo/501_classes_and_objects/50101_classes/5010110_visibility/Sem_5010110_Visibility_004.ttcn create mode 100644 oo/501_classes_and_objects/50101_classes/5010112_nested_classes/NegSem_5010112_NestedClasses_001.ttcn create mode 100644 oo/501_classes_and_objects/50101_classes/5010112_nested_classes/NegSem_5010112_NestedClasses_002.ttcn create mode 100644 oo/501_classes_and_objects/50101_classes/5010112_nested_classes/NegSem_5010112_NestedClasses_003.ttcn create mode 100644 oo/501_classes_and_objects/50101_classes/5010112_nested_classes/NegSem_5010112_NestedClasses_004.ttcn create mode 100644 oo/501_classes_and_objects/50101_classes/5010112_nested_classes/NegSem_5010112_NestedClasses_005.ttcn create mode 100644 oo/501_classes_and_objects/50101_classes/5010112_nested_classes/Sem_5010112_NestedClasses_001.ttcn create mode 100644 oo/501_classes_and_objects/50101_classes/5010112_nested_classes/Sem_5010112_NestedClasses_002.ttcn create mode 100644 oo/501_classes_and_objects/50101_classes/5010112_nested_classes/Sem_5010112_NestedClasses_003.ttcn create mode 100644 oo/501_classes_and_objects/50101_classes/5010112_nested_classes/Sem_5010112_NestedClasses_004.ttcn create mode 100755 oo/501_classes_and_objects/50101_classes/50101_top_level/NegSem_50101_top_level_001.ttcn create mode 100755 oo/501_classes_and_objects/50101_classes/50101_top_level/NegSem_50101_top_level_002.ttcn create mode 100755 oo/501_classes_and_objects/50101_classes/50101_top_level/NegSem_50101_top_level_003.ttcn create mode 100755 oo/501_classes_and_objects/50101_classes/50101_top_level/NegSem_50101_top_level_004.ttcn create mode 100755 oo/501_classes_and_objects/50101_classes/50101_top_level/NegSem_50101_top_level_005.ttcn create mode 100755 oo/501_classes_and_objects/50101_classes/50101_top_level/NegSem_50101_top_level_006.ttcn create mode 100755 oo/501_classes_and_objects/50101_classes/50101_top_level/NegSem_50101_top_level_007.ttcn create mode 100755 oo/501_classes_and_objects/50101_classes/50101_top_level/NegSem_50101_top_level_008.ttcn create mode 100755 oo/501_classes_and_objects/50101_classes/50101_top_level/NegSem_50101_top_level_009.ttcn create mode 100755 oo/501_classes_and_objects/50101_classes/50101_top_level/NegSem_50101_top_level_010.ttcn create mode 100755 oo/501_classes_and_objects/50101_classes/50101_top_level/NegSem_50101_top_level_011.ttcn create mode 100755 oo/501_classes_and_objects/50101_classes/50101_top_level/Sem_50101_top_level_001.ttcn create mode 100755 oo/501_classes_and_objects/50101_classes/50101_top_level/Sem_50101_top_level_002.ttcn create mode 100755 oo/501_classes_and_objects/50101_classes/50101_top_level/Sem_50101_top_level_003.ttcn create mode 100755 oo/501_classes_and_objects/50101_classes/50101_top_level/Sem_50101_top_level_004.ttcn create mode 100755 oo/501_classes_and_objects/50101_classes/50101_top_level/Sem_50101_top_level_005.ttcn create mode 100755 oo/501_classes_and_objects/50101_classes/50101_top_level/Sem_50101_top_level_006.ttcn create mode 100755 oo/501_classes_and_objects/50101_classes/50101_top_level/Sem_50101_top_level_007.ttcn create mode 100755 oo/501_classes_and_objects/50101_classes/50101_top_level/Sem_50101_top_level_008.ttcn create mode 100755 oo/501_classes_and_objects/50102_objects/5010202_object_references/NegSem_5010202_ObjectReferences_001.ttcn create mode 100755 oo/501_classes_and_objects/50102_objects/5010202_object_references/NegSem_5010202_ObjectReferences_002.ttcn create mode 100755 oo/501_classes_and_objects/50102_objects/5010202_object_references/Sem_5010202_ObjectReferences_001.ttcn create mode 100755 oo/501_classes_and_objects/50102_objects/5010203_null_reference/Sem_5010203_NullReference_001.ttcn create mode 100755 oo/501_classes_and_objects/50102_objects/5010204_select_class-statement/NegSem_5010204_SelectClassStatement_001.ttcn create mode 100755 oo/501_classes_and_objects/50102_objects/5010204_select_class-statement/Sem_5010204_SelectClassStatement_001.ttcn create mode 100644 oo/501_classes_and_objects/50102_objects/5010204_select_class-statement/Sem_5010204_SelectClassStatement_002.ttcn create mode 100755 oo/501_classes_and_objects/50102_objects/5010205_of_operator/Sem_5010205_OfOperator_001.ttcn create mode 100755 oo/501_classes_and_objects/50102_objects/5010206_casting/NegSem_5010206_Casting_001.ttcn create mode 100755 oo/501_classes_and_objects/50102_objects/5010206_casting/Sem_5010206_Casting_001.ttcn create mode 100755 oo/502_exception_handling/50201_functions/Sem_50201_Functions_001.ttcn create mode 100755 oo/502_exception_handling/50202_external_functions/Sem_50202_ExternalFunctions_001.ttcn create mode 100755 oo/502_exception_handling/50203_invoking_functions/Sem_50203_invoking_functions_001.ttcn create mode 100755 oo/502_exception_handling/50204_altsteps/Sem_50204_altsteps_001.ttcn create mode 100755 oo/502_exception_handling/50205_test_cases/Sem_50205_test_cases_001.ttcn create mode 100644 xml/05_mapping_xml_schemas/0501_namespaces/050101_namespaces/Pos_050101_namespaces_005/Pos_050101_namespaces_005.ttcn create mode 100644 xml/05_mapping_xml_schemas/0501_namespaces/050101_namespaces/Pos_050101_namespaces_005/Pos_050101_namespaces_005.xml create mode 100644 xml/05_mapping_xml_schemas/0501_namespaces/050101_namespaces/Pos_050101_namespaces_005/Pos_050101_namespaces_005.xsd create mode 100644 xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_026/Pos_050202_name_conversion_rules_026.ttcn create mode 100644 xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_026/Pos_050202_name_conversion_rules_026.xml create mode 100644 xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_026/Pos_050202_name_conversion_rules_026.xsd create mode 100644 xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_027/Pos_050202_name_conversion_rules_027.ttcn create mode 100644 xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_027/Pos_050202_name_conversion_rules_027.xml create mode 100644 xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_027/Pos_050202_name_conversion_rules_027.xsd create mode 100644 xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_028/Pos_050202_name_conversion_rules_028.ttcn create mode 100644 xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_028/Pos_050202_name_conversion_rules_028.xml create mode 100644 xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_028/Pos_050202_name_conversion_rules_028.xsd create mode 100644 xml/06_built_in_data_types/0608_anytype_and_anysimpletype_types/Pos_0608_anytype_and_anysimpletype_types_008/Pos_0608_anytype_and_anysimpletype_types_008.ttcn create mode 100644 xml/06_built_in_data_types/0608_anytype_and_anysimpletype_types/Pos_0608_anytype_and_anysimpletype_types_008/Pos_0608_anytype_and_anysimpletype_types_008.xml create mode 100644 xml/06_built_in_data_types/0608_anytype_and_anysimpletype_types/Pos_0608_anytype_and_anysimpletype_types_008/Pos_0608_anytype_and_anysimpletype_types_008.xsd diff --git a/core_language/05_basic_language_elements/0501_identifiers_and_keywords/NegSem_0501_Identifier_001.ttcn b/core_language/05_basic_language_elements/0501_identifiers_and_keywords/NegSem_0501_Identifier_001.ttcn old mode 100755 new mode 100644 diff --git a/core_language/05_basic_language_elements/0501_identifiers_and_keywords/NegSyn_0501_Identifier_001.ttcn b/core_language/05_basic_language_elements/0501_identifiers_and_keywords/NegSyn_0501_Identifier_001.ttcn old mode 100755 new mode 100644 diff --git a/core_language/05_basic_language_elements/0501_identifiers_and_keywords/Syn_0501_Identifier_001.ttcn b/core_language/05_basic_language_elements/0501_identifiers_and_keywords/Syn_0501_Identifier_001.ttcn old mode 100755 new mode 100644 diff --git a/core_language/05_basic_language_elements/0502_scope_rules/050201_Scope_of_parameters/Sem_050201_Scope_of_parameters_001.ttcn b/core_language/05_basic_language_elements/0502_scope_rules/050201_Scope_of_parameters/Sem_050201_Scope_of_parameters_001.ttcn old mode 100755 new mode 100644 diff --git a/core_language/05_basic_language_elements/0502_scope_rules/050202_Uniqueness_of_identifiers/NegSem_050202_Uniqueness_001.ttcn b/core_language/05_basic_language_elements/0502_scope_rules/050202_Uniqueness_of_identifiers/NegSem_050202_Uniqueness_001.ttcn old mode 100755 new mode 100644 diff --git a/core_language/05_basic_language_elements/0502_scope_rules/050202_Uniqueness_of_identifiers/NegSem_050202_Uniqueness_004.ttcn b/core_language/05_basic_language_elements/0502_scope_rules/050202_Uniqueness_of_identifiers/NegSem_050202_Uniqueness_004.ttcn old mode 100755 new mode 100644 diff --git a/core_language/05_basic_language_elements/0502_scope_rules/050202_Uniqueness_of_identifiers/NegSem_050202_Uniqueness_005.ttcn b/core_language/05_basic_language_elements/0502_scope_rules/050202_Uniqueness_of_identifiers/NegSem_050202_Uniqueness_005.ttcn old mode 100755 new mode 100644 diff --git a/core_language/05_basic_language_elements/0502_scope_rules/050202_Uniqueness_of_identifiers/NegSem_050202_Uniqueness_006.ttcn b/core_language/05_basic_language_elements/0502_scope_rules/050202_Uniqueness_of_identifiers/NegSem_050202_Uniqueness_006.ttcn old mode 100755 new mode 100644 diff --git a/core_language/05_basic_language_elements/0502_scope_rules/050202_Uniqueness_of_identifiers/NegSem_050202_Uniqueness_007.ttcn b/core_language/05_basic_language_elements/0502_scope_rules/050202_Uniqueness_of_identifiers/NegSem_050202_Uniqueness_007.ttcn old mode 100755 new mode 100644 diff --git a/core_language/05_basic_language_elements/0502_scope_rules/050202_Uniqueness_of_identifiers/NegSem_050202_Uniqueness_008.ttcn b/core_language/05_basic_language_elements/0502_scope_rules/050202_Uniqueness_of_identifiers/NegSem_050202_Uniqueness_008.ttcn old mode 100755 new mode 100644 diff --git a/core_language/05_basic_language_elements/0502_scope_rules/050202_Uniqueness_of_identifiers/NegSem_050202_Uniqueness_009.ttcn b/core_language/05_basic_language_elements/0502_scope_rules/050202_Uniqueness_of_identifiers/NegSem_050202_Uniqueness_009.ttcn old mode 100755 new mode 100644 diff --git a/core_language/05_basic_language_elements/0502_scope_rules/050202_Uniqueness_of_identifiers/NegSem_050202_Uniqueness_010.ttcn b/core_language/05_basic_language_elements/0502_scope_rules/050202_Uniqueness_of_identifiers/NegSem_050202_Uniqueness_010.ttcn old mode 100755 new mode 100644 diff --git a/core_language/05_basic_language_elements/0502_scope_rules/050202_Uniqueness_of_identifiers/NegSem_050202_Uniqueness_011.ttcn b/core_language/05_basic_language_elements/0502_scope_rules/050202_Uniqueness_of_identifiers/NegSem_050202_Uniqueness_011.ttcn old mode 100755 new mode 100644 diff --git a/core_language/05_basic_language_elements/0502_scope_rules/050202_Uniqueness_of_identifiers/NegSem_050202_Uniqueness_012.ttcn b/core_language/05_basic_language_elements/0502_scope_rules/050202_Uniqueness_of_identifiers/NegSem_050202_Uniqueness_012.ttcn old mode 100755 new mode 100644 diff --git a/core_language/05_basic_language_elements/0502_scope_rules/050202_Uniqueness_of_identifiers/Sem_050202_Uniqueness_001.ttcn b/core_language/05_basic_language_elements/0502_scope_rules/050202_Uniqueness_of_identifiers/Sem_050202_Uniqueness_001.ttcn old mode 100755 new mode 100644 diff --git a/core_language/05_basic_language_elements/0502_scope_rules/050202_Uniqueness_of_identifiers/Sem_050202_Uniqueness_002.ttcn b/core_language/05_basic_language_elements/0502_scope_rules/050202_Uniqueness_of_identifiers/Sem_050202_Uniqueness_002.ttcn old mode 100755 new mode 100644 diff --git a/core_language/05_basic_language_elements/0502_scope_rules/050202_Uniqueness_of_identifiers/Sem_050202_Uniqueness_003.ttcn b/core_language/05_basic_language_elements/0502_scope_rules/050202_Uniqueness_of_identifiers/Sem_050202_Uniqueness_003.ttcn old mode 100755 new mode 100644 diff --git a/core_language/05_basic_language_elements/0502_scope_rules/0502_toplevel/NegSem_0502_Scope_001.ttcn b/core_language/05_basic_language_elements/0502_scope_rules/0502_toplevel/NegSem_0502_Scope_001.ttcn old mode 100755 new mode 100644 diff --git a/core_language/05_basic_language_elements/0502_scope_rules/0502_toplevel/NegSem_0502_Scope_002.ttcn b/core_language/05_basic_language_elements/0502_scope_rules/0502_toplevel/NegSem_0502_Scope_002.ttcn old mode 100755 new mode 100644 diff --git a/core_language/05_basic_language_elements/0502_scope_rules/0502_toplevel/Sem_0502_Scope_001.ttcn b/core_language/05_basic_language_elements/0502_scope_rules/0502_toplevel/Sem_0502_Scope_001.ttcn old mode 100755 new mode 100644 diff --git a/core_language/05_basic_language_elements/0502_scope_rules/0502_toplevel/Sem_0502_Scope_002.ttcn b/core_language/05_basic_language_elements/0502_scope_rules/0502_toplevel/Sem_0502_Scope_002.ttcn old mode 100755 new mode 100644 diff --git a/core_language/05_basic_language_elements/0502_scope_rules/0502_toplevel/Sem_0502_Scope_003.ttcn b/core_language/05_basic_language_elements/0502_scope_rules/0502_toplevel/Sem_0502_Scope_003.ttcn old mode 100755 new mode 100644 diff --git a/core_language/05_basic_language_elements/0502_scope_rules/0502_toplevel/Sem_0502_Scope_004.ttcn b/core_language/05_basic_language_elements/0502_scope_rules/0502_toplevel/Sem_0502_Scope_004.ttcn old mode 100755 new mode 100644 diff --git a/core_language/05_basic_language_elements/0502_scope_rules/0502_toplevel/Sem_0502_Scope_008.ttcn b/core_language/05_basic_language_elements/0502_scope_rules/0502_toplevel/Sem_0502_Scope_008.ttcn old mode 100755 new mode 100644 diff --git a/core_language/05_basic_language_elements/0502_scope_rules/0502_toplevel/Syn_0502_Scope_001.ttcn b/core_language/05_basic_language_elements/0502_scope_rules/0502_toplevel/Syn_0502_Scope_001.ttcn old mode 100755 new mode 100644 diff --git a/core_language/05_basic_language_elements/0503_ordering_of_declarations/NegSem_0503_Ordering_001.ttcn b/core_language/05_basic_language_elements/0503_ordering_of_declarations/NegSem_0503_Ordering_001.ttcn old mode 100755 new mode 100644 diff --git a/core_language/05_basic_language_elements/0503_ordering_of_declarations/Sem_0503_Ordering_001.ttcn b/core_language/05_basic_language_elements/0503_ordering_of_declarations/Sem_0503_Ordering_001.ttcn old mode 100755 new mode 100644 diff --git a/core_language/05_basic_language_elements/0503_ordering_of_declarations/Sem_0503_Ordering_003.ttcn b/core_language/05_basic_language_elements/0503_ordering_of_declarations/Sem_0503_Ordering_003.ttcn new file mode 100644 index 0000000..e58455e --- /dev/null +++ b/core_language/05_basic_language_elements/0503_ordering_of_declarations/Sem_0503_Ordering_003.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 409, updated by STF 572 + ** @version 0.0.2 + ** @desc Test cases for clause 5.2 Scope rules + ** @purpose 1:5.3, Ensure that declarations are in the allowed ordering + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_0503_Ordering_003 { + + type component GeneralComp { + var integer vc_component := 0; + } + + function f_function() runs on GeneralComp { + var integer v_function := 0; + } + + testcase TC_Sem_0503_Ordering_003() runs on GeneralComp { + if(true) { + var integer v_int := 0; + if (v_int == 0) { + var integer v_statement_block_1 := 0; + v_statement_block_1 := v_statement_block_1 + 1; + var integer v_statement_block_2 := 0; // declaration in the middle of the block are allowed + } + + } + setverdict(pass); + } + + control { + var integer v_control := 0; + execute(TC_Sem_0503_Ordering_003()); + } + +} diff --git a/core_language/05_basic_language_elements/0503_ordering_of_declarations/Sem_0503_Ordering_004.ttcn b/core_language/05_basic_language_elements/0503_ordering_of_declarations/Sem_0503_Ordering_004.ttcn new file mode 100644 index 0000000..622b91d --- /dev/null +++ b/core_language/05_basic_language_elements/0503_ordering_of_declarations/Sem_0503_Ordering_004.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 409, updated by STF 572 + ** @version 0.0.1 + ** @desc Test cases for clause 5.2 Scope rules + ** @purpose 1:5.3, Ensure that declarations are in the allowed ordering + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_0503_Ordering_004 { + + type component GeneralComp { + var integer vc_component := 0; + } + + function f_function() runs on GeneralComp { + var integer v_function; + v_function := 0; + var integer v_function_2 := 0; // declaration don't have to be in the beginning of a block any more + } + + testcase TC_Sem_0503_Ordering_004() runs on GeneralComp { + if(true) { + var integer v_statement := 0; + if (v_statement == 0) { + var integer v_nested_statement := 0; + } + + } + setverdict(pass); + } + + control { + var integer v_control := 0; + execute(TC_Sem_0503_Ordering_004()); + } + +} diff --git a/core_language/05_basic_language_elements/0503_ordering_of_declarations/Sem_0503_Ordering_005.ttcn b/core_language/05_basic_language_elements/0503_ordering_of_declarations/Sem_0503_Ordering_005.ttcn old mode 100755 new mode 100644 diff --git a/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_008.ttcn b/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_008.ttcn new file mode 100644 index 0000000..8a15372 --- /dev/null +++ b/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_008.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.1, verify that default value of value formal parameters cannot reference component variables + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction e) +// The expression shall not refer to elements of the component type of the optional runs on clause. + +module NegSem_05040101_parameters_of_kind_value_008 language "TTCN-3:2016" { + type component GeneralComp { + var integer vc_int := 0; + } + + function f(in integer p_int := vc_int) runs on GeneralComp { + } + + testcase TC_NegSem_05040101_parameters_of_kind_value_008() runs on GeneralComp { + f(); + setverdict(pass); + } + + control{ + execute(TC_NegSem_05040101_parameters_of_kind_value_008()); + } +} diff --git a/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_010.ttcn b/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_010.ttcn new file mode 100644 index 0000000..54ff954 --- /dev/null +++ b/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_010.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.1, verify that default value of value formal parameters cannot invoke functions with runs on clause + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction e) +// The expression shall not contain the invocation of functions with a runs on clause. + +module NegSem_05040101_parameters_of_kind_value_010 { + type component GeneralComp { + var integer vc_int; + } + + function fx() runs on GeneralComp return integer { + return vc_int + 1; + } + + function f(in integer p_int := fx()) runs on GeneralComp { + log(p_int); + } + + testcase TC_NegSem_05040101_parameters_of_kind_value_010() runs on GeneralComp { + f(); + setverdict(pass); + } + + control{ + execute(TC_NegSem_05040101_parameters_of_kind_value_010()); + } +} diff --git a/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_018.ttcn b/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_018.ttcn index f6b083f..9bd7ca7 100644 --- a/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_018.ttcn +++ b/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_018.ttcn @@ -1,27 +1,35 @@ -/*************************************************** - ** @author STF 487 +/***************************************************************** + ** @author STF 521 ** @version 0.0.1 - ** @purpose 1:5.4.1.1, verify that incompatible value in default value assignment of value formal parameters causes error + ** @purpose 1:5.4.1.1, Verify that functions with port parameters cannot be used in component.start operation ** @verdict pass reject - ***************************************************/ + *****************************************************************/ // The following requirement is tested: -// Restriction e) -// The expression of the formal parameters' default value had to be compatible with the type of the parameter. +// Only function and altstep definitions may have formal port parameters, - with the exception of functions or +// altsteps started as test component behaviour (see clause 21.3.2). -module NegSem_05040101_parameters_of_kind_value_007 { - type component GeneralComp { - } +module NegSem_05040104_parameters_of_kind_port_001 { - function f(in integer p_int := 5.0) { + type port P message { + inout integer + } + type component C { + port P p; } - testcase TC_NegSem_05040101_parameters_of_kind_value_007() runs on GeneralComp { - f(); + function f_test(P p_port) runs on C { + p_port.send(1); setverdict(pass); - } - - control{ - execute(TC_NegSem_05040101_parameters_of_kind_value_007()); - } -} + } + + testcase TC_NegSem_05040104_parameters_of_kind_port_001() runs on C system C { + var C v_ptc := C.create; + v_ptc.start(f_test(p)); + v_ptc.done; + } + + control { + execute(TC_NegSem_05040104_parameters_of_kind_port_001()); + } +} \ No newline at end of file diff --git a/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_019.ttcn b/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_019.ttcn new file mode 100644 index 0000000..1bca067 --- /dev/null +++ b/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_019.ttcn @@ -0,0 +1,38 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:5.4.1.1, Verify that altsteps with port parameters cannot be used in component.start operation + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// Only function and altstep definitions may have formal port parameters, - with the exception of functions or +// altsteps started as test component behaviour (see clause 21.3.2). + +module NegSem_05040101_parameters_of_kind_value_019 { + + type port P message { + inout integer + } + type component C { + port P p; + } + + altstep a_test(P p_port) runs on C { + [] p_port.receive(integer:?) { + setverdict(pass); + } + } + + testcase TC_NegSem_05040101_parameters_of_kind_value_019() runs on C system C { + var C v_ptc := C.create; + connect(mtc:p, mtc:p); + p.send(1); + v_ptc.start(a_test(p)); + v_ptc.done; + } + + control { + execute(TC_NegSem_05040101_parameters_of_kind_value_019()); + } +} \ No newline at end of file diff --git a/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_020.ttcn b/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_020.ttcn new file mode 100644 index 0000000..89e5eb4 --- /dev/null +++ b/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_020.ttcn @@ -0,0 +1,28 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:5.4.1.1, Verify that test cases cannot have port parameters + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// Only function and altstep definitions may have formal port parameters, - with the exception of functions or +// altsteps started as test component behaviour (see clause 21.3.2). + +module NegSem_05040101_parameters_of_kind_value_020 { + + type port P message { + inout integer + } + type component C { + port P p; + } + + testcase TC_NegSem_05040101_parameters_of_kind_value_020(P p_port) runs on C { // should cause a compilation error + setverdict(pass); + } + + control { + execute(TC_NegSem_05040101_parameters_of_kind_value_020(null)); + } +} \ No newline at end of file diff --git a/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_021.ttcn b/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_021.ttcn new file mode 100644 index 0000000..3252c26 --- /dev/null +++ b/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_021.ttcn @@ -0,0 +1,31 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:5.4.1.1, Verify that templates cannot contain port parameters + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// Only function and altstep definitions may have formal port parameters, - with the exception of functions or +// altsteps started as test component behaviour (see clause 21.3.2). + +module NegSem_05040101_parameters_of_kind_value_021 { + + type port P message { + inout integer + } + type component C { + port P p; + } + + template boolean m_msg(P p_par) := p_par.checkstate("Started"); + + testcase TC_NegSem_05040101_parameters_of_kind_value_021() runs on C system C { + log(m_msg(p)); + setverdict(pass); + } + + control { + execute(TC_NegSem_05040101_parameters_of_kind_value_021()); + } +} \ No newline at end of file diff --git a/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_022.ttcn b/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_022.ttcn new file mode 100644 index 0000000..155d80f --- /dev/null +++ b/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_022.ttcn @@ -0,0 +1,33 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:5.4.1.1, Verify that functions with timer parameters cannot be used in component.start operation + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// Only function and altstep definitions may have formal timer parameters, with the exception of functions or +// altsteps started as test component behaviour (see clause 21.3.2). + +module NegSem_05040101_parameters_of_kind_value_022 { + + type component C { + } + + function f_test(inout timer p_tmr) runs on C { + p_tmr.timeout; + setverdict(pass); + } + + testcase TC_NegSem_05040101_parameters_of_kind_value_022() runs on C system C { + timer t_tmr := 0.1; + var C v_ptc := C.create; + t_tmr.start; + v_ptc.start(f_test(t_tmr)); + v_ptc.done; + } + + control { + execute(TC_NegSem_05040101_parameters_of_kind_value_022()); + } +} \ No newline at end of file diff --git a/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_023.ttcn b/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_023.ttcn new file mode 100644 index 0000000..9e2373e --- /dev/null +++ b/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_023.ttcn @@ -0,0 +1,34 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:5.4.1.1, Verify that altsteps with timer parameters cannot be used in component.start operation + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// Only function and altstep definitions may have formal timer parameters, with the exception of functions or +// altsteps started as test component behaviour (see clause 21.3.2). + +module NegSem_05040101_parameters_of_kind_value_023 { + + type component C { + } + + altstep f_test(inout timer p_tmr) runs on C { + [] p_tmr.timeout { + setverdict(pass); + } + } + + testcase TC_NegSem_05040101_parameters_of_kind_value_023() runs on C system C { + timer t_tmr := 0.1; + var C v_ptc := C.create; + t_tmr.start; + v_ptc.start(f_test(t_tmr)); + v_ptc.done; + } + + control { + execute(TC_NegSem_05040101_parameters_of_kind_value_023()); + } +} \ No newline at end of file diff --git a/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_024.ttcn b/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_024.ttcn new file mode 100644 index 0000000..fddb4b3 --- /dev/null +++ b/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_024.ttcn @@ -0,0 +1,27 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:5.4.1.1, Verify that test cases cannot have timer parameters + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// Only function and altstep definitions may have formal timer parameters, with the exception of functions or +// altsteps started as test component behaviour (see clause 21.3.2). + +module NegSem_05040101_parameters_of_kind_value_024 { + + type component C { + } + + testcase TC_NegSem_05040101_parameters_of_kind_value_024(timer p_tmr) runs on C { + p_tmr.timeout; + setverdict(pass); + } + + control { + timer t_tmr := 0.1; + t_tmr.start; + execute(TC_NegSem_05040101_parameters_of_kind_value_024(t_tmr)); + } +} \ No newline at end of file diff --git a/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_025.ttcn b/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_025.ttcn new file mode 100644 index 0000000..303dce3 --- /dev/null +++ b/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_025.ttcn @@ -0,0 +1,33 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:5.4.1.1, Verify that templates cannot have timer parameters + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// Only function and altstep definitions may have formal timer parameters, with the exception of functions or +// altsteps started as test component behaviour (see clause 21.3.2). + +module NegSem_05040101_parameters_of_kind_value_025 { + + type component C { + } + + function f(timer p_tmr) return boolean { + return p_tmr.running; + } + + template boolean m_msg (timer p_tmr) := f(p_tmr); + + testcase TC_NegSem_05040101_parameters_of_kind_value_025() runs on C system C { + timer t_tmr := 0.1; + t_tmr.start; + log(m_msg(t_tmr)); + setverdict(pass); + } + + control { + execute(TC_NegSem_05040101_parameters_of_kind_value_025()); + } +} \ No newline at end of file diff --git a/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_026.ttcn b/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_026.ttcn new file mode 100644 index 0000000..fc2e834 --- /dev/null +++ b/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_026.ttcn @@ -0,0 +1,24 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:5.4.1.1, Verify that test cases cannot have timer parameters + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// Only function and altstep definitions may have formal port, timer, or default parameters, - with the exception of functions or +// altsteps started as test component behaviour (see clause 21.3.2). + +module NegSem_05040101_parameters_of_kind_value_026 { + + type component C { + } + + testcase TC_NegSem_05040101_parameters_of_kind_value_026(timer p_timer) runs on C { // should cause a compilation error + setverdict(pass); + } + + control { + execute(TC_NegSem_05040101_parameters_of_kind_value_026(null)); + } +} \ No newline at end of file diff --git a/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_027.ttcn b/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_027.ttcn new file mode 100644 index 0000000..c7f8929 --- /dev/null +++ b/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_027.ttcn @@ -0,0 +1,24 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:5.4.1.1, Verify that test cases cannot have default parameters + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// Only function and altstep definitions may have formal port, timer or default parameters, - with the exception of functions or +// altsteps started as test component behaviour (see clause 21.3.2). + +module NegSem_05040101_parameters_of_kind_value_027 { + + type component C { + } + + testcase TC_NegSem_05040101_parameters_of_kind_value_027(default p_default) runs on C { // should cause a compilation error + setverdict(pass); + } + + control { + execute(TC_NegSem_05040101_parameters_of_kind_value_027(null)); + } +} \ No newline at end of file diff --git a/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_028.ttcn b/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_028.ttcn new file mode 100644 index 0000000..31782a0 --- /dev/null +++ b/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_028.ttcn @@ -0,0 +1,30 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:5.4.1.1, Verify that templates cannot have timer parameters + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// Only function and altstep definitions may have formal port, timer or default parameters, - with the exception of functions or +// altsteps started as test component behaviour (see clause 21.3.2). + +module NegSem_05040101_parameters_of_kind_value_028 { + + type component C { + } + + template boolean m_msg(timer p_timer) := p_timer.running; + } + + testcase TC_NegSem_05040101_parameters_of_kind_value_028() runs on C system C { + timer t1 := 1.0; + t1.start; + log(m_msg(t1)); + setverdict(pass); + } + + control { + execute(TC_NegSem_05040101_parameters_of_kind_value_028()); + } +} \ No newline at end of file diff --git a/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_029.ttcn b/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_029.ttcn new file mode 100644 index 0000000..1f1410f --- /dev/null +++ b/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_029.ttcn @@ -0,0 +1,27 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:5.4.1.1, Verify that templates cannot contain port parameters + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// Only function and altstep definitions may have formal port, timer or default parameters, - with the exception of functions or +// altsteps started as test component behaviour (see clause 21.3.2). + +module NegSem_05040101_parameters_of_kind_value_029 { + + type component C { + } + + template boolean m_msg(default p_default) := p_default == null; + + testcase TC_NegSem_05040101_parameters_of_kind_value_029() runs on C system C { + log(m_msg(null)); + setverdict(pass); + } + + control { + execute(TC_NegSem_05040101_parameters_of_kind_value_029()); + } +} \ No newline at end of file diff --git a/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_030.ttcn b/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_030.ttcn new file mode 100644 index 0000000..d7fc4fb --- /dev/null +++ b/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_030.ttcn @@ -0,0 +1,36 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:5.4.1.1, Verify that templates cannot contain component parameters + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// m) Only function, altstep and testcase definitions may have formal parameters of a +// component type or of a type that contains a direct or indirect element or field of a component type. + +module NegSem_05040101_parameters_of_kind_value_030 { + + type port P message { + inout integer + } + type component C { + port P p; + } + + template boolean m_msg(C p_component) := true; + + function fun_start() runs on C { + setverdict(pass); + } + + testcase TC_NegSem_05040101_parameters_of_kind_value_030() runs on C system C { + C myComponentRef; + log(m_msg(myComponentRef.start(fun_start()))); + setverdict(pass); + } + + control { + execute(TC_NegSem_05040101_parameters_of_kind_value_030()); + } +} \ No newline at end of file diff --git a/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_031.ttcn b/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_031.ttcn new file mode 100644 index 0000000..9a6e425 --- /dev/null +++ b/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_031.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:5.4.1.1, verify that lazy in param used in determinstic context mustbe declared @deteministic + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction n) +// If a lazy or fuzzy value parameter is used in deterministic contexts (i.e. during the evaluation of a snapshot or +// initialization of global non-fuzzy templates), it shall be declared @deterministic. + +module NegSem_05040101_parameters_of_kind_value_031 { + + type component GeneralComp { + } + + template integer t_int; + + function f(in @lazy integer p_int) { + t_int := p_int; //template deterministic, in param lazy -> error + } + testcase TC_NegSem_05040101_parameters_of_kind_value_031() runs on GeneralComp { + var integer v_int := 0; + f(v_int); + log(v_int); + setverdict(pass); + } + + control{ + execute(TC_NegSem_05040101_parameters_of_kind_value_031()); + } +} diff --git a/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_032.ttcn b/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_032.ttcn new file mode 100644 index 0000000..1a0db75 --- /dev/null +++ b/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_032.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:5.4.1.1, verify that lazy in param used in determinstic context mustbe declared @deteministic + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction n) +// If a lazy or fuzzy value parameter is used in deterministic contexts (i.e. during the evaluation of a snapshot or +// initialization of global non-fuzzy templates), it shall be declared @deterministic. + +module NegSem_05040101_parameters_of_kind_value_032 { + + type component GeneralComp { + } + + template integer t_int; + + function f(in @fuzzy integer p_int) { + t_int := p_int; //template deterministic, in param fuzzy -> error + } + testcase TC_NegSem_05040101_parameters_of_kind_value_032() runs on GeneralComp { + var integer v_int := 0; + f(v_int); + log(v_int); + setverdict(pass); + } + + control{ + execute(TC_NegSem_05040101_parameters_of_kind_value_032()); + } +} diff --git a/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_026.ttcn b/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_026.ttcn new file mode 100644 index 0000000..c48c0a4 --- /dev/null +++ b/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_026.ttcn @@ -0,0 +1,35 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:5.4.1.1, Verify that in port parameters are allowed + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The older versions of the core language specifications contained this rule: +// Formal port parameters shall be inout parameters, which can optionally be indicated by the keyword inout. +// +// The rule has been removed and the test verifies that compilers can accept in port prameters now. + +module Sem_05040101_parameters_of_kind_value_026 { + + type port P message { + inout integer + } + + type component C { + port P p; + } + + function f_test(in P p_port) { + p_port.send(1); + } + + testcase TC_Sem_05040101_parameters_of_kind_value_026() runs on C { + f_test(p); + setverdict(pass); + } + + control { + execute(TC_Sem_05040101_parameters_of_kind_value_026()); + } +} \ No newline at end of file diff --git a/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_027.ttcn b/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_027.ttcn new file mode 100644 index 0000000..4b7e3e3 --- /dev/null +++ b/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_027.ttcn @@ -0,0 +1,34 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:5.4.1.1, Verify that out port parameters are allowed + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The older versions of the core language specifications contained this rule: +// Formal port parameters shall be inout parameters, which can optionally be indicated by the keyword inout. +// +// The rule has been removed and the test verifies that compilers can accept in port prameters now. + +module Sem_05040101_parameters_of_kind_value_027 { + + type port P message { + inout integer + } + + type component C { + port P p; + } + + function f_test(out P p_port) { + setverdict(pass); + } + + testcase TC_Sem_05040101_parameters_of_kind_value_027() runs on C { + f_test(-); + } + + control { + execute(TC_Sem_05040101_parameters_of_kind_value_027()); + } +} \ No newline at end of file diff --git a/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_028.ttcn b/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_028.ttcn new file mode 100644 index 0000000..80ac7f7 --- /dev/null +++ b/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_028.ttcn @@ -0,0 +1,111 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:5.4.1.1, Ensure that the IUT accepts port parametrization types for functions. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_05040101_parameters_of_kind_value_028 { + + type enumerated MyEnumeratedType {e_black, e_white} + type integer address; + + type record MyRecord { + integer field1, + boolean field2, + address field3, + MyEnumeratedType field4, + integer field5 + } + + type port TestPort message { + inout MyRecord + } + + type component GeneralComp { + port TestPort generalPort; + port TestPort otherPort; + } + + function f_parametrizationCheck ( + MyRecord ExpectedMatch, + timer p_timer, + integer p_integer := 0, + boolean p_boolean := true, + address p_address := null, + MyEnumeratedType p_enumerated := e_black, + template integer p_integerTemplate := ?, + TestPort p_port + ) runs on GeneralComp { + var template MyRecord ReceivedRecordTemplate := {p_integer, p_boolean, p_address, p_enumerated, p_integerTemplate}; + + p_port.send(ExpectedMatch); + } + + testcase Sem_05040101_parameters_of_kind_value_028_a ( + MyRecord ExpectedMatch, + integer p_integer := 0, + boolean p_boolean := true, + address p_address := null, + MyEnumeratedType p_enumerated := e_black, + template integer p_integerTemplate := ? + ) runs on GeneralComp { + + timer t_check; + t_check.start(5.0); + f_parametrizationCheck(ExpectedMatch, t_check, p_integer, p_boolean, p_address, p_enumerated, p_integerTemplate,generalPort); + alt { + [] generalPort.receive { + setverdict(pass); + } + [] t_check.timeout { + setverdict(fail); + } + } + + t_check.stop; + + } + + testcase Sem_05040101_parameters_of_kind_value_028_b ( + MyRecord ExpectedMatch, + integer p_integer := 0, + boolean p_boolean := true, + address p_address := null, + MyEnumeratedType p_enumerated := e_black, + template integer p_integerTemplate := ? + ) runs on GeneralComp { + + timer t_check; + t_check.start(1.0); + f_parametrizationCheck(ExpectedMatch, t_check, p_integer, p_boolean, p_address, p_enumerated, p_integerTemplate,otherPort); + alt { + [] otherPort.receive { + setverdict(pass); + } + [] t_check.timeout { + setverdict(fail); + } + } + + t_check.stop; + + } + + + control{ + + var MyRecord ModifiedValues := { + field1 := 1, + field2 := false, + field3 := 1, + field4 := e_white, + field5 := 1 + } + + //the following testcases will call same function with different port parameter values + execute(Sem_05040101_parameters_of_kind_value_028_a(ModifiedValues,1,false,1,e_white,1)); + execute(Sem_05040101_parameters_of_kind_value_028_b(ModifiedValues,1,false,1,e_white,1)); + + } + +} diff --git a/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_029.ttcn b/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_029.ttcn new file mode 100644 index 0000000..d8dbafa --- /dev/null +++ b/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_029.ttcn @@ -0,0 +1,34 @@ +/***************************************************************** + ** @author STF 521, updated by STF 572 + ** @version 0.0.2, + ** @purpose 1:5.4.1.1, Verify that inout prefix can be used for port parameters + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirement is tested: +// Formal port parameters shall be inout parameters, which can optionally be indicated by the keyword inout. + +module Sem_05040101_parameters_of_kind_value_029 { + + type port P message { + inout integer + } + + type component C { + port P p; + } + + function f_test(inout P p_port) { + p_port.send(1); + setverdict(pass); + } + + testcase TC_Sem_05040101_parameters_of_kind_value_029() runs on C { + var P v_port := p; + f_test(v_port); + } + + control { + execute(TC_Sem_05040101_parameters_of_kind_value_029()); + } +} \ No newline at end of file diff --git a/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_030.ttcn b/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_030.ttcn new file mode 100644 index 0000000..9630a80 --- /dev/null +++ b/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_030.ttcn @@ -0,0 +1,32 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:5.4.1.1, Verify that in timer parameters are allowed + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The older versions of the core language specifications contained this rule: +// Formal timer parameters shall be inout parameters, which can optionally be indicated by the keyword inout. +// +// The rule has been removed and the test verifies that compilers can accept in timer prameters now. + +module Sem_05040101_parameters_of_kind_value_030 { + + type component C { + } + + function f_test(in timer p_tmr) { + p_tmr.timeout; + } + + testcase TC_Sem_05040101_parameters_of_kind_value_030() runs on C { + timer t_tmr := 1.0; + t_tmr.start; + f_test(t_tmr); + setverdict(pass); + } + + control { + execute(TC_Sem_05040101_parameters_of_kind_value_030()); + } +} \ No newline at end of file diff --git a/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_031.ttcn b/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_031.ttcn new file mode 100644 index 0000000..a7107c8 --- /dev/null +++ b/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_031.ttcn @@ -0,0 +1,43 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:5.4.1.1, Verify that out timer parameters are allowed + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The older versions of the core language specifications contained this rule: +// Formal timer parameters shall be inout parameters, which can optionally be indicated by the keyword inout. +// +// The rule has been removed and the test verifies that compilers can accept in timer prameters now. + +module Sem_05040101_parameters_of_kind_value_031 { + + type component C { + timer tc_tmr; + } + + function f_test(out timer p_tmr) runs on C { + p_tmr := tc_tmr; + p_tmr.start(1.0); + } + + + testcase TC_Sem_05040101_parameters_of_kind_value_031() runs on C{ + + var timer t_tmr; + + f_test(t_tmr); + + t_tmr.timeout; + setverdict(pass); + + } + + + control { + + execute(TC_Sem_05040101_parameters_of_kind_value_031()); + + } + +} \ No newline at end of file diff --git a/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_032.ttcn b/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_032.ttcn new file mode 100644 index 0000000..5f82ea3 --- /dev/null +++ b/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_032.ttcn @@ -0,0 +1,98 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:5.4.1.1, Ensure that the IUT correctly handles parametrization through the use of timer parameters. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_05040101_parameters_of_kind_value_032 { + +type enumerated MyEnumeratedType {e_black, e_white} +type integer address; + +type record MyRecord { + integer field1, + boolean field2, + address field3, + MyEnumeratedType field4, + integer field5 +} + +type port TestPort message { + inout MyRecord +} + +type component GeneralComp { + port TestPort generalPort; + port TestPort otherport; +} +function f_parametrizationCheck ( + MyRecord ExpectedMatch, + timer p_timer, + integer p_integer := 0, + boolean p_boolean := true, + address p_address := null, + MyEnumeratedType p_enumerated := e_black, + template integer p_integerTemplate := ? + ) runs on GeneralComp { + var template MyRecord ReceivedRecordTemplate := {p_integer, p_boolean, p_address, p_enumerated, p_integerTemplate}; + + if ( match(ExpectedMatch, ReceivedRecordTemplate) and (p_timer.running) ) { + setverdict(pass); + } + else { + setverdict(fail); + } + } + +testcase TC_Sem_05040101_parameters_of_kind_value_032 ( + MyRecord ExpectedMatch, + integer p_integer := 0, + boolean p_boolean := true, + address p_address := null, + MyEnumeratedType p_enumerated := e_black, + template integer p_integerTemplate := ? + ) runs on GeneralComp { + + timer t_check; + t_check.start(5.0); + f_parametrizationCheck(ExpectedMatch, t_check, p_integer, p_boolean, p_address, p_enumerated, p_integerTemplate); + + t_check.stop; + +} + + +control{ + + var MyRecord DefaultValues := { + field1 := 0, + field2 := true, + field3 := null, + field4 := e_black, + field5 := 1 //any number can be used here to correspond with ? matching + } + + var MyRecord ModifiedValues := { + field1 := 1, + field2 := false, + field3 := 1, + field4 := e_white, + field5 := 1 + } + + var MyRecord PartlyModifiedValues := { + field1 := 0, + field2 := false, + field3 := null, + field4 := e_white, + field5 := 1 + } + + execute(TC_Sem_05040101_parameters_of_kind_value_032(DefaultValues)); + execute(TC_Sem_05040101_parameters_of_kind_value_032(DefaultValues,-,-,-,-,-)); + execute(TC_Sem_05040101_parameters_of_kind_value_032(ModifiedValues,1,false,1,e_white,1)); + execute(TC_Sem_05040101_parameters_of_kind_value_032(PartlyModifiedValues,-,false,-,e_white,-)); +} + +} diff --git a/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_033.ttcn b/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_033.ttcn new file mode 100644 index 0000000..cffd105 --- /dev/null +++ b/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_033.ttcn @@ -0,0 +1,28 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:5.4.1.1, Verify that inout prefix can be used for timer parameters + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_05040101_parameters_of_kind_value_033 { + + type component C { + } + + function f_test(inout timer p_tmr) { + p_tmr.timeout; + setverdict(pass); + } + + testcase TC_Sem_05040101_parameters_of_kind_value_033() runs on C { + timer t_tmr := 0.1; + var timer v_tmr := t_tmr; + t_tmr.start; + f_test(v_tmr); + } + + control { + execute(TC_Sem_05040101_parameters_of_kind_value_033()); + } +} \ No newline at end of file diff --git a/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_034.ttcn b/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_034.ttcn new file mode 100644 index 0000000..fd85881 --- /dev/null +++ b/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_034.ttcn @@ -0,0 +1,32 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:5.4.1.1, Verify that altstep can have timer parameters + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirement is tested: +// Only function and altstep definitions may have formal timer parameters, with the exception of functions or +// altsteps started as test component behaviour (see clause 21.3.2). + +module Sem_05040101_parameters_of_kind_value_034 { + + type component C { + } + + altstep a_test(timer p_tmr) { + [] p_tmr.timeout { + setverdict(pass); + } + } + + testcase TC_Sem_05040101_parameters_of_kind_value_034() runs on C { + timer t_tmr := 0.1; + t_tmr.start; + a_test(t_tmr); + } + + control { + execute(TC_Sem_05040101_parameters_of_kind_value_034()); + } +} \ No newline at end of file diff --git a/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_035.ttcn b/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_035.ttcn new file mode 100644 index 0000000..541201d --- /dev/null +++ b/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_035.ttcn @@ -0,0 +1,34 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:5.4.1.1, verify that null can be used as default value of formal value parameters of default type + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Restriction g) +// Default values of port type formal parameters shall be the special value null. + +module Sem_05040101_parameters_of_kind_value_035 { + + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f(P p_def := null) { + log(p_def); + } + + testcase TC_Sem_05040101_parameters_of_kind_value_035() runs on GeneralComp { + f(); + setverdict(pass); + } + + control{ + execute(TC_Sem_05040101_parameters_of_kind_value_035()); + } +} diff --git a/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_036.ttcn b/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_036.ttcn new file mode 100644 index 0000000..0518bbd --- /dev/null +++ b/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_036.ttcn @@ -0,0 +1,29 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:5.4.1.1, verify that null can be used as default value of formal value parameters of default type + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Restriction g) +// Default values of timer type formal parameters shall be the special value null. + +module Sem_05040101_parameters_of_kind_value_036 { + + type component GeneralComp { + } + + function f(timer p_def := null) { + log(p_def); + } + + testcase TC_Sem_05040101_parameters_of_kind_value_036() runs on GeneralComp { + f(); + setverdict(pass); + } + + control{ + execute(TC_Sem_05040101_parameters_of_kind_value_036()); + } +} diff --git a/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/NegSem_05040102_parameters_of_kind_template_004.ttcn b/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/NegSem_05040102_parameters_of_kind_template_004.ttcn index 53c9a17..f39c13f 100644 --- a/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/NegSem_05040102_parameters_of_kind_template_004.ttcn +++ b/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/NegSem_05040102_parameters_of_kind_template_004.ttcn @@ -7,7 +7,7 @@ // The following requirement is tested: // Restriction b) -// Formal value parameters of templates ... shall always be in parameters. +// Formal template parameters of templates ... shall always be in parameters. module NegSem_05040102_parameters_of_kind_template_004 { type component GeneralComp { diff --git a/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/NegSem_05040102_parameters_of_kind_template_008.ttcn b/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/NegSem_05040102_parameters_of_kind_template_008.ttcn new file mode 100644 index 0000000..7ccff31 --- /dev/null +++ b/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/NegSem_05040102_parameters_of_kind_template_008.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.2, verify that default template instance of template formal parameters cannot reference component elements + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction e) +// The template instance shall not refer to elements of the component type in a runs on clause. + +module NegSem_05040102_parameters_of_kind_template_008 language "TTCN-3:2016" { + type component GeneralComp { + var template integer vc_int := ?; + } + + function f(in template integer p_int := vc_int) runs on GeneralComp { + } + + testcase TC_NegSem_05040102_parameters_of_kind_template_008() runs on GeneralComp { + f(); + setverdict(pass); + } + + control{ + execute(TC_NegSem_05040102_parameters_of_kind_template_008()); + } +} diff --git a/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/NegSem_05040102_parameters_of_kind_template_010.ttcn b/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/NegSem_05040102_parameters_of_kind_template_010.ttcn new file mode 100644 index 0000000..d47161e --- /dev/null +++ b/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/NegSem_05040102_parameters_of_kind_template_010.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.2, verify that default template instance of template formal parameters cannot invoke functions with runs on clause + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction e) +// The template instance shall not contain the invocation of functions with a runs on clause. + +module NegSem_05040101_parameters_of_kind_value_010 { + type component GeneralComp { + var integer vc_int; + } + + function fx() runs on GeneralComp return integer { + return vc_int + 1; + } + + function f(in template integer p_int := fx()) runs on GeneralComp { + log(p_int); + } + + testcase TC_NegSem_05040101_parameters_of_kind_value_010() runs on GeneralComp { + f(); + setverdict(pass); + } + + control{ + execute(TC_NegSem_05040101_parameters_of_kind_value_010()); + } +} diff --git a/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/NegSem_05040102_parameters_of_kind_template_020.ttcn b/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/NegSem_05040102_parameters_of_kind_template_020.ttcn new file mode 100644 index 0000000..c9a949c --- /dev/null +++ b/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/NegSem_05040102_parameters_of_kind_template_020.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:5.4.1.2, verify that non-deterministic lazy template parameter cannot be used in deteministic context + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction j +// If a lazy or fuzzy template parameter is used in deterministic contexts (i.e. during the evaluation of a snapshot or initialization +// of global non-fuzzy templates), it shall be declared @deterministic. + +module NegSem_05040102_parameters_of_kind_template_020 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test(template @lazy integer p_param1) runs on GeneralComp { + p.send(1); + p.receive(p_param1); + } + + testcase TC_NegSem_05040102_parameters_of_kind_template_020() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + f_test(?); + setverdict(pass); + } + + control { + execute(TC_NegSem_05040102_parameters_of_kind_template_020()); + } +} diff --git a/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/NegSem_05040102_parameters_of_kind_template_021.ttcn b/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/NegSem_05040102_parameters_of_kind_template_021.ttcn new file mode 100644 index 0000000..8321af7 --- /dev/null +++ b/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/NegSem_05040102_parameters_of_kind_template_021.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:5.4.1.2, verify that non-deterministic fuzzy template parameter cannot be used in deteministic context + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction j +// If a lazy or fuzzy template parameter is used in deterministic contexts (i.e. during the evaluation of a snapshot or initialization +// of global non-fuzzy templates), it shall be declared @deterministic. + +module NegSem_05040102_parameters_of_kind_template_021 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test(template @fuzzy integer p_param1) runs on GeneralComp { + p.send(1); + p.receive(p_param1); + } + + testcase TC_NegSem_05040102_parameters_of_kind_template_021() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + f_test(?); + setverdict(pass); + } + + control { + execute(TC_NegSem_05040102_parameters_of_kind_template_021()); + } +} diff --git a/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_042.ttcn b/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_042.ttcn new file mode 100644 index 0000000..8eeff43 --- /dev/null +++ b/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_042.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:5.4.1.2, verify that deterministic lazy template parameters can be declared and used in deteministic context + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Restriction j +// If a lazy or fuzzy template parameter is used in deterministic contexts (i.e. during the evaluation of a snapshot or initialization +// of global non-fuzzy templates), it shall be declared @deterministic. + +module Sem_05040102_parameters_of_kind_template_042 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test(template @lazy @deterministic integer p_param1) runs on GeneralComp { + p.send(1); + p.receive(p_param1); + } + + testcase TC_Sem_05040102_parameters_of_kind_template_042() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + f_test(?); + setverdict(pass); + } + + control { + execute(TC_Sem_05040102_parameters_of_kind_template_042()); + } +} diff --git a/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_043.ttcn b/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_043.ttcn new file mode 100644 index 0000000..aa7e24f --- /dev/null +++ b/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_043.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:5.4.1.2, verify that deterministic fuzzy template parameters can be declared and used in deteministic context + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Restriction j +// If a lazy or fuzzy template parameter is used in deterministic contexts (i.e. during the evaluation of a snapshot or initialization +// of global non-fuzzy templates), it shall be declared @deterministic. + +module Sem_05040102_parameters_of_kind_template_043 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test(template @fuzzy @deterministic integer p_param1) runs on GeneralComp { + p.send(1); + p.receive(p_param1); + } + + testcase TC_Sem_05040102_parameters_of_kind_template_043() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + f_test(?); + setverdict(pass); + } + + control { + execute(TC_Sem_05040102_parameters_of_kind_template_043()); + } +} diff --git a/core_language/05_basic_language_elements/0504_parametrization/050401_top_level/Sem_050401_top_level_030.ttcn b/core_language/05_basic_language_elements/0504_parametrization/050401_top_level/Sem_050401_top_level_030.ttcn new file mode 100644 index 0000000..4af3cc5 --- /dev/null +++ b/core_language/05_basic_language_elements/0504_parametrization/050401_top_level/Sem_050401_top_level_030.ttcn @@ -0,0 +1,29 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:5.4.1, verify that @deterministic modifier can be used for lazy value parameters + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Formal value or template parameters may be declared lazy using the @lazy modifier. The behaviour +// of lazy parameters is defined in clause 3.1, definition of lazy values or templates. + +module Sem_050401_top_level_030 { + + type component GeneralComp { + } + + function f(@lazy @deterministic integer p_int) { + if (p_int == 1) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_Sem_050401_top_level_030() runs on GeneralComp { + f(1); + } + + control{ + execute(TC_Sem_050401_top_level_030()); + } +} diff --git a/core_language/05_basic_language_elements/0504_parametrization/050401_top_level/Sem_050401_top_level_031.ttcn b/core_language/05_basic_language_elements/0504_parametrization/050401_top_level/Sem_050401_top_level_031.ttcn new file mode 100644 index 0000000..4f28fbe --- /dev/null +++ b/core_language/05_basic_language_elements/0504_parametrization/050401_top_level/Sem_050401_top_level_031.ttcn @@ -0,0 +1,29 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:5.4.1, verify that @deterministic modifier can be used for lazy template parameters + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Formal value or template parameters may be declared lazy using the @lazy modifier. The behaviour +// of lazy parameters is defined in clause 3.1, definition of lazy values or templates. + +module Sem_050401_top_level_031 { + + type component GeneralComp { + } + + function f(template @lazy @deterministic integer pm_int) { + if (match(1, pm_int)) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_Sem_050401_top_level_031() runs on GeneralComp { + f(1); + } + + control{ + execute(TC_Sem_050401_top_level_031()); + } +} diff --git a/core_language/05_basic_language_elements/0504_parametrization/050401_top_level/Sem_050401_top_level_032.ttcn b/core_language/05_basic_language_elements/0504_parametrization/050401_top_level/Sem_050401_top_level_032.ttcn new file mode 100644 index 0000000..04a9768 --- /dev/null +++ b/core_language/05_basic_language_elements/0504_parametrization/050401_top_level/Sem_050401_top_level_032.ttcn @@ -0,0 +1,29 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:5.4.1, verify that @deterministic modifier can be used for fuzzy value parameters + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Formal value or template parameters may be declared fuzzy using the @fuzzy modifier. The behaviour +// of fuzzy parameters is defined in clause 3.1, definition of fuzzy values or templates. + +module Sem_050401_top_level_032 { + + type component GeneralComp { + } + + function f(@fuzzy @deterministic integer p_int) { + if (p_int == 1) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_Sem_050401_top_level_032() runs on GeneralComp { + f(1); + } + + control{ + execute(TC_Sem_050401_top_level_032()); + } +} diff --git a/core_language/05_basic_language_elements/0504_parametrization/050401_top_level/Sem_050401_top_level_033.ttcn b/core_language/05_basic_language_elements/0504_parametrization/050401_top_level/Sem_050401_top_level_033.ttcn new file mode 100644 index 0000000..e94fc14 --- /dev/null +++ b/core_language/05_basic_language_elements/0504_parametrization/050401_top_level/Sem_050401_top_level_033.ttcn @@ -0,0 +1,29 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:5.4.1, verify that @deterministic modifier can be used for fuzzy template parameters + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Formal value or template parameters may be declared fuzzy using the @fuzzy modifier. The behaviour +// of fuzzy parameters is defined in clause 3.1, definition of fuzzy values or templates. + +module Sem_050401_top_level_033 { + + type component GeneralComp { + } + + function f(template @fuzzy @deterministic integer pm_int) { + if (match(1, pm_int)) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_Sem_050401_top_level_033() runs on GeneralComp { + f(1); + } + + control{ + execute(TC_Sem_050401_top_level_033()); + } +} diff --git a/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_103.ttcn b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_103.ttcn index 03fc7c0..0fcf203 100644 --- a/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_103.ttcn +++ b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_103.ttcn @@ -1,13 +1,13 @@ /*************************************************** ** @author STF 487 ** @version 0.0.1 - ** @purpose 1:5.4.2, verify that mixing list and assignment notation is not allowed in parameterized calls (value as actual parameter) + ** @purpose 1:5.4.2, verify that assignment notation followed by list notation is not allowed in parameterized calls (value as actual parameter) ** @verdict pass reject ***************************************************/ // The following requirement is tested: -// Either list notation or assignment notation shall be used in a single parameter -// list. They shall not be mixed. +// Actual parameters can be provided ... in a mixed notation where the first parameters are given in list notation +// and additional parameters in assignment notation. module NegSem_050402_actual_parameters_103 { diff --git a/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_104.ttcn b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_104.ttcn index bef5b3d..837c399 100644 --- a/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_104.ttcn +++ b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_104.ttcn @@ -1,13 +1,13 @@ /*************************************************** ** @author STF 487 ** @version 0.0.1 - ** @purpose 1:5.4.2, verify that mixing list and assignment notation is not allowed in parameterized calls (skipped actual parameter) + ** @purpose 1:5.4.2, verify that assignment notation followed by list notation is not allowed in parameterized calls (skipped actual parameter) ** @verdict pass reject ***************************************************/ // The following requirement is tested: -// Either list notation or assignment notation shall be used in a single parameter -// list. They shall not be mixed. +// Actual parameters can be provided ... in a mixed notation where the first parameters are given in list notation +// and additional parameters in assignment notation. module NegSem_050402_actual_parameters_104 { diff --git a/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_184.ttcn b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_184.ttcn new file mode 100644 index 0000000..4103a72 --- /dev/null +++ b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_184.ttcn @@ -0,0 +1,41 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that lazy variables cannot be referenced during evaluation of a deterministic fuzzy parameter + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters passed to fuzzy or lazy formal parameters shall fulfill the restrictions imposed on content +// of functions used in special places given in 16.1.4. +// The following operations shall not be used: +// m) Referencing lazy or fuzzy variables, parameters or templates that have not been declared deterministic. + +module NegSem_050402_actual_parameters_184 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + var @lazy integer vc_int := 1; + } + + function f_test() runs on GeneralComp return template integer { + log(vc_int); // forbidden reference + return ?; + } + + function f_param(template @fuzzy @deterministic integer p_param) runs on GeneralComp { + log(p_param); // forbidden reference + } + + testcase TC_NegSem_050402_actual_parameters_184() runs on GeneralComp system GeneralComp { + f_param(f_test()); + setverdict(pass); + } + + control { + execute(TC_NegSem_050402_actual_parameters_184()); + } +} diff --git a/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_185.ttcn b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_185.ttcn new file mode 100644 index 0000000..7a0e4b6 --- /dev/null +++ b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_185.ttcn @@ -0,0 +1,41 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that fuzzy variables cannot be referenced during evaluation of a deterministic fuzzy parameter + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters passed to fuzzy or lazy formal parameters shall fulfill the restrictions imposed on content +// of functions used in special places given in 16.1.4. +// The following operations shall not be used: +// m) Referencing lazy or fuzzy variables, parameters or templates that have not been declared deterministic. + +module NegSem_050402_actual_parameters_185 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + var @fuzzy integer vc_int := 1; + } + + function f_test() runs on GeneralComp return template integer { + log(vc_int); // forbidden reference + return ?; + } + + function f_param(template @fuzzy @deterministic integer p_param) runs on GeneralComp { + log(p_param); // causes validation + } + + testcase TC_NegSem_050402_actual_parameters_185() runs on GeneralComp system GeneralComp { + f_param(f_test()); + setverdict(pass); + } + + control { + execute(TC_NegSem_050402_actual_parameters_185()); + } +} diff --git a/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_186.ttcn b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_186.ttcn new file mode 100644 index 0000000..cf4056d --- /dev/null +++ b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_186.ttcn @@ -0,0 +1,40 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that lazy parameters cannot be referenced during evaluation of a deterministic fuzzy parameter + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters passed to fuzzy or lazy formal parameters shall fulfill the restrictions imposed on content +// of functions used in special places given in 16.1.4. +// The following operations shall not be used: +// m) Referencing lazy or fuzzy variables, parameters or templates that have not been declared deterministic. + +module NegSem_050402_actual_parameters_186 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test(@lazy integer p_param) runs on GeneralComp return template integer { + log(p_param); // forbidden reference + return ?; + } + + function f_param(template @fuzzy @deterministic integer p_param) runs on GeneralComp { + log(p_param); // causes validation + } + + testcase TC_NegSem_050402_actual_parameters_186() runs on GeneralComp system GeneralComp { + f_param(f_test(1)); + setverdict(pass); + } + + control { + execute(TC_NegSem_050402_actual_parameters_186()); + } +} diff --git a/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_187.ttcn b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_187.ttcn new file mode 100644 index 0000000..ed6b345 --- /dev/null +++ b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_187.ttcn @@ -0,0 +1,41 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that fuzzy templates cannot be referenced during evaluation of a deterministic fuzzy parameter + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters passed to fuzzy or lazy formal parameters shall fulfill the restrictions imposed on content +// of functions used in special places given in 16.1.4. +// The following operations shall not be used: +// m) Referencing lazy or fuzzy variables, parameters or templates that have not been declared deterministic. + +module NegSem_050402_actual_parameters_187 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + template @fuzzy integer m_int := 1; + } + + function f_test() runs on GeneralComp return template integer { + log(m_int); // forbidden reference + return ?; + } + + function f_param(template @fuzzy @deterministic integer p_param) runs on GeneralComp { + log(p_param); // causes validation + } + + testcase TC_NegSem_050402_actual_parameters_187() runs on GeneralComp system GeneralComp { + f_param(f_test()); + setverdict(pass); + } + + control { + execute(TC_NegSem_050402_actual_parameters_187()); + } +} diff --git a/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_188.ttcn b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_188.ttcn new file mode 100644 index 0000000..54bc3f1 --- /dev/null +++ b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_188.ttcn @@ -0,0 +1,41 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that the create operation cannot be used during evaluation of a deterministic fuzzy parameter + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters passed to fuzzy or lazy formal parameters shall fulfill the restrictions imposed on content +// of functions used in special places given in 16.1.4. +// The following operations shall not be used: +// a) All component operations, i.e. create, start (component), stop (component), kill, running (component), +// alive, done and killed (see notes 1, 3, 4 and 6). + +module NegSem_050402_actual_parameters_188 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() return template integer { + var GeneralComp v_ptc := GeneralComp.create; + return ?; + } + + function f_param(template @fuzzy @deterministic integer p_param) runs on GeneralComp { + log(p_param); // causes validation + } + + testcase TC_NegSem_050402_actual_parameters_188() runs on GeneralComp system GeneralComp { + f_param(f_test()); + setverdict(pass); + } + + control { + execute(TC_NegSem_050402_actual_parameters_188()); + } +} diff --git a/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_189.ttcn b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_189.ttcn new file mode 100644 index 0000000..0c2186e --- /dev/null +++ b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_189.ttcn @@ -0,0 +1,46 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that the component.start operation cannot be used during evaluation of a deterministic fuzzy parameter + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters passed to fuzzy or lazy formal parameters shall fulfill the restrictions imposed on content +// of functions used in special places given in 16.1.4. +// The following operations shall not be used: +// a) All component operations, i.e. create, start (component), stop (component), kill, running (component), +// alive, done and killed (see notes 1, 3, 4 and 6). + +module NegSem_050402_actual_parameters_189 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_ptcBehaviour() runs on GeneralComp { + log("PTC running"); + } + + function f_test(GeneralComp p_ptc) return template integer { + p_ptc.start(f_ptcBehaviour()); + return ?; + } + + function f_param(template @fuzzy @deterministic integer p_param) runs on GeneralComp { + log(p_param); // causes validation + } + + testcase TC_NegSem_050402_actual_parameters_189() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + f_param(f_test(v_ptc)); + setverdict(pass); + } + + control { + execute(TC_NegSem_050402_actual_parameters_189()); + } +} diff --git a/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_190.ttcn b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_190.ttcn new file mode 100644 index 0000000..53e0439 --- /dev/null +++ b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_190.ttcn @@ -0,0 +1,49 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that the component.stop operation cannot be used during evaluation of a deterministic fuzzy parameter + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters passed to fuzzy or lazy formal parameters shall fulfill the restrictions imposed on content +// of functions used in special places given in 16.1.4. +// The following operations shall not be used: +// a) All component operations, i.e. create, start (component), stop (component), kill, running (component), +// alive, done and killed (see notes 1, 3, 4 and 6). + +module NegSem_050402_actual_parameters_190 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_ptcBehaviour() runs on GeneralComp { + timer t_tmr := 10.0; + t_tmr.start; + t_tmr.timeout; + } + + function f_test(GeneralComp p_ptc) return template integer { + p_ptc.stop; + return ?; + } + + function f_param(template @fuzzy @deterministic integer p_param) runs on GeneralComp { + log(p_param); // causes validation + } + + testcase TC_NegSem_050402_actual_parameters_190() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + f_param(f_test(v_ptc)); + v_ptc.start(f_ptcBehaviour()); + setverdict(pass); + } + + control { + execute(TC_NegSem_050402_actual_parameters_190()); + } +} diff --git a/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_191.ttcn b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_191.ttcn new file mode 100644 index 0000000..bdaf244 --- /dev/null +++ b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_191.ttcn @@ -0,0 +1,49 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that the kill operation cannot be used during evaluation of a deterministic fuzzy parameter + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters passed to fuzzy or lazy formal parameters shall fulfill the restrictions imposed on content +// of functions used in special places given in 16.1.4. +// The following operations shall not be used: +// a) All component operations, i.e. create, start (component), stop (component), kill, running (component), +// alive, done and killed (see notes 1, 3, 4 and 6). + +module NegSem_050402_actual_parameters_191 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_ptcBehaviour() runs on GeneralComp { + timer t_tmr := 10.0; + t_tmr.start; + t_tmr.timeout; + } + + function f_test(GeneralComp p_ptc) return template integer { + p_ptc.kill; + return ?; + } + + function f_param(template @fuzzy @deterministic integer p_param) runs on GeneralComp { + log(p_param); // causes validation + } + + testcase TC_NegSem_050402_actual_parameters_191() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + f_param(f_test(v_ptc)); + v_ptc.start(f_ptcBehaviour()); + setverdict(pass); + } + + control { + execute(TC_NegSem_050402_actual_parameters_191()); + } +} diff --git a/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_192.ttcn b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_192.ttcn new file mode 100644 index 0000000..260e40a --- /dev/null +++ b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_192.ttcn @@ -0,0 +1,49 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that the component.running operation cannot be used during evaluation of a deterministic fuzzy parameter + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters passed to fuzzy or lazy formal parameters shall fulfill the restrictions imposed on content +// of functions used in special places given in 16.1.4. +// The following operations shall not be used: +// a) All component operations, i.e. create, start (component), stop (component), kill, running (component), +// alive, done and killed (see notes 1, 3, 4 and 6). + +module NegSem_050402_actual_parameters_192 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_ptcBehaviour() runs on GeneralComp { + timer t_tmr := 10.0; + t_tmr.start; + t_tmr.timeout; + } + + function f_test(GeneralComp p_ptc) return template integer { + if (p_ptc.running) { return ?; } + else { return 1; } + } + + function f_param(template @fuzzy @deterministic integer p_param) runs on GeneralComp { + log(p_param); // causes validation + } + + testcase TC_NegSem_050402_actual_parameters_192() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + f_param(f_test(v_ptc)); + v_ptc.start(f_ptcBehaviour()); + setverdict(pass); + } + + control { + execute(TC_NegSem_050402_actual_parameters_192()); + } +} diff --git a/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_193.ttcn b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_193.ttcn new file mode 100644 index 0000000..bd0c206 --- /dev/null +++ b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_193.ttcn @@ -0,0 +1,49 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that the alive operation cannot be used during evaluation of a deterministic fuzzy parameter + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters passed to fuzzy or lazy formal parameters shall fulfill the restrictions imposed on content +// of functions used in special places given in 16.1.4. +// The following operations shall not be used: +// a) All component operations, i.e. create, start (component), stop (component), kill, running (component), +// alive, done and killed (see notes 1, 3, 4 and 6). + +module NegSem_050402_actual_parameters_193 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_ptcBehaviour() runs on GeneralComp { + timer t_tmr := 10.0; + t_tmr.start; + t_tmr.timeout; + } + + function f_test(GeneralComp p_ptc) return template integer { + if (p_ptc.alive) { return ?; } + else { return 1; } + } + + function f_param(template @fuzzy @deterministic integer p_param) runs on GeneralComp { + log(p_param); // causes validation + } + + testcase TC_NegSem_050402_actual_parameters_193() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + f_param(f_test(v_ptc)); + v_ptc.start(f_ptcBehaviour()); + setverdict(pass); + } + + control { + execute(TC_NegSem_050402_actual_parameters_193()); + } +} diff --git a/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_194.ttcn b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_194.ttcn new file mode 100644 index 0000000..dc8f979 --- /dev/null +++ b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_194.ttcn @@ -0,0 +1,46 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that the done operation cannot be used during evaluation of a deterministic fuzzy parameter + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters passed to fuzzy or lazy formal parameters shall fulfill the restrictions imposed on content +// of functions used in special places given in 16.1.4. +// The following operations shall not be used: +// a) All component operations, i.e. create, start (component), stop (component), kill, running (component), +// alive, done and killed (see notes 1, 3, 4 and 6). + +module NegSem_050402_actual_parameters_194 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_ptcBehaviour() runs on GeneralComp { + } + + function f_test(GeneralComp p_ptc) return template integer { + p_ptc.done; + return ?; + } + + function f_param(template @fuzzy @deterministic integer p_param) runs on GeneralComp { + log(p_param); // causes validation + } + + testcase TC_NegSem_050402_actual_parameters_194() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + f_param(f_test(v_ptc)); + v_ptc.start(f_ptcBehaviour()); + setverdict(pass); + } + + control { + execute(TC_NegSem_050402_actual_parameters_194()); + } +} diff --git a/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_195.ttcn b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_195.ttcn new file mode 100644 index 0000000..c49fa1f --- /dev/null +++ b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_195.ttcn @@ -0,0 +1,46 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that the killed operation cannot be used during evaluation of a deterministic fuzzy parameter + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters passed to fuzzy or lazy formal parameters shall fulfill the restrictions imposed on content +// of functions used in special places given in 16.1.4. +// The following operations shall not be used: +// a) All component operations, i.e. create, start (component), stop (component), kill, running (component), +// alive, done and killed (see notes 1, 3, 4 and 6). + +module NegSem_050402_actual_parameters_195 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_ptcBehaviour() runs on GeneralComp { + } + + function f_test(GeneralComp p_ptc) return template integer { + p_ptc.killed; + return ?; + } + + function f_param(template @fuzzy @deterministic integer p_param) runs on GeneralComp { + log(p_param); // causes validation + } + + testcase TC_NegSem_050402_actual_parameters_195() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + f_param(f_test(v_ptc)); + v_ptc.start(f_ptcBehaviour()); + setverdict(pass); + } + + control { + execute(TC_NegSem_050402_actual_parameters_195()); + } +} diff --git a/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_196.ttcn b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_196.ttcn new file mode 100644 index 0000000..7628a3a --- /dev/null +++ b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_196.ttcn @@ -0,0 +1,41 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that the port.start operation cannot be used during evaluation of a deterministic fuzzy parameter + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters passed to fuzzy or lazy formal parameters shall fulfill the restrictions imposed on content +// of functions used in special places given in 16.1.4. +// The following operations shall not be used: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_050402_actual_parameters_196 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return template integer { + p.start; + return ?; + } + + function f_param(template @fuzzy @deterministic integer p_param) runs on GeneralComp { + log(p_param); // causes validation + } + + testcase TC_NegSem_050402_actual_parameters_196() runs on GeneralComp system GeneralComp { + f_param(f_test()); + setverdict(pass); + } + + control { + execute(TC_NegSem_050402_actual_parameters_196()); + } +} diff --git a/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_197.ttcn b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_197.ttcn new file mode 100644 index 0000000..e730289 --- /dev/null +++ b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_197.ttcn @@ -0,0 +1,41 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that the port.stop operation cannot be used during evaluation of a deterministic fuzzy parameter + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters passed to fuzzy or lazy formal parameters shall fulfill the restrictions imposed on content +// of functions used in special places given in 16.1.4. +// The following operations shall not be used: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_050402_actual_parameters_197 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return template integer { + p.stop; + return ?; + } + + function f_param(template @fuzzy @deterministic integer p_param) runs on GeneralComp { + log(p_param); // causes validation + } + + testcase TC_NegSem_050402_actual_parameters_197() runs on GeneralComp system GeneralComp { + f_param(f_test()); + setverdict(pass); + } + + control { + execute(TC_NegSem_050402_actual_parameters_197()); + } +} diff --git a/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_198.ttcn b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_198.ttcn new file mode 100644 index 0000000..aa5d152 --- /dev/null +++ b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_198.ttcn @@ -0,0 +1,41 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that the halt operation cannot be used during evaluation of a deterministic fuzzy parameter + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters passed to fuzzy or lazy formal parameters shall fulfill the restrictions imposed on content +// of functions used in special places given in 16.1.4. +// The following operations shall not be used: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_050402_actual_parameters_198 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return template integer { + p.halt; + return ?; + } + + function f_param(template @fuzzy @deterministic integer p_param) runs on GeneralComp { + log(p_param); // causes validation + } + + testcase TC_NegSem_050402_actual_parameters_198() runs on GeneralComp system GeneralComp { + f_param(f_test()); + setverdict(pass); + } + + control { + execute(TC_NegSem_050402_actual_parameters_198()); + } +} diff --git a/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_199.ttcn b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_199.ttcn new file mode 100644 index 0000000..ecd028b --- /dev/null +++ b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_199.ttcn @@ -0,0 +1,41 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that the clear operation cannot be used during evaluation of a deterministic fuzzy parameter + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters passed to fuzzy or lazy formal parameters shall fulfill the restrictions imposed on content +// of functions used in special places given in 16.1.4. +// The following operations shall not be used: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_050402_actual_parameters_199 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return template integer { + p.clear; + return ?; + } + + function f_param(template @fuzzy @deterministic integer p_param) runs on GeneralComp { + log(p_param); // causes validation + } + + testcase TC_NegSem_050402_actual_parameters_199() runs on GeneralComp system GeneralComp { + f_param(f_test()); + setverdict(pass); + } + + control { + execute(TC_NegSem_050402_actual_parameters_199()); + } +} diff --git a/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_200.ttcn b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_200.ttcn new file mode 100644 index 0000000..63ac812 --- /dev/null +++ b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_200.ttcn @@ -0,0 +1,41 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that the checkstate operation cannot be used during evaluation of a deterministic fuzzy parameter + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters passed to fuzzy or lazy formal parameters shall fulfill the restrictions imposed on content +// of functions used in special places given in 16.1.4. +// The following operations shall not be used: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_050402_actual_parameters_200 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return template integer { + if (p.checkstate("Started")) { return ?; } + else { return 1; } + } + + function f_param(template @fuzzy @deterministic integer p_param) runs on GeneralComp { + log(p_param); // causes validation + } + + testcase TC_NegSem_050402_actual_parameters_200() runs on GeneralComp system GeneralComp { + f_param(f_test()); + setverdict(pass); + } + + control { + execute(TC_NegSem_050402_actual_parameters_200()); + } +} diff --git a/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_201.ttcn b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_201.ttcn new file mode 100644 index 0000000..34f5ef1 --- /dev/null +++ b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_201.ttcn @@ -0,0 +1,42 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that the send operation cannot be used during evaluation of a deterministic fuzzy parameter + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters passed to fuzzy or lazy formal parameters shall fulfill the restrictions imposed on content +// of functions used in special places given in 16.1.4. +// The following operations shall not be used: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_050402_actual_parameters_201 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return template integer { + p.send(2); + return ?; + } + + function f_param(template @fuzzy @deterministic integer p_param) runs on GeneralComp { + log(p_param); // causes validation + } + + testcase TC_NegSem_050402_actual_parameters_201() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + f_param(f_test()); + setverdict(pass); + } + + control { + execute(TC_NegSem_050402_actual_parameters_201()); + } +} diff --git a/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_202.ttcn b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_202.ttcn new file mode 100644 index 0000000..8d229b6 --- /dev/null +++ b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_202.ttcn @@ -0,0 +1,43 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that the receive operation cannot be used during evaluation of a deterministic fuzzy parameter + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters passed to fuzzy or lazy formal parameters shall fulfill the restrictions imposed on content +// of functions used in special places given in 16.1.4. +// The following operations shall not be used: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_050402_actual_parameters_202 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return template integer { + p.receive(integer:?); + return ?; + } + + function f_param(template @fuzzy @deterministic integer p_param) runs on GeneralComp { + log(p_param); // causes validation + } + + testcase TC_NegSem_050402_actual_parameters_202() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + f_param(f_test()); + setverdict(pass); + } + + control { + execute(TC_NegSem_050402_actual_parameters_202()); + } +} diff --git a/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_203.ttcn b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_203.ttcn new file mode 100644 index 0000000..0664d6a --- /dev/null +++ b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_203.ttcn @@ -0,0 +1,43 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that the trigger operation cannot be used during evaluation of a deterministic fuzzy parameter + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters passed to fuzzy or lazy formal parameters shall fulfill the restrictions imposed on content +// of functions used in special places given in 16.1.4. +// The following operations shall not be used: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_050402_actual_parameters_203 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return template integer { + p.trigger(integer:?); + return ?; + } + + function f_param(template @fuzzy @deterministic integer p_param) runs on GeneralComp { + log(p_param); // causes validation + } + + testcase TC_NegSem_050402_actual_parameters_203() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + f_param(f_test()); + setverdict(pass); + } + + control { + execute(TC_NegSem_050402_actual_parameters_203()); + } +} diff --git a/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_204.ttcn b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_204.ttcn new file mode 100644 index 0000000..cf7e84a --- /dev/null +++ b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_204.ttcn @@ -0,0 +1,51 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that the call operation cannot be used during evaluation of a deterministic fuzzy parameter + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters passed to fuzzy or lazy formal parameters shall fulfill the restrictions imposed on content +// of functions used in special places given in 16.1.4. +// The following operations shall not be used: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_050402_actual_parameters_204 { + type port P message { + inout integer; + } + + signature S(); + + type port PSig procedure { + inout S; + } + + type component GeneralComp { + port P p; + port PSig psig; + } + + function f_test() runs on GeneralComp return template integer { + psig.call(S:{}, nowait); + return ?; + } + + function f_param(template @fuzzy @deterministic integer p_param) runs on GeneralComp { + log(p_param); // causes validation + } + + testcase TC_NegSem_050402_actual_parameters_204() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + connect(mtc:p, mtc:p); + connect(mtc:psig, v_ptc:psig); + f_param(f_test()); + setverdict(pass); + } + + control { + execute(TC_NegSem_050402_actual_parameters_204()); + } +} diff --git a/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_205.ttcn b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_205.ttcn new file mode 100644 index 0000000..302c285 --- /dev/null +++ b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_205.ttcn @@ -0,0 +1,56 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that the getcall operation cannot be used during evaluation of a deterministic fuzzy parameter + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters passed to fuzzy or lazy formal parameters shall fulfill the restrictions imposed on content +// of functions used in special places given in 16.1.4. +// The following operations shall not be used: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_050402_actual_parameters_205 { + type port P message { + inout integer; + } + + signature S(); + + type port PSig procedure { + inout S; + } + + type component GeneralComp { + port P p; + port PSig psig; + } + + function f_ptcBehaviour() runs on GeneralComp { + psig.call(S:{}, nowait); + } + + function f_test() runs on GeneralComp return template integer { + psig.getcall(S:?); + return ?; + } + + function f_param(template @fuzzy @deterministic integer p_param) runs on GeneralComp { + log(p_param); // causes validation + } + + testcase TC_NegSem_050402_actual_parameters_205() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + connect(mtc:p, mtc:p); + connect(mtc:psig, v_ptc:psig); + v_ptc.start(f_ptcBehaviour()); + f_param(f_test()); + setverdict(pass); + } + + control { + execute(TC_NegSem_050402_actual_parameters_205()); + } +} diff --git a/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_206.ttcn b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_206.ttcn new file mode 100644 index 0000000..9b1a4df --- /dev/null +++ b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_206.ttcn @@ -0,0 +1,57 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that the reply operation cannot be used during evaluation of a deterministic fuzzy parameter + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters passed to fuzzy or lazy formal parameters shall fulfill the restrictions imposed on content +// of functions used in special places given in 16.1.4. +// The following operations shall not be used: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_050402_actual_parameters_206 { + type port P message { + inout integer; + } + + signature S(); + + type port PSig procedure { + inout S; + } + + type component GeneralComp { + port P p; + port PSig psig; + } + + function f_ptcBehaviour() runs on GeneralComp { + psig.call(S:{}, nowait); + } + + function f_test() runs on GeneralComp return template integer { + psig.reply(S:{}); + return ?; + } + + function f_param(template @fuzzy @deterministic integer p_param) runs on GeneralComp { + log(p_param); // causes validation + } + + testcase TC_NegSem_050402_actual_parameters_206() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + connect(mtc:p, mtc:p); + connect(mtc:psig, v_ptc:psig); + v_ptc.start(f_ptcBehaviour()); + psig.getcall(S:?); + f_param(f_test()); + setverdict(pass); + } + + control { + execute(TC_NegSem_050402_actual_parameters_206()); + } +} diff --git a/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_207.ttcn b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_207.ttcn new file mode 100644 index 0000000..cd36ea0 --- /dev/null +++ b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_207.ttcn @@ -0,0 +1,58 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that the getreply operation cannot be used during evaluation of a deterministic fuzzy parameter + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters passed to fuzzy or lazy formal parameters shall fulfill the restrictions imposed on content +// of functions used in special places given in 16.1.4. +// The following operations shall not be used: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_050402_actual_parameters_207 { + type port P message { + inout integer; + } + + signature S(); + + type port PSig procedure { + inout S; + } + + type component GeneralComp { + port P p; + port PSig psig; + } + + function f_ptcBehaviour() runs on GeneralComp { + psig.getcall(S:?); + psig.reply(S:{}); + } + + function f_test() runs on GeneralComp return template integer { + psig.getreply(S:?); + return ?; + } + + function f_param(template @fuzzy @deterministic integer p_param) runs on GeneralComp { + log(p_param); // causes validation + } + + testcase TC_NegSem_050402_actual_parameters_207() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + connect(mtc:p, mtc:p); + connect(mtc:psig, v_ptc:psig); + v_ptc.start(f_ptcBehaviour()); + psig.call(S:{}, nowait); + f_param(f_test()); + setverdict(pass); + } + + control { + execute(TC_NegSem_050402_actual_parameters_207()); + } +} diff --git a/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_208.ttcn b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_208.ttcn new file mode 100644 index 0000000..6efdbaf --- /dev/null +++ b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_208.ttcn @@ -0,0 +1,56 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that the raise operation cannot be used during evaluation of a deterministic fuzzy parameter + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters passed to fuzzy or lazy formal parameters shall fulfill the restrictions imposed on content +// of functions used in special places given in 16.1.4. +// The following operations shall not be used: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_050402_actual_parameters_208 { + type port P message { + inout integer; + } + + signature S() exception (charstring); + + type port PSig procedure { + inout S; + } + + type component GeneralComp { + port P p; + port PSig psig; + } + + function f_ptcBehaviour() runs on GeneralComp { + psig.call(S:{}, nowait); + } + + function f_test() runs on GeneralComp return template integer { + psig.raise(S, "UserException"); + return ?; + } + + function f_param(template @fuzzy @deterministic integer p_param) runs on GeneralComp { + log(p_param); // causes validation + } + + testcase TC_NegSem_050402_actual_parameters_208() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + connect(mtc:p, mtc:p); + connect(mtc:psig, v_ptc:psig); + v_ptc.start(f_ptcBehaviour()); + f_param(f_test()); + setverdict(pass); + } + + control { + execute(TC_NegSem_050402_actual_parameters_208()); + } +} diff --git a/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_209.ttcn b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_209.ttcn new file mode 100644 index 0000000..ef43d99 --- /dev/null +++ b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_209.ttcn @@ -0,0 +1,58 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that the catch operation cannot be used during evaluation of a deterministic fuzzy parameter + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters passed to fuzzy or lazy formal parameters shall fulfill the restrictions imposed on content +// of functions used in special places given in 16.1.4. +// The following operations shall not be used: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_050402_actual_parameters_209 { + type port P message { + inout integer; + } + + signature S() exception (charstring); + + type port PSig procedure { + inout S; + } + + type component GeneralComp { + port P p; + port PSig psig; + } + + function f_ptcBehaviour() runs on GeneralComp { + psig.getcall(S:?); + psig.raise(S, "UserException"); + } + + function f_test() runs on GeneralComp return template integer { + psig.catch(S, charstring:?); + return ?; + } + + function f_param(template @fuzzy @deterministic integer p_param) runs on GeneralComp { + log(p_param); // causes validation + } + + testcase TC_NegSem_050402_actual_parameters_209() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + connect(mtc:p, mtc:p); + connect(mtc:psig, v_ptc:psig); + v_ptc.start(f_ptcBehaviour()); + psig.call(S:{}, nowait); + f_param(f_test()); + setverdict(pass); + } + + control { + execute(TC_NegSem_050402_actual_parameters_209()); + } +} diff --git a/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_210.ttcn b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_210.ttcn new file mode 100644 index 0000000..4527a22 --- /dev/null +++ b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_210.ttcn @@ -0,0 +1,43 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that the check operation cannot be used during evaluation of a deterministic fuzzy parameter + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters passed to fuzzy or lazy formal parameters shall fulfill the restrictions imposed on content +// of functions used in special places given in 16.1.4. +// The following operations shall not be used: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_050402_actual_parameters_210 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return template integer { + p.check; + return ?; + } + + function f_param(template @fuzzy @deterministic integer p_param) runs on GeneralComp { + log(p_param); // causes validation + } + + testcase TC_NegSem_050402_actual_parameters_210() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + f_param(f_test()); + setverdict(pass); + } + + control { + execute(TC_NegSem_050402_actual_parameters_210()); + } +} diff --git a/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_211.ttcn b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_211.ttcn new file mode 100644 index 0000000..7e79552 --- /dev/null +++ b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_211.ttcn @@ -0,0 +1,41 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that the connect operation cannot be used during evaluation of a deterministic fuzzy parameter + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters passed to fuzzy or lazy formal parameters shall fulfill the restrictions imposed on content +// of functions used in special places given in 16.1.4. +// The following operations shall not be used: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_050402_actual_parameters_211 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return template integer { + connect(mtc:p, mtc:p); + return ?; + } + + function f_param(template @fuzzy @deterministic integer p_param) runs on GeneralComp { + log(p_param); // causes validation + } + + testcase TC_NegSem_050402_actual_parameters_211() runs on GeneralComp system GeneralComp { + f_param(f_test()); + setverdict(pass); + } + + control { + execute(TC_NegSem_050402_actual_parameters_211()); + } +} diff --git a/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_212.ttcn b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_212.ttcn new file mode 100644 index 0000000..0f4b4cb --- /dev/null +++ b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_212.ttcn @@ -0,0 +1,41 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that the disconnect operation cannot be used during evaluation of a deterministic fuzzy parameter + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters passed to fuzzy or lazy formal parameters shall fulfill the restrictions imposed on content +// of functions used in special places given in 16.1.4. +// The following operations shall not be used: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_050402_actual_parameters_212 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return template integer { + disconnect(mtc:p, mtc:p); + return ?; + } + + function f_param(template @fuzzy @deterministic integer p_param) runs on GeneralComp { + log(p_param); // causes validation + } + + testcase TC_NegSem_050402_actual_parameters_212() runs on GeneralComp system GeneralComp { + f_param(f_test()); + setverdict(pass); + } + + control { + execute(TC_NegSem_050402_actual_parameters_212()); + } +} diff --git a/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_213.ttcn b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_213.ttcn new file mode 100644 index 0000000..0acc320 --- /dev/null +++ b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_213.ttcn @@ -0,0 +1,41 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that the map operation cannot be used during evaluation of a deterministic fuzzy parameter + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters passed to fuzzy or lazy formal parameters shall fulfill the restrictions imposed on content +// of functions used in special places given in 16.1.4. +// The following operations shall not be used: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_050402_actual_parameters_213 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp system GeneralComp return template integer { + map(mtc:p, system:p); + return ?; + } + + function f_param(template @fuzzy @deterministic integer p_param) runs on GeneralComp { + log(p_param); // causes validation + } + + testcase TC_NegSem_050402_actual_parameters_213() runs on GeneralComp system GeneralComp { + f_param(f_test()); + setverdict(pass); + } + + control { + execute(TC_NegSem_050402_actual_parameters_213()); + } +} diff --git a/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_214.ttcn b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_214.ttcn new file mode 100644 index 0000000..4a7dbc9 --- /dev/null +++ b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_214.ttcn @@ -0,0 +1,43 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that the unmap operation cannot be used during evaluation of a deterministic fuzzy parameter + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters passed to fuzzy or lazy formal parameters shall fulfill the restrictions imposed on content +// of functions used in special places given in 16.1.4. +// The following operations shall not be used: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_050402_actual_parameters_214 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp system GeneralComp return template integer { + unmap(mtc:p, system:p); + return ?; + } + + function f_param(template @fuzzy @deterministic integer p_param) runs on GeneralComp { + log(p_param); // causes validation + } + + testcase TC_NegSem_050402_actual_parameters_214() runs on GeneralComp system GeneralComp { + f_param(f_test()); map(mtc:p, system:p); + + setverdict(pass); + + } + + control { + execute(TC_NegSem_050402_actual_parameters_214()); + } +} diff --git a/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_215.ttcn b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_215.ttcn new file mode 100644 index 0000000..53c2212 --- /dev/null +++ b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_215.ttcn @@ -0,0 +1,40 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that the action operation cannot be used during evaluation of a deterministic fuzzy parameter + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters passed to fuzzy or lazy formal parameters shall fulfill the restrictions imposed on content +// of functions used in special places given in 16.1.4. +// The following operations shall not be used: +// c) The action operation (see notes 2 and 6). + +module NegSem_050402_actual_parameters_215 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return template integer { + action("My action"); + return ?; + } + + function f_param(template @fuzzy @deterministic integer p_param) runs on GeneralComp { + log(p_param); // causes validation + } + + testcase TC_NegSem_050402_actual_parameters_215() runs on GeneralComp system GeneralComp { + f_param(f_test()); + setverdict(pass); + } + + control { + execute(TC_NegSem_050402_actual_parameters_215()); + } +} diff --git a/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_216.ttcn b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_216.ttcn new file mode 100644 index 0000000..4d0d022 --- /dev/null +++ b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_216.ttcn @@ -0,0 +1,41 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that the timer.start operation cannot be used during evaluation of a deterministic fuzzy parameter + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters passed to fuzzy or lazy formal parameters shall fulfill the restrictions imposed on content +// of functions used in special places given in 16.1.4. +// The following operations shall not be used: +// d) All timer operations, i.e. start (timer), stop (timer), running (timer), read, timeout (see notes 4 and 6). + +module NegSem_050402_actual_parameters_216 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + timer tc_tmr := 0.1; + } + + function f_test() runs on GeneralComp return template integer { + tc_tmr.start; + return ?; + } + + function f_param(template @fuzzy @deterministic integer p_param) runs on GeneralComp { + log(p_param); // causes validation + } + + testcase TC_NegSem_050402_actual_parameters_216() runs on GeneralComp system GeneralComp { + f_param(f_test()); + setverdict(pass); + } + + control { + execute(TC_NegSem_050402_actual_parameters_216()); + } +} diff --git a/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_217.ttcn b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_217.ttcn new file mode 100644 index 0000000..468e0da --- /dev/null +++ b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_217.ttcn @@ -0,0 +1,43 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that the timer.stop operation cannot be used during evaluation of a deterministic fuzzy parameter + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters passed to fuzzy or lazy formal parameters shall fulfill the restrictions imposed on content +// of functions used in special places given in 16.1.4. +// The following operations shall not be used: +// d) All timer operations, i.e. start (timer), stop (timer), running (timer), read, timeout (see notes 4 and 6). + +module NegSem_050402_actual_parameters_217 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + timer tc_tmr := 0.1; + } + + function f_test() runs on GeneralComp return template integer { + tc_tmr.stop; + return ?; + } + + function f_param(template @fuzzy @deterministic integer p_param) runs on GeneralComp { + log(p_param); // causes validation + } + + testcase TC_NegSem_050402_actual_parameters_217() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + tc_tmr.start; + f_param(f_test()); + setverdict(pass); + } + + control { + execute(TC_NegSem_050402_actual_parameters_217()); + } +} diff --git a/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_218.ttcn b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_218.ttcn new file mode 100644 index 0000000..4ff3be2 --- /dev/null +++ b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_218.ttcn @@ -0,0 +1,42 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that the timer.running operation cannot be used during evaluation of a deterministic fuzzy parameter + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters passed to fuzzy or lazy formal parameters shall fulfill the restrictions imposed on content +// of functions used in special places given in 16.1.4. +// The following operations shall not be used: +// d) All timer operations, i.e. start (timer), stop (timer), running (timer), read, timeout (see notes 4 and 6). + +module NegSem_050402_actual_parameters_218 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + timer tc_tmr := 0.1; + } + + function f_test() runs on GeneralComp return template integer { + if (tc_tmr.running) { return ?; } + else { return 1; } + } + + function f_param(template @fuzzy @deterministic integer p_param) runs on GeneralComp { + log(p_param); // causes validation + } + + testcase TC_NegSem_050402_actual_parameters_218() runs on GeneralComp system GeneralComp { + tc_tmr.start; + f_param(f_test()); + setverdict(pass); + } + + control { + execute(TC_NegSem_050402_actual_parameters_218()); + } +} diff --git a/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_219.ttcn b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_219.ttcn new file mode 100644 index 0000000..803febb --- /dev/null +++ b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_219.ttcn @@ -0,0 +1,42 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that the read operation cannot be used during evaluation of a deterministic fuzzy parameter + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters passed to fuzzy or lazy formal parameters shall fulfill the restrictions imposed on content +// of functions used in special places given in 16.1.4. +// The following operations shall not be used: +// d) All timer operations, i.e. start (timer), stop (timer), running (timer), read, timeout (see notes 4 and 6). + +module NegSem_050402_actual_parameters_219 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + timer tc_tmr := 0.1; + } + + function f_test() runs on GeneralComp return template integer { + if (tc_tmr.read > 0.0) { return ?; } + else { return 1; } + } + + function f_param(template @fuzzy @deterministic integer p_param) runs on GeneralComp { + log(p_param); // causes validation + } + + testcase TC_NegSem_050402_actual_parameters_219() runs on GeneralComp system GeneralComp { + tc_tmr.start; + f_param(f_test()); + setverdict(pass); + } + + control { + execute(TC_NegSem_050402_actual_parameters_219()); + } +} diff --git a/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_220.ttcn b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_220.ttcn new file mode 100644 index 0000000..7e78028 --- /dev/null +++ b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_220.ttcn @@ -0,0 +1,42 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that the timeout operation cannot be used during evaluation of a deterministic fuzzy parameter + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters passed to fuzzy or lazy formal parameters shall fulfill the restrictions imposed on content +// of functions used in special places given in 16.1.4. +// The following operations shall not be used: +// d) All timer operations, i.e. start (timer), stop (timer), running (timer), read, timeout (see notes 4 and 6). + +module NegSem_050402_actual_parameters_220 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + timer tc_tmr := 0.1; + } + + function f_test() runs on GeneralComp return template integer { + any timer.timeout; + return ?; + } + + function f_param(template @fuzzy @deterministic integer p_param) runs on GeneralComp { + log(p_param); // causes validation + } + + testcase TC_NegSem_050402_actual_parameters_220() runs on GeneralComp system GeneralComp { + tc_tmr.start; + f_param(f_test()); + setverdict(pass); + } + + control { + execute(TC_NegSem_050402_actual_parameters_220()); + } +} diff --git a/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_221.ttcn b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_221.ttcn new file mode 100644 index 0000000..8ed11f2 --- /dev/null +++ b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_221.ttcn @@ -0,0 +1,48 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that a non-deterministic external function call cannot be used during evaluation of a deterministic fuzzy parameter + ** @verdict pass reject + ** @configuration external_functions + ***************************************************/ + +// The following requirement is tested: +// Actual parameters passed to fuzzy or lazy formal parameters shall fulfill the restrictions imposed on content +// of functions used in special places given in 16.1.4. +// The following operations shall not be used: +// e) Calling non-deterministic external functions, i.e. external functions where the resulting values for actual +// inout or out parameters or the return value may differ for different invocations with the same actual in and +// inout parameters (see notes 4 and 6). + +module NegSem_050402_actual_parameters_221 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + /** + * @return always true + */ + external function xf_NegSem_050402_actual_parameters_001() return boolean; + + function f_test() runs on GeneralComp return template integer { + if (xf_NegSem_050402_actual_parameters_001()) { return ?; } + else { return 1; } + } + + function f_param(template @fuzzy @deterministic integer p_param) runs on GeneralComp { + log(p_param); // causes validation + } + + testcase TC_NegSem_050402_actual_parameters_221() runs on GeneralComp system GeneralComp { + f_param(f_test()); + setverdict(pass); + } + + control { + execute(TC_NegSem_050402_actual_parameters_221()); + } +} diff --git a/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_222.ttcn b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_222.ttcn new file mode 100644 index 0000000..13dba2a --- /dev/null +++ b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_222.ttcn @@ -0,0 +1,40 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that the predefined rnd function cannot be used during evaluation of a deterministic fuzzy parameter + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters passed to fuzzy or lazy formal parameters shall fulfill the restrictions imposed on content +// of functions used in special places given in 16.1.4. +// The following operations shall not be used: +// f) Calling the rnd predefined function (see notes 4 and 6). + +module NegSem_050402_actual_parameters_222 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return template integer { + if (rnd() > 0.5) { return ?; } + else { return 1; } + } + + function f_param(template @fuzzy @deterministic integer p_param) runs on GeneralComp { + log(p_param); // causes validation + } + + testcase TC_NegSem_050402_actual_parameters_222() runs on GeneralComp system GeneralComp { + f_param(f_test()); + setverdict(pass); + } + + control { + execute(TC_NegSem_050402_actual_parameters_222()); + } +} diff --git a/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_223.ttcn b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_223.ttcn new file mode 100644 index 0000000..a9d2378 --- /dev/null +++ b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_223.ttcn @@ -0,0 +1,42 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify a function called uring evaluation of a deterministic fuzzy parameter cannot contain an assignment of a component variable (in non-deterministic fuzzy parameters) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters passed to fuzzy or lazy formal parameters shall fulfill the restrictions imposed on content +// of functions used in special places given in 16.1.4. +// The following operations shall not be used: +// g) Changing of component variables, i.e. using component variables on the left-hand side of assignments, +// and in the instantiation of out and inout parameters (see notes 4 and 6). + +module NegSem_050402_actual_parameters_223 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + var integer vc_int; + } + + function f_test() runs on GeneralComp return template integer { + vc_int := 1; + return ?; + } + + function f_param(template @fuzzy @deterministic integer p_param) runs on GeneralComp { + log(p_param); // causes validation + } + + testcase TC_NegSem_050402_actual_parameters_223() runs on GeneralComp system GeneralComp { + f_param(f_test()); + setverdict(pass); + } + + control { + execute(TC_NegSem_050402_actual_parameters_223()); + } +} diff --git a/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_224.ttcn b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_224.ttcn new file mode 100644 index 0000000..d068992 --- /dev/null +++ b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_224.ttcn @@ -0,0 +1,46 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify a function called during evaluation of a deterministic fuzzy parameter cannot contain a component variable used as an actual out parameter + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters passed to fuzzy or lazy formal parameters shall fulfill the restrictions imposed on content +// of functions used in special places given in 16.1.4. +// The following operations shall not be used: +// g) Changing of component variables, i.e. using component variables on the left-hand side of assignments, +// and in the instantiation of out and inout parameters (see notes 4 and 6). + +module NegSem_050402_actual_parameters_224 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + var integer vc_int; + } + + function f_out (out integer p_out) { + p_out := 1; + } + + function f_test() runs on GeneralComp return template integer { + f_out(vc_int); + return ?; + } + + function f_param(template @fuzzy @deterministic integer p_param) runs on GeneralComp { + log(p_param); // causes validation + } + + testcase TC_NegSem_050402_actual_parameters_224() runs on GeneralComp system GeneralComp { + f_param(f_test()); + setverdict(pass); + } + + control { + execute(TC_NegSem_050402_actual_parameters_224()); + } +} diff --git a/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_225.ttcn b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_225.ttcn new file mode 100644 index 0000000..763d7f8 --- /dev/null +++ b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_225.ttcn @@ -0,0 +1,46 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify a function called during evaluation of a deterministic fuzzy parameter cannot contain a component variable used as an actual inout parameter + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters passed to fuzzy or lazy formal parameters shall fulfill the restrictions imposed on content +// of functions used in special places given in 16.1.4. +// The following operations shall not be used: +// g) Changing of component variables, i.e. using component variables on the left-hand side of assignments, +// and in the instantiation of out and inout parameters (see notes 4 and 6). + +module NegSem_050402_actual_parameters_225 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + var integer vc_int := 0; + } + + function f_inout (inout integer p_inout) { + p_inout := 1; + } + + function f_test() runs on GeneralComp return template integer { + f_inout(vc_int); + return ?; + } + + function f_param(template @fuzzy @deterministic integer p_param) runs on GeneralComp { + log(p_param); // causes validation + } + + testcase TC_NegSem_050402_actual_parameters_225() runs on GeneralComp system GeneralComp { + f_param(f_test()); + setverdict(pass); + } + + control { + execute(TC_NegSem_050402_actual_parameters_225()); + } +} diff --git a/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_226.ttcn b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_226.ttcn new file mode 100644 index 0000000..84946c8 --- /dev/null +++ b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_226.ttcn @@ -0,0 +1,40 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that the setverdict operation cannot be used during evaluation of a deterministic fuzzy parameter + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters passed to fuzzy or lazy formal parameters shall fulfill the restrictions imposed on content +// of functions used in special places given in 16.1.4. +// The following operations shall not be used: +// h) Calling the setverdict operation (see notes 4 and 6). + +module NegSem_050402_actual_parameters_226 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return template integer { + setverdict(pass); + return ?; + } + + function f_param(template @fuzzy @deterministic integer p_param) runs on GeneralComp { + log(p_param); // causes validation + } + + testcase TC_NegSem_050402_actual_parameters_226() runs on GeneralComp system GeneralComp { + f_param(f_test()); + setverdict(pass); + } + + control { + execute(TC_NegSem_050402_actual_parameters_226()); + } +} diff --git a/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_227.ttcn b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_227.ttcn new file mode 100644 index 0000000..a0a53f2 --- /dev/null +++ b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_227.ttcn @@ -0,0 +1,44 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that the activate operation cannot be used during evaluation of a deterministic fuzzy parameter + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters passed to fuzzy or lazy formal parameters shall fulfill the restrictions imposed on content +// of functions used in special places given in 16.1.4. +// The following operations shall not be used: +// i) Activation and deactivation of defaults, i.e. the activate and deactivate statements (see notes 5 and 6). + +module NegSem_050402_actual_parameters_227 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + altstep a_anyTimer() runs on GeneralComp { + [] any timer.timeout {} + } + + function f_test() runs on GeneralComp return template integer { + activate(a_anyTimer()); + return ?; + } + + function f_param(template @fuzzy @deterministic integer p_param) runs on GeneralComp { + log(p_param); // causes validation + } + + testcase TC_NegSem_050402_actual_parameters_227() runs on GeneralComp system GeneralComp { + f_param(f_test()); + setverdict(pass); + } + + control { + execute(TC_NegSem_050402_actual_parameters_227()); + } +} diff --git a/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_228.ttcn b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_228.ttcn new file mode 100644 index 0000000..a41ee65 --- /dev/null +++ b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_228.ttcn @@ -0,0 +1,46 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that the deactivate operation cannot be used during evaluation of a deterministic fuzzy parameter + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters passed to fuzzy or lazy formal parameters shall fulfill the restrictions imposed on content +// of functions used in special places given in 16.1.4. +// The following operations shall not be used: +// i) Activation and deactivation of defaults, i.e. the activate and deactivate statements (see notes 5 and 6). + +module NegSem_050402_actual_parameters_228 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + altstep a_anyTimer() runs on GeneralComp { + [] any timer.timeout {} + } + + function f_test() runs on GeneralComp return template integer { + deactivate; + return ?; + } + + function f_param(template @fuzzy @deterministic integer p_param) runs on GeneralComp { + log(p_param); // causes validation + } + + testcase TC_NegSem_050402_actual_parameters_228() runs on GeneralComp system GeneralComp { + activate(a_anyTimer()); + connect(mtc:p, mtc:p); + f_param(f_test()); + setverdict(pass); + } + + control { + execute(TC_NegSem_050402_actual_parameters_228()); + } +} diff --git a/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_229.ttcn b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_229.ttcn new file mode 100644 index 0000000..fecc933 --- /dev/null +++ b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_229.ttcn @@ -0,0 +1,44 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that a function called during evaluation of a deterministic fuzzy parameter cannot contain fuzzy parameters + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters passed to fuzzy or lazy formal parameters shall fulfill the restrictions imposed on content +// of functions used in special places given in 16.1.4. +// The following operations shall not be used: +// k) Calling functions and external functions with @fuzzy formal parameters and variables (see notes 4 and 9). + +module NegSem_050402_actual_parameters_229 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test(@fuzzy integer p_par) return template integer { + return (0..5); + } + + function f_eval() return integer { + return 10; + } + + function f_param(template @fuzzy @deterministic integer p_param) runs on GeneralComp { + log(p_param); // causes validation + } + + testcase TC_NegSem_050402_actual_parameters_229() runs on GeneralComp system GeneralComp { + var @fuzzy integer v_int := f_eval(); + f_param(f_test(v_int)); + setverdict(pass); + } + + control { + execute(TC_NegSem_050402_actual_parameters_229()); + } +} diff --git a/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_230.ttcn b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_230.ttcn new file mode 100644 index 0000000..116fb1f --- /dev/null +++ b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_230.ttcn @@ -0,0 +1,41 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that an external function called during evaluation of a deterministic fuzzy parameter cannot contain fuzzy parameters + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters passed to fuzzy or lazy formal parameters shall fulfill the restrictions imposed on content +// of functions used in special places given in 16.1.4. +// The following operations shall not be used: +// k) Calling functions and external functions with @fuzzy formal parameters and variables (see notes 4 and 9). + +module NegSem_050402_actual_parameters_230 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + external function @deterministic f_test(@fuzzy integer p_par) return template integer; + + function f_eval() return integer { + return 10; + } + + function f_param(template @fuzzy @deterministic integer p_param) runs on GeneralComp { + log(p_param); // causes validation + } + + testcase TC_NegSem_050402_actual_parameters_230() runs on GeneralComp system GeneralComp { + f_param(f_test(1)); + setverdict(pass); + } + + control { + execute(TC_NegSem_050402_actual_parameters_230()); + } +} diff --git a/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_231.ttcn b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_231.ttcn new file mode 100644 index 0000000..4a5fc6b --- /dev/null +++ b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_231.ttcn @@ -0,0 +1,44 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that a function called during evaluation of a deterministic fuzzy parameter cannot contain fuzzy variables + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters passed to fuzzy or lazy formal parameters shall fulfill the restrictions imposed on content +// of functions used in special places given in 16.1.4. +// The following operations shall not be used: +// k) Calling functions and external functions with @fuzzy formal parameters and variables (see notes 4 and 9). + +module NegSem_050402_actual_parameters_231 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() return template integer { + var @fuzzy integer v_int := f_eval(); + return (0..v_int); + } + + function f_eval() return integer { + return 100; + } + + function f_param(template @fuzzy @deterministic integer p_param) runs on GeneralComp { + log(p_param); // causes validation + } + + testcase TC_NegSem_050402_actual_parameters_231() runs on GeneralComp system GeneralComp { + f_param(f_test()); + setverdict(pass); + } + + control { + execute(TC_NegSem_050402_actual_parameters_231()); + } +} diff --git a/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_232.ttcn b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_232.ttcn new file mode 100644 index 0000000..7d38e4c --- /dev/null +++ b/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_232.ttcn @@ -0,0 +1,40 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that a function called during evaluation of a deterministic fuzzy parameter cannot contain the setencode operation + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters passed to fuzzy or lazy formal parameters shall fulfill the restrictions imposed on content +// of functions used in special places given in 16.1.4. +// The following operations shall not be used: +// l) The setencode operation (see note 8 and clause 27.9). + +module NegSem_050402_actual_parameters_232 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return template integer { + p.setencode(integer, "Binary"); + return ?; + } + + function f_param(template @fuzzy @deterministic integer p_param) runs on GeneralComp { + log(p_param); // causes validation + } + + testcase TC_NegSem_050402_actual_parameters_232() runs on GeneralComp system GeneralComp { + f_param(f_test()); + setverdict(pass); + } + + control { + execute(TC_NegSem_050402_actual_parameters_232()); + } +} diff --git a/core_language/05_basic_language_elements/05_toplevel/NegSyn_05_TopLevel_001.ttcn b/core_language/05_basic_language_elements/05_toplevel/NegSyn_05_TopLevel_001.ttcn old mode 100755 new mode 100644 diff --git a/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/06010101_accessing_individual_string_elements/NegSem_06010101_AccessStringElements_001.ttcn b/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/06010101_accessing_individual_string_elements/NegSem_06010101_AccessStringElements_001.ttcn index 9e3618e..8841ae2 100644 --- a/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/06010101_accessing_individual_string_elements/NegSem_06010101_AccessStringElements_001.ttcn +++ b/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/06010101_accessing_individual_string_elements/NegSem_06010101_AccessStringElements_001.ttcn @@ -1,5 +1,5 @@ /*************************************************** - ** @author STF 521 + ** @author STF 521, updated by STF 572 ** @version 0.0.1 ** @purpose 1:6.1.1.1, Access bitstring elements ** @verdict pass reject @@ -16,9 +16,9 @@ module NegSem_06010101_AccessStringElements_001 { type component GeneralComp {} testcase TC_NegSem_06010101_AccessStringElements_001() runs on GeneralComp { - var octetstring v_b := '100010'O; - v_b[1] := '11'O; //error: only individual elements can be accessed - if (v_b == '100001'O){ + var bitstring v_b := '100010'B; + v_b[1] := '11'B; //error: only individual elements can be accessed + if (v_b == '100001'B){ setverdict(pass); } else { diff --git a/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/060101_toplevel/Sem_060101_TopLevel_007.ttcn b/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/060101_toplevel/Sem_060101_TopLevel_007.ttcn old mode 100755 new mode 100644 diff --git a/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010203_ranges/Sem_06010203_Ranges_009.ttcn b/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010203_ranges/Sem_06010203_Ranges_009.ttcn new file mode 100644 index 0000000..cdb11c5 --- /dev/null +++ b/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010203_ranges/Sem_06010203_Ranges_009.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:6.1.2.3, Assign values with negative integer range. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + + /* The following requirement is tested: range with all negative integer numbers */ + +module Sem_06010203_Ranges_009 { + + type integer MyIntegerRange (-infinity .. -1); + + type component GeneralComp {} + + testcase TC_Sem_06010203_Ranges_009() runs on GeneralComp { + var MyIntegerRange v_i; + v_i := -1; + v_i := -100; + v_i := -255; + v_i := -10000; + setverdict(pass); + } + + control{ + execute(TC_Sem_06010203_Ranges_009()); + } +} \ No newline at end of file diff --git a/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010205_pattern_subtyping_of_character_string_types/NegSyn_06010205_StringPattern_001.ttcn b/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010205_pattern_subtyping_of_character_string_types/NegSyn_06010205_StringPattern_001.ttcn old mode 100755 new mode 100644 diff --git a/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010205_pattern_subtyping_of_character_string_types/NegSyn_06010205_StringPattern_002.ttcn b/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010205_pattern_subtyping_of_character_string_types/NegSyn_06010205_StringPattern_002.ttcn old mode 100755 new mode 100644 diff --git a/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010205_pattern_subtyping_of_character_string_types/Sem_06010205_StringPattern_003.ttcn b/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010205_pattern_subtyping_of_character_string_types/Sem_06010205_StringPattern_003.ttcn old mode 100755 new mode 100644 diff --git a/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010206_mixing_subtyping_mechanisms/0601020602_using_length_restriction_with_other_constraints/Sem_0601020602_StringMixing_007.ttcn b/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010206_mixing_subtyping_mechanisms/0601020602_using_length_restriction_with_other_constraints/Sem_0601020602_StringMixing_007.ttcn old mode 100755 new mode 100644 diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/060201_toplevel/Sem_060201_RecordTypeValues_005.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/060201_toplevel/Sem_060201_RecordTypeValues_005.ttcn new file mode 100644 index 0000000..6ca6959 --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/060201_toplevel/Sem_060201_RecordTypeValues_005.ttcn @@ -0,0 +1,39 @@ +/*************************************************** + ** @author 548 + ** @version 0.0.1 + ** @purpose 1:6.2, assignment notation for record values containing union with @default + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// using the @default modifier before the type of the alternative. For unions with a default alternative, special type compatibility rules apply (see clause 6.3.2.4) which allow using the union value as compatible with the type of the default alternative. + +module Sem_060201_RecordTypeValues_005 { + +type component GeneralComp { +} + + type record R { + integer f1, + U f2 + } + + type union U { + @default integer option1, + charstring option2 + } + + +testcase TC_Sem_060201_RecordTypeValues_005() runs on GeneralComp { + + var R v_assigned := { 1, 2 }; // implicit usage of default modifier in f2 + if (match(v_assigned.f1, 1) and match(v_assigned.f2, 2)) { + setverdict(pass); + } else { setverdict(fail); } +} + +control { + execute(TC_Sem_060201_RecordTypeValues_005()); +} + +} diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/060202_set_type_and_values/Sem_060202_SetTypeValues_009.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/060202_set_type_and_values/Sem_060202_SetTypeValues_009.ttcn new file mode 100644 index 0000000..8909238 --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/060202_set_type_and_values/Sem_060202_SetTypeValues_009.ttcn @@ -0,0 +1,46 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:6.2.2, assignment notation for sets containing union with @default + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + // The following requirement is tested: +// using the @default modifier before the type of the alternative. For unions with a default alternative, special type compatibility rules apply (see clause 6.3.2.4) which allow using the union value as compatible with the type of the default alternative. + +module Sem_060202_SetTypeValues_009 { + +type component GeneralComp { +} + +type union U { + @default integer option1, + charstring option2 + } + + type set S { + integer field1 (1 .. 10), + U field2 + } + + type S ConstrainedSet ({1, 1}, {2, { option2 := "xyz" }}); // implicit usage of the default modifier to assign value + + type ConstrainedSet.field2 MyInteger; + +testcase TC_Sem_060202_SetTypeValues_009() runs on GeneralComp { + + var MyInteger v_int := 2; + + if (match(v_int,2)) { + setverdict(pass); + } + else { + setverdict(fail); + } + +} + +control { + execute(TC_Sem_060202_SetTypeValues_009()); +} + +} diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/060204_enumerated_type_and_values/NegSem_060204_enumerated_type_and_values_014.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/060204_enumerated_type_and_values/NegSem_060204_enumerated_type_and_values_014.ttcn new file mode 100644 index 0000000..98a14e6 --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/060204_enumerated_type_and_values/NegSem_060204_enumerated_type_and_values_014.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:6.2.4, using enumerated value with assigned expression + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +/* Each user assigned expression shall be statically bound, known in compilation + * time, and evaluate to an integer value. + * */ + +module NegSem_060204_enumerated_type_and_values_014 { + + type component GeneralComp { + } + + type enumerated EDays { + Monday(bit2hex('0101'B)), Tuesday(1), Wednesday(2), Thursday(3), Friday(5) + }; // error: assigned expression shall be integer value + + testcase TC_NegSem_060204_enumerated_type_and_values_014() runs on GeneralComp { + } + + control { + execute(TC_NegSem_060204_enumerated_type_and_values_014()); + } +} \ No newline at end of file diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/060204_enumerated_type_and_values/NegSem_060204_enumerated_type_and_values_015.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/060204_enumerated_type_and_values/NegSem_060204_enumerated_type_and_values_015.ttcn new file mode 100644 index 0000000..4b6e25a --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/060204_enumerated_type_and_values/NegSem_060204_enumerated_type_and_values_015.ttcn @@ -0,0 +1,31 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:6.2.4, using enumerated value with assigned expression + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +/* Each user assigned expression shall be statically bound, known in compilation + * time, and evaluate to an integer value. + * */ + +module NegSem_060204_enumerated_type_and_values_015{ + + type component GeneralComp { + } + + type integer v_int; // unbound value + + type enumerated EDays { + Monday(v_int), Tuesday(1), Wednesday(2), Thursday(3), Friday(5) + }; // error: assigned expression shall be integer value + + testcase TC_NegSem_060204_enumerated_type_and_values_015() runs on GeneralComp { + + } + + control { + execute(TC_NegSem_060204_enumerated_type_and_values_015()); + } +} \ No newline at end of file diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/060204_enumerated_type_and_values/Sem_060204_enumerated_type_and_values_008.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/060204_enumerated_type_and_values/Sem_060204_enumerated_type_and_values_008.ttcn new file mode 100644 index 0000000..e300678 --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/060204_enumerated_type_and_values/Sem_060204_enumerated_type_and_values_008.ttcn @@ -0,0 +1,35 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:6.2.4, using user-assigned integer expressions for enums + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +//The following requirement is tested: +/* Each enumerated value may optionally have a user-assigned integer expressionor non-empty list of integer literal + * values or ranges of integer literal values, which is defined after the name of the enumerated value in parenthesis. + */ +module Sem_060204_enumerated_type_and_values_008 { + + type component GeneralComp { + } + + type enumerated EDays { + Monday(1), Tuesday(1+1), Wednesday(bit2int('0011'B)), Thursday(oct2int('34'O)), Friday(hex2int('FF'H)) + }; + // note: Monday(1), Tuesday(2), Wednesday(3), Thursday(28), Friday(255) + + testcase TC_Sem_060204_enumerated_type_and_values_008() runs on GeneralComp { + var EDays v_day0 := Monday, v_day2 := Tuesday, v_day3 := Wednesday, v_day4 := Thursday, v_day5 := Friday; + + if (enum2int(v_day0) == 1 and enum2int(v_day2) == 2 and enum2int(v_day3) == 3 and enum2int(v_day4) == 52 and enum2int(v_day5) == 255) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_060204_enumerated_type_and_values_008()); + } +} diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/060204_enumerated_type_and_values/Sem_060204_enumerated_type_and_values_009.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/060204_enumerated_type_and_values/Sem_060204_enumerated_type_and_values_009.ttcn new file mode 100644 index 0000000..3bdebb0 --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/060204_enumerated_type_and_values/Sem_060204_enumerated_type_and_values_009.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:6.2.4, Ensure that Each user-assigned integer number shall be distinct within a single enumerated type, all ranges of +all the values lists shall be disjoint and shall not include any of the used single integer values. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +//The following requirement is tested: +/* user-assigned integer number shall be distinct within a single enumerated type, all ranges of + * all the values lists shall be disjoint and shall not include any of the used single integer values. + * */ + +module Sem_060204_enumerated_type_and_values_009 { + + type component GeneralComp { + } + + type enumerated EDays { + Monday(1), Tuesday(2, 4..255) + }; + // note: Monday(1), Tuesday(2), Wednesday(3), Thursday(28), Friday(255) + + testcase TC_Sem_060204_enumerated_type_and_values_009() runs on GeneralComp { + var EDays v_day0 := Tuesday(5); + + if (not match(v_day0, Tuesday((6..10), 15, (20..225)))){ + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_060204_enumerated_type_and_values_009()); + } +} diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/060204_enumerated_type_and_values/Syn_060204_enumerated_type_and_values_003.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/060204_enumerated_type_and_values/Syn_060204_enumerated_type_and_values_003.ttcn new file mode 100644 index 0000000..195e182 --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/060204_enumerated_type_and_values/Syn_060204_enumerated_type_and_values_003.ttcn @@ -0,0 +1,19 @@ +/*************************************************** + ** @author STF 487, updated by 572 + ** @version 0.0.2 + ** @purpose 1:6.2.4, constant as user-assigned enumerated values + ** @verdict pass accept, noexecution + ***************************************************/ + +// The following requirement is tested: +// Each enumerated value may optionally have a user-assigned integer expression or +// non-empty list of integer literal values or ranges of integer literal values, +// which is defined after the name of the enumerated value in parenthesis. + +module Syn_060204_enumerated_type_and_values_003 { + + const integer c_int := 5; + type enumerated MyFirstEnumType { + Monday, Tuesday(c_int), Wednesday, Thursday, Friday + }; +} diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/060204_enumerated_type_and_values/Syn_060204_enumerated_type_and_values_004.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/060204_enumerated_type_and_values/Syn_060204_enumerated_type_and_values_004.ttcn new file mode 100644 index 0000000..ce53335 --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/060204_enumerated_type_and_values/Syn_060204_enumerated_type_and_values_004.ttcn @@ -0,0 +1,18 @@ +/*************************************************** + ** @author STF 487, updated by 572 + ** @version 0.0.2 + ** @purpose 1:6.2.4, expression as user-assigned enumerated value + ** @verdict pass accept, noexecution + ***************************************************/ + +// The following requirement is tested: +// Each enumerated value may optionally have a user-assigned integer expression or +// non-empty list of integer literal values or ranges of integer literal values, +// which is defined after the name of the enumerated value in parenthesis. + +module Syn_060204_enumerated_type_and_values_004 { + + type enumerated MyFirstEnumType { + Monday, Tuesday(2+3), Thursday, Friday + }; +} diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/06020501_referencing_fields_of_union_type/Sem_06020501_referencing_fields_of_union_type_009.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/06020501_referencing_fields_of_union_type/Sem_06020501_referencing_fields_of_union_type_009.ttcn new file mode 100644 index 0000000..193ac3f --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/06020501_referencing_fields_of_union_type/Sem_06020501_referencing_fields_of_union_type_009.ttcn @@ -0,0 +1,51 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:6.5.2, Ensure that union with record containing "implicit omit" handled correctly + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +/*The following requirement is tested: + * Restriction B: Expansion of record, record of, set, set of, and array values and intermediate fields shall follow + * the rules of item a) in clauses When using direct assignment notation in a scope where the optional + * attribute is set to "implicit omit", the uninitialized optional fields in the referenced value, shall + * implicitly be set to omit after the assignment in the new value, while mandatory fields shall remain unchanged + */ + +module Sem_06020501_referencing_fields_of_union_type_009 { + + type record R { + integer f1, + charstring f2 optional + } + + + type union MyUnionType + { + integer number, + R rec + }; + + type component GeneralComp { + }; + + + testcase TC_Sem_06020501_referencing_fields_of_union_type_009 () runs on GeneralComp { + var MyUnionType v_mut; + + var R myRec := {1, - } with { optional "implicit omit" }; + + v_mut.rec := myRec; + + if (match(v_mut.rec, { 1, omit })) { + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_06020501_referencing_fields_of_union_type_009()); + } +} \ No newline at end of file diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/06020501_referencing_fields_of_union_type/Sem_06020501_referencing_fields_of_union_type_010.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/06020501_referencing_fields_of_union_type/Sem_06020501_referencing_fields_of_union_type_010.ttcn new file mode 100644 index 0000000..48e9d82 --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/06020501_referencing_fields_of_union_type/Sem_06020501_referencing_fields_of_union_type_010.ttcn @@ -0,0 +1,50 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:6.5.2, Ensure that union with set containing "implicit omit" handled correctly + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +/*The following requirement is tested: + * Restriction B: Expansion of record, record of, set, set of, and array values and intermediate fields shall follow + * the rules of item a) in clauses When using direct assignment notation in a scope where the optional + * attribute is set to "implicit omit", the uninitialized optional fields in the referenced value, shall + * implicitly be set to omit after the assignment in the new value, while mandatory fields shall remain unchanged + */ + +module Sem_06020501_referencing_fields_of_union_type_010 { + + type set S { + integer f1, + charstring f2 optional + } + + + type union MyUnionType + { + integer number, + S fieldSet + }; + + type component GeneralComp { + }; + + + testcase TC_Sem_06020501_referencing_fields_of_union_type_010 () runs on GeneralComp { + var MyUnionType v_mut; + + var S mySet := {1, - } with { optional "implicit omit" }; + v_mut.fieldSet := mySet; + + if (match(v_mut.fieldSet, { 1, omit })) { + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_06020501_referencing_fields_of_union_type_010()); + } +} \ No newline at end of file diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/06020501_referencing_fields_of_union_type/Sem_06020501_referencing_fields_of_union_type_011.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/06020501_referencing_fields_of_union_type/Sem_06020501_referencing_fields_of_union_type_011.ttcn new file mode 100644 index 0000000..86bc230 --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/06020501_referencing_fields_of_union_type/Sem_06020501_referencing_fields_of_union_type_011.ttcn @@ -0,0 +1,55 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:6.5.2, Ensure that union with "record of" containing "implicit omit" handled correctly + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +/*The following requirement is tested: + * Restriction B: Expansion of record, record of, set, set of, and array values and intermediate fields shall follow + * the rules of item a) in clauses When using direct assignment notation in a scope where the optional + * attribute is set to "implicit omit", the uninitialized optional fields in the referenced value, shall + * implicitly be set to omit after the assignment in the new value, while mandatory fields shall remain unchanged + */ + +module Sem_06020501_referencing_fields_of_union_type_011 { + + type record of integer RI; + + type record R { + RI field1 optional, + integer field2 + } + + + + type union MyUnionType + { + integer option1, + R option2 + }; + + type component GeneralComp { + }; + + + testcase TC_Sem_06020501_referencing_fields_of_union_type_011 () runs on GeneralComp { + var MyUnionType v_mut; + + var R myRec := {-, 1 } with { optional "implicit omit" }; + + v_mut.option2 := myRec; + + + if (match(v_mut.option2, {omit, 1 })) { + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_06020501_referencing_fields_of_union_type_011()); + } +} \ No newline at end of file diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/06020501_referencing_fields_of_union_type/Sem_06020501_referencing_fields_of_union_type_012.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/06020501_referencing_fields_of_union_type/Sem_06020501_referencing_fields_of_union_type_012.ttcn new file mode 100644 index 0000000..44972d4 --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/06020501_referencing_fields_of_union_type/Sem_06020501_referencing_fields_of_union_type_012.ttcn @@ -0,0 +1,54 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:6.5.2, Ensure that union with "set of" containing "implicit omit" handled correctly + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +/*The following requirement is tested: + * Restriction B: Expansion of record, record of, set, set of, and array values and intermediate fields shall follow + * the rules of item a) in clauses When using direct assignment notation in a scope where the optional + * attribute is set to "implicit omit", the uninitialized optional fields in the referenced value, shall + * implicitly be set to omit after the assignment in the new value, while mandatory fields shall remain unchanged + */ + +module Sem_06020501_referencing_fields_of_union_type_012 { + + type set of integer SI; + + type record R { + SI field1 optional, + integer field2 + } + + + + type union MyUnionType + { + integer option1, + R option2 + }; + + type component GeneralComp { + }; + + + testcase TC_Sem_06020501_referencing_fields_of_union_type_012 () runs on GeneralComp { + var MyUnionType v_mut; + + var R myRec := {-,1} with { optional "implicit omit" }; + + v_mut.option2 := myRec; + + if (match(v_mut.option2, { omit, 1 })) { + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_06020501_referencing_fields_of_union_type_012()); + } +} \ No newline at end of file diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/060205_toplevel/NegSem_060205_top_level_006.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/060205_toplevel/NegSem_060205_top_level_006.ttcn new file mode 100644 index 0000000..a780a4c --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/060205_toplevel/NegSem_060205_top_level_006.ttcn @@ -0,0 +1,29 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:6.2.5, @default notation used for union value definition + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// incorrect type is given as default value + +module NegSem_060205_top_level_006 { + type component GeneralComp { + } + + type union U { + @default integer option1, + charstring option2 + } + + testcase TC_NegSem_060205_top_level_006() runs on GeneralComp { + var U v_choice := "abc"; // error default type should be integer + if (ischosen(v_choice.option1)) { setverdict(pass); } + else { setverdict(fail); } + } + + control{ + execute(TC_NegSem_060205_top_level_006()); + } +} \ No newline at end of file diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/060205_toplevel/NegSem_060205_top_level_007.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/060205_toplevel/NegSem_060205_top_level_007.ttcn new file mode 100644 index 0000000..ac3bea3 --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/060205_toplevel/NegSem_060205_top_level_007.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:6.2.5, @default notation used for union value definition + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// incorrect type is given as default value + +module NegSem_060205_top_level_007 { + type component GeneralComp { + } + + type union U { + @default integer option1, + charstring option2 + } + + testcase TC_NegSem_060205_top_level_007() runs on GeneralComp { + var U v_choice := {option2 := "abc"}; + var U v_anotherChoice := 123; + + var U v_result := v_choice + v_anotherChoice; // error type mismatch + + if (ischosen(v_result.option1)) { setverdict(pass); } + else { setverdict(fail); } + } + + control{ + execute(TC_NegSem_060205_top_level_007()); + } +} \ No newline at end of file diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/060205_toplevel/NegSem_060205_top_level_008.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/060205_toplevel/NegSem_060205_top_level_008.ttcn new file mode 100644 index 0000000..d05640d --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/060205_toplevel/NegSem_060205_top_level_008.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:6.2.5, The @default alternative shall not be of the anytype. + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +/* + * The @default alternative shall not be of the anytype. + * */ + +module NegSem_060205_top_level_008 { + type component GeneralComp { + } + + type union U { + @default anytype option1, // not allowed to use @default with anytype + charstring option2 + } + + testcase TC_NegSem_060205_top_level_008() runs on GeneralComp { + var U v_value; + v_value.option1.integer := 5; + + if (match(v_value.option1.integer, 5)) { setverdict(pass); } + else { setverdict(fail); } + } + + control{ + execute(TC_NegSem_060205_top_level_008()); + } +} \ No newline at end of file diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/060205_toplevel/Sem_060205_top_level_002.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/060205_toplevel/Sem_060205_top_level_002.ttcn new file mode 100644 index 0000000..ec43b3c --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/060205_toplevel/Sem_060205_top_level_002.ttcn @@ -0,0 +1,29 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:6.2.5, assignment notation for union values with @default + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// using the @default modifier before the type of the alternative. For unions with a default alternative, special type compatibility rules apply (see clause 6.3.2.4) which allow using the union value as compatible with the type of the default alternative. + +module Sem_060205_top_level_002 { + type component GeneralComp { + } + + type union U { + @default integer option1, + charstring option2 + } + + testcase TC_Sem_060205_top_level_002() runs on GeneralComp { + var U v_choice := 12345; // implicit usage of the default alternative: v_choice := { option1 := 12345 } + if (ischosen(v_choice.option1) and match(v_choice.option1,12345)) { setverdict(pass); } + else { setverdict(fail); } + } + + control{ + execute(TC_Sem_060205_top_level_002()); + } +} \ No newline at end of file diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/060205_toplevel/Sem_060205_top_level_003.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/060205_toplevel/Sem_060205_top_level_003.ttcn new file mode 100644 index 0000000..b1ba5c0 --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/060205_toplevel/Sem_060205_top_level_003.ttcn @@ -0,0 +1,32 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:6.2.5, assignment notation for union values with @default + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// using the @default modifier before the type of the alternative. For unions with a default alternative, special type compatibility rules apply (see clause 6.3.2.4) which allow using the union value as compatible with the type of the default alternative. + +module Sem_060205_top_level_003 { + type component GeneralComp { + } + + type union U { + @default integer option1, + charstring option2 + } + + testcase TC_Sem_060205_top_level_003() runs on GeneralComp { + var U v_choice := 12345; // implicit usage of the default alternative: v_choice := { option1 := 34 } + var U v_res := v_choice + 5; // implicit usage of the default of v_choice + + if (ischosen(v_res.option1) and match(v_res.option1, 12350)) { setverdict(pass); } + else { setverdict(fail); } + + } + + control{ + execute(TC_Sem_060205_top_level_003()); + } +} \ No newline at end of file diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/060205_toplevel/Sem_060205_top_level_004.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/060205_toplevel/Sem_060205_top_level_004.ttcn new file mode 100644 index 0000000..07f7853 --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/060205_toplevel/Sem_060205_top_level_004.ttcn @@ -0,0 +1,34 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:6.2.5, assignment notation for union values with @default + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// using the @default modifier before the type of the alternative. For unions with a default alternative, special type compatibility rules apply (see clause 6.3.2.4) which allow using the union value as compatible with the type of the default alternative. + +module Sem_060205_top_level_004 { + type component GeneralComp { + } + + type union U { + @default integer option1, + charstring option2 + } + + testcase TC_Sem_060205_top_level_004() runs on GeneralComp { + var U v_choice := 12345; // implicit usage of the default alternative: v_choice := { option1 := 34 } + var U v_anotherChoice := 5; // implicit usage of the default alternative: v_choice := { option1 := 34 } + + var U v_res := v_choice + v_anotherChoice; // implicit usage of the default of v_choice and v_anotherChoice + + if (ischosen(v_res.option1) and v_res.option1 == 12350) { setverdict(pass); } + else { setverdict(fail); } + + } + + control{ + execute(TC_Sem_060205_top_level_004()); + } +} \ No newline at end of file diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/060206_anytype/NegSyn_060206_anytype_004.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/060206_anytype/NegSyn_060206_anytype_004.ttcn new file mode 100644 index 0000000..06bf293 --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/060206_anytype/NegSyn_060206_anytype_004.ttcn @@ -0,0 +1,41 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:6.2.0.6, ensure that timer type not allowed for anytype + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +/* + * The definition of the term known types is given in clause , + * i.e. the anytype shall comprise all the known data types + * but not the port, component, default and timer types. + * */ + +module NegSyn_060206_anytype_004 { + +type component MyComp{ +} + +type timer MyTimer; + +type component GeneralComp extends MyComp { + + var anytype c; + +} + + +testcase TC_NegSyn_060206_anytype_004() runs on GeneralComp { + + +c.MyTimer := 10.0; // timer type is not allowed with anytype. + + +} + +control { + execute(TC_NegSyn_060206_anytype_004()); +} + +} \ No newline at end of file diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/060206_anytype/NegSyn_060206_anytype_005.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/060206_anytype/NegSyn_060206_anytype_005.ttcn new file mode 100644 index 0000000..60227af --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/060206_anytype/NegSyn_060206_anytype_005.ttcn @@ -0,0 +1,39 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:6.2.0.6, ensure that timer type not allowed for anytype + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +/* + * The definition of the term known types is given in clause , + * i.e. the anytype shall comprise all the known data types + * but not the port, component, default and timer types. + * */ + +module NegSyn_060206_anytype_005 { + +type component MyComp{ +} + +type component GeneralComp extends MyComp { + + var anytype c; + +} + + +testcase TC_NegSyn_060206_anytype_005() runs on GeneralComp { + + +c.timer := 10.0; // timer type is not allowed with anytype. + + +} + +control { + execute(TC_NegSyn_060206_anytype_005()); +} + +} \ No newline at end of file diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/Sem_060207_arrays_024.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/Sem_060207_arrays_024.ttcn new file mode 100644 index 0000000..a8c815f --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/Sem_060207_arrays_024.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:6.2.7, verify that arrays can be used as a return value of a function + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +//The following requirement is tested: +/* Arrays can be used in TTCN-3 as a shorthand notation to specify record of types. + * They may be specified also at the point of a variable, formal parameter or function return + * value declaration. +*/ + + +module Sem_060207_arrays_024 { + + type component GeneralComp { + } + + function getArray() return integer[3]{ // array definition in function return type declaration + return {3,2,1}; + } + +testcase TC_Sem_060207_arrays_024() runs on GeneralComp { + + var integer v_res[3] := getArray(); + setverdict(pass, v_res); +} + +control { + execute(TC_Sem_060207_arrays_024()); +} + +} diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/Sem_060207_arrays_025.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/Sem_060207_arrays_025.ttcn new file mode 100644 index 0000000..d3e0796 --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/Sem_060207_arrays_025.ttcn @@ -0,0 +1,39 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:6.2.7, verify that arrays can be used as a formal parameter of a function + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +//The following requirement is tested: + /* Arrays can be used in TTCN-3 as a shorthand notation to specify record of types. + * They may be specified also at the point of a variable, formal parameter or function return + * value declaration. + */ + +module Sem_060207_arrays_025 { + + type component GeneralComp { + } + + function getArray(integer v_in[3]) return integer[3] { // array definition in function return type declaration + return v_in; +} + + +testcase TC_Sem_060207_arrays_025() runs on GeneralComp { + + var integer v_input[3] := { + [0] := 8, + [1] := 1, + [2] := 2 + } + var integer v_res[3] := getArray(v_input); + setverdict(pass, v_res); +} + +control { + execute(TC_Sem_060207_arrays_025()); +} + +} diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/NegSyn_060209_CommunicationPortTypes_001.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/NegSyn_060209_CommunicationPortTypes_001.ttcn new file mode 100644 index 0000000..43a070c --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/NegSyn_060209_CommunicationPortTypes_001.ttcn @@ -0,0 +1,35 @@ +/***************************************************************** + ** @author STF T003 + ** @version 0.0.1 + ** @purpose 1:6.2.9, Ensure that map param allows data types only. + ** @verdict pass reject, noexecution + *****************************************************************/ +// Restriction d: +// Formal parameters of map param and unmap param declarations shall be value parameters of a data type. + +module NegSyn_060209_CommunicationPortTypes_001 { + + type record MyType1 { + integer f1, + charstring f2 + } + + type default MyType2; // special default type + + type record MyType3 { + boolean h1, + MyType3 h2 optional + } + + signature S1(); + signature S2(in integer p_par1); + signature S3(in charstring p_par1); + + type port MyMessagePortTypeOne procedure { + inout S1, S2, S3; + map param (in integer p1, inout MyType2 p2); // error: default type not allowed for map param + unmap param (in MyType3 p1, out integer p2); + address MyType1; + } + +} \ No newline at end of file diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/NegSyn_060209_CommunicationPortTypes_002.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/NegSyn_060209_CommunicationPortTypes_002.ttcn new file mode 100644 index 0000000..46c6d95 --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/NegSyn_060209_CommunicationPortTypes_002.ttcn @@ -0,0 +1,37 @@ +/***************************************************************** + ** @author STF T003 + ** @version 0.0.1 + ** @purpose 1:6.2.9, Ensure that map param allows data types only. + ** @verdict pass reject, noexecution + *****************************************************************/ +// Restriction d: +// Formal parameters of map param and unmap param declarations shall be value parameters of a data type. + +module NegSyn_060209_CommunicationPortTypes_002 { + + type record MyType1 { + integer f1, + charstring f2 + } + + type port MyMessagePortType message { + inout integer; + } + + type record MyType3 { + boolean h1, + MyType3 h2 optional + } + + signature S1(); + signature S2(in integer p_par1); + signature S3(in charstring p_par1); + + type port MyMessagePortTypeOne procedure { + inout S1, S2, S3; + map param (in integer p1, inout MyMessagePortType p2); // error: port type not allowed for map param + unmap param (in MyType3 p1, out integer p2); + address MyType1; + } + +} \ No newline at end of file diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/NegSyn_060209_CommunicationPortTypes_003.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/NegSyn_060209_CommunicationPortTypes_003.ttcn new file mode 100644 index 0000000..d511359 --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/NegSyn_060209_CommunicationPortTypes_003.ttcn @@ -0,0 +1,36 @@ +/***************************************************************** + ** @author STF T003 + ** @version 0.0.1 + ** @purpose 1:6.2.9, Ensure that map param allows data types only. + ** @verdict pass reject, noexecution + *****************************************************************/ +// Restriction d: +// Formal parameters of map param and unmap param declarations shall be value parameters of a data type. + +module NegSyn_060209_CommunicationPortTypes_003 { + + type record MyType1 { + integer f1, + charstring f2 + } + + type component GeneralComp {} + + + type record MyType3 { + boolean h1, + MyType3 h2 optional + } + + signature S1(); + signature S2(in integer p_par1); + signature S3(in charstring p_par1); + + type port MyMessagePortTypeOne procedure { + inout S1, S2, S3; + map param (in integer p1, inout GeneralComp p2); // error: component type not allowed for map param + unmap param (in MyType3 p1, out integer p2); + address MyType1; + } + +} \ No newline at end of file diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/NegSyn_060209_CommunicationPortTypes_004.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/NegSyn_060209_CommunicationPortTypes_004.ttcn new file mode 100644 index 0000000..54469bb --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/NegSyn_060209_CommunicationPortTypes_004.ttcn @@ -0,0 +1,36 @@ +/***************************************************************** + ** @author STF T003 + ** @version 0.0.1 + ** @purpose 1:6.2.9, Ensure that map param allows data types only. + ** @verdict pass reject, noexecution + *****************************************************************/ +// Restriction d: +// Formal parameters of map param and unmap param declarations shall be value parameters of a data type. + +module NegSyn_060209_CommunicationPortTypes_004 { + + type record MyType1 { + integer f1, + charstring f2 + } + + type timer t1; + + + type record MyType3 { + boolean h1, + MyType3 h2 optional + } + + signature S1(); + signature S2(in integer p_par1); + signature S3(in charstring p_par1); + + type port MyMessagePortTypeOne procedure { + inout S1, S2, S3; + map param (in integer p1, inout t1 p2); // error: timer type not allowed for map param + unmap param (in MyType3 p1, out integer p2); + address MyType1; + } + +} \ No newline at end of file diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/NegSyn_060209_CommunicationPortTypes_005.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/NegSyn_060209_CommunicationPortTypes_005.ttcn new file mode 100644 index 0000000..080c51f --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/NegSyn_060209_CommunicationPortTypes_005.ttcn @@ -0,0 +1,28 @@ +/***************************************************************** + ** @author STF T003 + ** @version 0.0.1 + ** @purpose 1:6.2.9, Ensure that param allows data types only. + ** @verdict pass reject, noexecution + *****************************************************************/ +// Restriction e: +// MessageType shall be a reference to a data type. + +module NegSyn_060209_CommunicationPortTypes_005 { + + type record MsgType1 { + integer f1, + octetstring f2 + } + + type boolean MsgType2; + type charstring MsgType3; + + type default MyDefType; + + type port MyMessagePortTypeOne message { + in MsgType1, MsgType2; + out MsgType3; + inout MyDefType // error: not data type + } + +} \ No newline at end of file diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/NegSyn_060209_CommunicationPortTypes_006.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/NegSyn_060209_CommunicationPortTypes_006.ttcn new file mode 100644 index 0000000..feb7599 --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/NegSyn_060209_CommunicationPortTypes_006.ttcn @@ -0,0 +1,34 @@ +/***************************************************************** + ** @author STF T003 + ** @version 0.0.1 + ** @purpose 1:6.2.9, Ensure that unmap param allows data types only. + ** @verdict pass reject, noexecution + *****************************************************************/ +// Restriction d: +// Formal parameters of map param and unmap param declarations shall be value parameters of a data type. + +module NegSyn_060209_CommunicationPortTypes_006 { + + type record MyType1 { + integer f1, + charstring f2 + } + + type default MyType2; // special default type + + type record MyType3 { + boolean h1, + MyType3 h2 optional + } + + signature S1(); + signature S2(in integer p_par1); + signature S3(in charstring p_par1); + + type port MyMessagePortTypeOne procedure { + inout S1, S2, S3; + unmap param (in integer p1, inout MyType2 p2); // error: default type not allowed for unmap param + address MyType1; + } + +} \ No newline at end of file diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/NegSyn_060209_CommunicationPortTypes_007.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/NegSyn_060209_CommunicationPortTypes_007.ttcn new file mode 100644 index 0000000..e64242d --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/NegSyn_060209_CommunicationPortTypes_007.ttcn @@ -0,0 +1,36 @@ +/***************************************************************** + ** @author STF T003 + ** @version 0.0.1 + ** @purpose 1:6.2.9, Ensure that unmap param allows data types only. + ** @verdict pass reject, noexecution + *****************************************************************/ +// Restriction d: +// Formal parameters of map param and unmap param declarations shall be value parameters of a data type. + +module NegSyn_060209_CommunicationPortTypes_007 { + + type record MyType1 { + integer f1, + charstring f2 + } + + type port MyMessagePortType message { + inout integer; + } + + type record MyType3 { + boolean h1, + MyType3 h2 optional + } + + signature S1(); + signature S2(in integer p_par1); + signature S3(in charstring p_par1); + + type port MyMessagePortTypeOne procedure { + inout S1, S2, S3; + unmap param (in integer p1, inout MyMessagePortType p2); // error: port type not allowed for unmap param + address MyType1; + } + +} \ No newline at end of file diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/NegSyn_060209_CommunicationPortTypes_008.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/NegSyn_060209_CommunicationPortTypes_008.ttcn new file mode 100644 index 0000000..a851a8d --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/NegSyn_060209_CommunicationPortTypes_008.ttcn @@ -0,0 +1,35 @@ +/***************************************************************** + ** @author STF T003 + ** @version 0.0.1 + ** @purpose 1:6.2.9, Ensure that unmap param allows data types only. + ** @verdict pass reject, noexecution + *****************************************************************/ +// Restriction d: +// Formal parameters of map param and unmap param declarations shall be value parameters of a data type. + +module NegSyn_060209_CommunicationPortTypes_008 { + + type record MyType1 { + integer f1, + charstring f2 + } + + type component GeneralComp {} + + + type record MyType3 { + boolean h1, + MyType3 h2 optional + } + + signature S1(); + signature S2(in integer p_par1); + signature S3(in charstring p_par1); + + type port MyMessagePortTypeOne procedure { + inout S1, S2, S3; + unmap param (in integer p1, inout GeneralComp p2); // error: component type not allowed for unmap param + address MyType1; + } + +} \ No newline at end of file diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/NegSyn_060209_CommunicationPortTypes_009.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/NegSyn_060209_CommunicationPortTypes_009.ttcn new file mode 100644 index 0000000..7ec633a --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/NegSyn_060209_CommunicationPortTypes_009.ttcn @@ -0,0 +1,35 @@ +/***************************************************************** + ** @author STF T003 + ** @version 0.0.1 + ** @purpose 1:6.2.9, Ensure that unmap param allows data types only. + ** @verdict pass reject, noexecution + *****************************************************************/ +// Restriction d: +// Formal parameters of map param and unmap param declarations shall be value parameters of a data type. + +module NegSyn_060209_CommunicationPortTypes_009 { + + type record MyType1 { + integer f1, + charstring f2 + } + + type timer t1; + + + type record MyType3 { + boolean h1, + MyType3 h2 optional + } + + signature S1(); + signature S2(in integer p_par1); + signature S3(in charstring p_par1); + + type port MyMessagePortTypeOne procedure { + inout S1, S2, S3; + unmap param (in integer p1, inout t1 p2); // error: timer type not allowed for unmap param + address MyType1; + } + +} \ No newline at end of file diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/Sem_060209_CommunicationPortTypes_005.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/Sem_060209_CommunicationPortTypes_005.ttcn old mode 100755 new mode 100644 diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/060210_component_types/06021001_component_type_definition/Syn_06021001_component_type_definition_001.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/060210_component_types/06021001_component_type_definition/Syn_06021001_component_type_definition_001.ttcn new file mode 100644 index 0000000..2f61d24 --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/060210_component_types/06021001_component_type_definition/Syn_06021001_component_type_definition_001.ttcn @@ -0,0 +1,23 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:6.2.10.1, Component type with port instances only + ** @verdict pass accept, noexecution + ***************************************************/ +module Syn_06021001_component_type_definition_001 { + type port MyMessagePortType message { + inout integer + } + + signature Proc1(); + + type port MyProcedurePortType procedure { + out Proc1 + } + + type component MyPTCType { + port MyMessagePortType pCO1, pCO4; + port MyProcedurePortType pCO2; + } + +} \ No newline at end of file diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/060210_component_types/06021001_component_type_definition/Syn_06021001_component_type_definition_002.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/060210_component_types/06021001_component_type_definition/Syn_06021001_component_type_definition_002.ttcn new file mode 100644 index 0000000..b1fe30a --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/060210_component_types/06021001_component_type_definition/Syn_06021001_component_type_definition_002.ttcn @@ -0,0 +1,19 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:6.2.10.1, Component type with variable, timer and port instance + ** @verdict pass accept, noexecution + ***************************************************/ +module Syn_06021001_component_type_definition_002 { + type port MyMessagePortType message { + inout integer + } + + type component MyMTCType { + var integer vc_myLocalInteger; + timer tc_myLocalTimer; + port MyMessagePortType pCO1 + } + + +} \ No newline at end of file diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/060210_component_types/06021001_component_type_definition/Syn_06021001_component_type_definition_003.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/060210_component_types/06021001_component_type_definition/Syn_06021001_component_type_definition_003.ttcn new file mode 100644 index 0000000..ed346a5 --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/060210_component_types/06021001_component_type_definition/Syn_06021001_component_type_definition_003.ttcn @@ -0,0 +1,26 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:6.2.10.1, Component type with port instance arrays + ** @verdict pass accept, noexecution + ***************************************************/ +module Syn_06021001_component_type_definition_003 { + type port MyMessagePortType message { + inout integer + } + + signature Proc1(); + + type port MyProcedurePortType procedure { + out Proc1 + } + + type component MyCompType { + port MyMessagePortType pCO[3]; + port MyProcedurePortType pCOm[3][3] + // Defines a component type which has an array of 3 message ports and a two dimensional + // array of 9 procedure ports. + } + + +} \ No newline at end of file diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/060210_component_types/06021002_reuse_component_type/NegSyn_060210_ReuseofComponentTypes_001.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/060210_component_types/06021002_reuse_component_type/NegSyn_060210_ReuseofComponentTypes_001.ttcn old mode 100755 new mode 100644 diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/060210_component_types/06021002_reuse_component_type/NegSyn_060210_ReuseofComponentTypes_002.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/060210_component_types/06021002_reuse_component_type/NegSyn_060210_ReuseofComponentTypes_002.ttcn old mode 100755 new mode 100644 diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/060210_component_types/06021002_reuse_component_type/NegSyn_060210_ReuseofComponentTypes_003.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/060210_component_types/06021002_reuse_component_type/NegSyn_060210_ReuseofComponentTypes_003.ttcn old mode 100755 new mode 100644 diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/060210_component_types/06021002_reuse_component_type/Sem_060210_ReuseofComponentTypes_001.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/060210_component_types/06021002_reuse_component_type/Sem_060210_ReuseofComponentTypes_001.ttcn old mode 100755 new mode 100644 diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/060210_component_types/06021002_reuse_component_type/Sem_060210_ReuseofComponentTypes_002.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/060210_component_types/06021002_reuse_component_type/Sem_060210_ReuseofComponentTypes_002.ttcn old mode 100755 new mode 100644 diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/060210_component_types/06021002_reuse_component_type/Sem_060210_ReuseofComponentTypes_003.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/060210_component_types/06021002_reuse_component_type/Sem_060210_ReuseofComponentTypes_003.ttcn old mode 100755 new mode 100644 diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/060212_addressing_entities_inside_sut/NegSem_060212_AddressingEntitiesInsideSut_002.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/060212_addressing_entities_inside_sut/NegSem_060212_AddressingEntitiesInsideSut_002.ttcn old mode 100755 new mode 100644 diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/060212_addressing_entities_inside_sut/NegSem_060212_AddressingEntitiesInsideSut_003.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/060212_addressing_entities_inside_sut/NegSem_060212_AddressingEntitiesInsideSut_003.ttcn old mode 100755 new mode 100644 diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/060212_addressing_entities_inside_sut/NegSem_060212_AddressingEntitiesInsideSut_004.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/060212_addressing_entities_inside_sut/NegSem_060212_AddressingEntitiesInsideSut_004.ttcn old mode 100755 new mode 100644 diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/060213_subtyping_of_structured_types/06021302_list_subtyping/NegSem_06021302_ListSubtyping_003.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/060213_subtyping_of_structured_types/06021302_list_subtyping/NegSem_06021302_ListSubtyping_003.ttcn new file mode 100644 index 0000000..4ad3466 --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/060213_subtyping_of_structured_types/06021302_list_subtyping/NegSem_06021302_ListSubtyping_003.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:6.2.13.2, ensure that list subtyping check for array types is properly handled + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +/* Subtypes defined by a list subtyping restrict the allowed values of the subtype to the values matched by at least one of + * the constraints in the list. In case of list subtyping of record, set, record of, set of, union and anytype + * types, and arrays, the list may contain both subtypes and possibly partial templates of the parent types. + * */ + +module NegSem_06021302_ListSubtyping_003 { + +type charstring MyArray[1 .. 3]; + +type MyArray MyArraySub1 ( + { "aa", "bb", "cc" }, + { "dd", "ee", "ff" } +); // valid subtype of MyArray + + +type MyArraySub1 MyValidSubArray ( + { "dd", "ee", "ff" } + ); //valid subtype + +type MyArraySub1 MyInValidSubArray ( + { "dd", "ee", "gg" } + ); //invalid subtype + + +} diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/060213_subtyping_of_structured_types/06021302_list_subtyping/Sem_06021302_ListSubtyping_004.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/060213_subtyping_of_structured_types/06021302_list_subtyping/Sem_06021302_ListSubtyping_004.ttcn new file mode 100644 index 0000000..7051e1b --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/060213_subtyping_of_structured_types/06021302_list_subtyping/Sem_06021302_ListSubtyping_004.ttcn @@ -0,0 +1,46 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:6.2.13.2, ensure that list subtyping check for array types is properly handled + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +// The following requirement is tested: +//Subtypes defined by a list subtyping restrict the allowed values of the subtype to the values +//matched by at least one of the constraints in the list. +//In case of list subtyping of record, set, record of, set of, union and anytype types, and arrays, +//the list may contain both subtypes and possibly partial templates of the parent types. + +module Sem_06021302_ListSubtyping_004 { + + type component GeneralComp { + } + +type charstring MyArray[1 .. 3]; + +type MyArray MyArraySub1 ( + { "aa", "bb", "cc" }, + { "dd", "ee", "ff" } +); // valid subtype of MyArray + +type MyArraySub1 MyArraySub2 ( { "aa", "bb", "cc" } ); // valid subtype of MyArraySub1 +type MyArraySub1 MyArraySub3 ( { "dd", "ee", "ff" } ); // valid subtype of MyArraySub1 +type MyArraySub1 MyArraySub4 ( MyArraySub2 ); // valid subtype of MyArraySub1 + +testcase TC_Sem_06021302_ListSubtyping_004() runs on GeneralComp { + var MyArray v_array := { "aa", "bb", "cc" }; + template MyArraySub1 m_match := { "aa", "bb", "cc" }; + + if ( match(v_array ,m_match) ) { + setverdict(pass); + } + else { + setverdict(fail); + } + +} + +control { + execute(TC_Sem_06021302_ListSubtyping_004()); +} + +} diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/060214_timer_type/Sem_060214_timer_type_001.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/060214_timer_type/Sem_060214_timer_type_001.ttcn new file mode 100644 index 0000000..57395c0 --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/060214_timer_type/Sem_060214_timer_type_001.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:5.4.1.2, variable of the timer type + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// TTCN 3 allows to define timer constants, variables and parameters. These constants, variables or parameters can contain +// a reference to an existing timer or a special value null. + +module Sem_060214_timer_type_001 { + + type component GeneralComp {} + + testcase TC_Sem_060214_timer_type_001() runs on GeneralComp system GeneralComp { + timer t1 := 0.5, t2 := 0.2; + var timer v_tmr := t1; + t2.start; + v_tmr := t2; + v_tmr.timeout; + setverdict(pass); + } + + control { + execute(TC_Sem_060214_timer_type_001()); + } +} diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/060214_timer_type/Syn_060214_timer_type_001.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/060214_timer_type/Syn_060214_timer_type_001.ttcn new file mode 100644 index 0000000..30c1263 --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/060214_timer_type/Syn_060214_timer_type_001.ttcn @@ -0,0 +1,14 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:6.2.14, Constant of the timer type + ** @verdict pass accept, noexecution + ***************************************************/ + +// The following requirement is tested: +// TTCN 3 allows to define timer constants, variables and parameters. These constants, variables or parameters can contain +// a reference to an existing timer or a special value null. + +module Syn_060214_timer_type_001 { + const timer c_nullTimer := null; +} \ No newline at end of file diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021501_map_type_definition/NegSem_06021501_map_type_definition_001.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021501_map_type_definition/NegSem_06021501_map_type_definition_001.ttcn new file mode 100644 index 0000000..eda7ced --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021501_map_type_definition/NegSem_06021501_map_type_definition_001.ttcn @@ -0,0 +1,17 @@ +/*************************************************** + ** @author TTF T003 + ** @version 0.0.1 + ** @purpose 1:6.2.15.1, Verify that templates of a map type are not allowed + ** @verdict pass reject + ***************************************************/ + +// The following rule is tested: +// Restriction a +// Template definitions ... of type map ... are not allowed. + + +module NegSem_06021501_map_type_definition_001 { + type map from charstring to integer TMap1; + template TMap1 m_test := {} + +} diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021501_map_type_definition/NegSem_06021501_map_type_definition_002.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021501_map_type_definition/NegSem_06021501_map_type_definition_002.ttcn new file mode 100644 index 0000000..4e51a5e --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021501_map_type_definition/NegSem_06021501_map_type_definition_002.ttcn @@ -0,0 +1,21 @@ +/*************************************************** + ** @author TTF T003 + ** @version 0.0.1 + ** @purpose 1:6.2.15.1, Verify that templates of structured types containing fields of a map type are not allowed + ** @verdict pass reject + ***************************************************/ + +// The following rule is tested: +// Restriction a +// Template definitions ... of any structured type containing a field or element of type map +// ... are not allowed. + + +module NegSem_06021501_map_type_definition_002 { + type map from charstring to integer TMap1; + type record R { + TMap1 field1 + } + template R m_test := ? + +} diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021501_map_type_definition/NegSem_06021501_map_type_definition_003.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021501_map_type_definition/NegSem_06021501_map_type_definition_003.ttcn new file mode 100644 index 0000000..94195eb --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021501_map_type_definition/NegSem_06021501_map_type_definition_003.ttcn @@ -0,0 +1,29 @@ +/*************************************************** + ** @author TTF T014 + ** @version 0.0.1 + ** @purpose 1:6.2.15.1, Verify that maps cannot be used inside expressions + ** @verdict pass reject + ***************************************************/ + +// The following rule is tested: +// Restriction b +// Operands of expressions shall not be of the map type or any structured type containing a field +// or element of the map type on any level of nesting. + +module NegSem_06021501_map_type_definition_003 { + type map from charstring to integer TMap1; + + type component GeneralComp { + } + + testcase TC_NegSem_06021501_map_type_definition_003 () runs on GeneralComp { + var TMap1 v_map1 := {}, v_map2 := { }; + var boolean v_result := v_map1 == v_map2; + log (v_result); + setverdict(pass); + } + + control { + execute(TC_NegSem_06021501_map_type_definition_003()); + } +} \ No newline at end of file diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021501_map_type_definition/NegSem_06021501_map_type_definition_004.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021501_map_type_definition/NegSem_06021501_map_type_definition_004.ttcn new file mode 100644 index 0000000..6b605a5 --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021501_map_type_definition/NegSem_06021501_map_type_definition_004.ttcn @@ -0,0 +1,32 @@ +/*************************************************** + ** @author TTF T014 + ** @version 0.0.1 + ** @purpose 1:6.2.15.1, Verify that structrured types containing a map cannot be used inside expressions + ** @verdict pass reject + ***************************************************/ + +// The following rule is tested: +// Restriction b +// Operands of expressions shall not be of the map type or any structured type containing a field +// or element of the map type on any level of nesting. + +module NegSem_06021501_map_type_definition_004 { + type map from charstring to integer TMap1; + type record R { + TMap1 field1 + } + + type component GeneralComp { + } + + testcase TC_NegSem_06021501_map_type_definition_004 () runs on GeneralComp { + var R v_rec1 := { field1 := {} }, v_rec2 := { field1 := {} }; + var boolean v_result := v_rec1 == v_rec2; + log (v_result); + setverdict(pass); + } + + control { + execute(TC_NegSem_06021501_map_type_definition_004()); + } +} \ No newline at end of file diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021501_map_type_definition/Sem_06021501_map_type_definition_001.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021501_map_type_definition/Sem_06021501_map_type_definition_001.ttcn new file mode 100644 index 0000000..ef2f975 --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021501_map_type_definition/Sem_06021501_map_type_definition_001.ttcn @@ -0,0 +1,14 @@ +/*************************************************** + ** @author TTF T003 + ** @version 0.0.1 + ** @purpose 1:6.2.15.1, Verify map types can be defined + ** @verdict pass accept, noexecution + ***************************************************/ + +// The following requirement is tested: +// The Type following the from keyword is the type of the keys of the map type. The Type following +// the to keyword is the type of the values of the map type. + +module Sem_06021501_map_type_definition_001 { + type map from charstring to integer TMap1; +} diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021501_map_type_definition/Sem_06021501_map_type_definition_002.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021501_map_type_definition/Sem_06021501_map_type_definition_002.ttcn new file mode 100644 index 0000000..626b0da --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021501_map_type_definition/Sem_06021501_map_type_definition_002.ttcn @@ -0,0 +1,16 @@ +/*************************************************** + ** @author TTF T014 + ** @version 0.0.1 + ** @purpose 1:6.2.15.1, Verify nested map types can be defined + ** @verdict pass accept, noexecution + ***************************************************/ + +// The following requirement is tested: +// The Type following the from keyword is the type of the keys of the map type. The Type following +// the to keyword is the type of the values of the map type. + +module Sem_06021501_map_type_definition_002 { + type record R { + map from universal charstring to float mapField + } +} diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021502_indexed_assignment_notation/NegSem_06021502_indexed_assignment_notation_001.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021502_indexed_assignment_notation/NegSem_06021502_indexed_assignment_notation_001.ttcn new file mode 100644 index 0000000..7ce776d --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021502_indexed_assignment_notation/NegSem_06021502_indexed_assignment_notation_001.ttcn @@ -0,0 +1,24 @@ +/*************************************************** + ** @author TTF T003 + ** @version 0.0.1 + ** @purpose 1:6.2.15.2, Verify that an error is generated for type-incompatible index assignment list keys + ** @verdict pass reject + ***************************************************/ + +// The following rule is tested: +// Values of type map can be denoted with the indexed assignment notation where the indices +// are values of the key type of the map type and the right hand sides are values of the value type. + +module NegSem_06021502_indexed_assignment_notation_001 { + type map from charstring to integer TMap1; + type component C {} + + testcase TC_NegSem_06021502_indexed_assignment_notation_001() runs on C { + var TMap1 v_map := { ['AB04'O] := 1, ['C0'O] := 5 } + setverdict(pass); + } + + control { + execute(TC_NegSem_06021502_indexed_assignment_notation_001()); + } +} diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021502_indexed_assignment_notation/NegSem_06021502_indexed_assignment_notation_002.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021502_indexed_assignment_notation/NegSem_06021502_indexed_assignment_notation_002.ttcn new file mode 100644 index 0000000..a8a19c2 --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021502_indexed_assignment_notation/NegSem_06021502_indexed_assignment_notation_002.ttcn @@ -0,0 +1,24 @@ +/*************************************************** + ** @author TTF T003 + ** @version 0.0.1 + ** @purpose 1:6.2.15.2, Verify that an error is generated for type-incompatible index assignment list values + ** @verdict pass reject + ***************************************************/ + +// The following rule is tested: +// Values of type map can be denoted with the indexed assignment notation where the indices +// are values of the key type of the map type and the right hand sides are values of the value type. + +module NegSem_06021502_indexed_assignment_notation_002 { + type map from charstring to integer TMap1; + type component C {} + + testcase TC_NegSem_06021502_indexed_assignment_notation_002() runs on C { + var TMap1 v_map := { ["test"] := 2.5, ["xyz"] := true } + setverdict(pass); + } + + control { + execute(TC_NegSem_06021502_indexed_assignment_notation_002()); + } +} diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021502_indexed_assignment_notation/NegSem_06021502_indexed_assignment_notation_003.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021502_indexed_assignment_notation/NegSem_06021502_indexed_assignment_notation_003.ttcn new file mode 100644 index 0000000..f3ab8b9 --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021502_indexed_assignment_notation/NegSem_06021502_indexed_assignment_notation_003.ttcn @@ -0,0 +1,26 @@ +/*************************************************** + ** @author TTF T003 + ** @version 0.0.1 + ** @purpose 1:6.2.15.2, Verify that an error is generated if there are two equal keys in an index assignment list + ** @verdict pass reject + ***************************************************/ + +// The following rule is tested: +// Restriction a +// In the index assignment notation, every index expression shall evaluate to a different value than +// all the other ones. + +module NegSem_06021502_indexed_assignment_notation_003 { + type map from charstring to integer TMap1; + type component C {} + + testcase TC_NegSem_06021502_indexed_assignment_notation_003() runs on C { + var charstring v_str := "test"; + var TMap1 v_map := { ["test"] := 1, [v_str] := 5 } + setverdict(pass); + } + + control { + execute(TC_NegSem_06021502_indexed_assignment_notation_003()); + } +} diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021502_indexed_assignment_notation/Sem_06021502_indexed_assignment_notation_001.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021502_indexed_assignment_notation/Sem_06021502_indexed_assignment_notation_001.ttcn new file mode 100644 index 0000000..5b828fb --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021502_indexed_assignment_notation/Sem_06021502_indexed_assignment_notation_001.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @author TTF T003 + ** @version 0.0.1 + ** @purpose 1:6.2.15.2, Verify that index assignment notation can be used for map values + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Values of type map can be denoted with the indexed assignment notation where the indices are +// values of the key type of the map type and the right hand sides are values of the value type. + +module Sem_06021502_indexed_assignment_notation_001 { + type map from charstring to integer TMap1; + type component C {} + + testcase TC_Sem_06021502_indexed_assignment_notation_001() runs on C { + var TMap1 v_map := { ["test"] := 1, ["xyz"] := 5 } + if (v_map["test"] == 1 and v_map["xyz"] == 5) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_06021502_indexed_assignment_notation_001()); + } +} diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021502_indexed_assignment_notation/Sem_06021502_indexed_assignment_notation_002.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021502_indexed_assignment_notation/Sem_06021502_indexed_assignment_notation_002.ttcn new file mode 100644 index 0000000..d56b6e8 --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021502_indexed_assignment_notation/Sem_06021502_indexed_assignment_notation_002.ttcn @@ -0,0 +1,30 @@ +/*************************************************** + ** @author TTF T003 + ** @version 0.0.1 + ** @purpose 1:6.2.15.2, Verify that index assignment notation updates values properly + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Re-assigning a previously initialized value, using the not used symbol or just skipping +// a field or element in an assignment notation, will cause that field or element to remain +// unchanged. + +module Sem_06021502_indexed_assignment_notation_002 { + type map from charstring to integer TMap1; + type component C {} + + testcase TC_Sem_06021502_indexed_assignment_notation_002() runs on C { + var TMap1 v_map := { ["test"] := 1, ["xyz"] := 5 } + v_map := { ["test"] := 10, ["xyz"] := - } + if (v_map["test"] == 10 and v_map["xyz"] == 5) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_06021502_indexed_assignment_notation_002()); + } +} diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021502_indexed_assignment_notation/Sem_06021502_indexed_assignment_notation_003.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021502_indexed_assignment_notation/Sem_06021502_indexed_assignment_notation_003.ttcn new file mode 100644 index 0000000..0b16b06 --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021502_indexed_assignment_notation/Sem_06021502_indexed_assignment_notation_003.ttcn @@ -0,0 +1,30 @@ +/*************************************************** + ** @author TTF T003 + ** @version 0.0.1 + ** @purpose 1:6.2.15.2, Verify that values not present in the index assignment notation are unchanged + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Re-assigning a previously initialized value, using the not used symbol or just skipping +// a field or element in an assignment notation, will cause that field or element to remain +// unchanged. + +module Sem_06021502_indexed_assignment_notation_003 { + type map from charstring to integer TMap1; + type component C {} + + testcase TC_Sem_06021502_indexed_assignment_notation_003() runs on C { + var TMap1 v_map := { ["test"] := 1, ["xyz"] := 5 } + v_map := { ["test"] := 10} + if (v_map["test"] == 10 and v_map["xyz"] == 5) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_06021502_indexed_assignment_notation_003()); + } +} diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021503_unmapping_keys/NegSem_06021503_unmapping_keys_001.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021503_unmapping_keys/NegSem_06021503_unmapping_keys_001.ttcn new file mode 100644 index 0000000..8d0c5c5 --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021503_unmapping_keys/NegSem_06021503_unmapping_keys_001.ttcn @@ -0,0 +1,30 @@ +/*************************************************** + ** @author TTF T003 + ** @version 0.0.1 + ** @purpose 1:6.2.15.3, Verify that unmapping a key in an uninitialized map causes an error + ** @verdict pass reject + ***************************************************/ + +// The following rule is tested: +// Restriction a +// ValueRef shall be an initialized variable of map type. + +module NegSem_06021503_unmapping_keys_001 { + type map from charstring to integer TMap1; + type component C {} + + testcase TC_NegSem_06021503_unmapping_keys_001() runs on C { + var boolean v_condition := false; + var TMap1 v_map; + if (v_condition) { + v_map := { ["test"] := 1, ["xyz"] := 5 }; + } + unmap(v_map, "abc"); + setverdict(pass); + + } + + control { + execute(TC_NegSem_06021503_unmapping_keys_001()); + } +} diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021503_unmapping_keys/NegSem_06021503_unmapping_keys_002.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021503_unmapping_keys/NegSem_06021503_unmapping_keys_002.ttcn new file mode 100644 index 0000000..958ab95 --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021503_unmapping_keys/NegSem_06021503_unmapping_keys_002.ttcn @@ -0,0 +1,26 @@ +/*************************************************** + ** @author TTF T003 + ** @version 0.0.1 + ** @purpose 1:6.2.15.3, Verify that unmapping a type-incompatible key causes an error + ** @verdict pass reject + ***************************************************/ + +// The following rule is tested: +// Restriction a +// SingleExpression shall be a value compatible with the key type of the map type of ValueRef. + +module NegSem_06021503_unmapping_keys_002 { + type map from charstring to integer TMap1; + type component C {} + + testcase TC_NegSem_06021503_unmapping_keys_002() runs on C { + var TMap1 v_map := { ["test"] := 1, ["xyz"] := 5 }; + unmap(v_map, 1); + setverdict(pass); + + } + + control { + execute(TC_NegSem_06021503_unmapping_keys_002()); + } +} diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021503_unmapping_keys/Sem_06021503_unmapping_keys_001.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021503_unmapping_keys/Sem_06021503_unmapping_keys_001.ttcn new file mode 100644 index 0000000..2827150 --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021503_unmapping_keys/Sem_06021503_unmapping_keys_001.ttcn @@ -0,0 +1,29 @@ +/*************************************************** + ** @author TTF T003 + ** @version 0.0.1 + ** @purpose 1:6.2.15.3, Verify that unmapping of keys is possible + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// To remove a mapping from a key to its associated value in a variable of type map, the unmap +// statement may be used. + +module Sem_06021503_unmapping_keys_001 { + type map from charstring to integer TMap1; + type component C {} + + testcase TC_Sem_06021503_unmapping_keys_001() runs on C { + var TMap1 v_map := { ["test"] := 1, ["xyz"] := 5 } + unmap(v_map, "xyz"); + if (v_map["test"] == 1 and not ispresent(v_map["xyz"])) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_06021503_unmapping_keys_001()); + } +} diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021503_unmapping_keys/Sem_06021503_unmapping_keys_002.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021503_unmapping_keys/Sem_06021503_unmapping_keys_002.ttcn new file mode 100644 index 0000000..dd445df --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021503_unmapping_keys/Sem_06021503_unmapping_keys_002.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @author TTF T003 + ** @version 0.0.1 + ** @purpose 1:6.2.15.3, Verify that unmapping a non-existent key is possible + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// If the map variable did not associate the given key with a value, the operation has no effect. + +module Sem_06021503_unmapping_keys_002 { + type map from charstring to integer TMap1; + type component C {} + + testcase TC_Sem_06021503_unmapping_keys_002() runs on C { + var TMap1 v_map := { ["test"] := 1, ["xyz"] := 5 } + unmap(v_map, "abc"); + if (v_map["test"] == 1 and v_map["xyz"] == 5) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_06021503_unmapping_keys_002()); + } +} diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021504_index_notation/NegSem_06021504_index_notation_001.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021504_index_notation/NegSem_06021504_index_notation_001.ttcn new file mode 100644 index 0000000..0669b37 --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021504_index_notation/NegSem_06021504_index_notation_001.ttcn @@ -0,0 +1,26 @@ +/*************************************************** + ** @author TTF T003 + ** @version 0.0.1 + ** @purpose 1:6.2.15.4, Verify that type-incompatible key used as an index of the left hand side causes an error + ** @verdict pass reject + ***************************************************/ + +// The following rule is tested: +// Restriction a +// The index expression used for index notation and index assignment notation shall be +// completely initialized and compatible with the from type of the map type. + +module NegSem_06021504_index_notation_001 { + type map from charstring to integer TMap1; + type component C {} + + testcase TC_NegSem_06021504_index_notation_001() runs on C { + var TMap1 v_map := { ["test"] := 1, ["xyz"] := 5 }; + v_map['152A'O] := 6; + setverdict(pass); + } + + control { + execute(TC_NegSem_06021504_index_notation_001()); + } +} diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021504_index_notation/NegSem_06021504_index_notation_002.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021504_index_notation/NegSem_06021504_index_notation_002.ttcn new file mode 100644 index 0000000..72c4cfe --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021504_index_notation/NegSem_06021504_index_notation_002.ttcn @@ -0,0 +1,26 @@ +/*************************************************** + ** @author TTF T003 + ** @version 0.0.1 + ** @purpose 1:6.2.15.4, Verify that type-incompatible key used as an index of the right hand side causes an error + ** @verdict pass reject + ***************************************************/ + +// The following rule is tested: +// Restriction a +// The index expression used for index notation and index assignment notation shall be +// completely initialized and compatible with the from type of the map type. + +module NegSem_06021504_index_notation_002 { + type map from charstring to integer TMap1; + type component C {} + + testcase TC_NegSem_06021504_index_notation_002() runs on C { + var TMap1 v_map := { ["test"] := 1, ["xyz"] := 5 }; + var integer v_val := v_map['152A'O]; + setverdict(pass); + } + + control { + execute(TC_NegSem_06021504_index_notation_002()); + } +} diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021504_index_notation/NegSem_06021504_index_notation_003.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021504_index_notation/NegSem_06021504_index_notation_003.ttcn new file mode 100644 index 0000000..9e71035 --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021504_index_notation/NegSem_06021504_index_notation_003.ttcn @@ -0,0 +1,30 @@ +/*************************************************** + ** @author TTF T003 + ** @version 0.0.1 + ** @purpose 1:6.2.15.4, Verify that partially initialized key used as an index of the left hand side causes an error + ** @verdict pass reject + ***************************************************/ + +// The following rule is tested: +// Restriction a +// The index expression used for index notation and index assignment notation shall be +// completely initialized and compatible with the from type of the map type. + +module NegSem_06021504_index_notation_003 { + type record R { + charstring ip, + integer portNum + } + type map from R to integer TMap1; + type component C {} + + testcase TC_NegSem_06021504_index_notation_003() runs on C { + var TMap1 v_map := { [ { "127.0.01", 80 }] := 1, [{"192.168.0.1", 433}] := 5 }; + v_map[{"192.168.0.100", -}] := 6; + setverdict(pass); + } + + control { + execute(TC_NegSem_06021504_index_notation_003()); + } +} diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021504_index_notation/NegSem_06021504_index_notation_004.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021504_index_notation/NegSem_06021504_index_notation_004.ttcn new file mode 100644 index 0000000..fe2c8b8 --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021504_index_notation/NegSem_06021504_index_notation_004.ttcn @@ -0,0 +1,31 @@ +/*************************************************** + ** @author TTF T003 + ** @version 0.0.1 + ** @purpose 1:6.2.15.4, Verify that a partially initialized key used as an index of the right hand side causes an error + ** @verdict pass reject + ***************************************************/ + +// The following rule is tested: +// Restriction a +// The index expression used for index notation and index assignment notation shall be +// completely initialized and compatible with the from type of the map type. + +module NegSem_06021504_index_notation_004 { + type record R { + charstring ip, + integer portNum + } + type map from R to integer TMap1; + type component C {} + + testcase TC_NegSem_06021504_index_notation_004() runs on C { + var TMap1 v_map := { [ { "127.0.01", 80 }] := 1, [{"192.168.0.1", 433}] := 5 }; + var R v_index := {"192.168.0.100", - }; + var integer v_val := v_map[v_index]; + setverdict(pass); + } + + control { + execute(TC_NegSem_06021504_index_notation_004()); + } +} diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021504_index_notation/NegSem_06021504_index_notation_005.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021504_index_notation/NegSem_06021504_index_notation_005.ttcn new file mode 100644 index 0000000..c450c30 --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021504_index_notation/NegSem_06021504_index_notation_005.ttcn @@ -0,0 +1,26 @@ +/*************************************************** + ** @author TTF T003 + ** @version 0.0.1 + ** @purpose 1:6.2.15.4, Verify that type-incompatible value cannot be assigned to a map + ** @verdict pass reject + ***************************************************/ + +// The following rule is tested: +// Restriction b +// When an index operation of a map value is used as the left-hand side of an assignment, +// the assigned value shall be compatible with the to type of the map type. + +module NegSem_06021504_index_notation_005 { + type map from charstring to integer TMap1; + type component C {} + + testcase TC_NegSem_06021504_index_notation_005() runs on C { + var TMap1 v_map := { ["test"] := 1, ["xyz"] := 5 }; + v_map["xyz"] := 6.5; + setverdict(pass); + } + + control { + execute(TC_NegSem_06021504_index_notation_005()); + } +} diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021504_index_notation/NegSem_06021504_index_notation_006.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021504_index_notation/NegSem_06021504_index_notation_006.ttcn new file mode 100644 index 0000000..68e8c85 --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021504_index_notation/NegSem_06021504_index_notation_006.ttcn @@ -0,0 +1,27 @@ +/*************************************************** + ** @author TTF T003 + ** @version 0.0.1 + ** @purpose 1:6.2.15.4, Verify that an error is generated if a non-existent key is used on the right hand side + ** @verdict pass reject + ***************************************************/ + +// The following rule is tested: +// Restriction c +// An index notation used on the right hand side with a key that has no associated value +// shall result in an error. + +module NegSem_06021504_index_notation_006 { + type map from charstring to integer TMap1; + type component C {} + + testcase TC_NegSem_06021504_index_notation_006() runs on C { + var TMap1 v_map := { ["test"] := 1, ["xyz"] := 5 }; + var charstring v_key := "abc"; + var integer v_val := v_map[v_key] := 6.5; + setverdict(pass); + } + + control { + execute(TC_NegSem_06021504_index_notation_006()); + } +} diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021504_index_notation/Sem_06021504_index_notation_001.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021504_index_notation/Sem_06021504_index_notation_001.ttcn new file mode 100644 index 0000000..9d0fff4 --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021504_index_notation/Sem_06021504_index_notation_001.ttcn @@ -0,0 +1,30 @@ +/*************************************************** + ** @author TTF T003 + ** @version 0.0.1 + ** @purpose 1:6.2.15.4, Verify that a new key can be used as an index on the left hand side of an assignment + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// When it is used at the left-hand side, only the value associated with the index key is changed, +// values with other keys remain unchanged. + +module Sem_06021504_index_notation_001 { + type map from charstring to integer TMap1; + type component C {} + + testcase TC_Sem_06021504_index_notation_001() runs on C { + var TMap1 v_map; + v_map["test"] := 1; + v_map["xyz"] := 5; + if (v_map["test"] == 1 and v_map["xyz"] == 5) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_06021504_index_notation_001()); + } +} diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021504_index_notation/Sem_06021504_index_notation_002.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021504_index_notation/Sem_06021504_index_notation_002.ttcn new file mode 100644 index 0000000..75f8fca --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021504_index_notation/Sem_06021504_index_notation_002.ttcn @@ -0,0 +1,29 @@ +/*************************************************** + ** @author TTF T003 + ** @version 0.0.1 + ** @purpose 1:6.2.15.4, Verify that a key updates only the referenced value + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Using the index notation on the left hand side of an assignment with a key that is already +// mapped causes the key to be mapped to the assigned value. + +module Sem_06021504_index_notation_001 { + type map from charstring to integer TMap1; + type component C {} + + testcase TC_Sem_06021504_index_notation_001() runs on C { + var TMap1 v_map := { ["test"] := 1, ["xyz"] := 10 }; + v_map["xyz"] := 5; + if (v_map["test"] == 1 and v_map["xyz"] == 5) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_06021504_index_notation_001()); + } +} diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021504_index_notation/Sem_06021504_index_notation_003.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021504_index_notation/Sem_06021504_index_notation_003.ttcn new file mode 100644 index 0000000..09f652b --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021504_index_notation/Sem_06021504_index_notation_003.ttcn @@ -0,0 +1,29 @@ +/*************************************************** + ** @author TTF T003 + ** @version 0.0.1 + ** @purpose 1:6.2.15.4, Verify that an index notation can be used on the right hand side of an assignment + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// The index notation, when used on the right-hand side, refers to the value element that the +// map associates with the key given as the index. + +module Sem_06021504_index_notation_003 { + type map from charstring to integer TMap1; + type component C {} + + testcase TC_Sem_06021504_index_notation_003() runs on C { + var TMap1 v_map := { ["test"] := 1, ["xyz"] := 5 }; + var integer v_val := v_map["xyz"]; + if (v_val == 5) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_06021504_index_notation_003()); + } +} diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021504_index_notation/Sem_06021504_index_notation_004.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021504_index_notation/Sem_06021504_index_notation_004.ttcn new file mode 100644 index 0000000..063a377 --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021504_index_notation/Sem_06021504_index_notation_004.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @author TTF T003 + ** @version 0.0.1 + ** @purpose 1:6.2.15.4, Verify that the isbound operator can be used with maps + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Presence of a mapping for a key can be checked by using the isbound, isvalue or ispresent +// with an index notation as its argument. + +module Sem_06021504_index_notation_004 { + type map from charstring to integer TMap1; + type component C {} + + testcase TC_Sem_06021504_index_notation_004() runs on C { + var TMap1 v_map := { ["test"] := 1, ["xyz"] := 5 }; + if (isbound(v_map["test"]) and not isbound(v_map["abc"])) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_06021504_index_notation_004()); + } +} diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021504_index_notation/Sem_06021504_index_notation_005.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021504_index_notation/Sem_06021504_index_notation_005.ttcn new file mode 100644 index 0000000..63a8738 --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021504_index_notation/Sem_06021504_index_notation_005.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @author TTF T003 + ** @version 0.0.1 + ** @purpose 1:6.2.15.4, Verify that the isvalue operator can be used with maps + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Presence of a mapping for a key can be checked by using the isbound, isvalue or ispresent +// with an index notation as its argument. + +module Sem_06021504_index_notation_005 { + type map from charstring to integer TMap1; + type component C {} + + testcase TC_Sem_06021504_index_notation_005() runs on C { + var TMap1 v_map := { ["test"] := 1, ["xyz"] := 5 }; + if (isvalue(v_map["test"]) and not isvalue(v_map["abc"])) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_06021504_index_notation_005()); + } +} diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021504_index_notation/Sem_06021504_index_notation_006.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021504_index_notation/Sem_06021504_index_notation_006.ttcn new file mode 100644 index 0000000..149eb02 --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021504_index_notation/Sem_06021504_index_notation_006.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @author TTF T003 + ** @version 0.0.1 + ** @purpose 1:6.2.15.4, Verify that the ispresent operator can be used with maps + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Presence of a mapping for a key can be checked by using the isbound, isvalue or ispresent +// with an index notation as its argument. + +module Sem_06021504_index_notation_006 { + type map from charstring to integer TMap1; + type component C {} + + testcase TC_Sem_06021504_index_notation_006() runs on C { + var TMap1 v_map := { ["test"] := 1, ["xyz"] := 5 }; + if (ispresent(v_map["test"]) and not ispresent(v_map["abc"])) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_06021504_index_notation_006()); + } +} \ No newline at end of file diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021505_accessing_the_keys/Sem_06021505_accessing_the_keys_001.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021505_accessing_the_keys/Sem_06021505_accessing_the_keys_001.ttcn new file mode 100644 index 0000000..1feae6d --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021505_accessing_the_keys/Sem_06021505_accessing_the_keys_001.ttcn @@ -0,0 +1,16 @@ +/*************************************************** + ** @author TTF T003 + ** @version 0.0.1 + ** @purpose 1:6.2.15.5, Verify that it is possible to derive a set of keys from a map type + ** @verdict pass accept, noexecution + ***************************************************/ + +// The following requirement is tested: +// If the MapValue is a value of type MapValueType defined as map fromAtoB then MapValue.from yields +// a result compatible with type setof A that contains all the key values from MapValue. This type +// can also be referenced as MapValueType.from. + +module Sem_06021505_accessing_the_keys_001 { + type map from charstring to integer TMap1; + template TMap1.from m_keys := {"abc", "def" } +} diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021505_accessing_the_keys/Sem_06021505_accessing_the_keys_002.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021505_accessing_the_keys/Sem_06021505_accessing_the_keys_002.ttcn new file mode 100644 index 0000000..20af873 --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021505_accessing_the_keys/Sem_06021505_accessing_the_keys_002.ttcn @@ -0,0 +1,31 @@ +/*************************************************** + ** @author TTF T003 + ** @version 0.0.1 + ** @purpose 1:6.2.15.5, Verify that it is possible to get a set of keys from a map value + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// If the MapValue is a value of type MapValueType defined as map fromAtoB then MapValue.from yields +// a result compatible with type setof A that contains all the key values from MapValue. This type +// can also be referenced as MapValueType.from. + +module Sem_06021505_accessing_the_keys_002 { + type map from charstring to integer TMap1; + type component C {} + + testcase TC_Sem_06021505_accessing_the_keys_002() runs on C { + var TMap1 v_map; + v_map["test"] := 1; + v_map["xyz"] := 5; + if (match(v_map.from, { "test", "xyz" })) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_06021505_accessing_the_keys_002()); + } +} diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021506_accessing_the_values/Sem_06021506_accessing_the_values_001.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021506_accessing_the_values/Sem_06021506_accessing_the_values_001.ttcn new file mode 100644 index 0000000..d270437 --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021506_accessing_the_values/Sem_06021506_accessing_the_values_001.ttcn @@ -0,0 +1,16 @@ +/*************************************************** + ** @author TTF T003 + ** @version 0.0.1 + ** @purpose 1:6.2.15.6, Verify that it is possible to derive a set of values from a map type + ** @verdict pass accept, noexecution + ***************************************************/ + +// The following requirement is tested: +// If MapValue is a value of type MapValueType defined as mapfromAtoB then MapValue.to yields a result +// compatible with type set ofB that contains all the values from MapValue. This type can also be +// referenced as MapValueType.to. + +module Sem_06021506_accessing_the_values_001 { + type map from charstring to integer TMap1; + template TMap1.to m_values := {1, 2 } +} diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021506_accessing_the_values/Sem_06021506_accessing_the_values_002.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021506_accessing_the_values/Sem_06021506_accessing_the_values_002.ttcn new file mode 100644 index 0000000..98e8f4e --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021506_accessing_the_values/Sem_06021506_accessing_the_values_002.ttcn @@ -0,0 +1,31 @@ +/*************************************************** + ** @author TTF T003 + ** @version 0.0.1 + ** @purpose 1:6.2.15.6, Verify that it is possible to get a set of values from a map value + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// If MapValue is a value of type MapValueType defined as mapfromAtoB then MapValue.to yields a result +// compatible with type set ofB that contains all the values from MapValue. This type can also be +// referenced as MapValueType.to. + +module Sem_06021506_accessing_the_values_002 { + type map from charstring to integer TMap1; + type component C {} + + testcase TC_Sem_06021506_accessing_the_values_002() runs on C { + var TMap1 v_map; + v_map["test"] := 1; + v_map["xyz"] := 5; + if (match(v_map.to, { 1, 5 })) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_06021506_accessing_the_values_002()); + } +} diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021507_referencing_of_elements/Sem_06021507_referencing_of_elements_001.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021507_referencing_of_elements/Sem_06021507_referencing_of_elements_001.ttcn new file mode 100644 index 0000000..8a8fb0f --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021507_referencing_of_elements/Sem_06021507_referencing_of_elements_001.ttcn @@ -0,0 +1,35 @@ +/*************************************************** + ** @author TTF T003 + ** @version 0.0.1 + ** @purpose 1:6.2.15.7, Verify that an uninitialized map is properly expanded + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// When referencing an element of an uninitialized map value or field or omitted field (including +// omitting a field at a higher level of the embedding hierarchy) on the left-hand side of an assignment, +// the reference shall recursively be expanded up to and including the depth of the referenced element + +module Sem_06021507_referencing_of_elements_001 { + type record R { + integer field1, + integer field2, + integer field3 optional + } + type map from charstring to R TMap1; + type component C {} + + testcase TC_Sem_06021507_referencing_of_elements_001() runs on C { + var TMap1 v_map; + v_map["test"].field1 := 1; + if (not isbound(v_map["test"].field2) and not ispresent(v_map["test"].field3)) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_06021507_referencing_of_elements_001()); + } +} diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021507_referencing_of_elements/Sem_06021507_referencing_of_elements_002.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021507_referencing_of_elements/Sem_06021507_referencing_of_elements_002.ttcn new file mode 100644 index 0000000..ab27897 --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021507_referencing_of_elements/Sem_06021507_referencing_of_elements_002.ttcn @@ -0,0 +1,39 @@ +/*************************************************** + ** @author TTF T003 + ** @version 0.0.1 + ** @purpose 1:6.2.15.7, Verify that an omitted map is properly expanded + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// When referencing an element of an uninitialized map value or field or omitted field (including +// omitting a field at a higher level of the embedding hierarchy) on the left-hand side of an assignment, +// the reference shall recursively be expanded up to and including the depth of the referenced element + +module Sem_06021507_referencing_of_elements_002 { + type record R { + integer field1, + integer field2, + integer field3 optional + } + type map from charstring to R TMap1; + type record MyType { + TMap1 mapField optional + } + type component C {} + + testcase TC_Sem_06021507_referencing_of_elements_002() runs on C { + var MyType v_val; + v_val.mapField := omit; + v_val.mapField["test"].field1 := 1; + if (not isbound(v_val.mapField["test"].field2) and not ispresent(v_val.mapField["test"].field3)) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_06021507_referencing_of_elements_002()); + } +} diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021508_nested_type_definitions/Sem_06021508_nested_type_definitions_001.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021508_nested_type_definitions/Sem_06021508_nested_type_definitions_001.ttcn new file mode 100644 index 0000000..4611307 --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021508_nested_type_definitions/Sem_06021508_nested_type_definitions_001.ttcn @@ -0,0 +1,17 @@ +/*************************************************** + ** @author TTF T003 + ** @version 0.0.1 + ** @purpose 1:6.2.15.8, Verify that it is possible to use a nested type as a key + ** @verdict pass accept, noexecution + ***************************************************/ + +// The following requirement is tested: +// TTCN-3 supports the definition of map types with nested structured types for the to part. The usage +// of structured types (record, set, enumerated, setof, recordof and map) is allowed. + +module Sem_06021508_nested_type_definitions_001 { + type map from record { + integer field1, + charstring field2 + } to integer TMap1; +} diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021508_nested_type_definitions/Sem_06021508_nested_type_definitions_002.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021508_nested_type_definitions/Sem_06021508_nested_type_definitions_002.ttcn new file mode 100644 index 0000000..0b0a38a --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/060215_map_types/06021508_nested_type_definitions/Sem_06021508_nested_type_definitions_002.ttcn @@ -0,0 +1,17 @@ +/*************************************************** + ** @author TTF T003 + ** @version 0.0.1 + ** @purpose 1:6.2.15.8, Verify that it is possible to use a nested type as a value of a map + ** @verdict pass accept, noexecution + ***************************************************/ + +// The following requirement is tested: +// TTCN-3 supports the definition of map types with nested structured types for the to part. The usage +// of structured types (record, set, enumerated, setof, recordof and map) is allowed. + +module Sem_06021508_nested_type_definitions_002 { + type map from charstring to union { + integer option1, + charstring option2 + } TMap1; +} diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/060216_the_open_type/NegSem_060216__the_open_type_001.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/060216_the_open_type/NegSem_060216__the_open_type_001.ttcn new file mode 100644 index 0000000..25e0402 --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/060216_the_open_type/NegSem_060216__the_open_type_001.ttcn @@ -0,0 +1,22 @@ +/*************************************************** + * @author TTF T003 + * @version 0.0.1 + * @purpose 1.6.2.16, Ensure that the open type is forbidden in Type declarations. + * @verdict pass reject + ***************************************************/ + +module NegSem_060216_the_open_type_001 { + type component GeneralComp { + } + + type any MyOpenType; //not allowed + + testcase TC_Sem_060216_the_open_type_001() runs on GeneralComp { + //empty testcase + setverdict(pass); + } + + control { + execute(TC_Sem_060216_the_open_type_001()); + }; +} diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/060216_the_open_type/NegSem_060216__the_open_type_002.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/060216_the_open_type/NegSem_060216__the_open_type_002.ttcn new file mode 100644 index 0000000..44153ef --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/060216_the_open_type/NegSem_060216__the_open_type_002.ttcn @@ -0,0 +1,25 @@ +/*************************************************** + * @author TTF T003 + * @version 0.0.1 + * @purpose 1.6.2.16, Ensure that the open type is forbidden in Variable declarations. + * @verdict pass reject + ***************************************************/ + +module NegSem_060216_the_open_type_002 { + type component GeneralComp { + } + + testcase TC_Sem_060216_the_open_type_002() runs on GeneralComp { + var any v_any; // not allowed + + if (match(int2str(55), "55")) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_060216_the_open_type_002()); + }; +} diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/060216_the_open_type/NegSem_060216__the_open_type_003.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/060216_the_open_type/NegSem_060216__the_open_type_003.ttcn new file mode 100644 index 0000000..b816ae7 --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/060216_the_open_type/NegSem_060216__the_open_type_003.ttcn @@ -0,0 +1,22 @@ +/*************************************************** + * @author TTF T003 + * @version 0.0.1 + * @purpose 1.6.2.16, Ensure that the open type is forbidden in Template declarations. + * @verdict pass reject + ***************************************************/ + +module NegSem_060216_the_open_type_003 { + type component GeneralComp { + } + + template any MyOpenTemplate := {0,1,2} //not allowed + + testcase TC_Sem_060216_the_open_type_003() runs on GeneralComp { + //empty TC + setverdict(pass); + } + + control { + execute(TC_Sem_060216_the_open_type_003()); + }; +} diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/060216_the_open_type/NegSem_060216__the_open_type_004.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/060216_the_open_type/NegSem_060216__the_open_type_004.ttcn new file mode 100644 index 0000000..fd132ae --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/060216_the_open_type/NegSem_060216__the_open_type_004.ttcn @@ -0,0 +1,22 @@ +/*************************************************** + * @author TTF T003 + * @version 0.0.1 + * @purpose 1.6.2.16, Ensure that the open type is forbidden in Constant declarations. + * @verdict pass reject + ***************************************************/ + +module NegSem_060216_the_open_type_004 { + type component GeneralComp { + } + + const any myOpenConst := 2; //not allowed + + testcase TC_Sem_060216_the_open_type_004() runs on GeneralComp { + //empty TC + setverdict(pass); + } + + control { + execute(TC_Sem_060216_the_open_type_004()); + }; +} diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/060216_the_open_type/NegSem_060216__the_open_type_005.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/060216_the_open_type/NegSem_060216__the_open_type_005.ttcn new file mode 100644 index 0000000..6b65493 --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/060216_the_open_type/NegSem_060216__the_open_type_005.ttcn @@ -0,0 +1,22 @@ +/*************************************************** + * @author TTF T003 + * @version 0.0.1 + * @purpose 1.6.2.16, Ensure that the open type is forbidden in Module parameter declarations. + * @verdict pass reject + ***************************************************/ + +module NegSem_060216_the_open_type_005 { + type component GeneralComp { + } + + modulepar any myOpenModulPar := 1; // not allowed + + testcase TC_Sem_060216_the_open_type_005() runs on GeneralComp { + //empty TC + setverdict(pass); + } + + control { + execute(TC_Sem_060216_the_open_type_005()); + }; +} diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/060216_the_open_type/NegSem_060216__the_open_type_006.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/060216_the_open_type/NegSem_060216__the_open_type_006.ttcn new file mode 100644 index 0000000..ac3701d --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/060216_the_open_type/NegSem_060216__the_open_type_006.ttcn @@ -0,0 +1,22 @@ +/*************************************************** + * @author TTF T003 + * @version 0.0.1 + * @purpose 1.6.2.16, Ensure that the open type is forbidden as formal parameters of templates. + * @verdict pass reject + ***************************************************/ + +module NegSem_060216_the_open_type_006 { + type component GeneralComp { + } + + template integer MyTemplate(any p_any) := p_any; //not allowed + + testcase TC_Sem_060216_the_open_type_006() runs on GeneralComp { + //empty TC + setverdict(pass); + } + + control { + execute(TC_Sem_060216_the_open_type_006()); + }; +} diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/060216_the_open_type/NegSem_060216__the_open_type_007.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/060216_the_open_type/NegSem_060216__the_open_type_007.ttcn new file mode 100644 index 0000000..1a1d252 --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/060216_the_open_type/NegSem_060216__the_open_type_007.ttcn @@ -0,0 +1,29 @@ +/*************************************************** + * @author TTF T003 + * @version 0.0.1 + * @purpose 1.6.2.16, Ensure that the open type is forbidden as formal parameters of testcases. + * @verdict pass reject + ***************************************************/ + +module NegSem_060216_the_open_type_007 { + type component GeneralComp { + } + + function f_my_function(in any parameter) return integer{ + return 1; + }; + + testcase TC_Sem_060216_the_open_type_007(in any p_any) runs on GeneralComp { + var integer v_i := 123; + + if (f_my_function(v_i) == 1) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_060216_the_open_type_007()); + }; +} diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/060216_the_open_type/NegSem_060216__the_open_type_008.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/060216_the_open_type/NegSem_060216__the_open_type_008.ttcn new file mode 100644 index 0000000..707a443 --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/060216_the_open_type/NegSem_060216__the_open_type_008.ttcn @@ -0,0 +1,34 @@ +/*************************************************** + * @author TTF T003 + * @version 0.0.1 + * @purpose 1.6.2.16, Ensure that the open type is forbidden as formal parameters of altsteps. + * @verdict pass reject + ***************************************************/ + +module NegSem_060216_the_open_type_008 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + altstep a_test(any p_any) runs on GeneralComp{ //not allowed + [] any port.receive { + setverdict(pass); + } + } + + testcase TC_Sem_060216_the_open_type_008() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + connect(mtc:p, v_ptc:p); + p.send(1); + v_ptc.start(a_test(p)); + v_ptc.done; + } + + control { + execute(TC_Sem_060216_the_open_type_007()); + }; +} diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/060216_the_open_type/NegSem_060216__the_open_type_009.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/060216_the_open_type/NegSem_060216__the_open_type_009.ttcn new file mode 100644 index 0000000..6dd850a --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/060216_the_open_type/NegSem_060216__the_open_type_009.ttcn @@ -0,0 +1,29 @@ +/*************************************************** + * @author TTF T003 + * @version 0.0.1 + * @purpose 1.6.2.16, Ensure that the open type is forbidden as formal parameters of non-external functions. + * @verdict pass reject + ***************************************************/ + +module NegSem_060216_the_open_type_009 { + type component GeneralComp { + } + + function f_my_function(in any parameter) return integer{ + return 1; + }; + + testcase TC_Sem_060216_the_open_type_009() runs on GeneralComp { + var integer v_i := 123; + + if (f_my_function(v_i) == 1) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_060216_the_open_type_007()); + }; +} diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/060216_the_open_type/NegSem_060216__the_open_type_010.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/060216_the_open_type/NegSem_060216__the_open_type_010.ttcn new file mode 100644 index 0000000..8ad6771 --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/060216_the_open_type/NegSem_060216__the_open_type_010.ttcn @@ -0,0 +1,29 @@ +/*************************************************** + * @author TTF T003 + * @version 0.0.1 + * @purpose 1.6.2.16, Ensure that the open type is forbidden as return parameters of functions. + * @verdict pass reject + ***************************************************/ + +module NegSem_060216_the_open_type_010 { + type component GeneralComp { + } + + function f_my_function(in integer p_int) return any{ + return p_int; + }; + + testcase TC_Sem_060216_the_open_type_010() runs on GeneralComp { + var integer v_i := 123; + + if (f_my_function(v_i) == 123) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_060216_the_open_type_007()); + }; +} diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/060216_the_open_type/Sem_060216_the_open_type_001.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/060216_the_open_type/Sem_060216_the_open_type_001.ttcn new file mode 100644 index 0000000..5712f4e --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/060216_the_open_type/Sem_060216_the_open_type_001.ttcn @@ -0,0 +1,26 @@ +/*************************************************** + * @author TTF T003 + * @version 0.0.1 + * @purpose 1.6.2.16, Verify that it is possible to use the open type as a formal parameter. + * @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +// The following requirement is tested: +// The open type is represented by the keyword any. +// It shall only be used in formal parameters of external and predefined functions. +module Sem_060216_the_open_type_001 { + type component GeneralComp { + } + + external function xf_my_external_function(in any p_any); + + testcase TC_Sem_060216_the_open_type_001() runs on GeneralComp { + var integer v_i := 123; + + xf_my_external_function(v_i); + setverdict(pass); + } + + control { + execute(TC_Sem_060216_the_open_type_001()); + }; +} diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/NegSem_0602_TopLevel_005.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/NegSem_0602_TopLevel_005.ttcn new file mode 100644 index 0000000..c0977ea --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/NegSem_0602_TopLevel_005.ttcn @@ -0,0 +1,39 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:6.2, Ensure that mixed list and assignment notation index shall not appear more than once + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: + /* + * In these notations this notation each assigned field or index shall not appear more + * than once and assignments to fields or indexes given in list notation are not allowed. + * */ + +module NegSem_0602_TopLevel_005 { + + type record MyRecordType{ + integer field1, + integer field2, + integer field3 + } + type component GeneralComp { + } + +testcase TC_NegSem_0602_TopLevel_005() runs on GeneralComp { + + var MyRecordType v_r := {1, 2, field1 := 3 // error, field1 is already given + }; + + if ( match(v_r, {1,2,3})) { + setverdict(pass); + } + else{ + setverdict(fail); + } +} + control { + execute(TC_NegSem_0602_TopLevel_005()); + } +} \ No newline at end of file diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/NegSem_0602_TopLevel_006.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/NegSem_0602_TopLevel_006.ttcn new file mode 100644 index 0000000..7364586 --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/NegSem_0602_TopLevel_006.ttcn @@ -0,0 +1,38 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:6.2, Ensure that mixed list and assignment notation index shall not appear more than once + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +/* In these notations this notation each assigned field or index shall not appear more + * than once and assignments to fields or indexes given in list notation are not allowed. + * */ + +module NegSem_0602_TopLevel_006 { + + type set MySetType{ + integer field1, + integer field2, + integer field3 + } + type component GeneralComp { + } + +testcase TC_NegSem_0602_TopLevel_006() runs on GeneralComp { + + var MySetType v_s := {1, 2, field1 := 3 // error, field1 is already given + }; + + if ( match(v_s, {1,2,3})) { + setverdict(pass); + } + else{ + setverdict(fail); + } +} + control { + execute(TC_NegSem_0602_TopLevel_006()); + } +} \ No newline at end of file diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/NegSem_0602_TopLevel_007.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/NegSem_0602_TopLevel_007.ttcn new file mode 100644 index 0000000..355f18d --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/NegSem_0602_TopLevel_007.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:6.2, Ensure that mixed list and assignment notation index shall not appear more than once + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +/* In these notations this notation each assigned field or index shall not appear + * more than once and assignments to fields or indexes given in list + * notation are not allowed. */ + +module NegSem_0602_TopLevel_007 { + + type record MyRecord { + integer field1, + charstring field2, + float field3 + } + + type record of MyRecord MyRo; + + type component GeneralComp { + } + +testcase TC_NegSem_0602_TopLevel_007() runs on GeneralComp { + + var MyRo v_myRecordOf := { + {5, field3 := 3.14, field2 := "ABCD"}, + {6, field3 := 6.28, field2 := "EFGH"}, + [1] := {7, field3 := 12.56, field2 := "IJKL"} // error: already given + }; // mixed notation (assignment + list) +} + control { + execute(TC_NegSem_0602_TopLevel_007()); + } +} \ No newline at end of file diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/NegSem_0602_TopLevel_008.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/NegSem_0602_TopLevel_008.ttcn new file mode 100644 index 0000000..c0745f2 --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/NegSem_0602_TopLevel_008.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:6.2, Ensure that mixed list and assignment notation index shall not appear more than once + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: + /* In these notations this notation each assigned field or index shall not appear + * more than once and assignments to fields or indexes given in list notation are not allowed. + * */ + +module NegSem_0602_TopLevel_008 { + + type set MySet { + integer field1, + charstring field2, + float field3 + } + + type set of MySet MySo; + + type component GeneralComp { + } + +testcase TC_NegSem_0602_TopLevel_008() runs on GeneralComp { + + var MySo v_mySo := { + {5, field3 := 3.14, field2 := "ABCD"}, + {6, field3 := 6.28, field2 := "EFGH"}, + [1] := {7, field3 := 12.56, field2 := "IJKL"} // error: already given + }; // mixed notation (assignment + list) +} + control { + execute(TC_NegSem_0602_TopLevel_008()); + } +} \ No newline at end of file diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/NegSem_0602_TopLevel_009.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/NegSem_0602_TopLevel_009.ttcn new file mode 100644 index 0000000..c87acc4 --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/NegSem_0602_TopLevel_009.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:6.2, Ensure that mixed list and assignment notation index shall not appear more than once + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +/* In these notations this notation each assigned field or index shall not appear + * more than once and assignments to fields or indexes given in list notation are not allowed. + * */ + +module NegSem_0602_TopLevel_009 { + + type integer MyArrayType[3]; + + type component GeneralComp { + } + +testcase TC_NegSem_0602_TopLevel_009() runs on GeneralComp { + + var MyArrayType v_myArray := { 1, [0] := 3, [2] := 3, [1] := 2}; // error: index 0 is already given + +} + control { + execute(TC_NegSem_0602_TopLevel_009()); + } +} \ No newline at end of file diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/NegSem_0602_TopLevel_010.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/NegSem_0602_TopLevel_010.ttcn new file mode 100644 index 0000000..9c0598c --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/NegSem_0602_TopLevel_010.ttcn @@ -0,0 +1,42 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:6.2, Ensure that mixed list and assignment notation are evaluated correctly + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +/* It is allowed to mix the two value notations in the same (immediate) + * context only in such a way that elements in list notation do not follow + * elements in assignment notation. + * */ + +module NegSem_0602_TopLevel_010 { + + type record MyRecordType{ + integer field1, + integer field2, + integer field3 + } + type component GeneralComp { + } + + type component GeneralComp { + } + +testcase TC_NegSem_0602_TopLevel_010() runs on GeneralComp { + + var MyRecordType v_r := {1, field3 := 3 , 2 }; // error: assignment notation after list notification, + + + if ( match(v_r, {1,2,3})) { + setverdict(pass); + } + else{ + setverdict(fail); + } +} + control { + execute(TC_NegSem_0602_TopLevel_010()); + } +} \ No newline at end of file diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/Sem_0602_TopLevel_015.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/Sem_0602_TopLevel_015.ttcn new file mode 100644 index 0000000..62ebf44 --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/Sem_0602_TopLevel_015.ttcn @@ -0,0 +1,47 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:6.2, Ensure that assignment notation can be used for a record type. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + + /* The following requirement is tested: Mandatory fields, not explicitly referred to in the notation or explicitely unspecified using the not used symbol "-", shall remain unchanged. */ + +module Sem_0602_TopLevel_015 { + + + type component GeneralComp { + } + + type record MyRecord { + integer field1, + charstring field2 optional, + float field3 + } + + testcase TC_Sem_0602_TopLevel_015() runs on GeneralComp { + + var MyRecord v_myRecord := { + field1 := 5, + field2 := "hi", + field3 := 3.14 + }; + + // change value "field1" and "field3". Leave "field2" unchanged. + v_myRecord := { + field1 := 3, + field3 := 2.0 + }; + + if (match(v_myRecord, {3,"hi",2.0})) { + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_0602_TopLevel_015()); + } +} \ No newline at end of file diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/Sem_0602_TopLevel_016.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/Sem_0602_TopLevel_016.ttcn new file mode 100644 index 0000000..fae0a93 --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/Sem_0602_TopLevel_016.ttcn @@ -0,0 +1,48 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:6.2, Ensure that assignment notation can be used for a record type. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + + /* The following requirement is tested: Mandatory fields, not explicitly referred to in the notation or explicitely unspecified using the not used symbol "-", shall remain unchanged. */ + +module Sem_0602_TopLevel_016 { + + + type component GeneralComp { + } + + type record MyRecord { + integer field1, + charstring field2 optional, + float field3 + } + + testcase TC_Sem_0602_TopLevel_016() runs on GeneralComp { + + var MyRecord v_myRecord := { + field1 := 5, + field2 := "hi", + field3 := 3.14 + }; + + // change value "field1" and "field3" + v_myRecord := { + field1 := 3, + field2 := -, // "field2" is unchanged. + field3 := 2.0 + }; + + if (match(v_myRecord, {3,"hi",2.0})) { + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_0602_TopLevel_016()); + } +} \ No newline at end of file diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/Sem_0602_TopLevel_017.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/Sem_0602_TopLevel_017.ttcn new file mode 100644 index 0000000..9456004 --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/Sem_0602_TopLevel_017.ttcn @@ -0,0 +1,41 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:6.2, Ensure that assignment notation can be used for a record type. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +/* The following requirement is tested: Fields not mentioned are implicitly left uninitialized. When re-assigning a previously initialized value, using the not used symbol or just skipping a field in an assignment notation, will cause that field to remain unchanged. Even when specifying partial values each field shall not appear more than once.*/ + +module Sem_0602_TopLevel_017 { + + + type component GeneralComp { + } + + type record MyRecord { + integer field1, + charstring field2 optional, + float field3 + } + + testcase TC_Sem_0602_TopLevel_017() runs on GeneralComp { + + var MyRecord v_myRecord := { + field1 := 5, + field3 := 3.14 + }; + + + if (not ispresent(v_myRecord.field2)) { + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_0602_TopLevel_017()); + } +} \ No newline at end of file diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/Sem_0602_TopLevel_018.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/Sem_0602_TopLevel_018.ttcn new file mode 100644 index 0000000..49d6a18 --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/Sem_0602_TopLevel_018.ttcn @@ -0,0 +1,44 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:6.2, Ensure that assignment notation can be used for a record type. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +/* The following requirement is tested: When the assignment notation is used in a scope, where the optional attribute is implicitly or explicitly set to +"explicit omit", optional and mandatory fields, not directly referred to in the notation shall remain +unchanged.When optional fields of variables are not assigned explicitly, they are uninitialized +*/ + +module Sem_0602_TopLevel_018 { + + + type component GeneralComp { + } + + type record MyRecord { + integer field1, + charstring field2 optional, + float field3 + } + + testcase TC_Sem_0602_TopLevel_018() runs on GeneralComp { + + var MyRecord v_myRecord := { + field1 := 5, + field3 := 3.14 + } with { optional "implicit omit" }; + + + if (match(v_myRecord.field2, omit)) { + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_0602_TopLevel_018()); + } +} \ No newline at end of file diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/Sem_0602_TopLevel_019.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/Sem_0602_TopLevel_019.ttcn new file mode 100644 index 0000000..0b55ccc --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/Sem_0602_TopLevel_019.ttcn @@ -0,0 +1,44 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:6.2, Ensure that assignment notation can be used for a record type. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +/* The following requirement is tested: When the assignment notation is used in a scope, where the optional attribute is implicitly or explicitly set to +"explicit omit", optional and mandatory fields, not directly referred to in the notation shall remain +unchanged.When optional fields of variables are not assigned explicitly, they are uninitialized +*/ + +module Sem_0602_TopLevel_019 { + + + type component GeneralComp { + } + + type record MyRecord { + integer field1, + charstring field2 optional, + float field3 + } + + testcase TC_Sem_0602_TopLevel_019() runs on GeneralComp { + + var MyRecord v_myRecord := { + field1 := 5, + field3 := 3.14 + } with { optional "explicit omit" }; + + + if (not ispresent(v_myRecord.field2) and match(v_myRecord.field1, 5) and match(v_myRecord.field3, 3.14)) { + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_0602_TopLevel_019()); + } +} \ No newline at end of file diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/Sem_0602_TopLevel_20.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/Sem_0602_TopLevel_20.ttcn new file mode 100644 index 0000000..6d47760 --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/Sem_0602_TopLevel_20.ttcn @@ -0,0 +1,40 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:6.2, Ensure that mixed list and assignment notation can be used for a record type. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +//The following requirement is tested: + /* + * Values of these types (record, set, record of , set of, array) may be given using an explicit assignment notation or a + * short-hand value list notation or in a mixed list and assignment notation. + */ + +module Sem_0602_TopLevel_20 +{ + type component GeneralComp { + } + + type record MyRecord { + integer field1, + charstring field2, + float field3 + } + + testcase TC_Sem_0602_TopLevel_020() runs on GeneralComp { + + var MyRecord v_myRecord := {5, field3 := 3.14, field2 := "ABCD"}; // mixed notation (assignment + list) + + if (match(v_myRecord, {5, "ABCD", 3.14})) { + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_0602_TopLevel_020()); + } +} \ No newline at end of file diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/Sem_0602_TopLevel_21.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/Sem_0602_TopLevel_21.ttcn new file mode 100644 index 0000000..fb7f3d6 --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/Sem_0602_TopLevel_21.ttcn @@ -0,0 +1,39 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:6.2, Ensure that mixed list and assignment notation can be used for a set type. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +//The following requirement is tested: + /* Values of these types (record, set, record of , set of, array) may be given using an explicit assignment notation or a + * short-hand value list notation or in a mixed list and assignment notation. + * */ + +module Sem_0602_TopLevel_21 +{ + type component GeneralComp { + } + + type set MySet{ + integer field1, + charstring field2, + float field3 + }; + + testcase TC_Sem_0602_TopLevel_021() runs on GeneralComp { + + var MySet v_mySet := {5, field3 := 3.14, field2 := "ABCD"}; // mixed notation (assignment + list) + + if (match(v_mySet, {5, "ABCD", 3.14})) { + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_0602_TopLevel_021()); + } +} \ No newline at end of file diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/Sem_0602_TopLevel_22.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/Sem_0602_TopLevel_22.ttcn new file mode 100644 index 0000000..957b66a --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/Sem_0602_TopLevel_22.ttcn @@ -0,0 +1,48 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:6.2, Ensure that mixed list and assignment notation can be used for a record of type. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +//The following requirement is tested: +/* Values of these types (record, set, record of , set of, array) may be given using an explicit assignment notation or a + * short-hand value list notation or in a mixed list and assignment notation. + * */ + +module Sem_0602_TopLevel_22 +{ + type component GeneralComp { + } + + type record MyRecord { + integer field1, + charstring field2, + float field3 + } + + type record of MyRecord MyRo; + +testcase TC_Sem_0602_TopLevel_022() runs on GeneralComp { + + var MyRo v_myRecordOf := { + {5, field3 := 3.14, field2 := "ABCD"}, + {6, field3 := 6.28, field2 := "EFGH"}, + [2] := {7, field3 := 12.56, field2 := "IJKL"} + }; // mixed notation (assignment + list) + + if (match(v_myRecordOf, + {{5, field3 := 3.14, field2 := "ABCD"}, + {6, field3 := 6.28, field2 := "EFGH"}, + {7, field3 := 12.56, field2 := "IJKL"}})) { + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_0602_TopLevel_022()); + } +} \ No newline at end of file diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/Sem_0602_TopLevel_23.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/Sem_0602_TopLevel_23.ttcn new file mode 100644 index 0000000..a8b45c6 --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/Sem_0602_TopLevel_23.ttcn @@ -0,0 +1,48 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:6.2, Ensure that mixed list and assignment notation can be used for a set of type. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +//The following requirement is tested: +/* Values of these types (record, set, record of , set of, array) may be given using an explicit assignment notation or a + * short-hand value list notation or in a mixed list and assignment notation. + * */ + +module Sem_0602_TopLevel_23 +{ + type component GeneralComp { + } + + type set MySet { + integer field1, + charstring field2, + float field3 + } + + type set of MySet MySo; + + testcase TC_Sem_0602_TopLevel_023() runs on GeneralComp { + + var MySo v_mySetOf := { + {5, field3 := 3.14, field2 := "ABCD"}, + {6, field3 := 6.28, field2 := "EFGH"}, + [2] := {7, field3 := 12.56, field2 := "IJKL"} + }; // mixed notation (assignment + list) + + if (match(v_mySetOf, + {{5, field3 := 3.14, field2 := "ABCD"}, + {6, field3 := 6.28, field2 := "EFGH"}, + {7, field3 := 12.56, field2 := "IJKL"}})) { + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_0602_TopLevel_023()); + } +} \ No newline at end of file diff --git a/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/Sem_0602_TopLevel_24.ttcn b/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/Sem_0602_TopLevel_24.ttcn new file mode 100644 index 0000000..7a84515 --- /dev/null +++ b/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/Sem_0602_TopLevel_24.ttcn @@ -0,0 +1,35 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:6.2, Ensure that mixed list and assignment notation can be used for an array type. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +//The following requirement is tested: +/* Values of these types (record, set, record of , set of, array) may be given using an explicit assignment notation or a + * short-hand value list notation or in a mixed list and assignment notation. + * */ + +module Sem_0602_TopLevel_24 +{ + type component GeneralComp { + } + + type integer MyArrayType[3]; + + testcase TC_Sem_0602_TopLevel_024() runs on GeneralComp { + + var MyArrayType v_myArray := { 1, [2] := 3, [1] := 2}; // mixed notation (assignment + list) + + if (match(v_myArray, {1,2,3})) { + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_0602_TopLevel_024()); + } +} \ No newline at end of file diff --git a/core_language/06_types_and_values/0603_type_compatibility/060302_structured_types/Sem_060302_structured_types_007.ttcn b/core_language/06_types_and_values/0603_type_compatibility/060302_structured_types/Sem_060302_structured_types_007.ttcn new file mode 100644 index 0000000..418b089 --- /dev/null +++ b/core_language/06_types_and_values/0603_type_compatibility/060302_structured_types/Sem_060302_structured_types_007.ttcn @@ -0,0 +1,51 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:6.3.2, Ensure that the IUT correctly handles assignments from structures having compatible types + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/*The following requirement is tested: Using union values of unions with default alternatives. + +A union value "b" of union type "B" with a default alternative of type +"C" is compatible with an arbitrary type "A" if the alternative selected in "b" is the default alternative and the +value of the default alternative is compatible to "A". A value "a" of an arbitrary type "A" is compatible with a +union type "B" with a default alternative of type "C" if value "a" is compatible to "C". + + */ + +module Sem_060302_structured_types_007 { + + type union U { + @default integer option1, + boolean option2 + } + + type union U2 { + integer option1, + @default boolean option2 + } + + type component GeneralComp { + } + + testcase TC_Sem_060302_structured_types_007() runs on GeneralComp { + + var U v_u1 := 3; // using default value of U + var U2 v_u2 := v_u1; // setting option1 to v_u2 + + if(match(v_u1,v_u2)){ + // correct because all alternatives in U exist in U2 and are compatible + setverdict(pass); + } + else { + setverdict(fail); + } + + + } + + control{ + execute(TC_Sem_060302_structured_types_007()); + } + +} diff --git a/core_language/06_types_and_values/0603_type_compatibility/060302_structured_types/Sem_060302_structured_types_008.ttcn b/core_language/06_types_and_values/0603_type_compatibility/060302_structured_types/Sem_060302_structured_types_008.ttcn new file mode 100644 index 0000000..75679f2 --- /dev/null +++ b/core_language/06_types_and_values/0603_type_compatibility/060302_structured_types/Sem_060302_structured_types_008.ttcn @@ -0,0 +1,51 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:6.3.2, Ensure that the IUT correctly handles assignments from structures having compatible types + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/*The following requirement is tested: Using union values of unions with default alternatives. + +A union value "b" of union type "B" with a default alternative of type +"C" is compatible with an arbitrary type "A" if the alternative selected in "b" is the default alternative and the +value of the default alternative is compatible to "A". A value "a" of an arbitrary type "A" is compatible with a +union type "B" with a default alternative of type "C" if value "a" is compatible to "C". + + */ + +module Sem_060302_structured_types_008 { + + type union U { + integer option1, + @default boolean option2 + } + + type union U2 { + @default integer option1, + boolean option2 + } + + type component GeneralComp { + } + + testcase TC_Sem_060302_structured_types_008() runs on GeneralComp { + + var U v_u1 := true; // using default value of U + var U2 v_u2 := {option2 := true}; + + if(match(v_u1,v_u2)){ + // correct because all alternatives in U exist in U2 and are compatible + setverdict(pass); + } + else { + setverdict(fail); + } + + + } + + control{ + execute(TC_Sem_060302_structured_types_008()); + } + +} diff --git a/core_language/06_types_and_values/0603_type_compatibility/060302_structured_types/Sem_060302_structured_types_009.ttcn b/core_language/06_types_and_values/0603_type_compatibility/060302_structured_types/Sem_060302_structured_types_009.ttcn new file mode 100644 index 0000000..3265715 --- /dev/null +++ b/core_language/06_types_and_values/0603_type_compatibility/060302_structured_types/Sem_060302_structured_types_009.ttcn @@ -0,0 +1,31 @@ +/*************************************************** + ** @author STF 409, updated by STF 572 + ** @version 0.0.2 + ** @purpose 1:6.3.2.1, Compatible enumerated types + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_060302_structured_types_009 { + + type enumerated EnumeratedType {e_black, e_white}; + type enumerated EnumeratedRedefinition {e_black, e_white}; + + + +type component GeneralComp { +} + +testcase TC_Sem_060302_structured_types_009() runs on GeneralComp { + + var EnumeratedType v_enum1:=e_black; + var EnumeratedRedefinition v_enum2; + + v_enum2:=v_enum1; // not a synonym type + setverdict(pass); +} + +control{ + execute(TC_Sem_060302_structured_types_009()); +} + +} diff --git a/core_language/06_types_and_values/0603_type_compatibility/060302_structured_types/Sem_060302_structured_types_010.ttcn b/core_language/06_types_and_values/0603_type_compatibility/060302_structured_types/Sem_060302_structured_types_010.ttcn new file mode 100644 index 0000000..5ceb0a2 --- /dev/null +++ b/core_language/06_types_and_values/0603_type_compatibility/060302_structured_types/Sem_060302_structured_types_010.ttcn @@ -0,0 +1,51 @@ +/*************************************************** + * @author TTF T003 + * @version 0.0.1 + * @purpose 1.6.2.16, Verify that existing TTCN-3 types are compatible with the open type. + * @verdict pass accept + ***************************************************/ +module Sem_060302_structured_type_010 { + type component GeneralComp { + } + + type record MyRecord {float field1, float field2 optional}; + type set of integer MySet; + type enumerated MyEnum {e_key1}; + + /** + * @return always true + */ + external function xf_my_external_function(in any p_any) return boolean; + + testcase TC_Sem_060302_structured_type_010() + runs on GeneralComp { + var integer v_i := 4; + var MyRecord v_record := { 1.0, 2.0 }; + var MySet v_set := { 0, 1, 2}; + var MyEnum v_enum := e_key1; + var anytype v_any := { charstring := "Hello" }; + + if (xf_my_external_function(p_any := v_i)/* and //integer + xf_my_external_function(p_any := int2float(v_i)) and //float + xf_my_external_function(p_any := int2char(v_i)) and //char + xf_my_external_function(p_any := int2str(v_i)) and //charstring + xf_my_external_function(p_any := int2unichar(v_i)) and //universal charstring + xf_my_external_function(p_any := int2bit(v_i,4)) and //bitstring + xf_my_external_function(p_any := int2hex(v_i,4)) and //hexstring + xf_my_external_function(p_any := int2oct(v_i,4)) and //octetstring + xf_my_external_function(p_any := v_record) and //MyRecord + xf_my_external_function(p_any := v_set) and //MySet + xf_my_external_function(p_any := v_enum) and //MyEnum + xf_my_external_function(p_any := v_any)*/ //anytype + ) { + log(v_i); + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_060302_structured_type_010()); + }; +} diff --git a/core_language/06_types_and_values/0603_type_compatibility/060306_compatibility_of_port_types/NegSem_060306_compatibility_of_port_types_001.ttcn b/core_language/06_types_and_values/0603_type_compatibility/060306_compatibility_of_port_types/NegSem_060306_compatibility_of_port_types_001.ttcn new file mode 100644 index 0000000..5127556 --- /dev/null +++ b/core_language/06_types_and_values/0603_type_compatibility/060306_compatibility_of_port_types/NegSem_060306_compatibility_of_port_types_001.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:6.3.6, verify that port type is not compatible with a non-port type + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// For variables, constants and parameters of port types, the reference to a port "b" of type "B" is compatible to type "A" +// if type "B" and type "A" are equal or synonym types. + +module NegSem_060306_compatibility_of_port_types_001 { + type port P message { + inout integer + } + + type component GeneralComp { + } + + testcase TC_NegSem_060306_compatibility_of_port_types_001() runs on GeneralComp { + var P v_port := self; + setverdict(pass); + } + + control { + execute(TC_NegSem_060306_compatibility_of_port_types_001()); + } +} diff --git a/core_language/06_types_and_values/0603_type_compatibility/060306_compatibility_of_port_types/NegSem_060306_compatibility_of_port_types_002.ttcn b/core_language/06_types_and_values/0603_type_compatibility/060306_compatibility_of_port_types/NegSem_060306_compatibility_of_port_types_002.ttcn new file mode 100644 index 0000000..c0211c4 --- /dev/null +++ b/core_language/06_types_and_values/0603_type_compatibility/060306_compatibility_of_port_types/NegSem_060306_compatibility_of_port_types_002.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:6.3.6, verify that port type is not compatible with a different port type + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// For variables, constants and parameters of port types, the reference to a port "b" of type "B" is compatible to type "A" +// if type "B" and type "A" are equal or synonym types. + +module NegSem_060306_compatibility_of_port_types_002 { + type port P message { + inout integer + } + + type port P2 message { + inout integer + } + + type component GeneralComp { + port P p; + } + + testcase TC_Sem_060306_compatibility_of_port_types_002() runs on GeneralComp { + var P2 v_port := p; + setverdict(pass); + } + + control { + execute(TC_Sem_060306_compatibility_of_port_types_002()); + } +} diff --git a/core_language/06_types_and_values/0603_type_compatibility/060306_compatibility_of_port_types/Sem_060306_compatibility_of_port_types_001.ttcn b/core_language/06_types_and_values/0603_type_compatibility/060306_compatibility_of_port_types/Sem_060306_compatibility_of_port_types_001.ttcn new file mode 100644 index 0000000..c9f7be3 --- /dev/null +++ b/core_language/06_types_and_values/0603_type_compatibility/060306_compatibility_of_port_types/Sem_060306_compatibility_of_port_types_001.ttcn @@ -0,0 +1,29 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:6.3.6, verify that port type is compatible with itself + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// For variables, constants and parameters of port types, the reference to a port "b" of type "B" is compatible to type "A" +// if type "B" and type "A" are equal or synonym types. + +module Sem_060306_compatibility_of_port_types_001 { + type port P message { + inout integer + } + type component GeneralComp { + port P p; + } + + + testcase TC_Sem_060306_compatibility_of_port_types_001() runs on GeneralComp { + var P v_port := p; + setverdict(pass); + } + + control { + execute(TC_Sem_060306_compatibility_of_port_types_001()); + } +} \ No newline at end of file diff --git a/core_language/06_types_and_values/0603_type_compatibility/060306_compatibility_of_port_types/Sem_060306_compatibility_of_port_types_002.ttcn b/core_language/06_types_and_values/0603_type_compatibility/060306_compatibility_of_port_types/Sem_060306_compatibility_of_port_types_002.ttcn new file mode 100644 index 0000000..07d85fc --- /dev/null +++ b/core_language/06_types_and_values/0603_type_compatibility/060306_compatibility_of_port_types/Sem_060306_compatibility_of_port_types_002.ttcn @@ -0,0 +1,31 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:6.3.6, verify that port type is compatible with a synonym type + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// For variables, constants and parameters of port types, the reference to a port "b" of type "B" is compatible to type "A" +// if type "B" and type "A" are equal or synonym types. + +module Sem_060306_compatibility_of_port_types_002 { + type port P message { + inout integer + } + + type P P2; // synonym type + + type component GeneralComp { + port P p; + } + + testcase TC_Sem_060306_compatibility_of_port_types_002() runs on GeneralComp { + var P2 v_port := p; + setverdict(pass); + } + + control { + execute(TC_Sem_060306_compatibility_of_port_types_002()); + } +} \ No newline at end of file diff --git a/core_language/06_types_and_values/0603_type_compatibility/060307_compatibility_of_timer_types/NegSem_060307_compatibility_of_timer_types_001.ttcn b/core_language/06_types_and_values/0603_type_compatibility/060307_compatibility_of_timer_types/NegSem_060307_compatibility_of_timer_types_001.ttcn new file mode 100644 index 0000000..62f345d --- /dev/null +++ b/core_language/06_types_and_values/0603_type_compatibility/060307_compatibility_of_timer_types/NegSem_060307_compatibility_of_timer_types_001.ttcn @@ -0,0 +1,29 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:6.3.6, verify that timer type is not compatible with a non-timer type + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// For variables, constants and parameters of timer types, the reference to a timer is compatible with any other timer reference. + +module NegSem_060307_compatibility_of_timer_types_001 { + type port P message { + inout integer + } + + type component GeneralComp { + } + + testcase TC_NegSem_060307_compatibility_of_timer_types_001() runs on GeneralComp { + var GeneralComp v_ptc := null; + var timer v_timer; + v_timer := v_ptc; + setverdict(pass); + } + + control { + execute(TC_NegSem_060307_compatibility_of_timer_types_001()); + } +} diff --git a/core_language/06_types_and_values/0603_type_compatibility/060307_compatibility_of_timer_types/Sem_060307_compatibility_of_timer_types_001.ttcn b/core_language/06_types_and_values/0603_type_compatibility/060307_compatibility_of_timer_types/Sem_060307_compatibility_of_timer_types_001.ttcn new file mode 100644 index 0000000..6aa1918 --- /dev/null +++ b/core_language/06_types_and_values/0603_type_compatibility/060307_compatibility_of_timer_types/Sem_060307_compatibility_of_timer_types_001.ttcn @@ -0,0 +1,25 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:6.3.7, verify that a variable of the timer type is compatible with other timer references + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// For variables, constants and parameters of timer types, the reference to a timer is compatible with any other timer reference. + +module Sem_060307_compatibility_of_timer_types_001 { + type component GeneralComp { + } + + testcase TC_Sem_060307_compatibility_of_timer_types_001() runs on GeneralComp { + var timer v_timer := null; + var timer v_timer2; + v_timer2 := v_timer; + setverdict(pass); + } + + control { + execute(TC_Sem_060307_compatibility_of_timer_types_001()); + } +} \ No newline at end of file diff --git a/core_language/06_types_and_values/0603_type_compatibility/060308_compatibility_of_map_types/NegSem_060308_compatibility_of_map_types_001.ttcn b/core_language/06_types_and_values/0603_type_compatibility/060308_compatibility_of_map_types/NegSem_060308_compatibility_of_map_types_001.ttcn new file mode 100644 index 0000000..2d331b2 --- /dev/null +++ b/core_language/06_types_and_values/0603_type_compatibility/060308_compatibility_of_map_types/NegSem_060308_compatibility_of_map_types_001.ttcn @@ -0,0 +1,29 @@ +/*************************************************** + ** @author TTF T003 + ** @version 0.0.1 + ** @purpose 1:6.3.8, Verify that map types are not compatible with arrays + ** @verdict pass reject + ***************************************************/ + +// The following rule is tested: +// map types are only compatible with other map types. A value "b" of a map type "B" is compatible +// with a map type "A" if the from type of "A" is compatible with the from type of "B" and the to +// type of "B" is compatible with the totype of "A". + +module NegSem_060308_compatibility_of_map_types_001 { + type map from integer to charstring TMap1; + type component C {} + + testcase TC_NegSem_060308_compatibility_of_map_types_001() runs on C { + var TMap1 v_map; + v_map[0] := "test1"; + v_map[1] := "test2"; + var integer v_arr[2] := v_map; + log(v_arr); + setverdict(pass); + } + + control { + execute(TC_NegSem_060308_compatibility_of_map_types_001()); + } +} diff --git a/core_language/06_types_and_values/0603_type_compatibility/060308_compatibility_of_map_types/NegSem_060308_compatibility_of_map_types_002.ttcn b/core_language/06_types_and_values/0603_type_compatibility/060308_compatibility_of_map_types/NegSem_060308_compatibility_of_map_types_002.ttcn new file mode 100644 index 0000000..30fee77 --- /dev/null +++ b/core_language/06_types_and_values/0603_type_compatibility/060308_compatibility_of_map_types/NegSem_060308_compatibility_of_map_types_002.ttcn @@ -0,0 +1,40 @@ +/*************************************************** + ** @author TTF T003 + ** @version 0.0.1 + ** @purpose 1:6.3.8, Verify that map types are not compatible if their key types are not compatible + ** @verdict pass reject + ***************************************************/ + +// The following rule is tested: +// map types are only compatible with other map types. A value "b" of a map type "B" is compatible +// with a map type "A" if the from type of "A" is compatible with the from type of "B" and the to +// type of "B" is compatible with the totype of "A". + +module NegSem_060308_compatibility_of_map_types_002 { + type record R1 { + charstring addr, + integer portVal + } + + type record R2 { + charstring id1, + integer id2 optional + } + // R1 and R2 are not compatible, because there's a difference in optionality of the 2nd field + type map from R1 to integer TMap1; + type map from R2 to integer TMap2; + type component C {} + + testcase TC_NegSem_060308_compatibility_of_map_types_002() runs on C { + var TMap1 v_map; + v_map[{"127.0.0.1", 80}] := 1; + v_map[{"127.0.0.1", 443}] := 2; + var TMap2 v_map2 := v_map; + log(v_map2); + setverdict(pass); + } + + control { + execute(TC_NegSem_060308_compatibility_of_map_types_002()); + } +} diff --git a/core_language/06_types_and_values/0603_type_compatibility/060308_compatibility_of_map_types/NegSem_060308_compatibility_of_map_types_003.ttcn b/core_language/06_types_and_values/0603_type_compatibility/060308_compatibility_of_map_types/NegSem_060308_compatibility_of_map_types_003.ttcn new file mode 100644 index 0000000..424e858 --- /dev/null +++ b/core_language/06_types_and_values/0603_type_compatibility/060308_compatibility_of_map_types/NegSem_060308_compatibility_of_map_types_003.ttcn @@ -0,0 +1,40 @@ +/*************************************************** + ** @author TTF T003 + ** @version 0.0.1 + ** @purpose 1:6.3.8, Verify that map types are not compatible if their value types are not compatible + ** @verdict pass reject + ***************************************************/ + +// The following rule is tested: +// map types are only compatible with other map types. A value "b" of a map type "B" is compatible +// with a map type "A" if the from type of "A" is compatible with the from type of "B" and the to +// type of "B" is compatible with the totype of "A". + +module NegSem_060308_compatibility_of_map_types_003 { + type record R1 { + charstring addr, + integer portVal + } + + type record R2 { + charstring id1, + integer id2 optional + } + // R1 and R2 are not compatible, because there's a difference in optionality of the 2nd field + type map from charstring to R1 TMap1; + type map from charstring to R2 TMap2; + type component C {} + + testcase TC_NegSem_060308_compatibility_of_map_types_003() runs on C { + var TMap1 v_map; + v_map["HTTP"] := {"127.0.0.1", 80}; + v_map["SSL"] := {"127.0.0.1", 443}; + var TMap2 v_map2 := v_map; + log(v_map2); + setverdict(pass); + } + + control { + execute(TC_NegSem_060308_compatibility_of_map_types_003()); + } +} diff --git a/core_language/06_types_and_values/0603_type_compatibility/060308_compatibility_of_map_types/Sem_060308_compatibility_of_map_types_001.ttcn b/core_language/06_types_and_values/0603_type_compatibility/060308_compatibility_of_map_types/Sem_060308_compatibility_of_map_types_001.ttcn new file mode 100644 index 0000000..e9c29eb --- /dev/null +++ b/core_language/06_types_and_values/0603_type_compatibility/060308_compatibility_of_map_types/Sem_060308_compatibility_of_map_types_001.ttcn @@ -0,0 +1,41 @@ +/*************************************************** + ** @author TTF T003 + ** @version 0.0.1 + ** @purpose 1:6.3.8, Verify that a map types are compatible + ** @verdict pass accept, ttcn3verdict: pass + ***************************************************/ + +// The following requirement is tested: +// map types are only compatible with other map types. A value "b" of a map type "B" is compatible +// with a map type "A" if the from type of "A" is compatible with the from type of "B" and the to +// type of "B" is compatible with the totype of "A". + +module Sem_060308_compatibility_of_map_types_001 { + type record R1 { + integer field1, + integer field2 + } + type record R2 { + integer element1, + integer element2 + } + type map from charstring to R1 TMap1; + type map from charstring to R2 TMap2; + type component C {} + + testcase TC_Sem_060308_compatibility_of_map_types_001() runs on C { + var TMap1 v_map; + v_map["test"] := { 1, 2 }; + v_map["xyz"] := { 5, 10}; + var TMap2 v_map2 := v_map; + if (v_map2["test"] == { 1, 2 }) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_060308_compatibility_of_map_types_001()); + } +} diff --git a/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_051.ttcn b/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_051.ttcn new file mode 100644 index 0000000..7edd4da --- /dev/null +++ b/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_051.ttcn @@ -0,0 +1,46 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:7.1.3, Ensure that the less than or equal to operator on enumerations is evaluated correctly with differing values. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// The following requirements are tested: +/* Enumerated values of the same, or different types can be compared. In the case of different enumerated +types, expression "b" of type "B" can be compared with expression "a" of type "A" if the two types "A" and +"B" can be merged to a consistent larger enumerated type (i.e. where numbers are not associated with different +identifiers, see also clause 6.3.2.1). Two enumerated values are equal if and only if both their identifiers and +associated integer values (associated either explicitly or implicitly, see clause 6.2.4) are the same. + * */ + + +module Sem_070103_RelationalOperators_051 { + +type component GeneralComp { +} + +type enumerated MyEnumType1 { + e_monday(2), e_tuesday, e_wednesday, e_thursday, e_friday +}; + +type enumerated MyEnumType2 { + e_tuesday, e_wednesday +}; + +// note: MyEnumType1 and MyEnumType2 have different size, but it has the same identifiers and associated integers + +testcase TC_Sem_070103_RelationalOperators_051() runs on GeneralComp { + var MyEnumType1 v_first := e_tuesday; + var MyEnumType2 v_second := e_tuesday; + + if ( v_first == v_second ) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_070103_RelationalOperators_051()); +} + +} diff --git a/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_052.ttcn b/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_052.ttcn new file mode 100644 index 0000000..998c148 --- /dev/null +++ b/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_052.ttcn @@ -0,0 +1,35 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:7.1.3, Ensure that the less than or equal to operator on timers is evaluated correctly with differing values. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// The following requirements are tested: +/* + * Two default, two port, two timer or two component values are equal if and only if they both are initialized with + * the special value null or they both contain a reference to the same entity value (i.e. they designate the same + * default, port, timer or test component, independent of the actual state of the denoted object). + * */ + + +module Sem_070103_RelationalOperators_052 { + +type component GeneralComp { +} + +testcase TC_Sem_070103_RelationalOperators_052() runs on GeneralComp { + var timer t1 := null; + var timer t2 := null; + + if ( t1 == t2 ) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_070103_RelationalOperators_052()); +} + +} diff --git a/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_053.ttcn b/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_053.ttcn new file mode 100644 index 0000000..109f7d4 --- /dev/null +++ b/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_053.ttcn @@ -0,0 +1,35 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:7.1.3, Ensure that the less than or equal to operator on timers is evaluated correctly with differing values. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// The following requirements are tested: +/* + * Two default, two port, two timer or two component values are equal if and only if they both are initialized with + * the special value null or they both contain a reference to the same entity value (i.e. they designate the same + * default, port, timer or test component, independent of the actual state of the denoted object). + * */ + +module Sem_070103_RelationalOperators_053 { + +type component GeneralComp { +} + +testcase TC_Sem_070103_RelationalOperators_053() runs on GeneralComp { + timer t_ref := 10.0; + var timer t1 := t_ref; + var timer t2 := t_ref; + + if ( t1 == t2 ) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_070103_RelationalOperators_053()); +} + +} diff --git a/core_language/07_expressions/0701_operators/070108_presence_checking_operators/07010801_ispresent_operator/Sem_07010801_ispresent_operator_001.ttcn b/core_language/07_expressions/0701_operators/070108_presence_checking_operators/07010801_ispresent_operator/Sem_07010801_ispresent_operator_001.ttcn new file mode 100644 index 0000000..8faa87b --- /dev/null +++ b/core_language/07_expressions/0701_operators/070108_presence_checking_operators/07010801_ispresent_operator/Sem_07010801_ispresent_operator_001.ttcn @@ -0,0 +1,63 @@ +/*************************************************** + ** @author STF T003 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_07010801_ispresent_operator_001 { + type enumerated MyEnumeratedType {e_black, e_white, e_green}; + + type record MyRecord { + record { + boolean innerField1 optional, + integer innerField2 optional + } field1 optional, + integer field2, + integer field3, + MyEnumeratedType field4 optional + } + + type union U { integer f1, octetstring f2 } + + type component GeneralComp { + } + + testcase TC_Sem_07010801_ispresent_operator_001 () runs on GeneralComp { + var MyRecord v_record1 := { + field1 := {innerField1 := omit, innerField2 := omit}, + field2 := 2, + field3 := 3, + field4 := omit + }; + var U v_U1 := {f1 := 1}; + template MyRecord template1 := { + field1 := {?, *}, + field2 := 2, + field3 := 3, + field4 := (e_black, e_white) ifpresent + } + template U template2 := {f2 := ?} + + if( match(ispresent(v_record1.field1), true) and + match(ispresent(v_record1.field4), false) and + match(ispresent(v_record1.field2), true) and + match(ispresent(template1.field1.innerField1), true) and + match(ischosen(v_U1.f1), true) and + match(ischosen(v_U1.f2), false) and + match(ischosen(template2.f2), true) and + match(ischosen(template2.f1), false) and + match(isvalue(template1.field2), true) and + match(isvalue(template2.f2), false) + ) { + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control{ + execute(TC_Sem_07010801_ispresent_operator_001()); + } +} diff --git a/core_language/07_expressions/0701_operators/070108_presence_checking_operators/07010801_ispresent_operator/Sem_07010801_ispresent_operator_002.ttcn b/core_language/07_expressions/0701_operators/070108_presence_checking_operators/07010801_ispresent_operator/Sem_07010801_ispresent_operator_002.ttcn new file mode 100644 index 0000000..93d768a --- /dev/null +++ b/core_language/07_expressions/0701_operators/070108_presence_checking_operators/07010801_ispresent_operator/Sem_07010801_ispresent_operator_002.ttcn @@ -0,0 +1,41 @@ +/*************************************************** + ** @author STF T003 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_07010801_ispresent_operator_002 { + type enumerated MyEnumeratedType {e_black, e_white, e_green}; + + type record MyRecord { + record { + boolean innerField1 optional, + integer innerField2 optional + } field1 optional, + integer field2, + integer field3, + MyEnumeratedType field4 optional + } + + type component GeneralComp { + } + + testcase TC_Sem_07010801_ispresent_operator_002 () runs on GeneralComp { + template MyRecord template1 := { + field1 := {?, *}, + field2 := 2, + field3 := 3, + field4 := (e_black, e_white) ifpresent + } + + if (ispresent(template1.field1.innerField2)) { // not present + setverdict(fail); + } else { + setverdict(pass); + } + } + + control{ + execute(TC_Sem_07010801_ispresent_operator_002()); + } +} diff --git a/core_language/07_expressions/0701_operators/070108_presence_checking_operators/07010801_ispresent_operator/Sem_07010801_ispresent_operator_003.ttcn b/core_language/07_expressions/0701_operators/070108_presence_checking_operators/07010801_ispresent_operator/Sem_07010801_ispresent_operator_003.ttcn new file mode 100644 index 0000000..d8c8236 --- /dev/null +++ b/core_language/07_expressions/0701_operators/070108_presence_checking_operators/07010801_ispresent_operator/Sem_07010801_ispresent_operator_003.ttcn @@ -0,0 +1,41 @@ +/*************************************************** + ** @author STF T003 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_07010801_ispresent_operator_003 { + type enumerated MyEnumeratedType {e_black, e_white, e_green}; + + type record MyRecord { + record { + boolean innerField1 optional, + integer innerField2 optional + } field1 optional, + integer field2, + integer field3, + MyEnumeratedType field4 optional + } + + type component GeneralComp { + } + + testcase TC_Sem_07010801_ispresent_operator_003 () runs on GeneralComp { + template MyRecord template1 := { + field1 := {?, *}, + field2 := 2, + field3 := 3, + field4 := (e_black, e_white) ifpresent + } + + if (ispresent(template1.field4)) { // not present + setverdict(fail); + } else { + setverdict(pass); + } + } + + control{ + execute(TC_Sem_07010801_ispresent_operator_003()); + } +} diff --git a/core_language/07_expressions/0701_operators/070108_presence_checking_operators/07010801_ispresent_operator/Sem_07010801_ispresent_operator_004.ttcn b/core_language/07_expressions/0701_operators/070108_presence_checking_operators/07010801_ispresent_operator/Sem_07010801_ispresent_operator_004.ttcn new file mode 100644 index 0000000..72c429d --- /dev/null +++ b/core_language/07_expressions/0701_operators/070108_presence_checking_operators/07010801_ispresent_operator/Sem_07010801_ispresent_operator_004.ttcn @@ -0,0 +1,43 @@ +/*************************************************** + ** @author STF T003 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_07010801_ispresent_operator_004 { + type enumerated MyEnumeratedType {e_black, e_white, e_green}; + + type record MyRecord { + record { + boolean innerField1 optional, + integer innerField2 optional + } field1 optional, + integer field2, + integer field3, + MyEnumeratedType field4 optional + } + + type component GeneralComp { + } + + + testcase TC_Sem_07010801_ispresent_operator_004 () runs on GeneralComp { + var MyRecord v_record1 := { field1 := omit, field2 := 2, field3 := 3, field4 := omit } ; + var boolean v_i; + + v_i:=ispresent(v_record1.field1.innerField1); //function returns false value + if(v_i==false) { + setverdict(pass); + } else { + setverdict(fail, "Unexpected decoding result"); + } + } + + + control{ + + execute(TC_Sem_07010801_ispresent_operator_004()); + + } + +} diff --git a/core_language/07_expressions/0701_operators/070108_presence_checking_operators/07010802_ischosen_operator/Sem_07010802_ischosen_operator_001.ttcn b/core_language/07_expressions/0701_operators/070108_presence_checking_operators/07010802_ischosen_operator/Sem_07010802_ischosen_operator_001.ttcn new file mode 100644 index 0000000..5e0d88f --- /dev/null +++ b/core_language/07_expressions/0701_operators/070108_presence_checking_operators/07010802_ischosen_operator/Sem_07010802_ischosen_operator_001.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF T003 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_07010802_ischosen_operator_001 { + type union U { integer f1, octetstring f2 } + +type component GeneralComp { +} + + +testcase TC_Sem_07010802_ischosen_operator_001 () runs on GeneralComp { + template U template1 := ?; + var boolean v_i; + + v_i:=ischosen(template1.f1); //function returns false value + if(v_i==false) { + setverdict(pass); + } else { + setverdict(fail, "Unexpected decoding result"); + } +} + + +control{ + + execute(TC_Sem_07010802_ischosen_operator_001()); + +} + +} diff --git a/core_language/07_expressions/0701_operators/070108_presence_checking_operators/07010802_ischosen_operator/Sem_07010802_ischosen_operator_002.ttcn b/core_language/07_expressions/0701_operators/070108_presence_checking_operators/07010802_ischosen_operator/Sem_07010802_ischosen_operator_002.ttcn new file mode 100644 index 0000000..7d4cf46 --- /dev/null +++ b/core_language/07_expressions/0701_operators/070108_presence_checking_operators/07010802_ischosen_operator/Sem_07010802_ischosen_operator_002.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF T003 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_07010802_ischosen_operator_002 { + type union U { integer f1, octetstring f2 } + +type component GeneralComp { +} + + +testcase TC_Sem_07010802_ischosen_operator_002 () runs on GeneralComp { + template U template1 := ({ f1 := 2 }, {f2 := 'AB'O }); + var boolean v_i; + + v_i:=ischosen(template1.f1); //function returns false value + if(v_i==false) { + setverdict(pass); + } else { + setverdict(fail, "Unexpected decoding result"); + } +} + + +control{ + + execute(TC_Sem_07010802_ischosen_operator_002()); + +} + +} diff --git a/core_language/07_expressions/0701_operators/070108_presence_checking_operators/07010802_ischosen_operator/Sem_07010802_ischosen_operator_003.ttcn b/core_language/07_expressions/0701_operators/070108_presence_checking_operators/07010802_ischosen_operator/Sem_07010802_ischosen_operator_003.ttcn new file mode 100644 index 0000000..fdeb63e --- /dev/null +++ b/core_language/07_expressions/0701_operators/070108_presence_checking_operators/07010802_ischosen_operator/Sem_07010802_ischosen_operator_003.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF T003 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +// The following requirements are tested: Using ischosen for anytype + +module Sem_07010802_ischosen_operator_003 { + type union U { integer f1, octetstring f2 } + +type component GeneralComp { +} + + +testcase TC_Sem_07010802_ischosen_operator_003 () runs on GeneralComp { + template U m_u4 := ({ f1 := 2 }, {f2 := 'AB'O }); + template anytype mw_anytype := { U := m_u4 } + var boolean v_i; + + v_i:=ischosen(mw_anytype.U); //function returns true value + if(match(v_i,true)) { + setverdict(pass); + } else { + setverdict(fail, "Unexpected decoding result"); + } +} + + +control{ + + execute(TC_Sem_07010802_ischosen_operator_003()); + +} + +} \ No newline at end of file diff --git a/core_language/07_expressions/0701_operators/070108_presence_checking_operators/07010802_ischosen_operator/Sem_07010802_ischosen_operator_004.ttcn b/core_language/07_expressions/0701_operators/070108_presence_checking_operators/07010802_ischosen_operator/Sem_07010802_ischosen_operator_004.ttcn new file mode 100644 index 0000000..92cf45b --- /dev/null +++ b/core_language/07_expressions/0701_operators/070108_presence_checking_operators/07010802_ischosen_operator/Sem_07010802_ischosen_operator_004.ttcn @@ -0,0 +1,38 @@ +/*************************************************** + ** @author STF T003 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +// The following requirements are tested: Using ischosen for anytype + +module Sem_07010802_ischosen_operator_004 { + +type component GeneralComp { +} + +type union U { integer f1, charstring f2 }; + + +testcase TC_Sem_07010802_ischosen_operator_004 () runs on GeneralComp { + + template anytype mw_anytype := { U.f1:=1}; + var boolean v_i, v_j; + + v_i:=ischosen(mw_anytype.integer); //function returns false + + if(match(v_i,false)) { + setverdict(pass); + } else { + setverdict(fail, "Unexpected result for ischosen()"); + } +} + + +control{ + + execute(TC_Sem_07010802_ischosen_operator_004()); + +} + +} \ No newline at end of file diff --git a/core_language/07_expressions/0701_operators/070108_presence_checking_operators/07010803_isvalue_operator/Sem_07010803_isvalue_operator_001.ttcn b/core_language/07_expressions/0701_operators/070108_presence_checking_operators/07010803_isvalue_operator/Sem_07010803_isvalue_operator_001.ttcn new file mode 100644 index 0000000..2890435 --- /dev/null +++ b/core_language/07_expressions/0701_operators/070108_presence_checking_operators/07010803_isvalue_operator/Sem_07010803_isvalue_operator_001.ttcn @@ -0,0 +1,32 @@ +/*************************************************** + ** @author STF 470 (updated by STF 521, T003) + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_07010803_isvalue_operator_001 { + type union U { + integer f1, + octetstring f2 + } + + type component GeneralComp { + } + + + testcase TC_Sem_07010803_isvalue_operator_001() runs on GeneralComp { + template U template1 := {f2 := ?} + var boolean v_i; + + v_i := isvalue(template1.f1); //function returns false value + if(v_i==false) { + setverdict(pass); + } else { + setverdict(fail, "Unexpected decoding result"); + } + } + + control { + execute(TC_Sem_07010803_isvalue_operator_001()); + } +} diff --git a/core_language/07_expressions/0701_operators/070108_presence_checking_operators/07010803_isvalue_operator/Sem_07010803_isvalue_operator_002.ttcn b/core_language/07_expressions/0701_operators/070108_presence_checking_operators/07010803_isvalue_operator/Sem_07010803_isvalue_operator_002.ttcn new file mode 100644 index 0000000..ea3cc5d --- /dev/null +++ b/core_language/07_expressions/0701_operators/070108_presence_checking_operators/07010803_isvalue_operator/Sem_07010803_isvalue_operator_002.ttcn @@ -0,0 +1,39 @@ +/*************************************************** + ** @author STF 487 (updated by T003) + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that predefined function isvalue() works properly + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +/* The following requirements are tested: + * check that isvalue() predefined function works properly + */ + + +module Sem_07010803_isvalue_operator_002 { + + type component GeneralComp { + } + + testcase TC_Sem_07010803_isvalue_operator_002 () runs on GeneralComp { + + var boolean v_res; + + template charstring Mytemaplate:= "1234ABCD"; + + + + v_res := isvalue(Mytemaplate); //template, expected result: true + + + + if ( match(v_res, true)) {setverdict(pass," isvalue(Mytemaplate): ", v_res);} + else{setverdict(fail," isvalue(Mytemaplate):", v_res, " expected result: true");} + + } + + + control{ + execute(TC_Sem_07010803_isvalue_operator_002()); + } +} \ No newline at end of file diff --git a/core_language/07_expressions/0701_operators/070108_presence_checking_operators/07010803_isvalue_operator/Sem_07010803_isvalue_operator_003.ttcn b/core_language/07_expressions/0701_operators/070108_presence_checking_operators/07010803_isvalue_operator/Sem_07010803_isvalue_operator_003.ttcn new file mode 100644 index 0000000..6138ce1 --- /dev/null +++ b/core_language/07_expressions/0701_operators/070108_presence_checking_operators/07010803_isvalue_operator/Sem_07010803_isvalue_operator_003.ttcn @@ -0,0 +1,39 @@ +/*************************************************** + ** @author STF 487 (updated by T003) + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that predefined function isvalue() works properly + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +/* The following requirements are tested: + * check that isvalue() predefined function works properly + */ + + +module Sem_07010803_isvalue_operator_003 { + + type component GeneralComp { + } + + testcase TC_Sem_07010803_isvalue_operator_003 () runs on GeneralComp { + + var boolean v_res; + + var GeneralComp MyComp; + + + + v_res := isvalue(MyComp); //component ,expected result: false + + + + if ( match(v_res, false)) {setverdict(pass," isvalue(MyComp): ", v_res);} + else{setverdict(fail," isvalue(MyComp):", v_res, " expected result: false");} + + } + + + control{ + execute(TC_Sem_07010803_isvalue_operator_003()); + } +} \ No newline at end of file diff --git a/core_language/07_expressions/0701_operators/070108_presence_checking_operators/07010803_isvalue_operator/Sem_07010803_isvalue_operator_004.ttcn b/core_language/07_expressions/0701_operators/070108_presence_checking_operators/07010803_isvalue_operator/Sem_07010803_isvalue_operator_004.ttcn new file mode 100644 index 0000000..1a44c89 --- /dev/null +++ b/core_language/07_expressions/0701_operators/070108_presence_checking_operators/07010803_isvalue_operator/Sem_07010803_isvalue_operator_004.ttcn @@ -0,0 +1,41 @@ +/*************************************************** + ** @author STF 487 (updated by T003) + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that predefined function isvalue() works properly + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +/* The following requirements are tested: + * check that isvalue() predefined function works properly + */ + + +module Sem_07010803_isvalue_operator_004 { + + type integer address; + + type component GeneralComp { + } + + testcase TC_Sem_07010803_isvalue_operator_004 () runs on GeneralComp { + + var boolean v_res; + + var address MyAddr := null; + + + + v_res := isvalue(MyAddr); //address, expected result: true + + + + if ( match(v_res, true)) {setverdict(pass," isvalue(MyAddr): ", v_res);} + else{setverdict(fail," isvalue(MyAddr):", v_res, " expected result: true");} + + } + + + control{ + execute(TC_Sem_07010803_isvalue_operator_004()); + } +} \ No newline at end of file diff --git a/core_language/07_expressions/0701_operators/070108_presence_checking_operators/07010803_isvalue_operator/Sem_07010803_isvalue_operator_005.ttcn b/core_language/07_expressions/0701_operators/070108_presence_checking_operators/07010803_isvalue_operator/Sem_07010803_isvalue_operator_005.ttcn new file mode 100644 index 0000000..651bb25 --- /dev/null +++ b/core_language/07_expressions/0701_operators/070108_presence_checking_operators/07010803_isvalue_operator/Sem_07010803_isvalue_operator_005.ttcn @@ -0,0 +1,38 @@ +/*************************************************** + ** @author STF 487 (updated by T003) + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that predefined function isvalue() works properly + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +/* The following requirements are tested: + * check that isvalue() predefined function works properly + */ + + +module Sem_07010803_isvalue_operator_005 { + + type component GeneralComp { + } + + testcase TC_Sem_07010803_isvalue_operator_005 () runs on GeneralComp { + + var boolean v_res; + + var default MyDef := null; + + + + v_res := isvalue(MyDef); //dafult, expected result: true + + + if ( match(v_res, true)) {setverdict(pass," isvalue(MyDef): ", v_res);} + else{setverdict(fail," isvalue(MyDef)):", v_res, " expected result: true");} + + } + + + control{ + execute(TC_Sem_07010803_isvalue_operator_005()); + } +} \ No newline at end of file diff --git a/core_language/07_expressions/0701_operators/070108_presence_checking_operators/07010803_isvalue_operator/Sem_07010803_isvalue_operator_006.ttcn b/core_language/07_expressions/0701_operators/070108_presence_checking_operators/07010803_isvalue_operator/Sem_07010803_isvalue_operator_006.ttcn new file mode 100644 index 0000000..976a05b --- /dev/null +++ b/core_language/07_expressions/0701_operators/070108_presence_checking_operators/07010803_isvalue_operator/Sem_07010803_isvalue_operator_006.ttcn @@ -0,0 +1,39 @@ +/*************************************************** + ** @author STF 487 (updated by T003) + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that predefined function isvalue() works properly + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +/* The following requirements are tested: + * check that isvalue() predefined function works properly + */ + + +module Sem_07010803_isvalue_operator_006 { + + type component GeneralComp { + } + + testcase TC_Sem_07010803_isvalue_operator_006 () runs on GeneralComp { + + var boolean v_res; + + template charstring Mytemaplate2 := pattern "A*Z"; + + + + v_res := isvalue(Mytemaplate2); //pattern, expected result: false + + + if ( match(v_res, false)) {setverdict(pass," isvalue(Mytemaplate2: ", v_res);} + else{setverdict(fail," isvalue(Mytemaplate2): ", v_res, " expected result: false");} + + + } + + + control{ + execute(TC_Sem_07010803_isvalue_operator_006()); + } +} \ No newline at end of file diff --git a/core_language/07_expressions/0701_operators/070108_presence_checking_operators/07010803_isvalue_operator/Sem_07010803_isvalue_operator_007.ttcn b/core_language/07_expressions/0701_operators/070108_presence_checking_operators/07010803_isvalue_operator/Sem_07010803_isvalue_operator_007.ttcn new file mode 100644 index 0000000..d8cbf9a --- /dev/null +++ b/core_language/07_expressions/0701_operators/070108_presence_checking_operators/07010803_isvalue_operator/Sem_07010803_isvalue_operator_007.ttcn @@ -0,0 +1,47 @@ +/*************************************************** + ** @author STF 487 (updated by T003) + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that predefined function isvalue() works properly + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +/* The following requirements are tested: + * check that isvalue() predefined function works properly + */ + + +module Sem_07010803_isvalue_operator_007 { + + type record MyRec{ + integer field1, + integer field2 optional} + + type record MyRec2 { + MyRec field1, + integer field2 + } + + type component GeneralComp { + } + + testcase TC_Sem_07010803_isvalue_operator_007() runs on GeneralComp { + + var boolean v_res; + + var MyRec2 MyRecValue := {{1,-},1}; + + + + v_res := isvalue(MyRecValue.field1.field1); //nested, expected result: true + + + if ( match(v_res, true)) {setverdict(pass," isvalue(MyRecValue.field1.field1): ", v_res);} + else{setverdict(fail," isvalue(MyRecValue.field1.field1):", v_res, " expected result: true");} + + } + + + control{ + execute(TC_Sem_07010803_isvalue_operator_007()); + } +} \ No newline at end of file diff --git a/core_language/07_expressions/0701_operators/070108_presence_checking_operators/07010803_isvalue_operator/Sem_07010803_isvalue_operator_008.ttcn b/core_language/07_expressions/0701_operators/070108_presence_checking_operators/07010803_isvalue_operator/Sem_07010803_isvalue_operator_008.ttcn new file mode 100644 index 0000000..573a97e --- /dev/null +++ b/core_language/07_expressions/0701_operators/070108_presence_checking_operators/07010803_isvalue_operator/Sem_07010803_isvalue_operator_008.ttcn @@ -0,0 +1,47 @@ +/*************************************************** + ** @author STF 487 (updated by T003) + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that predefined function isvalue() works properly + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +/* The following requirements are tested: + * check that isvalue() predefined function works properly + */ + + +module Sem_07010803_isvalue_operator_008 { + + type record MyRec{ + integer field1, + integer field2 optional} + + type record MyRec2 { + MyRec field1, + integer field2 + } + + type component GeneralComp { + } + + testcase TC_Sem_07010803_isvalue_operator_008() runs on GeneralComp { + + var boolean v_res; + + var MyRec2 MyRecValue := {{1,-},1}; + + + + v_res := isvalue(MyRecValue.field1.field2); //nested omit, expected result: false + + + if ( match(v_res, false)) {setverdict(pass," isvalue(MyRecValue.field1.field2): ", v_res);} + else{setverdict(fail," isvalue(MyRecValue.field1.field2):", v_res, " expected result: true");} + + } + + + control{ + execute(TC_Sem_07010803_isvalue_operator_008()); + } +} \ No newline at end of file diff --git a/core_language/07_expressions/0701_operators/070108_presence_checking_operators/07010804_isbound_operator/Sem_07010804_isbound_operator_001.ttcn b/core_language/07_expressions/0701_operators/070108_presence_checking_operators/07010804_isbound_operator/Sem_07010804_isbound_operator_001.ttcn new file mode 100644 index 0000000..1079462 --- /dev/null +++ b/core_language/07_expressions/0701_operators/070108_presence_checking_operators/07010804_isbound_operator/Sem_07010804_isbound_operator_001.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF T003 + ** @version 0.0.1 + ** @purpose 1:7.1.8.4, Ensure that the IUT recognizes isbound operator and correctly evaluates it + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_07010804_isbound_operator_001 { + + type component GeneralComp { + } + + + testcase TC_Sem_07010804_isbound_operator_001() runs on GeneralComp { + + var charstring v_char; + var boolean checkResult := isbound(v_char); // yields false as v_char is uninitialized + if(checkResult == false) { + setverdict(pass); + } else { + setverdict(fail, "isbound should yield false as v_char is uninitialized"); + } + + v_char := "ABCD"; // initialized with a specific value + checkResult := isbound(v_char); // yields true + if(checkResult) { + setverdict(pass); + } else { + setverdict(fail, "isbound should yield true as v_char is initialized"); + } + + } + + control { + execute(TC_Sem_07010804_isbound_operator_001()); + } +} diff --git a/core_language/07_expressions/0701_operators/070108_presence_checking_operators/07010804_isbound_operator/Sem_07010804_isbound_operator_002.ttcn b/core_language/07_expressions/0701_operators/070108_presence_checking_operators/07010804_isbound_operator/Sem_07010804_isbound_operator_002.ttcn new file mode 100644 index 0000000..174cdf5 --- /dev/null +++ b/core_language/07_expressions/0701_operators/070108_presence_checking_operators/07010804_isbound_operator/Sem_07010804_isbound_operator_002.ttcn @@ -0,0 +1,32 @@ +/*************************************************** + ** @author STF T003 + ** @version 0.0.1 + ** @purpose 1:7.1.8.4, Ensure that the IUT recognizes isbound operator and correctly evaluates it + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_07010804_isbound_operator_002 { + type union U { + integer f1, + octetstring f2 + } + + type component GeneralComp { + } + + + testcase TC_Sem_07010804_isbound_operator_002() runs on GeneralComp { + + var default v_default := null; + var boolean checkResult := isbound(v_default); // yields true + if(checkResult) { + setverdict(pass); + } else { + setverdict(fail, "isbound should yield true as v_default is initialized to null"); + } + + } + + control { + execute(TC_Sem_07010804_isbound_operator_002()); + } +} diff --git a/core_language/07_expressions/0701_operators/070108_presence_checking_operators/07010804_isbound_operator/Sem_07010804_isbound_operator_003.ttcn b/core_language/07_expressions/0701_operators/070108_presence_checking_operators/07010804_isbound_operator/Sem_07010804_isbound_operator_003.ttcn new file mode 100644 index 0000000..2b3c1c1 --- /dev/null +++ b/core_language/07_expressions/0701_operators/070108_presence_checking_operators/07010804_isbound_operator/Sem_07010804_isbound_operator_003.ttcn @@ -0,0 +1,56 @@ +/*************************************************** + ** @author STF T003 + ** @version 0.0.1 + ** @purpose 1:7.1.8.4, Ensure that the IUT recognizes isbound operator and correctly evaluates it + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_07010804_isbound_operator_003 { + + type component GeneralComp { + } + + type record MyRec { + integer f1, + MyRec f2 optional + } + + + testcase TC_Sem_07010804_isbound_operator_003() runs on GeneralComp { + var MyRec v_myRec; + var boolean checkResult := isbound(v_myRec); // yields false + if(checkResult == false) { + setverdict(pass); + } else { + setverdict(fail, "isbound should yield false as v_myRec is uninitialized"); + } + + v_myRec.f2 := omit; + checkResult := isbound(v_myRec); // yields true as v_myRec is partially initialized, + // field f2 is set to omit + if(checkResult) { + setverdict(pass); + } else { + setverdict(fail, "isbound should yield true as v_myRec is partially initialized, field f2 is set to omit"); + } + + v_myRec := { f1 := 5, f2 := omit } + checkResult := isbound(v_myRec); // yields true as v_myRec is completely initialized + if(checkResult) { + setverdict(pass); + } else { + setverdict(fail, "isbound should yield true as v_myRec is completely initialized"); + } + + checkResult := isbound(v_myRec.f2.f1); // yields false as v_myRec.f2.f1 is inaccessible + if(checkResult == false) { + setverdict(pass); + } else { + setverdict(fail, "isbound should yield false as v_myRec.f2.f1 is inaccessible"); + } + + } + + control { + execute(TC_Sem_07010804_isbound_operator_003()); + } +} diff --git a/core_language/07_expressions/0701_operators/070108_presence_checking_operators/07010804_isbound_operator/Sem_07010804_isbound_operator_004.ttcn b/core_language/07_expressions/0701_operators/070108_presence_checking_operators/07010804_isbound_operator/Sem_07010804_isbound_operator_004.ttcn new file mode 100644 index 0000000..8251016 --- /dev/null +++ b/core_language/07_expressions/0701_operators/070108_presence_checking_operators/07010804_isbound_operator/Sem_07010804_isbound_operator_004.ttcn @@ -0,0 +1,72 @@ +/*************************************************** + ** @author STF T003 + ** @version 0.0.1 + ** @purpose 1:7.1.8.4, Ensure that the IUT recognizes isbound operator and correctly evaluates it + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_07010804_isbound_operator_004 { + + type component GeneralComp { + } + + type record MyRec { + integer f1, + MyRec f2 optional + } + + type union MyUnion { + integer ch1, + MyRec ch2 + } + + testcase TC_Sem_07010804_isbound_operator_004() runs on GeneralComp { + + var template MyUnion v_myUnion; + var boolean checkResult := isbound(v_myUnion); // yields false, as v_myUnion is uninitialized + if(checkResult == false) { + setverdict(pass); + } else { + setverdict(fail, "isbound should yield false as v_myUnion is uninitialized"); + } + + checkResult := isbound(v_myUnion.ch1); // yields false, as alternative ch1 is uninitialized + if(checkResult == false) { + setverdict(pass); + } else { + setverdict(fail, "isbound should yield false as as alternative ch1 is uninitialized"); + } + v_myUnion := { ch1 := 5 }; + checkResult := isbound(v_myUnion); // yields true + if(checkResult) { + setverdict(pass); + } else { + setverdict(fail, "isbound should yield true as v_myUnion is partially initialized"); + } + + checkResult := isbound(v_myUnion.ch1); // yields true + if(checkResult) { + setverdict(pass); + } else { + setverdict(fail, "isbound should yield true as v_myUnion.ch1 is initialized"); + } + + checkResult := isbound(v_myUnion.ch2); // yields false as the ch2 alternative is not selected + if(checkResult == false) { + setverdict(pass); + } else { + setverdict(fail, "isbound should yield false as the ch2 alternative is not selected"); + } + + checkResult := isbound(v_myUnion.ch2.f1); // yields false as the field f1 is inaccessible + if(checkResult == false) { + setverdict(pass); + } else { + setverdict(fail, "isbound should yield false as the field f1 is inaccessible"); + } + + } + + control { + execute(TC_Sem_07010804_isbound_operator_004()); + } +} diff --git a/core_language/07_expressions/0703_decoded_field_reference/NegSem_0703_decoded_field_reference_001.ttcn b/core_language/07_expressions/0703_decoded_field_reference/NegSem_0703_decoded_field_reference_001.ttcn new file mode 100644 index 0000000..cf843ff --- /dev/null +++ b/core_language/07_expressions/0703_decoded_field_reference/NegSem_0703_decoded_field_reference_001.ttcn @@ -0,0 +1,58 @@ +/***************************************************************** + ** @author STF 584 + ** @version 0.0.1 + ** @purpose 1:7.2, Ensure that the IUT correctly handles field reference decoding + ** @verdict pass reject + *****************************************************************/ + +/* The following requirement is tested: +The string value preceding the => operator shall be decoded into a value of the type following the => operator. Failure +of this decoding shall cause a test case error. In case the string operand is of the universalcharstring type and +the extended syntax with parentheses is used, the type operand can be followed by an optional parameter defining the +encoding format. The parameter shall be of the charstring type and it shall contain one of the strings allowed for +the decvalue_unichar function (specified in clause C.5.4). Any other value shall cause an error. In case the string +operand is not a universalcharstring, the optional parameter shall not be present. +*/ + +module NegSem_0703_decoded_field_reference_001 { + +type component GeneralComp { +} + +type bitstring PduHeader; +type integer OuterPayloadHeader; + +type record PDU { + PduHeader header, + bitstring outerPayload +} + +type record OuterPayload { + charstring innerPayload, + integer header +} + +type integer InnerPayload; + +testcase TC_NegSem_0703_decoded_field_reference_001() runs on GeneralComp { + // outerPayload content is "test text" + var charstring v_testText := "test text"; + var bitstring v_test := encvalue(v_testText); + + var PDU v_packet := {header:= '0110'B, outerPayload := v_test}; + // log(v_packet.outerPayload); + + var universal charstring v_payload := v_packet.outerPayload => InnerPayload; // error type mismatch + + if ( match(v_payload,"test text")) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_NegSem_0703_decoded_field_reference_001()); +} + +} \ No newline at end of file diff --git a/core_language/07_expressions/0703_decoded_field_reference/NegSem_0703_decoded_field_reference_002.ttcn b/core_language/07_expressions/0703_decoded_field_reference/NegSem_0703_decoded_field_reference_002.ttcn new file mode 100644 index 0000000..06e2dc8 --- /dev/null +++ b/core_language/07_expressions/0703_decoded_field_reference/NegSem_0703_decoded_field_reference_002.ttcn @@ -0,0 +1,53 @@ +/***************************************************************** + ** @author STF 584 + ** @version 0.0.1 + ** @purpose 1:7.2, Ensure that the IUT correctly handles field reference decoding + ** @verdict pass reject + *****************************************************************/ + +/* The following requirement is tested: +In case the string operand is of the universalcharstring type and +the extended syntax with parentheses is used, the type operand can be followed by an optional parameter defining the encoding format. The parameter shall be of the charstring type and it shall contain one of the strings allowed for the decvalue_unichar function (specified in clause C.5.4). Any other value shall cause an error. In case the string operand is not a universalcharstring, the optional parameter shall not be present. +*/ + +module NegSem_0703_decoded_field_reference_002 { + +type component GeneralComp { +} + +type charstring PduHeader; +type integer OuterPayloadHeader; + +type record PDU { + PduHeader header, + universal charstring outerPayload // universal charstring +} + +type record OuterPayload { + charstring innerPayload +} + +type universal charstring InnerPayload; + +testcase TC_NegSem_0703_decoded_field_reference_002() runs on GeneralComp { + // outerPayload content is "test text" + var charstring v_testText := "test text"; + var universal charstring v_test := encvalue_unichar(v_testText); + + // convert universal charstring (UTF-8) + var PDU v_packet := {header:= "header", outerPayload := v_test}; + + var InnerPayload v_payload := v_packet.outerPayload => (OuterPayload.innerPayload, "incorrect encoding format"); // error: incorrect encoding format + + if ( match(v_payload,"test text")) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_NegSem_0703_decoded_field_reference_002()); +} + +} \ No newline at end of file diff --git a/core_language/07_expressions/0703_decoded_field_reference/NegSem_0703_decoded_field_reference_003.ttcn b/core_language/07_expressions/0703_decoded_field_reference/NegSem_0703_decoded_field_reference_003.ttcn new file mode 100644 index 0000000..68aeadb --- /dev/null +++ b/core_language/07_expressions/0703_decoded_field_reference/NegSem_0703_decoded_field_reference_003.ttcn @@ -0,0 +1,52 @@ +/***************************************************************** + ** @author STF 584 + ** @version 0.0.1 + ** @purpose 1:7.2, Ensure that the IUT correctly handles field reference decoding + ** @verdict pass reject + *****************************************************************/ + +/* The following requirement is tested: +In case the string operand is not a universal charstring, the optional parameter shall not be present. +*/ + +module NegSem_0703_decoded_field_reference_003 { + +type component GeneralComp { +} + +type charstring PduHeader; +type integer OuterPayloadHeader; + +type record PDU { + PduHeader header, + bitstring outerPayload // bitstring +} + +type record OuterPayload { + charstring innerPayload +} + +type charstring InnerPayload; + +testcase TC_NegSem_0703_decoded_field_reference_003() runs on GeneralComp { + // outerPayload content is "test text" + var charstring v_testText := "test text"; + var bitstring v_test := encvalue(v_testText); + + // convert universal charstring (UTF-8) + var PDU v_packet := {header:= "header", outerPayload := v_test}; + + var InnerPayload v_payload := v_packet.outerPayload => (OuterPayload.innerPayload, "UTF8"); // error: incorrect encoding parameter + + if ( match(v_payload,"test text")) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_NegSem_0703_decoded_field_reference_003()); +} + +} \ No newline at end of file diff --git a/core_language/07_expressions/0703_decoded_field_reference/Sem_0703_decoded_field_reference_001.ttcn b/core_language/07_expressions/0703_decoded_field_reference/Sem_0703_decoded_field_reference_001.ttcn new file mode 100644 index 0000000..01ee309 --- /dev/null +++ b/core_language/07_expressions/0703_decoded_field_reference/Sem_0703_decoded_field_reference_001.ttcn @@ -0,0 +1,56 @@ +/***************************************************************** + ** @author STF 584 + ** @version 0.0.1 + ** @purpose 1:7.2, Ensure that the IUT correctly handles field reference decoding + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +/* The following requirement is tested: +Decoded field reference is a specific notation that can be applied to expressions of bitstring, hexstring, +octetstring, charstring or universal charstring types. It is used for accessing content of implicitly decoded payload fields. + +Restriction a) If the type operand is not enclosed into parentheses, only a built-in type or a type reference consisting of a +single identifier can be used. Extended type references shall always use the extended syntax with parentheses. +*/ + +module Sem_0703_decoded_field_reference_001 { + +type component GeneralComp { +} + +type bitstring PduHeader; +type integer OuterPayloadHeader; + +type record PDU { + PduHeader header, + bitstring outerPayload +} + +type record OuterPayload { + charstring innerPayload +} + +type charstring InnerPayload; + +testcase TC_Sem_0703_decoded_field_reference_001() runs on GeneralComp { + // outerPayload content is "test text" + var OuterPayload v_payload := { innerPayload := "test text" }; + var bitstring v_test := encvalue(v_payload); + + var PDU v_packet := {header:= '0110'B, outerPayload := v_test}; + // log(v_packet.outerPayload); + + var InnerPayload v_decodedPayload := v_packet.outerPayload => OuterPayload.innerPayload; // decode bitstring "innerPayload" + + if ( match(v_decodedPayload, "test text")) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_0703_decoded_field_reference_001()); +} + +} \ No newline at end of file diff --git a/core_language/07_expressions/0703_decoded_field_reference/Sem_0703_decoded_field_reference_002.ttcn b/core_language/07_expressions/0703_decoded_field_reference/Sem_0703_decoded_field_reference_002.ttcn new file mode 100644 index 0000000..7ae0211 --- /dev/null +++ b/core_language/07_expressions/0703_decoded_field_reference/Sem_0703_decoded_field_reference_002.ttcn @@ -0,0 +1,56 @@ +/***************************************************************** + ** @author STF 584 + ** @version 0.0.1 + ** @purpose 1:7.2, Ensure that the IUT correctly handles field reference decoding + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + + +/* The following requirement is tested: +Decoded field reference is a specific notation that can be applied to expressions of bitstring, hexstring, +octetstring, charstring or universal charstring types. It is used for accessing content of implicitly decoded payload fields. +*/ + +module Sem_0703_decoded_field_reference_002 { + +type component GeneralComp { +} + +type hexstring PduHeader; +type integer OuterPayloadHeader; + +type record PDU { + PduHeader header, + hexstring outerPayload // hexstring +} + +type record OuterPayload { + charstring innerPayload +} + +type charstring InnerPayload; + +testcase TC_Sem_0703_decoded_field_reference_002() runs on GeneralComp { + // outerPayload content is "test text" + var OuterPayload v_outerPayload := { innerPayload := "test text" }; + + // convert universal charstring to octetstring + var bitstring v_test := encvalue(v_outerPayload); + + // convert bitstring to hexstring + var PDU v_packet := {header:= 'FF'H, outerPayload := bit2hex(v_test)}; // PDU contains hexadecimal values + + var InnerPayload v_payload := v_packet.outerPayload => OuterPayload.innerPayload; // decode "innerPayload" + + if ( match(v_payload,"test text")) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_0703_decoded_field_reference_002()); +} + +} \ No newline at end of file diff --git a/core_language/07_expressions/0703_decoded_field_reference/Sem_0703_decoded_field_reference_003.ttcn b/core_language/07_expressions/0703_decoded_field_reference/Sem_0703_decoded_field_reference_003.ttcn new file mode 100644 index 0000000..2553032 --- /dev/null +++ b/core_language/07_expressions/0703_decoded_field_reference/Sem_0703_decoded_field_reference_003.ttcn @@ -0,0 +1,56 @@ +/***************************************************************** + ** @author STF 584 + ** @version 0.0.1 + ** @purpose 1:7.2, Ensure that the IUT correctly handles field reference decoding + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + + +/* The following requirement is tested: +Decoded field reference is a specific notation that can be applied to expressions of bitstring, hexstring, +octetstring, charstring or universal charstring types. It is used for accessing content of implicitly decoded payload fields. +*/ + +module Sem_0703_decoded_field_reference_003 { + +type component GeneralComp { +} + +type octetstring PduHeader; +type integer OuterPayloadHeader; + +type record PDU { + PduHeader header, + octetstring outerPayload // octetstring +} + +type record OuterPayload { + charstring innerPayload +} + +type charstring InnerPayload; + +testcase TC_Sem_0703_decoded_field_reference_003() runs on GeneralComp { + // outerPayload content is "test text" + var OuterPayload v_outerPayload := { innerPayload := "test text"}; + + // convert charstring to octetstring + var octetstring v_test := encvalue_o(v_outerPayload); + + // convert octetstring to hexstring + var PDU v_packet := {header:= '00'O, outerPayload := v_test}; // PDU contains octet values + + var InnerPayload v_payload := v_packet.outerPayload => OuterPayload.innerPayload; // decode "innerPayload" + + if ( match(v_payload,"test text")) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_0703_decoded_field_reference_003()); +} + +} \ No newline at end of file diff --git a/core_language/07_expressions/0703_decoded_field_reference/Sem_0703_decoded_field_reference_004.ttcn b/core_language/07_expressions/0703_decoded_field_reference/Sem_0703_decoded_field_reference_004.ttcn new file mode 100644 index 0000000..43cd52f --- /dev/null +++ b/core_language/07_expressions/0703_decoded_field_reference/Sem_0703_decoded_field_reference_004.ttcn @@ -0,0 +1,54 @@ +/***************************************************************** + ** @author STF 584 + ** @version 0.0.1 + ** @purpose 1:7.2, Ensure that the IUT correctly handles field reference decoding + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + + +/* The following requirement is tested: +Decoded field reference is a specific notation that can be applied to expressions of bitstring, hexstring, +octetstring, charstring or universal charstring types. It is used for accessing content of implicitly decoded payload fields. +*/ + +module Sem_0703_decoded_field_reference_004 { + +type component GeneralComp { +} + +type charstring PduHeader; +type integer OuterPayloadHeader; + +type record PDU { + PduHeader header, + universal charstring outerPayload // universal charstring +} + +type record OuterPayload { + charstring innerPayload +} + +type universal charstring InnerPayload; + +testcase TC_Sem_0703_decoded_field_reference_004() runs on GeneralComp { + // outerPayload content is "test text" + var OuterPayload v_outerPayload := { innerPayload := "test text" }; + var universal charstring v_test := encvalue_unichar(v_outerPayload); + + // convert to universal charstring + var PDU v_packet := {header:= "header", outerPayload := v_test}; + + var InnerPayload v_payload := v_packet.outerPayload => OuterPayload.innerPayload; + + if ( match(v_payload,"test text")) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_0703_decoded_field_reference_004()); +} + +} \ No newline at end of file diff --git a/core_language/07_expressions/0703_decoded_field_reference/Sem_0703_decoded_field_reference_005.ttcn b/core_language/07_expressions/0703_decoded_field_reference/Sem_0703_decoded_field_reference_005.ttcn new file mode 100644 index 0000000..189684d --- /dev/null +++ b/core_language/07_expressions/0703_decoded_field_reference/Sem_0703_decoded_field_reference_005.ttcn @@ -0,0 +1,56 @@ +/***************************************************************** + ** @author STF 584 + ** @version 0.0.1 + ** @purpose 1:7.2, Ensure that the IUT correctly handles field reference decoding + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + + +/* The following requirement is tested: +In case the string operand is of the universal charstring type and +the extended syntax with parentheses is used, the type operand can be followed by an optional parameter defining the +encoding format. The parameter shall be of the charstring type and it shall contain one of the strings allowed for +the decvalue_unichar function (specified in clause C.5.4). +*/ + +module Sem_0703_decoded_field_reference_005 { + +type component GeneralComp { +} + +type charstring PduHeader; +type integer OuterPayloadHeader; + +type record PDU { + PduHeader header, + universal charstring outerPayload // universal charstring +} + +type record OuterPayload { + charstring innerPayload +} + +type universal charstring InnerPayload; + +testcase TC_Sem_0703_decoded_field_reference_005() runs on GeneralComp { + // outerPayload content is "test text" + var charstring v_testText := "test text"; + var universal charstring v_test := encvalue_unichar(v_testText, "UTF-8"); + + // convert universal charstring (UTF-8) + var PDU v_packet := {header:= "header", outerPayload := v_test}; + + var InnerPayload v_payload := v_packet.outerPayload => (OuterPayload.innerPayload, "UTF-8"); + + if ( match(v_payload,"test text")) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_0703_decoded_field_reference_005()); +} + +} \ No newline at end of file diff --git a/core_language/07_expressions/0703_decoded_field_reference/Sem_0703_decoded_field_reference_006.ttcn b/core_language/07_expressions/0703_decoded_field_reference/Sem_0703_decoded_field_reference_006.ttcn new file mode 100644 index 0000000..7ff08dc --- /dev/null +++ b/core_language/07_expressions/0703_decoded_field_reference/Sem_0703_decoded_field_reference_006.ttcn @@ -0,0 +1,55 @@ +/***************************************************************** + ** @author STF 584 + ** @version 0.0.1 + ** @purpose 1:7.2, Ensure that the IUT correctly handles field reference decoding + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +/* The following requirement is tested: +In case the string operand is of the universal charstring type and +the extended syntax with parentheses is used, the type operand can be followed by an optional parameter defining the +encoding format. The parameter shall be of the charstring type and it shall contain one of the strings allowed for +the decvalue_unichar function (specified in clause C.5.4). +*/ + +module Sem_0703_decoded_field_reference_006 { + +type component GeneralComp { +} + +type charstring PduHeader; +type integer OuterPayloadHeader; + +type record PDU { + PduHeader header, + universal charstring outerPayload // universal charstring +} + +type record OuterPayload { + charstring innerPayload +} + +type universal charstring InnerPayload; + +testcase TC_Sem_0703_decoded_field_reference_006() runs on GeneralComp { + // outerPayload content is "test text" + var charstring v_testText := "test text"; + var universal charstring v_test := encvalue_unichar(v_testText, "UTF-16"); + + // convert universal charstring (UTF-16) + var PDU v_packet := {header:= "header", outerPayload := v_test}; + + var InnerPayload v_payload := v_packet.outerPayload => (OuterPayload.innerPayload,"UTF-16"); + + if ( match(v_payload,"test text")) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_0703_decoded_field_reference_006()); +} + +} \ No newline at end of file diff --git a/core_language/07_expressions/0703_decoded_field_reference/Sem_0703_decoded_field_reference_007.ttcn b/core_language/07_expressions/0703_decoded_field_reference/Sem_0703_decoded_field_reference_007.ttcn new file mode 100644 index 0000000..4eedd3d --- /dev/null +++ b/core_language/07_expressions/0703_decoded_field_reference/Sem_0703_decoded_field_reference_007.ttcn @@ -0,0 +1,55 @@ +/***************************************************************** + ** @author STF 584 + ** @version 0.0.1 + ** @purpose 1:7.2, Ensure that the IUT correctly handles field reference decoding + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +/* The following requirement is tested: +In case the string operand is of the universal charstring type and +the extended syntax with parentheses is used, the type operand can be followed by an optional parameter defining the +encoding format. The parameter shall be of the charstring type and it shall contain one of the strings allowed for +the decvalue_unichar function (specified in clause C.5.4). +*/ + +module Sem_0703_decoded_field_reference_007 { + +type component GeneralComp { +} + +type charstring PduHeader; +type integer OuterPayloadHeader; + +type record PDU { + PduHeader header, + universal charstring outerPayload // universal charstring +} + +type record OuterPayload { + charstring innerPayload +} + +type universal charstring InnerPayload; + +testcase TC_Sem_0703_decoded_field_reference_007() runs on GeneralComp { + // outerPayload content is "test text" + var charstring v_testText := "test text"; + var universal charstring v_test := encvalue_unichar(v_testText, "UTF-16LE"); + + // convert universal charstring (UTF-16LE) + var PDU v_packet := {header:= "header", outerPayload := v_test}; + + var InnerPayload v_payload := v_packet.outerPayload => (OuterPayload.innerPayload,"UTF-16LE"); + + if ( match(v_payload,"test text")) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_0703_decoded_field_reference_007()); +} + +} \ No newline at end of file diff --git a/core_language/07_expressions/0703_decoded_field_reference/Sem_0703_decoded_field_reference_008.ttcn b/core_language/07_expressions/0703_decoded_field_reference/Sem_0703_decoded_field_reference_008.ttcn new file mode 100644 index 0000000..774a40f --- /dev/null +++ b/core_language/07_expressions/0703_decoded_field_reference/Sem_0703_decoded_field_reference_008.ttcn @@ -0,0 +1,55 @@ +/***************************************************************** + ** @author STF 584 + ** @version 0.0.1 + ** @purpose 1:7.2, Ensure that the IUT correctly handles field reference decoding + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +/* The following requirement is tested: +In case the string operand is of the universal charstring type and +the extended syntax with parentheses is used, the type operand can be followed by an optional parameter defining the +encoding format. The parameter shall be of the charstring type and it shall contain one of the strings allowed for +the decvalue_unichar function (specified in clause C.5.4). +*/ + +module Sem_0703_decoded_field_reference_008 { + +type component GeneralComp { +} + +type charstring PduHeader; +type integer OuterPayloadHeader; + +type record PDU { + PduHeader header, + universal charstring outerPayload // universal charstring +} + +type record OuterPayload { + charstring innerPayload +} + +type universal charstring InnerPayload; + +testcase TC_Sem_0703_decoded_field_reference_008() runs on GeneralComp { + // outerPayload content is "test text" + var charstring v_testText := "test text"; + var universal charstring v_test := encvalue_unichar(v_testText, "UTF-16BE"); + + // convert universal charstring (UTF-16BE) + var PDU v_packet := {header:= "header", outerPayload := v_test}; + + var InnerPayload v_payload := v_packet.outerPayload => (OuterPayload.innerPayload,"UTF-16BE"); + + if ( match(v_payload,"test text")) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_0703_decoded_field_reference_008()); +} + +} \ No newline at end of file diff --git a/core_language/07_expressions/0703_decoded_field_reference/Sem_0703_decoded_field_reference_009.ttcn b/core_language/07_expressions/0703_decoded_field_reference/Sem_0703_decoded_field_reference_009.ttcn new file mode 100644 index 0000000..a65fb5d --- /dev/null +++ b/core_language/07_expressions/0703_decoded_field_reference/Sem_0703_decoded_field_reference_009.ttcn @@ -0,0 +1,55 @@ +/***************************************************************** + ** @author STF 584 + ** @version 0.0.1 + ** @purpose 1:7.2, Ensure that the IUT correctly handles field reference decoding + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +/* The following requirement is tested: +In case the string operand is of the universal charstring type and +the extended syntax with parentheses is used, the type operand can be followed by an optional parameter defining the +encoding format. The parameter shall be of the charstring type and it shall contain one of the strings allowed for +the decvalue_unichar function (specified in clause C.5.4). +*/ + +module Sem_0703_decoded_field_reference_009 { + +type component GeneralComp { +} + +type charstring PduHeader; +type integer OuterPayloadHeader; + +type record PDU { + PduHeader header, + universal charstring outerPayload // universal charstring +} + +type record OuterPayload { + charstring innerPayload +} + +type universal charstring InnerPayload; + +testcase TC_Sem_0703_decoded_field_reference_009() runs on GeneralComp { + // outerPayload content is "abc" + var charstring v_testText := "abc"; + var universal charstring v_test := encvalue_unichar(v_testText, "UTF-32"); + + // convert universal charstring (UTF-32) + var PDU v_packet := {header:= "header", outerPayload := v_test}; + + var InnerPayload v_payload := v_packet.outerPayload => (OuterPayload.innerPayload,"UTF-32"); + + if ( match(v_payload,"abc")) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_0703_decoded_field_reference_009()); +} + +} \ No newline at end of file diff --git a/core_language/07_expressions/0703_decoded_field_reference/Sem_0703_decoded_field_reference_010.ttcn b/core_language/07_expressions/0703_decoded_field_reference/Sem_0703_decoded_field_reference_010.ttcn new file mode 100644 index 0000000..74c92f1 --- /dev/null +++ b/core_language/07_expressions/0703_decoded_field_reference/Sem_0703_decoded_field_reference_010.ttcn @@ -0,0 +1,55 @@ +/***************************************************************** + ** @author STF 584 + ** @version 0.0.1 + ** @purpose 1:7.2, Ensure that the IUT correctly handles field reference decoding + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +/* The following requirement is tested: +In case the string operand is of the universal charstring type and +the extended syntax with parentheses is used, the type operand can be followed by an optional parameter defining the +encoding format. The parameter shall be of the charstring type and it shall contain one of the strings allowed for +the decvalue_unichar function (specified in clause C.5.4). +*/ + +module Sem_0703_decoded_field_reference_010 { + +type component GeneralComp { +} + +type charstring PduHeader; +type integer OuterPayloadHeader; + +type record PDU { + PduHeader header, + universal charstring outerPayload // universal charstring +} + +type record OuterPayload { + charstring innerPayload +} + +type universal charstring InnerPayload; + +testcase TC_Sem_0703_decoded_field_reference_010() runs on GeneralComp { + // outerPayload content is "abc" + var charstring v_testText := "abc"; + var universal charstring v_test := encvalue_unichar(v_testText, "UTF-32LE"); + + // convert universal charstring (UTF-32LE) + var PDU v_packet := {header:= "header", outerPayload := v_test}; + + var InnerPayload v_payload := v_packet.outerPayload => (OuterPayload.innerPayload,"UTF-32LE"); + + if ( match(v_payload,"abc")) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_0703_decoded_field_reference_010()); +} + +} \ No newline at end of file diff --git a/core_language/07_expressions/0703_decoded_field_reference/Sem_0703_decoded_field_reference_011.ttcn b/core_language/07_expressions/0703_decoded_field_reference/Sem_0703_decoded_field_reference_011.ttcn new file mode 100644 index 0000000..773a2eb --- /dev/null +++ b/core_language/07_expressions/0703_decoded_field_reference/Sem_0703_decoded_field_reference_011.ttcn @@ -0,0 +1,55 @@ +/***************************************************************** + ** @author STF 584 + ** @version 0.0.1 + ** @purpose 1:7.2, Ensure that the IUT correctly handles field reference decoding + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +/* The following requirement is tested: +In case the string operand is of the universal charstring type and +the extended syntax with parentheses is used, the type operand can be followed by an optional parameter defining the +encoding format. The parameter shall be of the charstring type and it shall contain one of the strings allowed for +the decvalue_unichar function (specified in clause C.5.4). +*/ + +module Sem_0703_decoded_field_reference_011 { + +type component GeneralComp { +} + +type charstring PduHeader; +type integer OuterPayloadHeader; + +type record PDU { + PduHeader header, + universal charstring outerPayload // universal charstring +} + +type record OuterPayload { + charstring innerPayload +} + +type universal charstring InnerPayload; + +testcase TC_Sem_0703_decoded_field_reference_011() runs on GeneralComp { + // outerPayload content is "abc" + var charstring v_testText := "abc"; + var universal charstring v_test := encvalue_unichar(v_testText, "UTF-32BE"); + + // convert universal charstring (UTF-32BE) + var PDU v_packet := {header:= "header", outerPayload := v_test}; + + var InnerPayload v_payload := v_packet.outerPayload => (OuterPayload.innerPayload,"UTF-32BE"); + + if ( match(v_payload,"abc")) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_0703_decoded_field_reference_011()); +} + +} \ No newline at end of file diff --git a/core_language/08_modules/0801_definition_of_a_module/Sem_0801_DefinitionOfAModule_001.ttcn b/core_language/08_modules/0801_definition_of_a_module/Sem_0801_DefinitionOfAModule_001.ttcn new file mode 100644 index 0000000..d8641c0 --- /dev/null +++ b/core_language/08_modules/0801_definition_of_a_module/Sem_0801_DefinitionOfAModule_001.ttcn @@ -0,0 +1,21 @@ +/***************************************************************** + ** @author TTF T014 + ** @version 0.0.1 + ** @purpose 1:8.1, Ensure that a module definition with invalid language specification is ignored. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// invalid language should fallback to compiler default language + +module Sem_0801_DefinitionOfAModule_001 language "TTCN-3:9999" { + + type component GeneralComp {} + + testcase TC_Sem_0801_DefinitionOfAModule_001() runs on GeneralComp { + setverdict(pass); + } + + control{ + execute(TC_Sem_0801_DefinitionOfAModule_001()); + } +} diff --git a/core_language/08_modules/0801_definition_of_a_module/Syn_0801_DefinitionOfAModule_011.ttcn b/core_language/08_modules/0801_definition_of_a_module/Syn_0801_DefinitionOfAModule_011.ttcn new file mode 100644 index 0000000..d4df1e4 --- /dev/null +++ b/core_language/08_modules/0801_definition_of_a_module/Syn_0801_DefinitionOfAModule_011.ttcn @@ -0,0 +1,10 @@ +/***************************************************************** + ** @author TTF T014 + ** @version 0.0.1 + ** @purpose 1:8.1, Ensure that a module definition with V4.9.1 language and package is accepted. + ** @verdict pass accept, noexecution + *****************************************************************/ + +module Syn_0801_DefinitionOfAModule_011 language "TTCN-3:2017" { + +} diff --git a/core_language/08_modules/0801_definition_of_a_module/Syn_0801_DefinitionOfAModule_012.ttcn b/core_language/08_modules/0801_definition_of_a_module/Syn_0801_DefinitionOfAModule_012.ttcn new file mode 100644 index 0000000..1c79ee0 --- /dev/null +++ b/core_language/08_modules/0801_definition_of_a_module/Syn_0801_DefinitionOfAModule_012.ttcn @@ -0,0 +1,10 @@ +/***************************************************************** + ** @author TTF T014 + ** @version 0.0.1 + ** @purpose 1:8.1, Ensure that a module definition with V4.10.1 language and package is accepted. + ** @verdict pass accept, noexecution + *****************************************************************/ + +module Syn_0801_DefinitionOfAModule_012 language "TTCN-3:2018" { + +} diff --git a/core_language/08_modules/0801_definition_of_a_module/Syn_0801_DefinitionOfAModule_013.ttcn b/core_language/08_modules/0801_definition_of_a_module/Syn_0801_DefinitionOfAModule_013.ttcn new file mode 100644 index 0000000..e1ff36b --- /dev/null +++ b/core_language/08_modules/0801_definition_of_a_module/Syn_0801_DefinitionOfAModule_013.ttcn @@ -0,0 +1,10 @@ +/***************************************************************** + ** @author TTF T014 + ** @version 0.0.1 + ** @purpose 1:8.1, Ensure that a module definition with V4.11.1 language and package is accepted. + ** @verdict pass accept, noexecution + *****************************************************************/ + +module Syn_0801_DefinitionOfAModule_013 language "TTCN-3:2019" { + +} diff --git a/core_language/08_modules/0801_definition_of_a_module/Syn_0801_DefinitionOfAModule_014.ttcn b/core_language/08_modules/0801_definition_of_a_module/Syn_0801_DefinitionOfAModule_014.ttcn new file mode 100644 index 0000000..88344fc --- /dev/null +++ b/core_language/08_modules/0801_definition_of_a_module/Syn_0801_DefinitionOfAModule_014.ttcn @@ -0,0 +1,10 @@ +/***************************************************************** + ** @author TTF T014 + ** @version 0.0.1 + ** @purpose 1:8.1, Ensure that a module definition with V4.12.1 language and package is accepted. + ** @verdict pass accept, noexecution + *****************************************************************/ + +module Syn_0801_DefinitionOfAModule_014 language "TTCN-3:2020" { + +} diff --git a/core_language/08_modules/0801_definition_of_a_module/Syn_0801_DefinitionOfAModule_015.ttcn b/core_language/08_modules/0801_definition_of_a_module/Syn_0801_DefinitionOfAModule_015.ttcn new file mode 100644 index 0000000..de02c66 --- /dev/null +++ b/core_language/08_modules/0801_definition_of_a_module/Syn_0801_DefinitionOfAModule_015.ttcn @@ -0,0 +1,10 @@ +/***************************************************************** + ** @author TTF T014 + ** @version 0.0.1 + ** @purpose 1:8.1, Ensure that a module definition with V4.13.1 language and package is accepted. + ** @verdict pass accept, noexecution + *****************************************************************/ + +module Syn_0801_DefinitionOfAModule_015 language "TTCN-3:2021" { + +} diff --git a/core_language/08_modules/0802_module_definitions_part/080201_module_parameters/NegSem_080201_ModuleParameters_007.ttcn b/core_language/08_modules/0802_module_definitions_part/080201_module_parameters/NegSem_080201_ModuleParameters_007.ttcn new file mode 100644 index 0000000..6f027bc --- /dev/null +++ b/core_language/08_modules/0802_module_definitions_part/080201_module_parameters/NegSem_080201_ModuleParameters_007.ttcn @@ -0,0 +1,30 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:8.2.1, verify that module parameters cannot be used as actual parameters of out formal parameters + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction a) +// During test execution module parameters shall not be used as target of assignments or as actual out or inout parameters. + +module NegSem_080201_ModuleParameters_007 { + modulepar integer PX_INT; + + function f_test(out integer p_par) { + p_par := 1; + } + + type component GeneralComp { + } + + testcase TC_NegSem_080201_ModuleParameters_007() runs on GeneralComp { + f_test(PX_INT); + setverdict(pass); + } + + control { + execute(TC_NegSem_080201_ModuleParameters_007()); + } +} diff --git a/core_language/08_modules/0802_module_definitions_part/080201_module_parameters/NegSem_080201_ModuleParameters_008.ttcn b/core_language/08_modules/0802_module_definitions_part/080201_module_parameters/NegSem_080201_ModuleParameters_008.ttcn new file mode 100644 index 0000000..13c1d23 --- /dev/null +++ b/core_language/08_modules/0802_module_definitions_part/080201_module_parameters/NegSem_080201_ModuleParameters_008.ttcn @@ -0,0 +1,30 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:8.2.1, verify that module parameters cannot be used as actual parameters of inout formal parameters + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction a) +// During test execution module parameters shall not be used as target of assignments or as actual out or inout parameters. + +module NegSem_080201_ModuleParameters_008 { + modulepar integer PX_INT; + + function f_test(inout integer p_par) { + p_par := 1; + } + + type component GeneralComp { + } + + testcase TC_NegSem_080201_ModuleParameters_008() runs on GeneralComp { + f_test(PX_INT); + setverdict(pass); + } + + control { + execute(TC_NegSem_080201_ModuleParameters_008()); + } +} diff --git a/core_language/08_modules/0802_module_definitions_part/080201_module_parameters/NegSem_080201_ModuleParameters_009.ttcn b/core_language/08_modules/0802_module_definitions_part/080201_module_parameters/NegSem_080201_ModuleParameters_009.ttcn new file mode 100644 index 0000000..f103baf --- /dev/null +++ b/core_language/08_modules/0802_module_definitions_part/080201_module_parameters/NegSem_080201_ModuleParameters_009.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:8.2.1, verify that module parameter values follow the rules for deterministic context + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction f) +// The constant expression for the default value TemplateBody of a module parameter shall respect the limitations given in clause +// 16.1.4. and shall be compatible with the Type of the declaration and conform to the given TemplateRestriction. If no template +// modifier is present, the TemplateBody shall resolve to a value. + +module NegSem_080201_ModuleParameters_009 { + + function f_test() return integer { + if (rnd() > 0.5) { + return 1; + } else { + return 0; + } + } + + modulepar integer PX_INT := f_test(); + + type component GeneralComp { + } + + testcase TC_NegSem_080201_ModuleParameters_009() runs on GeneralComp { + log(PX_INT); + setverdict(pass); + } + + control { + execute(TC_NegSem_080201_ModuleParameters_009()); + } +} diff --git a/core_language/08_modules/0802_module_definitions_part/080201_module_parameters/NegSem_080201_ModuleParameters_010.ttcn b/core_language/08_modules/0802_module_definitions_part/080201_module_parameters/NegSem_080201_ModuleParameters_010.ttcn new file mode 100644 index 0000000..dba69ef --- /dev/null +++ b/core_language/08_modules/0802_module_definitions_part/080201_module_parameters/NegSem_080201_ModuleParameters_010.ttcn @@ -0,0 +1,29 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:8.2.1, verify that module parameter declarations that don't contain the template keyword cannot contain matching symbols + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction f) +// The constant expression for the default value TemplateBody of a module parameter shall respect the limitations given in clause +// 16.1.4. and shall be compatible with the Type of the declaration and conform to the given TemplateRestriction. If no template +// modifier is present, the TemplateBody shall resolve to a value. + +module NegSem_080201_ModuleParameters_010 { + + modulepar integer PX_INT := ?; + + type component GeneralComp { + } + + testcase TC_NegSem_080201_ModuleParameters_010() runs on GeneralComp { + log(PX_INT); + setverdict(pass); + } + + control { + execute(TC_NegSem_080201_ModuleParameters_010()); + } +} diff --git a/core_language/08_modules/0802_module_definitions_part/080201_module_parameters/Syn_080201_ModuleParameters_004.ttcn b/core_language/08_modules/0802_module_definitions_part/080201_module_parameters/Syn_080201_ModuleParameters_004.ttcn new file mode 100644 index 0000000..ddf77c9 --- /dev/null +++ b/core_language/08_modules/0802_module_definitions_part/080201_module_parameters/Syn_080201_ModuleParameters_004.ttcn @@ -0,0 +1,13 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:8.2.1, module parameter of template type + ** @verdict pass accept, noexecution + *****************************************************************/ + +// The following requirement is tested: +// Module parameters are values or templates that are may be supplied by the test environment at runtime. + +module Syn_080201_ModuleParameters_001 { + modulepar template integer MY_INTEGER_MODULE_PARAMETER := ?; +} diff --git a/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_041.ttcn b/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_041.ttcn new file mode 100644 index 0000000..a0c7fba --- /dev/null +++ b/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_041.ttcn @@ -0,0 +1,31 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:8.2.3.1, verify that original name of a renamed imported module cannot be referenced + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// Restriction i: +// If an imported module is renamed in the import clause, the original module name +// is not imported and cannot be used for referencing the imported module. +// The imported module can be referenced using the new local name only. + +module NegSem_08020301_GeneralFormatOfImport_041 { + import from NegSem_08020301_GeneralFormatOfImport_041_import -> Imported all; + type component GeneralComp {} + + testcase TC_Sem_08020301_GeneralFormatOfImport_041() runs on GeneralComp { + log(NegSem_08020301_GeneralFormatOfImport_041_import.c_int); + setverdict(pass); + } + + control{ + // testing if parameter names are imported + execute(TC_Sem_08020301_GeneralFormatOfImport_041()); + } +} + +module NegSem_08020301_GeneralFormatOfImport_041_import { + const integer c_int := 1; +} \ No newline at end of file diff --git a/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_042.ttcn b/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_042.ttcn new file mode 100644 index 0000000..32429d4 --- /dev/null +++ b/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_042.ttcn @@ -0,0 +1,34 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:8.2.3.1, verify that original name of a renamed imported module cannot be referenced + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// Restriction j: +// If an imported module is renamed in the import clause, the new local name of the +// module shall be unique in the scope of the importing module. + +module NegSem_08020301_GeneralFormatOfImport_042 { + type record R { + integer c_int + } + const R Imported := { c_int := 10 } + import from NegSem_08020301_GeneralFormatOfImport_042_import -> Imported all; + type component GeneralComp {} + + testcase TC_Sem_08020301_GeneralFormatOfImport_042() runs on GeneralComp { + log(Imported.c_int); + setverdict(pass); + } + + control{ + // testing if parameter names are imported + execute(TC_Sem_08020301_GeneralFormatOfImport_042()); + } +} + +module NegSem_08020301_GeneralFormatOfImport_042_import { + const integer c_int := 1; +} \ No newline at end of file diff --git a/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/Sem_08020301_GeneralFormatOfImport_021.ttcn b/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/Sem_08020301_GeneralFormatOfImport_021.ttcn new file mode 100644 index 0000000..b2aabb8 --- /dev/null +++ b/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/Sem_08020301_GeneralFormatOfImport_021.ttcn @@ -0,0 +1,31 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:8.2.3.1, verify that imported modules can be renamed + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// It is allowed to rename a module name during its import. The new name will be visible only in the importing module. + +module Sem_08020301_GeneralFormatOfImport_021 { + + import from Sem_08020301_GeneralFormatOfImport_021_import -> Imported {type My_type} ; + + type component GeneralComp {} + + testcase TC_Sem_08020301_GeneralFormatOfImport_021() runs on GeneralComp { + var Imported.My_type v_1 := 2; + setverdict(pass); + } + + control { + // testing if parameter names are imported + execute(TC_Sem_08020301_GeneralFormatOfImport_021()); + } +} + +module Sem_08020301_GeneralFormatOfImport_021_import { + type integer My_type; //integer type + +} \ No newline at end of file diff --git a/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020305_importing_all_definitions_of_a_module/Sem_08020305_ImportingAllDefinitionsOfAModule_003.ttcn b/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020305_importing_all_definitions_of_a_module/Sem_08020305_ImportingAllDefinitionsOfAModule_003.ttcn new file mode 100644 index 0000000..428904b --- /dev/null +++ b/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020305_importing_all_definitions_of_a_module/Sem_08020305_ImportingAllDefinitionsOfAModule_003.ttcn @@ -0,0 +1,31 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:8.2.3.5, verify that the address type is imported when importing all definitions + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirement is tested: +// All visible definitions of a module definitions part may be imported using the all +// keyword next to the module name. + +module Sem_08020305_ImportingAllDefinitionsOfAModule_003 { + + import from Sem_08020305_ImportingAllDefinitionsOfAModule_003_import all; + + type component GeneralComp {} + + testcase TC_Sem_08020305_ImportingAllDefinitionsOfAModule_003() runs on GeneralComp { + var address v_addr := 3; + log(v_addr); + setverdict(pass); + } + + control { + execute(TC_Sem_08020305_ImportingAllDefinitionsOfAModule_003()); + } +} + +module Sem_08020305_ImportingAllDefinitionsOfAModule_003_import { + type integer address; +} diff --git a/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020305_importing_all_definitions_of_a_module/Sem_08020305_ImportingAllDefinitionsOfAModule_004.ttcn b/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020305_importing_all_definitions_of_a_module/Sem_08020305_ImportingAllDefinitionsOfAModule_004.ttcn new file mode 100644 index 0000000..2121e9a --- /dev/null +++ b/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020305_importing_all_definitions_of_a_module/Sem_08020305_ImportingAllDefinitionsOfAModule_004.ttcn @@ -0,0 +1,32 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:8.2.3.5, verify that the control function is imported when importing all definitions + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirement is tested: +// All visible definitions of a module definitions part may be imported using the all +// keyword next to the module name. + +module Sem_08020305_ImportingAllDefinitionsOfAModule_004 { + + import from Sem_08020305_ImportingAllDefinitionsOfAModule_004_import all; + + type component GeneralComp {} + + testcase TC_Sem_08020305_ImportingAllDefinitionsOfAModule_004() runs on GeneralComp { + setverdict(pass); + } + + control { + Sem_08020305_ImportingAllDefinitionsOfAModule_004_import.control(); + execute(TC_Sem_08020305_ImportingAllDefinitionsOfAModule_004()); + } +} + +module Sem_08020305_ImportingAllDefinitionsOfAModule_004_import { + control { + log("In imported control function"); + } +} diff --git a/core_language/09_test_configurations/0901_communication_ports/NegSem_0901_Communication_ports_008.ttcn b/core_language/09_test_configurations/0901_communication_ports/NegSem_0901_Communication_ports_008.ttcn old mode 100755 new mode 100644 diff --git a/core_language/09_test_configurations/0901_communication_ports/Sem_0901_Communication_ports_009.ttcn b/core_language/09_test_configurations/0901_communication_ports/Sem_0901_Communication_ports_009.ttcn old mode 100755 new mode 100644 diff --git a/core_language/09_test_configurations/0901_communication_ports/Sem_0901_Communication_ports_010.ttcn b/core_language/09_test_configurations/0901_communication_ports/Sem_0901_Communication_ports_010.ttcn old mode 100755 new mode 100644 diff --git a/core_language/09_test_configurations/0901_communication_ports/Sem_0901_Communication_ports_011.ttcn b/core_language/09_test_configurations/0901_communication_ports/Sem_0901_Communication_ports_011.ttcn old mode 100755 new mode 100644 diff --git a/core_language/10_constants/NegSem_10_Constants_004.ttcn b/core_language/10_constants/NegSem_10_Constants_004.ttcn old mode 100755 new mode 100644 diff --git a/core_language/10_constants/NegSem_10_Constants_005.ttcn b/core_language/10_constants/NegSem_10_Constants_005.ttcn old mode 100755 new mode 100644 diff --git a/core_language/10_constants/Sem_10_Constants_010.ttcn b/core_language/10_constants/Sem_10_Constants_010.ttcn new file mode 100644 index 0000000..948b86d --- /dev/null +++ b/core_language/10_constants/Sem_10_Constants_010.ttcn @@ -0,0 +1,44 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:10, record type used as a constant with optional fields and "implicit omit" + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/*The following requirement is tested: Restriction c) Using the dot notation (see clauses When using direct assignment notation in a scope where the optional +attribute is set to "implicit omit", the uninitialized optional fields in the referenced value, shall implicitly be set +to omit after the assignment in the new value, while mandatory fields shall remain unchanged +*/ + +module Sem_10_Constants_010 { + + type record MyRecordType + { + bitstring field1, + boolean field2 optional, + charstring field3 optional + + }; + + type component GeneralComp { + } + + testcase TC_Sem_10_Constants_010() runs on GeneralComp { + const MyRecordType c_mST3 := {field1 := '1010'B, + field2 := -, + field3 := -} with { optional "implicit omit" }; + + + + if (match(c_mST3, {'1010'B, omit, omit})) + { + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control{ + execute(TC_Sem_10_Constants_010()); + } +} \ No newline at end of file diff --git a/core_language/10_constants/Sem_10_Constants_011.ttcn b/core_language/10_constants/Sem_10_Constants_011.ttcn new file mode 100644 index 0000000..dc695cb --- /dev/null +++ b/core_language/10_constants/Sem_10_Constants_011.ttcn @@ -0,0 +1,45 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:10, set type used as a constant with optional fields and "implicit omit" + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + + /*The following requirement is tested: Restriction c) Using the dot notation (see clauses When using direct assignment notation in a scope where the optional +attribute is set to "implicit omit", the uninitialized optional fields in the referenced value, shall implicitly be set +to omit after the assignment in the new value, while mandatory fields shall remain unchanged +*/ + +module Sem_10_Constants_011 { + + type set MySetType + { + bitstring field1, + boolean field2 optional, + charstring field3 optional + + }; + + type component GeneralComp { + } + + testcase TC_Sem_10_Constants_011() runs on GeneralComp { + const MySetType c_mST3 := {field1 := '1010'B, + field2 := -, + field3 := -} with { optional "implicit omit" }; + + + + if (match(c_mST3, {'1010'B, omit, omit})) + { + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control{ + execute(TC_Sem_10_Constants_011()); + } +} \ No newline at end of file diff --git a/core_language/10_constants/Sem_10_Constants_012.ttcn b/core_language/10_constants/Sem_10_Constants_012.ttcn new file mode 100644 index 0000000..360747e --- /dev/null +++ b/core_language/10_constants/Sem_10_Constants_012.ttcn @@ -0,0 +1,39 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:10, Declaring constant with @default unions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + + /*The following requirement is tested: Restriction c) Using the dot notation (see clauses When using direct assignment notation in a scope where the optional +attribute is set to "implicit omit", the uninitialized optional fields in the referenced value, shall implicitly be set +to omit after the assignment in the new value, while mandatory fields shall remain unchanged +*/ + +module Sem_10_Constants_012 { + + type union U { + @default integer option1, + charstring option2 + } + + + type component GeneralComp { + } + + testcase TC_Sem_10_Constants_012() runs on GeneralComp { + const U c_mST3 := 12345; // implicit usage of the default alternative: c_mST3 := { option1 := 12345 } + + if (match(c_mST3, 12345)) + { + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control{ + execute(TC_Sem_10_Constants_012()); + } +} \ No newline at end of file diff --git a/core_language/10_constants/Sem_10_Constants_013.ttcn b/core_language/10_constants/Sem_10_Constants_013.ttcn new file mode 100644 index 0000000..152da3f --- /dev/null +++ b/core_language/10_constants/Sem_10_Constants_013.ttcn @@ -0,0 +1,40 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:10, global constant can be a port type, but only with value null + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + + // The only value that can be assigned to global constants of default, component, port or timer type or + // component constants of default or component types is the special value null. + + /* Note: This modification is added in ETSI ES201 873-1 V4.11.1 (2019-04), + * Section 10, by removing Restriction A) + * */ + + +module Sem_10_Constants_013 { + + type port MyMessagePortType message + { + inout integer + } + + const MyMessagePortType c_port:= null; + + type component GeneralComp { + } + + testcase TC_Sem_10_Constants_013() runs on GeneralComp { + + if(match(c_port, null)){ + setverdict(pass); + }else{ + setverdict(fail); + } + }//end testcase + + control{ + execute(TC_Sem_10_Constants_013()); + } +} diff --git a/core_language/11_variables/1101_value_variables/NegSem_1101_ValueVars_003.ttcn b/core_language/11_variables/1101_value_variables/NegSem_1101_ValueVars_003.ttcn old mode 100755 new mode 100644 diff --git a/core_language/11_variables/1101_value_variables/NegSem_1101_ValueVars_004.ttcn b/core_language/11_variables/1101_value_variables/NegSem_1101_ValueVars_004.ttcn old mode 100755 new mode 100644 diff --git a/core_language/11_variables/1101_value_variables/Sem_1101_ValueVars_007.ttcn b/core_language/11_variables/1101_value_variables/Sem_1101_ValueVars_007.ttcn new file mode 100644 index 0000000..6c1053b --- /dev/null +++ b/core_language/11_variables/1101_value_variables/Sem_1101_ValueVars_007.ttcn @@ -0,0 +1,35 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:11.1, Ensure that @deterministic modifier is evaluated correctly. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +/* If a variable is declared fuzzy or lazy they can additionally declared with the @deterministic modifier to indicate + * that when used in a deterministic evaluation context, any evaluation of the variable would have no side effect and would + * yield the same result. - Restrictions f) + * */ + +module Sem_1101_ValueVars_007 { + type component GeneralComp {} + + testcase TC_Sem_1101_ValueVars_007() runs on GeneralComp { + var integer v_i := 1; + var @fuzzy @deterministic integer v_j := v_i + 2; + + v_i := v_j; + if(v_i == 3){ + setverdict(pass); + } + else{ + setverdict(fail); + } + + + } + + control { + execute(TC_Sem_1101_ValueVars_007()); + } +} diff --git a/core_language/11_variables/1102_template_variables/NegSem_1102_TemplateVars_003.ttcn b/core_language/11_variables/1102_template_variables/NegSem_1102_TemplateVars_003.ttcn old mode 100755 new mode 100644 diff --git a/core_language/11_variables/1102_template_variables/NegSem_1102_TemplateVars_004.ttcn b/core_language/11_variables/1102_template_variables/NegSem_1102_TemplateVars_004.ttcn old mode 100755 new mode 100644 diff --git a/core_language/11_variables/1102_template_variables/Sem_1102_TemplateVars_004.ttcn b/core_language/11_variables/1102_template_variables/Sem_1102_TemplateVars_004.ttcn new file mode 100644 index 0000000..b57de2a --- /dev/null +++ b/core_language/11_variables/1102_template_variables/Sem_1102_TemplateVars_004.ttcn @@ -0,0 +1,52 @@ +/***************************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:11.2, Ensure that templates with "implicit omit" are evaluated correctly. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + + /*The following requirement is tested: Restriction k) Using the dot notation (see clauses When using direct assignment notation in a scope where the optional +attribute is set to "implicit omit", the uninitialized optional fields in the referenced value, shall implicitly be set +to omit after the assignment in the new value, while mandatory fields shall remain unchanged +*/ + +module Sem_1102_TemplateVars_004 { + + type set IntegerSet { + integer a1 optional, + integer a2 optional, + integer a3 optional + }; + + type port loopbackPort message { + inout IntegerSet + } + + +type component GeneralComp { + port loopbackPort messagePort +} + + +testcase TC_Sem_1102_TemplateVars_004() runs on GeneralComp { + var template IntegerSet mw_pattern := {a1:=1,a2:=*} with { optional "implicit omit" }; + var IntegerSet v_set := {a1:=1,a2:=2,a3:=omit} + + messagePort.send(v_set); + + alt { + [] messagePort.receive(mw_pattern) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } + +} + +control{ + execute(TC_Sem_1102_TemplateVars_004()); +} + +} diff --git a/core_language/11_variables/1102_template_variables/Sem_1102_TemplateVars_005.ttcn b/core_language/11_variables/1102_template_variables/Sem_1102_TemplateVars_005.ttcn new file mode 100644 index 0000000..aed9c86 --- /dev/null +++ b/core_language/11_variables/1102_template_variables/Sem_1102_TemplateVars_005.ttcn @@ -0,0 +1,50 @@ +/***************************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:11.2, Ensure that templates with "@default modifier" unions are evaluated correctly. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + + /*The following requirement is tested: At most one of the union alternatives can be declared as the default alternative by +using the @default modifier before the type of the alternative.*/ + + +module Sem_1102_TemplateVars_005 { + + type union U { + @default integer option1, + charstring option2 + } + + type port loopbackPort message { + inout U + } + + +type component GeneralComp { + port loopbackPort messagePort +} + + +testcase TC_Sem_1102_TemplateVars_005() runs on GeneralComp { + var template U mw_pattern := 12345; + var U v_int := { option1 := 12345}; + + messagePort.send(v_int); + + alt { + [] messagePort.receive(mw_pattern) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } + +} + +control{ + execute(TC_Sem_1102_TemplateVars_005()); +} + +} diff --git a/core_language/11_variables/1102_template_variables/Sem_1102_TemplateVars_006.ttcn b/core_language/11_variables/1102_template_variables/Sem_1102_TemplateVars_006.ttcn new file mode 100644 index 0000000..c4be9c9 --- /dev/null +++ b/core_language/11_variables/1102_template_variables/Sem_1102_TemplateVars_006.ttcn @@ -0,0 +1,54 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:11.2, Ensure that templates with "@default" modifier unions are evaluated correctly. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + + //The following requirement is tested: + /* + * Restriction j) If a lazy or fuzzy template variable iss are used in deterministic contexts (i.e. during the evaluation of a + * snapshot or initialization of global non-fuzzy templates), it shall be declared @deterministic and the template body assigned to the + * variable shall fulfill the restrictions imposed on content of functions used in special places. + * */ + + +module Sem_1102_TemplateVars_006 { + + type union U { + @default integer option1, + charstring option2 + } + + type port loopbackPort message { + inout U + } + + +type component GeneralComp { + port loopbackPort messagePort +} + + +testcase TC_Sem_1102_TemplateVars_006() runs on GeneralComp { + var template @lazy @deterministic U mw_pattern := 12345; + var U v_int := { option1 := 12345}; + + messagePort.send(v_int); + + alt { + [] messagePort.receive(mw_pattern) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } + +} + +control{ + execute(TC_Sem_1102_TemplateVars_006()); +} + +} diff --git a/core_language/14_procedure_signatures/NegSem_1400_procedure_signatures_003.ttcn b/core_language/14_procedure_signatures/NegSem_1400_procedure_signatures_003.ttcn new file mode 100644 index 0000000..43da0d0 --- /dev/null +++ b/core_language/14_procedure_signatures/NegSem_1400_procedure_signatures_003.ttcn @@ -0,0 +1,79 @@ +/***************************************************************** + ** @author TTF T014 + ** @version 0.0.1 + ** @purpose 1:14, Ensure that signature return type must be data type + ** @verdict pass reject + *****************************************************************/ +//Exception is a charstring + +module NegSem_1400_procedure_signatures_003 { + + signature p_Sig1_001(in integer p_par1, out integer p_par2, inout integer p_par3) return port // Not allowed: only data types are allowed + exception (charstring); //execption is a string + + + type port remotePort procedure { + inout p_Sig1_001; + } + + type component GeneralComp { + port remotePort PCO; + var integer MyComp; + } + + + function f_Server() runs on GeneralComp { + PCO.raise(p_Sig1_001,"My string"); // raise exception + } + + function f_client() runs on GeneralComp { + timer t_timeout:=30.0; + + t_timeout.start; + + alt { + [] PCO.catch(p_Sig1_001,charstring:"My string") { + setverdict(pass); // receive exception + } + [] PCO.catch(p_Sig1_001,charstring:?) // receive anything else + { + setverdict(fail); + } + + [] t_timeout.timeout { + setverdict(fail); + } + + } +} + + testcase TC_NegSem_1400_procedure_signatures_003() runs on GeneralComp system GeneralComp { + + var GeneralComp server := GeneralComp.create("RemoteProcedure Service"); + var GeneralComp client := GeneralComp.create("RemoteProcedure Client"); + + + connect(server:PCO, client:PCO); + + + server.start(f_Server()); + client.start(f_client()); + + alt { + [] client.done { + server.stop; + } + } + + alt { + [] all component.done {} + } + + disconnect(server:PCO); + } + + control{ + execute(TC_NegSem_1400_procedure_signatures_003()); + } + +} \ No newline at end of file diff --git a/core_language/15_templates/1500_general/NegSem_1500_general_001.ttcn b/core_language/15_templates/1500_general/NegSem_1500_general_001.ttcn new file mode 100644 index 0000000..d155490 --- /dev/null +++ b/core_language/15_templates/1500_general/NegSem_1500_general_001.ttcn @@ -0,0 +1,38 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:15.0, verify that lazy variables cannot be referenced in a function called during evaluation of a deterministic fuzzy template + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// For a fuzzy template that is declared deterministic the template body shall fulfill the restrictions imposed +// on content of functions used in special places given in clause 16.1.4. +// The following operations shall not be used: +// m) Referencing lazy or fuzzy variables, parameters or templates that have not been declared deterministic. + +module NegSem_1500_general_001 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + var @lazy integer vc_int := 1; + } + + function f_test() runs on GeneralComp return template integer { + log(vc_int); // forbidden reference + return ?; + } + + testcase TC_NegSem_1500_general_001() runs on GeneralComp system GeneralComp { + template @fuzzy @deterministic integer mw_test := f_test(); + log(mw_test); // causes evaluation + setverdict(pass); + } + + control { + execute(TC_NegSem_1500_general_001()); + } +} diff --git a/core_language/15_templates/1500_general/NegSem_1500_general_002.ttcn b/core_language/15_templates/1500_general/NegSem_1500_general_002.ttcn new file mode 100644 index 0000000..b618768 --- /dev/null +++ b/core_language/15_templates/1500_general/NegSem_1500_general_002.ttcn @@ -0,0 +1,38 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:15.0, verify that fuzzy variables cannot be referenced in a function called during evaluation of a deterministic fuzzy template + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// For a fuzzy template that is declared deterministic the template body shall fulfill the restrictions imposed +// on content of functions used in special places given in clause 16.1.4. +// The following operations shall not be used: +// m) Referencing lazy or fuzzy variables, parameters or templates that have not been declared deterministic. + +module NegSem_1500_general_002 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + var @fuzzy integer vc_int := 1; + } + + function f_test() runs on GeneralComp return template integer { + log(vc_int); // forbidden reference + return ?; + } + + testcase TC_NegSem_1500_general_002() runs on GeneralComp system GeneralComp { + template @fuzzy @deterministic integer mw_test := f_test(); + log(mw_test); // causes evaluation + setverdict(pass); + } + + control { + execute(TC_NegSem_1500_general_002()); + } +} diff --git a/core_language/15_templates/1500_general/NegSem_1500_general_003.ttcn b/core_language/15_templates/1500_general/NegSem_1500_general_003.ttcn new file mode 100644 index 0000000..970f9d2 --- /dev/null +++ b/core_language/15_templates/1500_general/NegSem_1500_general_003.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:15.0, verify that lazy parameters cannot be referenced in a function called during evaluation of a deterministic fuzzy template + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// For a fuzzy template that is declared deterministic the template body shall fulfill the restrictions imposed +// on content of functions used in special places given in clause 16.1.4. +// The following operations shall not be used: +// m) Referencing lazy or fuzzy variables, parameters or templates that have not been declared deterministic. + +module NegSem_1500_general_003 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test(@lazy integer p_param) runs on GeneralComp return template integer { + log(p_param); // forbidden reference + return ?; + } + + testcase TC_NegSem_1500_general_003() runs on GeneralComp system GeneralComp { + template @fuzzy @deterministic integer mw_test := f_test(1); + log(mw_test); // causes evaluation + setverdict(pass); + } + + control { + execute(TC_NegSem_1500_general_003()); + } +} diff --git a/core_language/15_templates/1500_general/NegSem_1500_general_004.ttcn b/core_language/15_templates/1500_general/NegSem_1500_general_004.ttcn new file mode 100644 index 0000000..6cb2592 --- /dev/null +++ b/core_language/15_templates/1500_general/NegSem_1500_general_004.ttcn @@ -0,0 +1,38 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:15.0, verify that fuzzy templates cannot be referenced in a function called during evaluation of a deterministic fuzzy template + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// For a fuzzy template that is declared deterministic the template body shall fulfill the restrictions imposed +// on content of functions used in special places given in clause 16.1.4. +// The following operations shall not be used: +// m) Referencing lazy or fuzzy variables, parameters or templates that have not been declared deterministic. + +module NegSem_1500_general_004 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + template @fuzzy integer m_int := 1; + } + + function f_test() runs on GeneralComp return template integer { + log(m_int); // forbidden reference + return ?; + } + + testcase TC_NegSem_1500_general_004() runs on GeneralComp system GeneralComp { + template @fuzzy @deterministic integer mw_test := f_test(); + log(mw_test); // causes evaluation + setverdict(pass); + } + + control { + execute(TC_NegSem_1500_general_004()); + } +} diff --git a/core_language/15_templates/1500_general/NegSem_1500_general_005.ttcn b/core_language/15_templates/1500_general/NegSem_1500_general_005.ttcn new file mode 100644 index 0000000..afecb1e --- /dev/null +++ b/core_language/15_templates/1500_general/NegSem_1500_general_005.ttcn @@ -0,0 +1,38 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:15.0, verify that the create operation cannot be used in a function called during evaluation of a deterministic fuzzy template + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// For a fuzzy template that is declared deterministic the template body shall fulfill the restrictions imposed +// on content of functions used in special places given in clause 16.1.4. +// The following operations shall not be used: +// a) All component operations, i.e. create, start (component), stop (component), kill, running (component), +// alive, done and killed (see notes 1, 3, 4 and 6). + +module NegSem_1500_general_005 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() return template integer { + var GeneralComp v_ptc := GeneralComp.create; + return ?; + } + + testcase TC_NegSem_1500_general_005() runs on GeneralComp system GeneralComp { + template @fuzzy @deterministic integer mw_test := f_test(); + log(mw_test); // causes evaluation + setverdict(pass); + } + + control { + execute(TC_NegSem_1500_general_005()); + } +} diff --git a/core_language/15_templates/1500_general/NegSem_1500_general_006.ttcn b/core_language/15_templates/1500_general/NegSem_1500_general_006.ttcn new file mode 100644 index 0000000..a5f0288 --- /dev/null +++ b/core_language/15_templates/1500_general/NegSem_1500_general_006.ttcn @@ -0,0 +1,43 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:15.0, verify that the component.start operation cannot be used in a function called during evaluation of a deterministic fuzzy template + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// For a fuzzy template that is declared deterministic the template body shall fulfill the restrictions imposed +// on content of functions used in special places given in clause 16.1.4. +// The following operations shall not be used: +// a) All component operations, i.e. create, start (component), stop (component), kill, running (component), +// alive, done and killed (see notes 1, 3, 4 and 6). + +module NegSem_1500_general_006 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_ptcBehaviour() runs on GeneralComp { + log("PTC running"); + } + + function f_test(GeneralComp p_ptc) return template integer { + p_ptc.start(f_ptcBehaviour()); + return ?; + } + + testcase TC_NegSem_1500_general_006() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + template @fuzzy @deterministic integer mw_test := f_test(v_ptc); + log(mw_test); // causes evaluation + setverdict(pass); + } + + control { + execute(TC_NegSem_1500_general_006()); + } +} diff --git a/core_language/15_templates/1500_general/NegSem_1500_general_007.ttcn b/core_language/15_templates/1500_general/NegSem_1500_general_007.ttcn new file mode 100644 index 0000000..6a8e4d3 --- /dev/null +++ b/core_language/15_templates/1500_general/NegSem_1500_general_007.ttcn @@ -0,0 +1,46 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:15.0, verify that the component.stop operation cannot be used in a function called during evaluation of a deterministic fuzzy template + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// For a fuzzy template that is declared deterministic the template body shall fulfill the restrictions imposed +// on content of functions used in special places given in clause 16.1.4. +// The following operations shall not be used: +// a) All component operations, i.e. create, start (component), stop (component), kill, running (component), +// alive, done and killed (see notes 1, 3, 4 and 6). + +module NegSem_1500_general_007 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_ptcBehaviour() runs on GeneralComp { + timer t_tmr := 10.0; + t_tmr.start; + t_tmr.timeout; + } + + function f_test(GeneralComp p_ptc) return template integer { + p_ptc.stop; + return ?; + } + + testcase TC_NegSem_1500_general_007() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + template @fuzzy @deterministic integer mw_test := f_test(v_ptc); + v_ptc.start(f_ptcBehaviour()); + log(mw_test); // causes evaluation + setverdict(pass); + } + + control { + execute(TC_NegSem_1500_general_007()); + } +} diff --git a/core_language/15_templates/1500_general/NegSem_1500_general_008.ttcn b/core_language/15_templates/1500_general/NegSem_1500_general_008.ttcn new file mode 100644 index 0000000..51b49e3 --- /dev/null +++ b/core_language/15_templates/1500_general/NegSem_1500_general_008.ttcn @@ -0,0 +1,46 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:15.0, verify that the kill operation cannot be used in a function called during evaluation of a deterministic fuzzy template + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// For a fuzzy template that is declared deterministic the template body shall fulfill the restrictions imposed +// on content of functions used in special places given in clause 16.1.4. +// The following operations shall not be used: +// a) All component operations, i.e. create, start (component), stop (component), kill, running (component), +// alive, done and killed (see notes 1, 3, 4 and 6). + +module NegSem_1500_general_008 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_ptcBehaviour() runs on GeneralComp { + timer t_tmr := 10.0; + t_tmr.start; + t_tmr.timeout; + } + + function f_test(GeneralComp p_ptc) return template integer { + p_ptc.kill; + return ?; + } + + testcase TC_NegSem_1500_general_008() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + template @fuzzy @deterministic integer mw_test := f_test(v_ptc); + v_ptc.start(f_ptcBehaviour()); + log(mw_test); // causes evaluation + setverdict(pass); + } + + control { + execute(TC_NegSem_1500_general_008()); + } +} diff --git a/core_language/15_templates/1500_general/NegSem_1500_general_009.ttcn b/core_language/15_templates/1500_general/NegSem_1500_general_009.ttcn new file mode 100644 index 0000000..978a461 --- /dev/null +++ b/core_language/15_templates/1500_general/NegSem_1500_general_009.ttcn @@ -0,0 +1,46 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:15.0, verify that the component.running operation cannot be used in a function called during evaluation of a deterministic fuzzy template + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// For a fuzzy template that is declared deterministic the template body shall fulfill the restrictions imposed +// on content of functions used in special places given in clause 16.1.4. +// The following operations shall not be used: +// a) All component operations, i.e. create, start (component), stop (component), kill, running (component), +// alive, done and killed (see notes 1, 3, 4 and 6). + +module NegSem_1500_general_009 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_ptcBehaviour() runs on GeneralComp { + timer t_tmr := 10.0; + t_tmr.start; + t_tmr.timeout; + } + + function f_test(GeneralComp p_ptc) return template integer { + if (p_ptc.running) { return ?; } + else { return 1; } + } + + testcase TC_NegSem_1500_general_009() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + template @fuzzy @deterministic integer mw_test := f_test(v_ptc); + v_ptc.start(f_ptcBehaviour()); + log(mw_test); // causes evaluation + setverdict(pass); + } + + control { + execute(TC_NegSem_1500_general_009()); + } +} diff --git a/core_language/15_templates/1500_general/NegSem_1500_general_010.ttcn b/core_language/15_templates/1500_general/NegSem_1500_general_010.ttcn new file mode 100644 index 0000000..aa08e0e --- /dev/null +++ b/core_language/15_templates/1500_general/NegSem_1500_general_010.ttcn @@ -0,0 +1,46 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:15.0, verify that the alive operation cannot be used in a function called during evaluation of a deterministic fuzzy template + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// For a fuzzy template that is declared deterministic the template body shall fulfill the restrictions imposed +// on content of functions used in special places given in clause 16.1.4. +// The following operations shall not be used: +// a) All component operations, i.e. create, start (component), stop (component), kill, running (component), +// alive, done and killed (see notes 1, 3, 4 and 6). + +module NegSem_1500_general_010 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_ptcBehaviour() runs on GeneralComp { + timer t_tmr := 10.0; + t_tmr.start; + t_tmr.timeout; + } + + function f_test(GeneralComp p_ptc) return template integer { + if (p_ptc.alive) { return ?; } + else { return 1; } + } + + testcase TC_NegSem_1500_general_010() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + template @fuzzy @deterministic integer mw_test := f_test(v_ptc); + v_ptc.start(f_ptcBehaviour()); + log(mw_test); // causes evaluation + setverdict(pass); + } + + control { + execute(TC_NegSem_1500_general_010()); + } +} diff --git a/core_language/15_templates/1500_general/NegSem_1500_general_011.ttcn b/core_language/15_templates/1500_general/NegSem_1500_general_011.ttcn new file mode 100644 index 0000000..f072e8f --- /dev/null +++ b/core_language/15_templates/1500_general/NegSem_1500_general_011.ttcn @@ -0,0 +1,43 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:15.0, verify that the done operation cannot be used in a function called during evaluation of a deterministic fuzzy template + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// For a fuzzy template that is declared deterministic the template body shall fulfill the restrictions imposed +// on content of functions used in special places given in clause 16.1.4. +// The following operations shall not be used: +// a) All component operations, i.e. create, start (component), stop (component), kill, running (component), +// alive, done and killed (see notes 1, 3, 4 and 6). + +module NegSem_1500_general_011 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_ptcBehaviour() runs on GeneralComp { + } + + function f_test(GeneralComp p_ptc) return template integer { + p_ptc.done; + return ?; + } + + testcase TC_NegSem_1500_general_011() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + template @fuzzy @deterministic integer mw_test := f_test(v_ptc); + v_ptc.start(f_ptcBehaviour()); + log(mw_test); // causes evaluation + setverdict(pass); + } + + control { + execute(TC_NegSem_1500_general_011()); + } +} diff --git a/core_language/15_templates/1500_general/NegSem_1500_general_012.ttcn b/core_language/15_templates/1500_general/NegSem_1500_general_012.ttcn new file mode 100644 index 0000000..0e9a13b --- /dev/null +++ b/core_language/15_templates/1500_general/NegSem_1500_general_012.ttcn @@ -0,0 +1,43 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:15.0, verify that the killed operation cannot be used in a function called during evaluation of a deterministic fuzzy template + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// For a fuzzy template that is declared deterministic the template body shall fulfill the restrictions imposed +// on content of functions used in special places given in clause 16.1.4. +// The following operations shall not be used: +// a) All component operations, i.e. create, start (component), stop (component), kill, running (component), +// alive, done and killed (see notes 1, 3, 4 and 6). + +module NegSem_1500_general_012 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_ptcBehaviour() runs on GeneralComp { + } + + function f_test(GeneralComp p_ptc) return template integer { + p_ptc.killed; + return ?; + } + + testcase TC_NegSem_1500_general_012() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + template @fuzzy @deterministic integer mw_test := f_test(v_ptc); + v_ptc.start(f_ptcBehaviour()); + log(mw_test); // causes evaluation + setverdict(pass); + } + + control { + execute(TC_NegSem_1500_general_012()); + } +} diff --git a/core_language/15_templates/1500_general/NegSem_1500_general_013.ttcn b/core_language/15_templates/1500_general/NegSem_1500_general_013.ttcn new file mode 100644 index 0000000..7ab8023 --- /dev/null +++ b/core_language/15_templates/1500_general/NegSem_1500_general_013.ttcn @@ -0,0 +1,38 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:15.0, verify that the port.start operation cannot be used in a function called during evaluation of a deterministic fuzzy template + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// For a fuzzy template that is declared deterministic the template body shall fulfill the restrictions imposed +// on content of functions used in special places given in clause 16.1.4. +// The following operations shall not be used: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_1500_general_013 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return template integer { + p.start; + return ?; + } + + testcase TC_NegSem_1500_general_013() runs on GeneralComp system GeneralComp { + template @fuzzy @deterministic integer mw_test := f_test(); + log(mw_test); // causes evaluation + setverdict(pass); + } + + control { + execute(TC_NegSem_1500_general_013()); + } +} diff --git a/core_language/15_templates/1500_general/NegSem_1500_general_014.ttcn b/core_language/15_templates/1500_general/NegSem_1500_general_014.ttcn new file mode 100644 index 0000000..9d2ab8d --- /dev/null +++ b/core_language/15_templates/1500_general/NegSem_1500_general_014.ttcn @@ -0,0 +1,38 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:15.0, verify that the port.stop operation cannot be used in a function called during evaluation of a deterministic fuzzy template + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// For a fuzzy template that is declared deterministic the template body shall fulfill the restrictions imposed +// on content of functions used in special places given in clause 16.1.4. +// The following operations shall not be used: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_1500_general_013 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return template integer { + p.stop; + return ?; + } + + testcase TC_NegSem_1500_general_013() runs on GeneralComp system GeneralComp { + template @fuzzy @deterministic integer mw_test := f_test(); + log(mw_test); // causes evaluation + setverdict(pass); + } + + control { + execute(TC_NegSem_1500_general_013()); + } +} diff --git a/core_language/15_templates/1500_general/NegSem_1500_general_015.ttcn b/core_language/15_templates/1500_general/NegSem_1500_general_015.ttcn new file mode 100644 index 0000000..18fb1fa --- /dev/null +++ b/core_language/15_templates/1500_general/NegSem_1500_general_015.ttcn @@ -0,0 +1,38 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:15.0, verify that the halt operation cannot be used in a function called during evaluation of a deterministic fuzzy template + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// For a fuzzy template that is declared deterministic the template body shall fulfill the restrictions imposed +// on content of functions used in special places given in clause 16.1.4. +// The following operations shall not be used: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_1500_general_015 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return template integer { + p.halt; + return ?; + } + + testcase TC_NegSem_1500_general_015() runs on GeneralComp system GeneralComp { + template @fuzzy @deterministic integer mw_test := f_test(); + log(mw_test); // causes evaluation + setverdict(pass); + } + + control { + execute(TC_NegSem_1500_general_015()); + } +} diff --git a/core_language/15_templates/1500_general/NegSem_1500_general_016.ttcn b/core_language/15_templates/1500_general/NegSem_1500_general_016.ttcn new file mode 100644 index 0000000..362a8c8 --- /dev/null +++ b/core_language/15_templates/1500_general/NegSem_1500_general_016.ttcn @@ -0,0 +1,38 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:15.0, verify that the clear operation cannot be used in a function called during evaluation of a deterministic fuzzy template + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// For a fuzzy template that is declared deterministic the template body shall fulfill the restrictions imposed +// on content of functions used in special places given in clause 16.1.4. +// The following operations shall not be used: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_1500_general_016 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return template integer { + p.clear; + return ?; + } + + testcase TC_NegSem_1500_general_016() runs on GeneralComp system GeneralComp { + template @fuzzy @deterministic integer mw_test := f_test(); + log(mw_test); // causes evaluation + setverdict(pass); + } + + control { + execute(TC_NegSem_1500_general_016()); + } +} diff --git a/core_language/15_templates/1500_general/NegSem_1500_general_017.ttcn b/core_language/15_templates/1500_general/NegSem_1500_general_017.ttcn new file mode 100644 index 0000000..0696cbb --- /dev/null +++ b/core_language/15_templates/1500_general/NegSem_1500_general_017.ttcn @@ -0,0 +1,38 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:15.0, verify that the checkstate operation cannot be used in a function called during evaluation of a deterministic fuzzy template + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// For a fuzzy template that is declared deterministic the template body shall fulfill the restrictions imposed +// on content of functions used in special places given in clause 16.1.4. +// The following operations shall not be used: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_1500_general_017 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return template integer { + if (p.checkstate("Started")) { return ?; } + else { return 1; } + } + + testcase TC_NegSem_1500_general_017() runs on GeneralComp system GeneralComp { + template @fuzzy @deterministic integer mw_test := f_test(); + log(mw_test); // causes evaluation + setverdict(pass); + } + + control { + execute(TC_NegSem_1500_general_017()); + } +} diff --git a/core_language/15_templates/1500_general/NegSem_1500_general_018.ttcn b/core_language/15_templates/1500_general/NegSem_1500_general_018.ttcn new file mode 100644 index 0000000..36b5fc1 --- /dev/null +++ b/core_language/15_templates/1500_general/NegSem_1500_general_018.ttcn @@ -0,0 +1,39 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:15.0, verify that the send operation cannot be used in a function called during evaluation of a deterministic fuzzy template + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// For a fuzzy template that is declared deterministic the template body shall fulfill the restrictions imposed +// on content of functions used in special places given in clause 16.1.4. +// The following operations shall not be used: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_1500_general_018 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return template integer { + p.send(2); + return ?; + } + + testcase TC_NegSem_1500_general_018() runs on GeneralComp system GeneralComp { + template @fuzzy @deterministic integer mw_test := f_test(); + connect(mtc:p, mtc:p); + log(mw_test); // causes evaluation + setverdict(pass); + } + + control { + execute(TC_NegSem_1500_general_018()); + } +} diff --git a/core_language/15_templates/1500_general/NegSem_1500_general_019.ttcn b/core_language/15_templates/1500_general/NegSem_1500_general_019.ttcn new file mode 100644 index 0000000..0a70c31 --- /dev/null +++ b/core_language/15_templates/1500_general/NegSem_1500_general_019.ttcn @@ -0,0 +1,40 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:15.0, verify that the receive operation cannot be used in a function called during evaluation of a deterministic fuzzy template + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// For a fuzzy template that is declared deterministic the template body shall fulfill the restrictions imposed +// on content of functions used in special places given in clause 16.1.4. +// The following operations shall not be used: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_1500_general_019 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return template integer { + p.receive(integer:?); + return ?; + } + + testcase TC_NegSem_1500_general_019() runs on GeneralComp system GeneralComp { + template @fuzzy @deterministic integer mw_test := f_test(); + connect(mtc:p, mtc:p); + p.send(1); + log(mw_test); // causes evaluation + setverdict(pass); + } + + control { + execute(TC_NegSem_1500_general_019()); + } +} diff --git a/core_language/15_templates/1500_general/NegSem_1500_general_020.ttcn b/core_language/15_templates/1500_general/NegSem_1500_general_020.ttcn new file mode 100644 index 0000000..9e2ff7c --- /dev/null +++ b/core_language/15_templates/1500_general/NegSem_1500_general_020.ttcn @@ -0,0 +1,40 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:15.0, verify that the trigger operation cannot be used in a function called during evaluation of a deterministic fuzzy template + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// For a fuzzy template that is declared deterministic the template body shall fulfill the restrictions imposed +// on content of functions used in special places given in clause 16.1.4. +// The following operations shall not be used: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_1500_general_020 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return template integer { + p.trigger(integer:?); + return ?; + } + + testcase TC_NegSem_1500_general_020() runs on GeneralComp system GeneralComp { + template @fuzzy @deterministic integer mw_test := f_test(); + connect(mtc:p, mtc:p); + p.send(1); + log(mw_test); // causes evaluation + setverdict(pass); + } + + control { + execute(TC_NegSem_1500_general_020()); + } +} diff --git a/core_language/15_templates/1500_general/NegSem_1500_general_021.ttcn b/core_language/15_templates/1500_general/NegSem_1500_general_021.ttcn new file mode 100644 index 0000000..c53b252 --- /dev/null +++ b/core_language/15_templates/1500_general/NegSem_1500_general_021.ttcn @@ -0,0 +1,48 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:15.0, verify that the call operation cannot be used in a function called during evaluation of a deterministic fuzzy template + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// For a fuzzy template that is declared deterministic the template body shall fulfill the restrictions imposed +// on content of functions used in special places given in clause 16.1.4. +// The following operations shall not be used: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_1500_general_021 { + type port P message { + inout integer; + } + + signature S(); + + type port PSig procedure { + inout S; + } + + type component GeneralComp { + port P p; + port PSig psig; + } + + function f_test() runs on GeneralComp return template integer { + psig.call(S:{}, nowait); + return ?; + } + + testcase TC_NegSem_1500_general_021() runs on GeneralComp system GeneralComp { + template @fuzzy @deterministic integer mw_test := f_test(); + var GeneralComp v_ptc := GeneralComp.create; + connect(mtc:p, mtc:p); + connect(mtc:psig, v_ptc:psig); + log(mw_test); // causes evaluation + setverdict(pass); + } + + control { + execute(TC_NegSem_1500_general_021()); + } +} diff --git a/core_language/15_templates/1500_general/NegSem_1500_general_022.ttcn b/core_language/15_templates/1500_general/NegSem_1500_general_022.ttcn new file mode 100644 index 0000000..3c363de --- /dev/null +++ b/core_language/15_templates/1500_general/NegSem_1500_general_022.ttcn @@ -0,0 +1,53 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:15.0, verify that the getcall operation cannot be used in a function called during evaluation of a deterministic fuzzy template + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// For a fuzzy template that is declared deterministic the template body shall fulfill the restrictions imposed +// on content of functions used in special places given in clause 16.1.4. +// The following operations shall not be used: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_1500_general_022 { + type port P message { + inout integer; + } + + signature S(); + + type port PSig procedure { + inout S; + } + + type component GeneralComp { + port P p; + port PSig psig; + } + + function f_ptcBehaviour() runs on GeneralComp { + psig.call(S:{}, nowait); + } + + function f_test() runs on GeneralComp return template integer { + psig.getcall(S:?); + return ?; + } + + testcase TC_NegSem_1500_general_022() runs on GeneralComp system GeneralComp { + template @fuzzy @deterministic integer mw_test := f_test(); + var GeneralComp v_ptc := GeneralComp.create; + connect(mtc:p, mtc:p); + connect(mtc:psig, v_ptc:psig); + v_ptc.start(f_ptcBehaviour()); + log(mw_test); // causes evaluation + setverdict(pass); + } + + control { + execute(TC_NegSem_1500_general_022()); + } +} diff --git a/core_language/15_templates/1500_general/NegSem_1500_general_023.ttcn b/core_language/15_templates/1500_general/NegSem_1500_general_023.ttcn new file mode 100644 index 0000000..3003793 --- /dev/null +++ b/core_language/15_templates/1500_general/NegSem_1500_general_023.ttcn @@ -0,0 +1,54 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:15.0, verify that the reply operation cannot be used in a function called during evaluation of a deterministic fuzzy template + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// For a fuzzy template that is declared deterministic the template body shall fulfill the restrictions imposed +// on content of functions used in special places given in clause 16.1.4. +// The following operations shall not be used: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_1500_general_023 { + type port P message { + inout integer; + } + + signature S(); + + type port PSig procedure { + inout S; + } + + type component GeneralComp { + port P p; + port PSig psig; + } + + function f_ptcBehaviour() runs on GeneralComp { + psig.call(S:{}, nowait); + } + + function f_test() runs on GeneralComp return template integer { + psig.reply(S:{}); + return ?; + } + + testcase TC_NegSem_1500_general_023() runs on GeneralComp system GeneralComp { + template @fuzzy @deterministic integer mw_test := f_test(); + var GeneralComp v_ptc := GeneralComp.create; + connect(mtc:p, mtc:p); + connect(mtc:psig, v_ptc:psig); + v_ptc.start(f_ptcBehaviour()); + psig.getcall(S:?); + log(mw_test); // causes evaluation + setverdict(pass); + } + + control { + execute(TC_NegSem_1500_general_023()); + } +} diff --git a/core_language/15_templates/1500_general/NegSem_1500_general_024.ttcn b/core_language/15_templates/1500_general/NegSem_1500_general_024.ttcn new file mode 100644 index 0000000..1cdf66b --- /dev/null +++ b/core_language/15_templates/1500_general/NegSem_1500_general_024.ttcn @@ -0,0 +1,55 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:15.0, verify that the getreply operation cannot be used in a function called during evaluation of a deterministic fuzzy template + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// For a fuzzy template that is declared deterministic the template body shall fulfill the restrictions imposed +// on content of functions used in special places given in clause 16.1.4. +// The following operations shall not be used: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_1500_general_024 { + type port P message { + inout integer; + } + + signature S(); + + type port PSig procedure { + inout S; + } + + type component GeneralComp { + port P p; + port PSig psig; + } + + function f_ptcBehaviour() runs on GeneralComp { + psig.getcall(S:?); + psig.reply(S:{}); + } + + function f_test() runs on GeneralComp return template integer { + psig.getreply(S:?); + return ?; + } + + testcase TC_NegSem_1500_general_024() runs on GeneralComp system GeneralComp { + template @fuzzy @deterministic integer mw_test := f_test(); + var GeneralComp v_ptc := GeneralComp.create; + connect(mtc:p, mtc:p); + connect(mtc:psig, v_ptc:psig); + v_ptc.start(f_ptcBehaviour()); + psig.call(S:{}, nowait); + log(mw_test); // causes evaluation + setverdict(pass); + } + + control { + execute(TC_NegSem_1500_general_024()); + } +} diff --git a/core_language/15_templates/1500_general/NegSem_1500_general_025.ttcn b/core_language/15_templates/1500_general/NegSem_1500_general_025.ttcn new file mode 100644 index 0000000..24cadb0 --- /dev/null +++ b/core_language/15_templates/1500_general/NegSem_1500_general_025.ttcn @@ -0,0 +1,53 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:15.0, verify that the raise operation cannot be used in a function called during evaluation of a deterministic fuzzy template + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// For a fuzzy template that is declared deterministic the template body shall fulfill the restrictions imposed +// on content of functions used in special places given in clause 16.1.4. +// The following operations shall not be used: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_1500_general_025 { + type port P message { + inout integer; + } + + signature S() exception (charstring); + + type port PSig procedure { + inout S; + } + + type component GeneralComp { + port P p; + port PSig psig; + } + + function f_ptcBehaviour() runs on GeneralComp { + psig.call(S:{}, nowait); + } + + function f_test() runs on GeneralComp return template integer { + psig.raise(S, "UserException"); + return ?; + } + + testcase TC_NegSem_1500_general_025() runs on GeneralComp system GeneralComp { + template @fuzzy @deterministic integer mw_test := f_test(); + var GeneralComp v_ptc := GeneralComp.create; + connect(mtc:p, mtc:p); + connect(mtc:psig, v_ptc:psig); + v_ptc.start(f_ptcBehaviour()); + log(mw_test); // causes evaluation + setverdict(pass); + } + + control { + execute(TC_NegSem_1500_general_025()); + } +} diff --git a/core_language/15_templates/1500_general/NegSem_1500_general_026.ttcn b/core_language/15_templates/1500_general/NegSem_1500_general_026.ttcn new file mode 100644 index 0000000..3323632 --- /dev/null +++ b/core_language/15_templates/1500_general/NegSem_1500_general_026.ttcn @@ -0,0 +1,55 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:15.0, verify that the catch operation cannot be used in a function called during evaluation of a deterministic fuzzy template + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// For a fuzzy template that is declared deterministic the template body shall fulfill the restrictions imposed +// on content of functions used in special places given in clause 16.1.4. +// The following operations shall not be used: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_1500_general_026 { + type port P message { + inout integer; + } + + signature S() exception (charstring); + + type port PSig procedure { + inout S; + } + + type component GeneralComp { + port P p; + port PSig psig; + } + + function f_ptcBehaviour() runs on GeneralComp { + psig.getcall(S:?); + psig.raise(S, "UserException"); + } + + function f_test() runs on GeneralComp return template integer { + psig.catch(S, charstring:?); + return ?; + } + + testcase TC_NegSem_1500_general_026() runs on GeneralComp system GeneralComp { + template @fuzzy @deterministic integer mw_test := f_test(); + var GeneralComp v_ptc := GeneralComp.create; + connect(mtc:p, mtc:p); + connect(mtc:psig, v_ptc:psig); + v_ptc.start(f_ptcBehaviour()); + psig.call(S:{}, nowait); + log(mw_test); // causes evaluation + setverdict(pass); + } + + control { + execute(TC_NegSem_1500_general_026()); + } +} diff --git a/core_language/15_templates/1500_general/NegSem_1500_general_027.ttcn b/core_language/15_templates/1500_general/NegSem_1500_general_027.ttcn new file mode 100644 index 0000000..5994b1c --- /dev/null +++ b/core_language/15_templates/1500_general/NegSem_1500_general_027.ttcn @@ -0,0 +1,40 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:15.0, verify that the check operation cannot be used in a function called during evaluation of a deterministic fuzzy template + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// For a fuzzy template that is declared deterministic the template body shall fulfill the restrictions imposed +// on content of functions used in special places given in clause 16.1.4. +// The following operations shall not be used: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_1500_general_027 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return template integer { + p.check; + return ?; + } + + testcase TC_NegSem_1500_general_027() runs on GeneralComp system GeneralComp { + template @fuzzy @deterministic integer mw_test := f_test(); + connect(mtc:p, mtc:p); + p.send(1); + log(mw_test); // causes evaluation + setverdict(pass); + } + + control { + execute(TC_NegSem_1500_general_027()); + } +} diff --git a/core_language/15_templates/1500_general/NegSem_1500_general_028.ttcn b/core_language/15_templates/1500_general/NegSem_1500_general_028.ttcn new file mode 100644 index 0000000..a1c0971 --- /dev/null +++ b/core_language/15_templates/1500_general/NegSem_1500_general_028.ttcn @@ -0,0 +1,38 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:15.0, verify that the connect operation cannot be used in a function called during evaluation of a deterministic fuzzy template + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// For a fuzzy template that is declared deterministic the template body shall fulfill the restrictions imposed +// on content of functions used in special places given in clause 16.1.4. +// The following operations shall not be used: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_1500_general_028 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return template integer { + connect(mtc:p, mtc:p); + return ?; + } + + testcase TC_NegSem_1500_general_028() runs on GeneralComp system GeneralComp { + template @fuzzy @deterministic integer mw_test := f_test(); + log(mw_test); // causes evaluation + setverdict(pass); + } + + control { + execute(TC_NegSem_1500_general_028()); + } +} diff --git a/core_language/15_templates/1500_general/NegSem_1500_general_029.ttcn b/core_language/15_templates/1500_general/NegSem_1500_general_029.ttcn new file mode 100644 index 0000000..39765d5 --- /dev/null +++ b/core_language/15_templates/1500_general/NegSem_1500_general_029.ttcn @@ -0,0 +1,38 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:15.0, verify that the disconnect operation cannot be used in a function called during evaluation of a deterministic fuzzy template + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// For a fuzzy template that is declared deterministic the template body shall fulfill the restrictions imposed +// on content of functions used in special places given in clause 16.1.4. +// The following operations shall not be used: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_1500_general_029 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return template integer { + disconnect(mtc:p, mtc:p); + return ?; + } + + testcase TC_NegSem_1500_general_029() runs on GeneralComp system GeneralComp { + template @fuzzy @deterministic integer mw_test := f_test(); + log(mw_test); // causes evaluation + setverdict(pass); + } + + control { + execute(TC_NegSem_1500_general_029()); + } +} diff --git a/core_language/15_templates/1500_general/NegSem_1500_general_030.ttcn b/core_language/15_templates/1500_general/NegSem_1500_general_030.ttcn new file mode 100644 index 0000000..de2d3cb --- /dev/null +++ b/core_language/15_templates/1500_general/NegSem_1500_general_030.ttcn @@ -0,0 +1,38 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:15.0, verify that the map operation cannot be used in a function called during evaluation of a deterministic fuzzy template + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// For a fuzzy template that is declared deterministic the template body shall fulfill the restrictions imposed +// on content of functions used in special places given in clause 16.1.4. +// The following operations shall not be used: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_1500_general_030 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp system GeneralComp return template integer { + map(mtc:p, system:p); + return ?; + } + + testcase TC_NegSem_1500_general_030() runs on GeneralComp system GeneralComp { + template @fuzzy @deterministic integer mw_test := f_test(); + log(mw_test); // causes evaluation + setverdict(pass); + } + + control { + execute(TC_NegSem_1500_general_030()); + } +} diff --git a/core_language/15_templates/1500_general/NegSem_1500_general_031.ttcn b/core_language/15_templates/1500_general/NegSem_1500_general_031.ttcn new file mode 100644 index 0000000..e34e259 --- /dev/null +++ b/core_language/15_templates/1500_general/NegSem_1500_general_031.ttcn @@ -0,0 +1,40 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:15.0, verify that the unmap operation cannot be used in a function called during evaluation of a deterministic fuzzy template + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// For a fuzzy template that is declared deterministic the template body shall fulfill the restrictions imposed +// on content of functions used in special places given in clause 16.1.4. +// The following operations shall not be used: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_1500_general_031 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp system GeneralComp return template integer { + unmap(mtc:p, system:p); + return ?; + } + + testcase TC_NegSem_1500_general_031() runs on GeneralComp system GeneralComp { + template @fuzzy @deterministic integer mw_test := f_test(); + map(mtc:p, system:p); + log(mw_test); // causes evaluation + setverdict(pass); + + } + + control { + execute(TC_NegSem_1500_general_031()); + } +} diff --git a/core_language/15_templates/1500_general/NegSem_1500_general_032.ttcn b/core_language/15_templates/1500_general/NegSem_1500_general_032.ttcn new file mode 100644 index 0000000..07f98aa --- /dev/null +++ b/core_language/15_templates/1500_general/NegSem_1500_general_032.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:15.0, verify that the action operation cannot be used in a function called during evaluation of a deterministic fuzzy template + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// For a fuzzy template that is declared deterministic the template body shall fulfill the restrictions imposed +// on content of functions used in special places given in clause 16.1.4. +// The following operations shall not be used: +// c) The action operation (see notes 2 and 6). + +module NegSem_1500_general_032 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return template integer { + action("My action"); + return ?; + } + + testcase TC_NegSem_1500_general_032() runs on GeneralComp system GeneralComp { + template @fuzzy @deterministic integer mw_test := f_test(); + log(mw_test); // causes evaluation + setverdict(pass); + } + + control { + execute(TC_NegSem_1500_general_032()); + } +} diff --git a/core_language/15_templates/1500_general/NegSem_1500_general_033.ttcn b/core_language/15_templates/1500_general/NegSem_1500_general_033.ttcn new file mode 100644 index 0000000..be61d46 --- /dev/null +++ b/core_language/15_templates/1500_general/NegSem_1500_general_033.ttcn @@ -0,0 +1,38 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:15.0, verify that the timer.start operation cannot be used in a function called during evaluation of a deterministic fuzzy template + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// For a fuzzy template that is declared deterministic the template body shall fulfill the restrictions imposed +// on content of functions used in special places given in clause 16.1.4. +// The following operations shall not be used: +// d) All timer operations, i.e. start (timer), stop (timer), running (timer), read, timeout (see notes 4 and 6). + +module NegSem_1500_general_033 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + timer tc_tmr := 0.1; + } + + function f_test() runs on GeneralComp return template integer { + tc_tmr.start; + return ?; + } + + testcase TC_NegSem_1500_general_033() runs on GeneralComp system GeneralComp { + template @fuzzy @deterministic integer mw_test := f_test(); + log(mw_test); // causes evaluation + setverdict(pass); + } + + control { + execute(TC_NegSem_1500_general_033()); + } +} diff --git a/core_language/15_templates/1500_general/NegSem_1500_general_034.ttcn b/core_language/15_templates/1500_general/NegSem_1500_general_034.ttcn new file mode 100644 index 0000000..ee85e74 --- /dev/null +++ b/core_language/15_templates/1500_general/NegSem_1500_general_034.ttcn @@ -0,0 +1,40 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:15.0, verify that the timer.stop operation cannot be used in a function called during evaluation of a deterministic fuzzy template + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// For a fuzzy template that is declared deterministic the template body shall fulfill the restrictions imposed +// on content of functions used in special places given in clause 16.1.4. +// The following operations shall not be used: +// d) All timer operations, i.e. start (timer), stop (timer), running (timer), read, timeout (see notes 4 and 6). + +module NegSem_1500_general_034 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + timer tc_tmr := 0.1; + } + + function f_test() runs on GeneralComp return template integer { + tc_tmr.stop; + return ?; + } + + testcase TC_NegSem_1500_general_034() runs on GeneralComp system GeneralComp { + template @fuzzy @deterministic integer mw_test := f_test(); + connect(mtc:p, mtc:p); + tc_tmr.start; + log(mw_test); // causes evaluation + setverdict(pass); + } + + control { + execute(TC_NegSem_1500_general_034()); + } +} diff --git a/core_language/15_templates/1500_general/NegSem_1500_general_035.ttcn b/core_language/15_templates/1500_general/NegSem_1500_general_035.ttcn new file mode 100644 index 0000000..325024f --- /dev/null +++ b/core_language/15_templates/1500_general/NegSem_1500_general_035.ttcn @@ -0,0 +1,39 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:15.0, verify that the timer.running operation cannot be used in a function called during evaluation of a deterministic fuzzy template + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// For a fuzzy template that is declared deterministic the template body shall fulfill the restrictions imposed +// on content of functions used in special places given in clause 16.1.4. +// The following operations shall not be used: +// d) All timer operations, i.e. start (timer), stop (timer), running (timer), read, timeout (see notes 4 and 6). + +module NegSem_1500_general_035 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + timer tc_tmr := 0.1; + } + + function f_test() runs on GeneralComp return template integer { + if (tc_tmr.running) { return ?; } + else { return 1; } + } + + testcase TC_NegSem_1500_general_035() runs on GeneralComp system GeneralComp { + template @fuzzy @deterministic integer mw_test := f_test(); + tc_tmr.start; + log(mw_test); // causes evaluation + setverdict(pass); + } + + control { + execute(TC_NegSem_1500_general_035()); + } +} diff --git a/core_language/15_templates/1500_general/NegSem_1500_general_036.ttcn b/core_language/15_templates/1500_general/NegSem_1500_general_036.ttcn new file mode 100644 index 0000000..8621e33 --- /dev/null +++ b/core_language/15_templates/1500_general/NegSem_1500_general_036.ttcn @@ -0,0 +1,39 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:15.0, verify that the read operation cannot be used in a function called during evaluation of a deterministic fuzzy template + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// For a fuzzy template that is declared deterministic the template body shall fulfill the restrictions imposed +// on content of functions used in special places given in clause 16.1.4. +// The following operations shall not be used: +// d) All timer operations, i.e. start (timer), stop (timer), running (timer), read, timeout (see notes 4 and 6). + +module NegSem_1500_general_036 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + timer tc_tmr := 0.1; + } + + function f_test() runs on GeneralComp return template integer { + if (tc_tmr.read > 0.0) { return ?; } + else { return 1; } + } + + testcase TC_NegSem_1500_general_036() runs on GeneralComp system GeneralComp { + template @fuzzy @deterministic integer mw_test := f_test(); + tc_tmr.start; + log(mw_test); // causes evaluation + setverdict(pass); + } + + control { + execute(TC_NegSem_1500_general_036()); + } +} diff --git a/core_language/15_templates/1500_general/NegSem_1500_general_037.ttcn b/core_language/15_templates/1500_general/NegSem_1500_general_037.ttcn new file mode 100644 index 0000000..6066f3f --- /dev/null +++ b/core_language/15_templates/1500_general/NegSem_1500_general_037.ttcn @@ -0,0 +1,39 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:15.0, verify that the timeout operation cannot be used in a function called during evaluation of a deterministic fuzzy template + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// For a fuzzy template that is declared deterministic the template body shall fulfill the restrictions imposed +// on content of functions used in special places given in clause 16.1.4. +// The following operations shall not be used: +// d) All timer operations, i.e. start (timer), stop (timer), running (timer), read, timeout (see notes 4 and 6). + +module NegSem_1500_general_037 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + timer tc_tmr := 0.1; + } + + function f_test() runs on GeneralComp return template integer { + any timer.timeout; + return ?; + } + + testcase TC_NegSem_1500_general_037() runs on GeneralComp system GeneralComp { + template @fuzzy @deterministic integer mw_test := f_test(); + tc_tmr.start; + log(mw_test); // causes evaluation + setverdict(pass); + } + + control { + execute(TC_NegSem_1500_general_037()); + } +} diff --git a/core_language/15_templates/1500_general/NegSem_1500_general_038.ttcn b/core_language/15_templates/1500_general/NegSem_1500_general_038.ttcn new file mode 100644 index 0000000..3a8ab54 --- /dev/null +++ b/core_language/15_templates/1500_general/NegSem_1500_general_038.ttcn @@ -0,0 +1,45 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:15.0, verify that a non-deterministic external function call cannot be used in a function called during evaluation of a deterministic fuzzy template + ** @verdict pass reject + ** @configuration external_functions + ***************************************************/ + +// The following requirement is tested: +// For a fuzzy template that is declared deterministic the template body shall fulfill the restrictions imposed +// on content of functions used in special places given in clause 16.1.4. +// The following operations shall not be used: +// e) Calling non-deterministic external functions, i.e. external functions where the resulting values for actual +// inout or out parameters or the return value may differ for different invocations with the same actual in and +// inout parameters (see notes 4 and 6). + +module NegSem_1500_general_038 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + /** + * @return always true + */ + external function xf_NegSem_1500_general_001() return boolean; + + function f_test() runs on GeneralComp return template integer { + if (xf_NegSem_1500_general_001()) { return ?; } + else { return 1; } + } + + testcase TC_NegSem_1500_general_038() runs on GeneralComp system GeneralComp { + template @fuzzy @deterministic integer mw_test := f_test(); + log(mw_test); // causes evaluation + setverdict(pass); + } + + control { + execute(TC_NegSem_1500_general_038()); + } +} diff --git a/core_language/15_templates/1500_general/NegSem_1500_general_039.ttcn b/core_language/15_templates/1500_general/NegSem_1500_general_039.ttcn new file mode 100644 index 0000000..ae3469d --- /dev/null +++ b/core_language/15_templates/1500_general/NegSem_1500_general_039.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:15.0, verify that the predefined rnd function cannot be used in a function called during evaluation of a deterministic fuzzy template + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// For a fuzzy template that is declared deterministic the template body shall fulfill the restrictions imposed +// on content of functions used in special places given in clause 16.1.4. +// The following operations shall not be used: +// f) Calling the rnd predefined function (see notes 4 and 6). + +module NegSem_1500_general_039 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return template integer { + if (rnd() > 0.5) { return ?; } + else { return 1; } + } + + testcase TC_NegSem_1500_general_039() runs on GeneralComp system GeneralComp { + template @fuzzy @deterministic integer mw_test := f_test(); + log(mw_test); // causes evaluation + setverdict(pass); + } + + control { + execute(TC_NegSem_1500_general_039()); + } +} diff --git a/core_language/15_templates/1500_general/NegSem_1500_general_040.ttcn b/core_language/15_templates/1500_general/NegSem_1500_general_040.ttcn new file mode 100644 index 0000000..5ba0d76 --- /dev/null +++ b/core_language/15_templates/1500_general/NegSem_1500_general_040.ttcn @@ -0,0 +1,39 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:15.0, verify a function called during evaluation of a deterministic fuzzy template cannot contain an assignment of a component variable + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// For a fuzzy template that is declared deterministic the template body shall fulfill the restrictions imposed +// on content of functions used in special places given in clause 16.1.4. +// The following operations shall not be used: +// g) Changing of component variables, i.e. using component variables on the left-hand side of assignments, +// and in the instantiation of out and inout parameters (see notes 4 and 6). + +module NegSem_1500_general_040 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + var integer vc_int; + } + + function f_test() runs on GeneralComp return template integer { + vc_int := 1; + return ?; + } + + testcase TC_NegSem_1500_general_040() runs on GeneralComp system GeneralComp { + template @fuzzy @deterministic integer mw_test := f_test(); + log(mw_test); // causes evaluation + setverdict(pass); + } + + control { + execute(TC_NegSem_1500_general_040()); + } +} diff --git a/core_language/15_templates/1500_general/NegSem_1500_general_041.ttcn b/core_language/15_templates/1500_general/NegSem_1500_general_041.ttcn new file mode 100644 index 0000000..023544c --- /dev/null +++ b/core_language/15_templates/1500_general/NegSem_1500_general_041.ttcn @@ -0,0 +1,43 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:15.0, verify a function called during evaluation of a deterministic fuzzy template cannot contain a component variable used as an actual out parameter + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// For a fuzzy template that is declared deterministic the template body shall fulfill the restrictions imposed +// on content of functions used in special places given in clause 16.1.4. +// The following operations shall not be used: +// g) Changing of component variables, i.e. using component variables on the left-hand side of assignments, +// and in the instantiation of out and inout parameters (see notes 4 and 6). + +module NegSem_1500_general_041 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + var integer vc_int; + } + + function f_out (out integer p_out) { + p_out := 1; + } + + function f_test() runs on GeneralComp return template integer { + f_out(vc_int); + return ?; + } + + testcase TC_NegSem_1500_general_041() runs on GeneralComp system GeneralComp { + template @fuzzy @deterministic integer mw_test := f_test(); + log(mw_test); // causes evaluation + setverdict(pass); + } + + control { + execute(TC_NegSem_1500_general_041()); + } +} diff --git a/core_language/15_templates/1500_general/NegSem_1500_general_042.ttcn b/core_language/15_templates/1500_general/NegSem_1500_general_042.ttcn new file mode 100644 index 0000000..18b20fe --- /dev/null +++ b/core_language/15_templates/1500_general/NegSem_1500_general_042.ttcn @@ -0,0 +1,43 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:15.0, verify a function called during evaluation of a deterministic fuzzy template cannot contain a component variable used as an actual inout parameter + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// For a fuzzy template that is declared deterministic the template body shall fulfill the restrictions imposed +// on content of functions used in special places given in clause 16.1.4. +// The following operations shall not be used: +// g) Changing of component variables, i.e. using component variables on the left-hand side of assignments, +// and in the instantiation of out and inout parameters (see notes 4 and 6). + +module NegSem_1500_general_042 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + var integer vc_int := 0; + } + + function f_inout (inout integer p_inout) { + p_inout := 1; + } + + function f_test() runs on GeneralComp return template integer { + f_inout(vc_int); + return ?; + } + + testcase TC_NegSem_1500_general_042() runs on GeneralComp system GeneralComp { + template @fuzzy @deterministic integer mw_test := f_test(); + log(mw_test); // causes evaluation + setverdict(pass); + } + + control { + execute(TC_NegSem_1500_general_042()); + } +} diff --git a/core_language/15_templates/1500_general/NegSem_1500_general_043.ttcn b/core_language/15_templates/1500_general/NegSem_1500_general_043.ttcn new file mode 100644 index 0000000..b8fafeb --- /dev/null +++ b/core_language/15_templates/1500_general/NegSem_1500_general_043.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:15.0, verify that the setverdict operation cannot be used in a function called during evaluation of a deterministic fuzzy template + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// For a fuzzy template that is declared deterministic the template body shall fulfill the restrictions imposed +// on content of functions used in special places given in clause 16.1.4. +// The following operations shall not be used: +// h) Calling the setverdict operation (see notes 4 and 6). + +module NegSem_1500_general_043 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return template integer { + setverdict(pass); + return ?; + } + + testcase TC_NegSem_1500_general_043() runs on GeneralComp system GeneralComp { + template @fuzzy @deterministic integer mw_test := f_test(); + log(mw_test); // causes evaluation + setverdict(pass); + } + + control { + execute(TC_NegSem_1500_general_043()); + } +} diff --git a/core_language/15_templates/1500_general/NegSem_1500_general_044.ttcn b/core_language/15_templates/1500_general/NegSem_1500_general_044.ttcn new file mode 100644 index 0000000..bf51925 --- /dev/null +++ b/core_language/15_templates/1500_general/NegSem_1500_general_044.ttcn @@ -0,0 +1,41 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:15.0, verify that the activate operation cannot be used in a function called during evaluation of a deterministic fuzzy template + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// For a fuzzy template that is declared deterministic the template body shall fulfill the restrictions imposed +// on content of functions used in special places given in clause 16.1.4. +// The following operations shall not be used: +// i) Activation and deactivation of defaults, i.e. the activate and deactivate statements (see notes 5 and 6). + +module NegSem_1500_general_044 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + altstep a_anyTimer() runs on GeneralComp { + [] any timer.timeout {} + } + + function f_test() runs on GeneralComp return template integer { + activate(a_anyTimer()); + return ?; + } + + testcase TC_NegSem_1500_general_044() runs on GeneralComp system GeneralComp { + template @fuzzy @deterministic integer mw_test := f_test(); + log(mw_test); // causes evaluation + setverdict(pass); + } + + control { + execute(TC_NegSem_1500_general_044()); + } +} diff --git a/core_language/15_templates/1500_general/NegSem_1500_general_045.ttcn b/core_language/15_templates/1500_general/NegSem_1500_general_045.ttcn new file mode 100644 index 0000000..7a23de3 --- /dev/null +++ b/core_language/15_templates/1500_general/NegSem_1500_general_045.ttcn @@ -0,0 +1,43 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:15.0, verify that the deactivate operation cannot be used in a function called during evaluation of a deterministic fuzzy template + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// For a fuzzy template that is declared deterministic the template body shall fulfill the restrictions imposed +// on content of functions used in special places given in clause 16.1.4. +// The following operations shall not be used: +// i) Activation and deactivation of defaults, i.e. the activate and deactivate statements (see notes 5 and 6). + +module NegSem_1500_general_045 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + altstep a_anyTimer() runs on GeneralComp { + [] any timer.timeout {} + } + + function f_test() runs on GeneralComp return template integer { + deactivate; + return ?; + } + + testcase TC_NegSem_1500_general_045() runs on GeneralComp system GeneralComp { + template @fuzzy @deterministic integer mw_test := f_test(); + activate(a_anyTimer()); + connect(mtc:p, mtc:p); + log(mw_test); // causes evaluation + setverdict(pass); + } + + control { + execute(TC_NegSem_1500_general_045()); + } +} diff --git a/core_language/15_templates/1500_general/NegSem_1500_general_046.ttcn b/core_language/15_templates/1500_general/NegSem_1500_general_046.ttcn new file mode 100644 index 0000000..b1726f4 --- /dev/null +++ b/core_language/15_templates/1500_general/NegSem_1500_general_046.ttcn @@ -0,0 +1,41 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:15.0, verify that a function called during evaluation of a deterministic fuzzy template cannot contain fuzzy parameters + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// For a fuzzy template that is declared deterministic the template body shall fulfill the restrictions imposed +// on content of functions used in special places given in clause 16.1.4. +// The following operations shall not be used: +// k) Calling functions and external functions with @fuzzy formal parameters and variables (see notes 4 and 9). + +module NegSem_1500_general_046 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test(@fuzzy integer p_par) return template integer { + return (0..p_par); + } + + function f_eval() return integer { + return 10; + } + + testcase TC_NegSem_1500_general_046() runs on GeneralComp system GeneralComp { + var @fuzzy integer v_int := f_eval(); + template @fuzzy @deterministic integer mw_test := f_test(v_int); + log(mw_test); + setverdict(pass); + } + + control { + execute(TC_NegSem_1500_general_046()); + } +} diff --git a/core_language/15_templates/1500_general/NegSem_1500_general_047.ttcn b/core_language/15_templates/1500_general/NegSem_1500_general_047.ttcn new file mode 100644 index 0000000..736a516 --- /dev/null +++ b/core_language/15_templates/1500_general/NegSem_1500_general_047.ttcn @@ -0,0 +1,38 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:15.0, verify that an external function called during evaluation of a deterministic fuzzy template cannot contain fuzzy parameters + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// For a fuzzy template that is declared deterministic the template body shall fulfill the restrictions imposed +// on content of functions used in special places given in clause 16.1.4. +// The following operations shall not be used: +// k) Calling functions and external functions with @fuzzy formal parameters and variables (see notes 4 and 9). + +module NegSem_1500_general_047 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + external function @deterministic f_test(@fuzzy integer p_par) return template integer; + + function f_eval() return integer { + return 10; + } + + testcase TC_NegSem_1500_general_047() runs on GeneralComp system GeneralComp { + template @fuzzy @deterministic integer mw_test := f_test(1); + log(mw_test); // causes evaluation + setverdict(pass); + } + + control { + execute(TC_NegSem_1500_general_047()); + } +} diff --git a/core_language/15_templates/1500_general/NegSem_1500_general_048.ttcn b/core_language/15_templates/1500_general/NegSem_1500_general_048.ttcn new file mode 100644 index 0000000..49eadcb --- /dev/null +++ b/core_language/15_templates/1500_general/NegSem_1500_general_048.ttcn @@ -0,0 +1,41 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:15.0, verify that a function called during evaluation of a deterministic fuzzy template cannot contain fuzzy variables + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// For a fuzzy template that is declared deterministic the template body shall fulfill the restrictions imposed +// on content of functions used in special places given in clause 16.1.4. +// The following operations shall not be used: +// k) Calling functions and external functions with @fuzzy formal parameters and variables (see notes 4 and 9). + +module NegSem_1500_general_048 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() return template integer { + var @fuzzy integer v_int := f_eval(); + return (0..v_int); + } + + function f_eval() return integer { + return 100; + } + + testcase TC_NegSem_1500_general_048() runs on GeneralComp system GeneralComp { + template @fuzzy @deterministic integer mw_test := f_test(); + log(mw_test); // causes evaluation + setverdict(pass); + } + + control { + execute(TC_NegSem_1500_general_048()); + } +} diff --git a/core_language/15_templates/1500_general/NegSem_1500_general_049.ttcn b/core_language/15_templates/1500_general/NegSem_1500_general_049.ttcn new file mode 100644 index 0000000..445873e --- /dev/null +++ b/core_language/15_templates/1500_general/NegSem_1500_general_049.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:15.0, verify that a function called during evaluation of a deterministic fuzzy template cannot contain the setencode operation + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// For a fuzzy template that is declared deterministic the template body shall fulfill the restrictions imposed +// on content of functions used in special places given in clause 16.1.4. +// The following operations shall not be used: +// l) The setencode operation (see note 8 and clause 27.9). + +module NegSem_1500_general_049 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return template integer { + p.setencode(integer, "Binary"); + return ?; + } + + testcase TC_NegSem_1500_general_049() runs on GeneralComp system GeneralComp { + template @fuzzy @deterministic integer mw_test := f_test(); + log(mw_test); // causes evaluation + setverdict(pass); + } + + control { + execute(TC_NegSem_1500_general_049()); + } +} diff --git a/core_language/15_templates/1500_general/NegSem_1500_general_050.ttcn b/core_language/15_templates/1500_general/NegSem_1500_general_050.ttcn new file mode 100644 index 0000000..0e4d55e --- /dev/null +++ b/core_language/15_templates/1500_general/NegSem_1500_general_050.ttcn @@ -0,0 +1,26 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:15.0, verify that lazy templates of the timer type are not allowed + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction a) +// Templates shall not be of default, port or timer type. + +module NegSem_1500_general_050 { + type component GeneralComp { + } + + template timer mw_test := ?; + + testcase TC_NegSem_1500_general_050() runs on GeneralComp system GeneralComp { + log(mw_test); + setverdict(pass); + } + + control { + execute(TC_NegSem_1500_general_050()); + } +} diff --git a/core_language/15_templates/1500_general/NegSem_1500_general_051.ttcn b/core_language/15_templates/1500_general/NegSem_1500_general_051.ttcn new file mode 100644 index 0000000..5367d6b --- /dev/null +++ b/core_language/15_templates/1500_general/NegSem_1500_general_051.ttcn @@ -0,0 +1,31 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:15.0, verify that lazy templates of types with timer fields are not allowed + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction b) +// Templates shall not be of a structured type that contains fields of default, port or timer type +// on any level of nesting. + +module NegSem_1500_general_051 { + type component GeneralComp { + } + + type record R { + timer tmr + } + + template R mw_test := ?; + + testcase TC_NegSem_1500_general_051() runs on GeneralComp system GeneralComp { + log(mw_test); + setverdict(pass); + } + + control { + execute(TC_NegSem_1500_general_051()); + } +} diff --git a/core_language/15_templates/1503_global_and_local_templates/NegSem_1503_GlobalAndLocalTemplates_007.ttcn b/core_language/15_templates/1503_global_and_local_templates/NegSem_1503_GlobalAndLocalTemplates_007.ttcn new file mode 100644 index 0000000..47aea5c --- /dev/null +++ b/core_language/15_templates/1503_global_and_local_templates/NegSem_1503_GlobalAndLocalTemplates_007.ttcn @@ -0,0 +1,94 @@ +/***************************************************************** + ** @author TTF 014 + ** @version 0.0.1 + ** @purpose 1:15.3, Ensure that signature templates with restriction e) are accepted. + ** @verdict pass reject + *****************************************************************/ +/* The following requirements are tested: + * After completing initialization, signature templates that do not contain the @abstract modifier + * and fulfil the following condition: + * All in and inout procedure parameters are completely initialized and + * all out procedure parameters are either unitialized or marked as not relevant using the NotUsedSymbol. + * + * Are safe to be used in call and getcall operations, but they shall not be used in reply and getreply operations. + */ +module NegSem_1503_GlobalAndLocalTemplates_007 { + signature p_NegSem_1503_GlobalAndLocalTemplates_007_SignatureTemplate(in integer p_in, + inout integer p_inout, + out integer p_out); + + + template p_NegSem_1503_GlobalAndLocalTemplates_007_SignatureTemplate s_notToUseInReplyTemplate := { + p_in := 1, + p_inout := 2, + p_out := - //NotUsedSymbol + } + + + type port remotePort procedure { + inout p_NegSem_1503_GlobalAndLocalTemplates_007_SignatureTemplate; + } + + type component GeneralComp { + port remotePort PCO; + } + + function f_ClientQuery() runs on GeneralComp { + + PCO.call(p_NegSem_1503_GlobalAndLocalTemplates_007_SignatureTemplate:s_notToUseInReplyTemplate, 5.0) { //safe to be used in call + [] PCO.getreply(p_NegSem_1503_GlobalAndLocalTemplates_007_SignatureTemplate:?) { + // any reply is accepted + setverdict(pass); + } + [] PCO.catch(timeout) { + setverdict(fail); + } + }; + } + + function f_ServerResponses() runs on GeneralComp { + + timer t_timeout := 30.0; + + t_timeout.start; + + alt { + [] PCO.getcall(p_NegSem_1503_GlobalAndLocalTemplates_007_SignatureTemplate:?) { + // Error: template shall not be used in reply + PCO.reply(p_NegSem_1503_GlobalAndLocalTemplates_007_SignatureTemplate:s_notToUseInReplyTemplate); + setverdict(fail); + } + [] t_timeout.timeout { + setverdict(fail); + } + } + } + + + testcase TC_NegSem_1503_GlobalAndLocalTemplates_007() + runs on GeneralComp system GeneralComp { + var GeneralComp server := GeneralComp.create("RemoteProcedure Service"); + var GeneralComp client := GeneralComp.create("RemoteProcedure Client"); + // map the PTCs to the system port + connect(server:PCO, client:PCO); + + server.start(f_ServerResponses()); + client.start(f_ClientQuery()); + + alt { + [] client.done { + server.stop; + } + } + + alt { + [] all component.done {} + } + + disconnect(server:PCO); + } + + control { + execute(TC_NegSem_1503_GlobalAndLocalTemplates_007()); + }; +} \ No newline at end of file diff --git a/core_language/15_templates/1503_global_and_local_templates/NegSem_1503_GlobalAndLocalTemplates_008.ttcn b/core_language/15_templates/1503_global_and_local_templates/NegSem_1503_GlobalAndLocalTemplates_008.ttcn new file mode 100644 index 0000000..a96cf73 --- /dev/null +++ b/core_language/15_templates/1503_global_and_local_templates/NegSem_1503_GlobalAndLocalTemplates_008.ttcn @@ -0,0 +1,92 @@ +/***************************************************************** + * @author TTF 014 + * @version 0.0.1 + * @purpose 1:15.3, Ensure that signature templates with restriction e) are accepted. + * @verdict pass reject + *****************************************************************/ +/* The following requirements are tested: + * After completing initialization, signature templates that do not contain the @abstract modifier + * and fulfil the following condition: + * All out and inout procedure parameters are completely initialized and + * all in procedure parameters are either unitialized or marked as not relevant using the NotUsedSymbol. + * + * Are safe to be used in replay and getreplay operations, but they shall not be used in call and getcall operations. + */ +module NegSem_1503_GlobalAndLocalTemplates_008 { + signature p_NegSem_1503_GlobalAndLocalTemplates_008_SignatureTemplate(in integer p_in, + inout integer p_inout, + out integer p_out); + + + template p_NegSem_1503_GlobalAndLocalTemplates_008_SignatureTemplate s_notToUseInCallTemplate := { + p_in := 1, //NotUsedSymbol? + p_inout := 2, + p_out := 3 + } + + + type port remotePort procedure { + inout p_NegSem_1503_GlobalAndLocalTemplates_008_SignatureTemplate; + } + + type component GeneralComp { + port remotePort PCO; + } + + function f_ClientQuery() runs on GeneralComp { + + PCO.call(p_NegSem_1503_GlobalAndLocalTemplates_008_SignatureTemplate:s_notToUseInCallTemplate, 5.0) { //Error: shall not be used in call + [] PCO.getreply(p_NegSem_1503_GlobalAndLocalTemplates_008_SignatureTemplate:?) { + // any reply is accepted + setverdict(pass); + } + [] PCO.catch(timeout) { + setverdict(fail); + } + }; + } + + function f_ServerResponses() runs on GeneralComp { + + timer t_timeout := 30.0; + + t_timeout.start; + + alt { + [] PCO.getcall(p_NegSem_1503_GlobalAndLocalTemplates_008_SignatureTemplate:s_notToUseInCallTemplate) { //Error: shall not be used in getcall + setverdict(fail); + } + [] t_timeout.timeout { + setverdict(fail); + } + } + } + + + testcase TC_NegSem_1503_GlobalAndLocalTemplates_008() + runs on GeneralComp system GeneralComp { + var GeneralComp server := GeneralComp.create("RemoteProcedure Service"); + var GeneralComp client := GeneralComp.create("RemoteProcedure Client"); + // map the PTCs to the system port + connect(server:PCO, client:PCO); + + server.start(f_ServerResponses()); + client.start(f_ClientQuery()); + + alt { + [] client.done { + server.stop; + } + } + + alt { + [] all component.done {} + } + + disconnect(server:PCO); + } + + control { + execute(TC_NegSem_1503_GlobalAndLocalTemplates_008()); + }; +} \ No newline at end of file diff --git a/core_language/15_templates/1503_global_and_local_templates/NegSyn_1503_GlobalAndLocalTemplates_005.ttcn b/core_language/15_templates/1503_global_and_local_templates/NegSyn_1503_GlobalAndLocalTemplates_005.ttcn new file mode 100644 index 0000000..cd8430f --- /dev/null +++ b/core_language/15_templates/1503_global_and_local_templates/NegSyn_1503_GlobalAndLocalTemplates_005.ttcn @@ -0,0 +1,39 @@ +/***************************************************************** + ** @author STF T003 + ** @version 0.0.1 + ** @purpose 1:15.3, Ensure that there's an error for re-assignment of a local parameterized template + ** @verdict pass reject, noexecution + *****************************************************************/ + +// The following requirement is tested: +// d) After completing initialization, global and local templates that do not contain the @abstract modifier shall be fully initialized. + +module NegSyn_1503_GlobalAndLocalTemplates_005 +{ + type component GeneralComp {} + + type record MyMessageType { + integer field1, + charstring field2, + boolean field3 + } + + testcase TC_NegSyn_1503_GlobalAndLocalTemplates_005() runs on GeneralComp { + + // non-abstract template + template MyMessageType m_myTemplate(integer p_myFormalParam):= { + field1 := p_myFormalParam, + field3 := true + // error: not fully initialized template (field2 is missing), but not an abstract + } + + if (valueof(m_myTemplate(2).field1) == 2) { + setverdict(pass); + } else { + setverdict(fail); + } + } +control{ + execute(TC_NegSyn_1503_GlobalAndLocalTemplates_005()); +} +} \ No newline at end of file diff --git a/core_language/15_templates/1503_global_and_local_templates/NegSyn_1503_GlobalAndLocalTemplates_006.ttcn b/core_language/15_templates/1503_global_and_local_templates/NegSyn_1503_GlobalAndLocalTemplates_006.ttcn new file mode 100644 index 0000000..04f3d5f --- /dev/null +++ b/core_language/15_templates/1503_global_and_local_templates/NegSyn_1503_GlobalAndLocalTemplates_006.ttcn @@ -0,0 +1,23 @@ +/***************************************************************** + ** @author TTF 014 + ** @version 0.0.1 + ** @purpose 1:15.3, Ensure that signature templates with restriction e) are accepted. + ** @verdict pass rejected + *****************************************************************/ +/* The following requirements are tested: + * After completing initialization, global and local signature templates that do not contain the @abstract modifier + * shall fulfil the following conditions: + * All in and inout procedure parameters OR all out and inout parameter are completely initialized + */ +module NegSyn_1503_GlobalAndLocalTemplates_006 { + signature p_NegSyn_1503_SignatureTemplate(in integer p_in, + inout integer p_inout, + out integer p_out) return integer; + + //Error: Either in or out procedure parameters need to be completely initialized + template p_NegSyn_1503_SignatureTemplate s_myTemplate := { + p_in := -, + p_inout := 2, + p_out := - + } +} \ No newline at end of file diff --git a/core_language/15_templates/1503_global_and_local_templates/Sem_1503_GlobalAndLocalTemplates_007.ttcn b/core_language/15_templates/1503_global_and_local_templates/Sem_1503_GlobalAndLocalTemplates_007.ttcn new file mode 100644 index 0000000..8c1a607 --- /dev/null +++ b/core_language/15_templates/1503_global_and_local_templates/Sem_1503_GlobalAndLocalTemplates_007.ttcn @@ -0,0 +1,46 @@ +/***************************************************************** + ** @author STF T003 + ** @version 0.0.1 + ** @purpose 1:15.3, Ensure that a send operation with actual parameters of a global parameterized template is accepted with the actual parameter being an inline template. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// The following requirement is tested: +// d) After completing initialization, global and local templates that do not contain the @abstract modifier shall be fully initialized. + +module Sem_1503_GlobalAndLocalTemplates_007 { + + type port MyMessagePortType message { + inout MyMessageType + } + + type component GeneralComp { + port MyMessagePortType pt_myPort; + } + + type record MyMessageType { + integer field1, + charstring field2, + boolean field3 + } + + type MyMessageType m_myTemplate; + + testcase TC_Sem_1503_GlobalAndLocalTemplates_007() runs on GeneralComp { + template @abstract m_myTemplate m_myAbstractTemplate :={ + field1 := 2 // field2 and field3 is missing, but @abstract modifier allows this + }; + + if(ispresent(m_myAbstractTemplate.field1) and not ispresent(m_myAbstractTemplate.field2) and not ispresent(m_myAbstractTemplate.field3)){ + setverdict(pass); + }else{ + setverdict(fail); + } + + } + + control{ + execute(TC_Sem_1503_GlobalAndLocalTemplates_007()); + } + + +} \ No newline at end of file diff --git a/core_language/15_templates/1503_global_and_local_templates/Sem_1503_GlobalAndLocalTemplates_010.ttcn b/core_language/15_templates/1503_global_and_local_templates/Sem_1503_GlobalAndLocalTemplates_010.ttcn new file mode 100644 index 0000000..2c342ea --- /dev/null +++ b/core_language/15_templates/1503_global_and_local_templates/Sem_1503_GlobalAndLocalTemplates_010.ttcn @@ -0,0 +1,108 @@ +/***************************************************************** + * @author TTF 014 + * @version 0.0.1 + * @purpose 1:15.3, Ensure that signature templates with restriction e) are accepted. + * @verdict pass reject + *****************************************************************/ +/* The following requirements are tested: + * Signature templates that do not contain the @abstract modifier and fulfil the following condition: + * All in and inout procedure parameters are completely initialized and + * all out procedure parameters are either unitialized or marked as not relevant using the NotUsedSymbol. + * + * are safe to be used in call and getcall operations, but they shall not be used in reply and getreply operations. + * + * AND + * + * Signature templates that do not contain the @abstract modifier and fulfil the following condition: + * All out and inout procedure parameters are completely initialized and + * all in procedure parameters are either unitialized or marked as not relevant using the NotUsedSymbol. + * + * are safe to be used in reply and getreply operations, but they shall not be used in call and getcall operations. + * + * + */ +module Sem_1503_GlobalAndLocalTemplates_010 { + signature p_Sem_1503_GlobalAndLocalTemplates_010_SignatureTemplate(in integer p_in, + inout integer p_inout, + out integer p_out); + + + template p_Sem_1503_GlobalAndLocalTemplates_010_SignatureTemplate toBeUsedInCallTemplate := { + p_in := 1, + p_inout := 2, + p_out := - + } + + template p_Sem_1503_GlobalAndLocalTemplates_010_SignatureTemplate toBeUsedInReplyTemplate := { + p_in := -, + p_inout := 2, + p_out := 3 + } + + + type port remotePort procedure { + inout p_Sem_1503_GlobalAndLocalTemplates_010_SignatureTemplate; + } + + type component GeneralComp { + port remotePort PCO; + } + + function f_ClientQuery() runs on GeneralComp { + + PCO.call(p_Sem_1503_GlobalAndLocalTemplates_010_SignatureTemplate:toBeUsedInCallTemplate, 5.0) { + [] PCO.getreply(p_Sem_1503_GlobalAndLocalTemplates_010_SignatureTemplate:toBeUsedInReplyTemplate) { + // reply is accepted + setverdict(pass); + } + [] PCO.catch(timeout) { + setverdict(fail); + } + }; + } + + function f_ServerResponses() runs on GeneralComp { + + timer t_timeout := 30.0; + + t_timeout.start; + + alt { + [] PCO.getcall(p_Sem_1503_GlobalAndLocalTemplates_010_SignatureTemplate:toBeUsedInCallTemplate) { + PCO.reply(p_Sem_1503_GlobalAndLocalTemplates_010_SignatureTemplate:toBeUsedInReplyTemplate); + setverdict(pass); + } + [] t_timeout.timeout { + setverdict(fail); + } + } + } + + + testcase TC_Sem_1503_GlobalAndLocalTemplates_010() + runs on GeneralComp system GeneralComp { + var GeneralComp server := GeneralComp.create("RemoteProcedure Service"); + var GeneralComp client := GeneralComp.create("RemoteProcedure Client"); + // map the PTCs to the system port + connect(server:PCO, client:PCO); + + server.start(f_ServerResponses()); + client.start(f_ClientQuery()); + + alt { + [] client.done { + server.stop; + } + } + + alt { + [] all component.done {} + } + + disconnect(server:PCO); + } + + control { + execute(TC_Sem_1503_GlobalAndLocalTemplates_010()); + }; +} \ No newline at end of file diff --git a/core_language/15_templates/1503_global_and_local_templates/Syn_1503_GlobalAndLocalTemplates_007.ttcn b/core_language/15_templates/1503_global_and_local_templates/Syn_1503_GlobalAndLocalTemplates_007.ttcn new file mode 100644 index 0000000..d968aef --- /dev/null +++ b/core_language/15_templates/1503_global_and_local_templates/Syn_1503_GlobalAndLocalTemplates_007.ttcn @@ -0,0 +1,34 @@ +/***************************************************************** + ** @author STF T003 + ** @version 0.0.1 + ** @purpose 1:15.3, Ensure that @abstract modifier works properly. + ** @verdict pass accept, noexecution + *****************************************************************/ +// Restriction d: +// After completing initialization, global and local templates that do not contain the @abstract modifier shall be fully initialized. + +module Syn_1503_GlobalAndLocalTemplates_007 { + + type port MyMessagePortType message { + inout MyMessageType + } + + type component GeneralComp { + port MyMessagePortType pt_myPort; + } + + type record MyMessageType { + integer field1, + charstring field2, + boolean field3 + } + + function f_testTemplate() { + template @abstract MyMessageType m_myTemplate(integer p_myFormalParam):= { + field1 := p_myFormalParam, + field2 := pattern "abc*xyz", + field3 := true + } // syntactically correct: fully initialized template with @abstract modifier + } + +} \ No newline at end of file diff --git a/core_language/15_templates/1503_global_and_local_templates/Syn_1503_GlobalAndLocalTemplates_008.ttcn b/core_language/15_templates/1503_global_and_local_templates/Syn_1503_GlobalAndLocalTemplates_008.ttcn new file mode 100644 index 0000000..ef11e6e --- /dev/null +++ b/core_language/15_templates/1503_global_and_local_templates/Syn_1503_GlobalAndLocalTemplates_008.ttcn @@ -0,0 +1,33 @@ +/***************************************************************** + ** @author STF T003 + ** @version 0.0.1 + ** @purpose 1:15.3, Ensure that @abstract modifier works properly. + ** @verdict pass accept, noexecution + *****************************************************************/ +// Restriction d: +// After completing initialization, global and local templates that do not contain the @abstract modifier shall be fully initialized. + +module Syn_1503_GlobalAndLocalTemplates_008 { + + type port MyMessagePortType message { + inout MyMessageType + } + + type component GeneralComp { + port MyMessagePortType pt_myPort; + } + + type record MyMessageType { + integer field1, + charstring field2, + boolean field3 + } + + function f_testTemplate() { + template @abstract MyMessageType m_myTemplate(integer p_myFormalParam):= { + field1 := p_myFormalParam, + field2 := pattern "abc*xyz" + } // not fully initialized template with @abstract modifier + } + +} \ No newline at end of file diff --git a/core_language/15_templates/1503_global_and_local_templates/Syn_1503_GlobalAndLocalTemplates_009.ttcn b/core_language/15_templates/1503_global_and_local_templates/Syn_1503_GlobalAndLocalTemplates_009.ttcn new file mode 100644 index 0000000..a506ba9 --- /dev/null +++ b/core_language/15_templates/1503_global_and_local_templates/Syn_1503_GlobalAndLocalTemplates_009.ttcn @@ -0,0 +1,24 @@ +/***************************************************************** + ** @author TTF 014 + ** @version 0.0.1 + ** @purpose 1:15.3, Ensure that signature templates with restriction e) are accepted. + ** @verdict pass accept, noexecution + *****************************************************************/ +/* The following requirements are tested: + * After completing initialization, global and local signature templates that do not contain the @abstract modifier + * shall fulfil the following conditions: + * + * All in and inout procedure parameters are completely initialized and + * all out procedure parameters are unitialized. + */ +module Syn_1503_GlobalAndLocalTemplates_009 { + signature p_Syn_1503_SignatureTemplate(in integer p_in, + inout integer p_inout, + out integer p_out) return integer; + + template p_Syn_1503_SignatureTemplate s_myTemplate := { + p_in := 1, + p_inout := 2 + // p_out := //unitialized + } +} \ No newline at end of file diff --git a/core_language/15_templates/1503_global_and_local_templates/Syn_1503_GlobalAndLocalTemplates_010.ttcn b/core_language/15_templates/1503_global_and_local_templates/Syn_1503_GlobalAndLocalTemplates_010.ttcn new file mode 100644 index 0000000..b9904a3 --- /dev/null +++ b/core_language/15_templates/1503_global_and_local_templates/Syn_1503_GlobalAndLocalTemplates_010.ttcn @@ -0,0 +1,23 @@ +/***************************************************************** + * @author TTF 014 + * @version 0.0.1 + * @purpose 1:15.3, Ensure that signature templates with restriction e) are accepted. + * @verdict pass accept, noexecution + *****************************************************************/ +/* The following requirements are tested: + * After completing initialization, global and local signature templates that do not contain the @abstract modifier + * shall fulfil the following conditions: + * All in and inout procedure parameters are completely initialized and + * all out procedure parameters are marked as not relevant using the NotUsedSymbol. + */ +module Syn_1503_GlobalAndLocalTemplates_010 { + signature p_Syn_1503_SignatureTemplate(in integer p_in, + inout integer p_inout, + out integer p_out) return integer; + + template p_Syn_1503_SignatureTemplate s_myTemplate := { + p_in := 1, + p_inout := 2, + p_out := - + } +} \ No newline at end of file diff --git a/core_language/15_templates/1503_global_and_local_templates/Syn_1503_GlobalAndLocalTemplates_011.ttcn b/core_language/15_templates/1503_global_and_local_templates/Syn_1503_GlobalAndLocalTemplates_011.ttcn new file mode 100644 index 0000000..95ed0a6 --- /dev/null +++ b/core_language/15_templates/1503_global_and_local_templates/Syn_1503_GlobalAndLocalTemplates_011.ttcn @@ -0,0 +1,23 @@ +/***************************************************************** + ** @author TTF 014 + ** @version 0.0.1 + ** @purpose 1:15.3, Ensure that signature templates with restriction e) are accepted. + ** @verdict pass accept, noexecution + *****************************************************************/ +/* The following requirements are tested: + * After completing initialization, global and local signature templates that do not contain the @abstract modifier + * shall fulfil the following conditions: + * All out and inout procedure parameters are completely initialized and + * all in procedure parameters are unitialized. + */ +module Syn_1503_GlobalAndLocalTemplates_011 { + signature p_Syn_1503_SignatureTemplate(in integer p_in, + inout integer p_inout, + out integer p_out) return integer; + + template p_Syn_1503_SignatureTemplate s_myTemplate := { + //p_in := 1, //unitialized + p_inout := 2, + p_out := 3 + } +} \ No newline at end of file diff --git a/core_language/15_templates/1503_global_and_local_templates/Syn_1503_GlobalAndLocalTemplates_012.ttcn b/core_language/15_templates/1503_global_and_local_templates/Syn_1503_GlobalAndLocalTemplates_012.ttcn new file mode 100644 index 0000000..3391b3a --- /dev/null +++ b/core_language/15_templates/1503_global_and_local_templates/Syn_1503_GlobalAndLocalTemplates_012.ttcn @@ -0,0 +1,23 @@ +/***************************************************************** + ** @author TTF 014 + ** @version 0.0.1 + ** @purpose 1:15.3, Ensure that signature templates with restriction e) are accepted. + ** @verdict pass accept, noexecution + *****************************************************************/ +/* The following requirements are tested: + * After completing initialization, global and local signature templates that do not contain the @abstract modifier + * shall fulfil the following conditions: + * All out and inout procedure parameters are completely initialized and + * all in procedure parameters are marked as not relevant using the NotUsedSymbol. + */ +module Syn_1503_GlobalAndLocalTemplates_012 { + signature p_Syn_1503_SignatureTemplate(in integer p_in, + inout integer p_inout, + out integer p_out) return integer; + + template p_Syn_1503_SignatureTemplate s_myTemplate := { + p_in := -, + p_inout := 2, + p_out := 3 + } +} \ No newline at end of file diff --git a/core_language/15_templates/1505_modified_templates/NegSem_1505_ModifiedTemplates_008.ttcn b/core_language/15_templates/1505_modified_templates/NegSem_1505_ModifiedTemplates_008.ttcn new file mode 100644 index 0000000..d74797b --- /dev/null +++ b/core_language/15_templates/1505_modified_templates/NegSem_1505_ModifiedTemplates_008.ttcn @@ -0,0 +1,44 @@ +/***************************************************************** + ** @author TTF T014 + ** @version 0.0.1 + ** @purpose 1:15.5, Ensure that modified templates with different restrictions are rejected. + ** @verdict pass rejected + *****************************************************************/ +// The following requirement is tested: +// b) Restrictions on referencing elements of templates or template fields are described in clause +// EXAMPLE 8 + +module NegSem_1505_ModifiedTemplates_008 { + + type component GeneralComp { + } + + type record MyRecordType { + integer field1, + charstring field2, + boolean field3 + } + + template MyRecordType m_myUnrestrictedRecTemplate := + { + field1 := 123, + field2 := "A string", + field3 := true + } + + testcase TC_NegSem_1505_ModifiedTemplates_008() runs on GeneralComp { + // ERROR the modified template has different restriction from the base template + template (value) MyRecordType m_myValueRecTemplate modifies m_myUnrestrictedRecTemplate := { + field2 := "A modified string" // field1, field3 is unchanged + } + + + setverdict(fail); + } + + control{ + execute(TC_NegSem_1505_ModifiedTemplates_008()); + } + + +} \ No newline at end of file diff --git a/core_language/15_templates/1505_modified_templates/NegSem_1505_ModifiedTemplates_009.ttcn b/core_language/15_templates/1505_modified_templates/NegSem_1505_ModifiedTemplates_009.ttcn new file mode 100644 index 0000000..93299d0 --- /dev/null +++ b/core_language/15_templates/1505_modified_templates/NegSem_1505_ModifiedTemplates_009.ttcn @@ -0,0 +1,44 @@ +/***************************************************************** + ** @author TTF T014 + ** @version 0.0.1 + ** @purpose 1:15.5, Ensure that modified templates with different restrictions are rejected. + ** @verdict pass rejected + *****************************************************************/ +// The following requirement is tested: +// b) Restrictions on referencing elements of templates or template fields are described in clause +// EXAMPLE 8 + + +module NegSem_1505_ModifiedTemplates_009 { + + type component GeneralComp { + } + + type record MyRecordType { + integer field1, + charstring field2, + boolean field3 + } + + template(value) MyRecordType m_myValueRecTemplate := + { + field1 := 123, + field2 := "A string", + field3 := true + } + + testcase TC_NegSem_1505_ModifiedTemplates_009() runs on GeneralComp { + template (value) MyRecordType m_myUnrestrictedRecTemplate modifies m_myValueRecTemplate := { + field2 := "A modified string" // field1, field3 is unchanged + } + // ERROR the modified template has different restriction from the base template + + setverdict(fail); + } + + control{ + execute(TC_NegSem_1505_ModifiedTemplates_009()); + } + + +} \ No newline at end of file diff --git a/core_language/15_templates/1505_modified_templates/Sem_1505_ModifiedTemplates_008.ttcn b/core_language/15_templates/1505_modified_templates/Sem_1505_ModifiedTemplates_008.ttcn index 98901ff..f88f55c 100644 --- a/core_language/15_templates/1505_modified_templates/Sem_1505_ModifiedTemplates_008.ttcn +++ b/core_language/15_templates/1505_modified_templates/Sem_1505_ModifiedTemplates_008.ttcn @@ -1,5 +1,5 @@ /***************************************************************** - ** @author STF 487 + ** @author STF 487 (updated by TTF T014) ** @version 0.0.1 ** @purpose 1:15.5, Ensure that the values of plain modified template definitions are as expected. ** @verdict pass accept, ttcn3verdict:pass @@ -24,7 +24,7 @@ type record MyMessageType { boolean field3 } -template MyMessageType m_templateOne := { +template @abstract MyMessageType m_templateOne := { field1 := 2, field2 := "Hello World", field3 := - diff --git a/core_language/15_templates/1505_modified_templates/Sem_1505_ModifiedTemplates_011.ttcn b/core_language/15_templates/1505_modified_templates/Sem_1505_ModifiedTemplates_011.ttcn new file mode 100644 index 0000000..90625eb --- /dev/null +++ b/core_language/15_templates/1505_modified_templates/Sem_1505_ModifiedTemplates_011.ttcn @@ -0,0 +1,35 @@ + /*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:15.5, verify that matching mechanisms can be modified + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// The modifies keyword denotes the parent template from which the new modified template shall be derived. +// This parent template may be either an original template or a modified template or also a matching mechanism. + +module Sem_1505_ModifiedTemplates_011 { + type component GeneralComp { + } + + type record R { + integer field1, + integer field2 + } + + template R mw_test modifies ? := { field1 := 5}; + + testcase TC_Sem_1505_ModifiedTemplates_011() runs on GeneralComp system GeneralComp { + log(mw_test); + if (istemplatekind(mw_test.field2, "?")) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_1505_ModifiedTemplates_011()); + } +} diff --git a/core_language/15_templates/1505_modified_templates/Sem_1505_ModifiedTemplates_012.ttcn b/core_language/15_templates/1505_modified_templates/Sem_1505_ModifiedTemplates_012.ttcn new file mode 100644 index 0000000..e5b24f6 --- /dev/null +++ b/core_language/15_templates/1505_modified_templates/Sem_1505_ModifiedTemplates_012.ttcn @@ -0,0 +1,43 @@ + /*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:15.5, verify that matching mechanisms can be modified in inline templates + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// The modifies keyword denotes the parent template from which the new modified template shall be derived. +// This parent template may be either an original template or a modified template or also a matching mechanism. + +module Sem_1505_ModifiedTemplates_012 { + type port P message { + inout R; + } + type component GeneralComp { + port P p; + } + + type record R { + integer field1, + integer field2 + } + + template R mw_test modifies ? := { field1 := 5}; + + testcase TC_Sem_1505_ModifiedTemplates_012() runs on GeneralComp system GeneralComp { + map(self:p, system:p); + p.send(R:{ field1 := 5, field2 := 10 }); + alt { + [] p.receive(R:modifies ? := { field1 := 5}) { + setverdict(pass); + } + [] p.receive { + setverdict(fail); + } + } + } + + control { + execute(TC_Sem_1505_ModifiedTemplates_012()); + } +} diff --git a/core_language/15_templates/1505_modified_templates/Sem_1505_ModifiedTemplates_013.ttcn b/core_language/15_templates/1505_modified_templates/Sem_1505_ModifiedTemplates_013.ttcn new file mode 100644 index 0000000..710e782 --- /dev/null +++ b/core_language/15_templates/1505_modified_templates/Sem_1505_ModifiedTemplates_013.ttcn @@ -0,0 +1,45 @@ + /*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:15.5, verify that matching mechanisms can be modified in inline templates + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// The modifies keyword denotes the parent template from which the new modified template shall be derived. +// This parent template may be either an original template or a modified template or also a matching mechanism. + +module Sem_1505_ModifiedTemplates_013 { + type component GeneralComp { + } + + type record MyRecordType { + integer field1 optional, + charstring field2, + boolean field3 + } + + template MyRecordType m_myTemplate1(integer p_myPar) := { + field1 := p_myPar, + field2 := "A string", + field3 := true + } + + testcase TC_Sem_1505_ModifiedTemplates_013() runs on GeneralComp system GeneralComp { + var template MyRecordType v_modification := { + field2 := "G string" // field1/field3 are uninitialized + } + var template MyRecordType v_myTemplate := modifies m_myTemplate1(5) := v_modification; + // no modification of field1/field3 + // results in { field1 := 5, field2 := "G string", field3 := true } + if (valueof(v_myTemplate) == { field1 := 5, field2 := "G string", field3 := true }) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_1505_ModifiedTemplates_013()); + } +} diff --git a/core_language/15_templates/1505_modified_templates/Sem_1505_ModifiedTemplates_014.ttcn b/core_language/15_templates/1505_modified_templates/Sem_1505_ModifiedTemplates_014.ttcn new file mode 100644 index 0000000..b10bf66 --- /dev/null +++ b/core_language/15_templates/1505_modified_templates/Sem_1505_ModifiedTemplates_014.ttcn @@ -0,0 +1,44 @@ + /*************************************************** + ** @author STF T003 + ** @version 0.0.1 + ** @purpose 1:15.5, verify that matching mechanisms can be modified in in-line templates + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Restriction e) After completing initialization, modified global and local templates that do not contain the @abstract modifier shall be fully initialized + +module Sem_1505_ModifiedTemplates_014 { + type component GeneralComp { + } + + type record MyRecordType { + integer field1 optional, + charstring field2, + boolean field3 + } + + // templates with @abstract modifier + template @abstract MyRecordType m_myTemplate1(integer p_myPar) := { + field1 := p_myPar + } + + testcase TC_Sem_1505_ModifiedTemplates_014() runs on GeneralComp system GeneralComp { + var template MyRecordType v_modification := { + field2 := "G string", + field3 := true + } + var template MyRecordType v_myTemplate := modifies m_myTemplate1(5) := v_modification; + // no modification of field1,field3 + // results in { field1 := 5, field2 := "G string", field3 := true } + if (valueof(v_myTemplate) == { field1 := 5, field2 := "G string", field3 := true }) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_1505_ModifiedTemplates_014()); + } +} diff --git a/core_language/15_templates/1505_modified_templates/Sem_1505_ModifiedTemplates_015.ttcn b/core_language/15_templates/1505_modified_templates/Sem_1505_ModifiedTemplates_015.ttcn new file mode 100644 index 0000000..0bdde8b --- /dev/null +++ b/core_language/15_templates/1505_modified_templates/Sem_1505_ModifiedTemplates_015.ttcn @@ -0,0 +1,51 @@ +/***************************************************************** + ** @author TTF T014 + ** @version 0.0.1 + ** @purpose 1:15.5, Ensure that modified templates with same restrictions are supported. + ** @verdict pass accept + *****************************************************************/ +// The following requirement is tested: +// b) Restrictions on referencing elements of templates or template fields are described in clause +//EXAMPLE 8 + +module Sem_1505_ModifiedTemplates_015 { + + type component GeneralComp { + } + + type record MyRecordType { + integer field1, + charstring field2, + boolean field3 + } + + template MyRecordType m_myUnrestrictedRecTemplate1 := + { + field1 := 123, + field2 := "A string", + field3 := true + } + + testcase TC_Sem_1505_ModifiedTemplates_015() runs on GeneralComp { + template MyRecordType m_myUnrestrictedRecTemplate2 modifies m_myUnrestrictedRecTemplate1 := { + field2 := "A modified string" // field1, field3 is unchanged + } + + if( + valueof(m_myUnrestrictedRecTemplate2.field1) == valueof(m_myUnrestrictedRecTemplate1.field1) and + valueof(m_myUnrestrictedRecTemplate2.field2) == "A modified string" and + valueof(m_myUnrestrictedRecTemplate2.field3) == valueof(m_myUnrestrictedRecTemplate1.field3) + ){ + setverdict(pass); + }else{ + setverdict(fail); + } + + } + + control{ + execute(TC_Sem_1505_ModifiedTemplates_015()); + } + + +} \ No newline at end of file diff --git a/core_language/15_templates/1505_modified_templates/Sem_1505_ModifiedTemplates_016.ttcn b/core_language/15_templates/1505_modified_templates/Sem_1505_ModifiedTemplates_016.ttcn new file mode 100644 index 0000000..5d775cd --- /dev/null +++ b/core_language/15_templates/1505_modified_templates/Sem_1505_ModifiedTemplates_016.ttcn @@ -0,0 +1,52 @@ +/***************************************************************** + ** @author TTF T014 + ** @version 0.0.1 + ** @purpose 1:15.5, Ensure that modified templates with same restrictions are supported. + ** @verdict pass accept + *****************************************************************/ +// The following requirement is tested: +// b) Restrictions on referencing elements of templates or template fields are described in clause +//EXAMPLE 8 + + +module Sem_1505_ModifiedTemplates_016 { + + type component GeneralComp { + } + + type record MyRecordType { + integer field1, + charstring field2, + boolean field3 + } + + template (value) MyRecordType m_myValueRecTemplate1 := + { + field1 := 123, + field2 := "A string", + field3 := true + } + + testcase TC_Sem_1505_ModifiedTemplates_016() runs on GeneralComp { + template (value) MyRecordType m_myValueRecTemplate2 modifies m_myValueRecTemplate1 := { + field2 := "A modified string" // field1, field3 is unchanged + } + + if( + valueof(m_myValueRecTemplate2.field1) == valueof(m_myValueRecTemplate1.field1) and + valueof(m_myValueRecTemplate2.field2) == "A modified string" and + valueof(m_myValueRecTemplate2.field3) == valueof(m_myValueRecTemplate1.field3) + ){ + setverdict(pass); + }else{ + setverdict(fail); + } + + } + + control{ + execute(TC_Sem_1505_ModifiedTemplates_016()); + } + + +} \ No newline at end of file diff --git a/core_language/15_templates/1505_modified_templates/Sem_1505_ModifiedTemplates_017.ttcn b/core_language/15_templates/1505_modified_templates/Sem_1505_ModifiedTemplates_017.ttcn new file mode 100644 index 0000000..0d1de29 --- /dev/null +++ b/core_language/15_templates/1505_modified_templates/Sem_1505_ModifiedTemplates_017.ttcn @@ -0,0 +1,38 @@ +/***************************************************************** + ** @author TTF T014 + ** @version 0.0.1 + ** @purpose 1:15.5, Ensure that it is possible to modify a matching symbol + ** @verdict pass accept + *****************************************************************/ +// The following requirement is tested: +// Syntactical structure: (... modifies BaseTemplateBody ...) + +module Sem_1505_ModifiedTemplates_017 { + + type component GeneralComp { + } + + type record MyRecordType { + integer field1, + charstring field2, + boolean field3 optional + } + + testcase TC_Sem_1505_ModifiedTemplates_017() runs on GeneralComp { + template MyRecordType m_msg modifies ? := { + field2 := "A modified string" // field1, field3 are assigned according to expansion rules + } + + if(istemplatekind(m_msg.field1, "?") and + valueof(m_msg.field2) == "A modified string" and + istemplatekind(m_msg.field3, "*")) { + setverdict(pass); + } else{ + setverdict(fail); + } + } + + control { + execute(TC_Sem_1505_ModifiedTemplates_017()); + } +} \ No newline at end of file diff --git a/core_language/15_templates/1505_modified_templates/Syn_1505_ModifiedTemplates_005.ttcn b/core_language/15_templates/1505_modified_templates/Syn_1505_ModifiedTemplates_005.ttcn new file mode 100644 index 0000000..13beda2 --- /dev/null +++ b/core_language/15_templates/1505_modified_templates/Syn_1505_ModifiedTemplates_005.ttcn @@ -0,0 +1,28 @@ +/***************************************************************** + ** @author STF T003 + ** @version 0.0.1 + ** @purpose 1:15.5, Ensure that templates without @abstract modifier are not accepted if it is not fully initialized. + ** @verdict pass accept, noexecution + *****************************************************************/ + +// Restriction e) After completing initialization, modified global and local templates that do not contain the @abstract modifier shall be fully initialized + +module Syn_1505_ModifiedTemplates_005 { + +type record MyMessageType { + integer field1, + charstring field2, + boolean field3 +} + +template @abstract MyMessageType m_templateOne(integer p_intValue:=2) := { + field1 := p_intValue, + field2 := "Hello World" +} + +template @abstract MyMessageType m_templateTwo(integer p_intValue := -) modifies m_templateOne := { + field1 := p_intValue + // field2 and field3 is not filled, modified template is an abstract template +} + +} \ No newline at end of file diff --git a/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_052.ttcn b/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_052.ttcn new file mode 100644 index 0000000..fc5f9b5 --- /dev/null +++ b/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_052.ttcn @@ -0,0 +1,38 @@ +/***************************************************************** + ** @author STF 470 (updated by STF 521 and 572) + ** @version 0.0.2 + ** @purpose 1:15.8, Ensure that template(present) parameter cannot be assigned to template(value) field + ** @verdict pass reject + *****************************************************************/ + +module NegSem_1508_TemplateRestrictions_052 { + + type record ExampleType { // Exampletype record integer and a boolean + integer a, + boolean b + } + + type component GeneralComp { + } + + + + template (value) ExampleType m_baseTemplate(template (present) integer MyintTemplate := ?) :={ + a := MyintTemplate, + b := true + } + + testcase TC_NegSem_1508_TemplateRestrictions_052() runs on GeneralComp { + + + if (ispresent(m_baseTemplate.a) == true) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control{ + execute(TC_NegSem_1508_TemplateRestrictions_052()); + } +} \ No newline at end of file diff --git a/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_053.ttcn b/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_053.ttcn new file mode 100644 index 0000000..8b68de6 --- /dev/null +++ b/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_053.ttcn @@ -0,0 +1,38 @@ +/***************************************************************** + ** @author STF 470 (updated by STF 521 and 572) + ** @version 0.0.2 + ** @purpose 1:15.8, Ensure that template(omit) parameter cannot be assigned to template(value) field + ** @verdict pass reject + *****************************************************************/ + +module NegSem_1508_TemplateRestrictions_053 { + + type record ExampleType { // Exampletype record integer and a boolean + integer a, + boolean b + } + + type component GeneralComp { + } + + + + template (value) ExampleType m_baseTemplate(template (omit) integer MyintTemplate := omit) :={ + a := MyintTemplate, + b := true + } + + testcase TC_NegSem_1508_TemplateRestrictions_053() runs on GeneralComp { + + + if (ispresent(m_baseTemplate.a) == true) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control{ + execute(TC_NegSem_1508_TemplateRestrictions_053()); + } +} \ No newline at end of file diff --git a/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_054.ttcn b/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_054.ttcn new file mode 100644 index 0000000..938f9ec --- /dev/null +++ b/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_054.ttcn @@ -0,0 +1,38 @@ +/***************************************************************** + ** @author STF 470 (updated by STF 521 and 572) + ** @version 0.0.2 + ** @purpose 1:15.8, Ensure that template(present) parameter cannot be assigned to template(omit) field + ** @verdict pass reject + *****************************************************************/ + +module NegSem_1508_TemplateRestrictions_053 { + + type record ExampleType { // Exampletype record integer and a boolean + integer a, + boolean b + } + + type component GeneralComp { + } + + + + template (omit) ExampleType m_baseTemplate(template integer MyintTemplate := ?) :={ + a := MyintTemplate, + b := true + } + + testcase TC_NegSem_1508_TemplateRestrictions_053() runs on GeneralComp { + + + if (ispresent(m_baseTemplate.a) == true) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control{ + execute(TC_NegSem_1508_TemplateRestrictions_053()); + } +} \ No newline at end of file diff --git a/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_055.ttcn b/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_055.ttcn new file mode 100644 index 0000000..e14513b --- /dev/null +++ b/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_055.ttcn @@ -0,0 +1,40 @@ +/***************************************************************** + ** @author TTF T014 + ** @version 0.0.1 + ** @purpose 1:15.8, Ensure that template(omit) base templates are not allowed to be modified to template(value) + ** @verdict pass reject + *****************************************************************/ +// The following requirement is tested: +// Restriction d: +// A modified template may have a less strict restriction than the base template according to table 13B. + +module NegSem_1508_TemplateRestrictions_055 { + + type component GeneralComp { } + + type record ExampleType { + integer a, + boolean b optional + } + + template(omit) ExampleType m_baseTemplate := { + a := 20, + b := true + } + + template(value) ExampleType m_modifiedTemplate modifies m_baseTemplate := { + a := 21 + } + + testcase TC_NegSem_1508_TemplateRestrictions_055() runs on GeneralComp { + if (match({ 21, true }, m_modifiedTemplate)) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control{ + execute(TC_NegSem_1508_TemplateRestrictions_055()); + } +} \ No newline at end of file diff --git a/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_056.ttcn b/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_056.ttcn new file mode 100644 index 0000000..6bba525 --- /dev/null +++ b/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_056.ttcn @@ -0,0 +1,40 @@ +/***************************************************************** + ** @author TTF T014 + ** @version 0.0.1 + ** @purpose 1:15.8, Ensure that template(omit) base templates are not allowed to be modfied to template(present) + ** @verdict pass reject + *****************************************************************/ +// The following requirement is tested: +// Restriction d: +// A modified template may have a less strict restriction than the base template according to table 13B. + +module NegSem_1508_TemplateRestrictions_056 { + + type component GeneralComp { } + + type record ExampleType { + integer a, + boolean b optional + } + + template(omit) ExampleType m_baseTemplate := { + a := 20, + b := true + } + + template(present) ExampleType m_modifiedTemplate modifies m_baseTemplate := { + a := 21 + } + + testcase TC_NegSem_1508_TemplateRestrictions_056() runs on GeneralComp { + if (match({ 21, true }, m_modifiedTemplate)) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control{ + execute(TC_NegSem_1508_TemplateRestrictions_056()); + } +} \ No newline at end of file diff --git a/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_057.ttcn b/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_057.ttcn new file mode 100644 index 0000000..6118a82 --- /dev/null +++ b/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_057.ttcn @@ -0,0 +1,40 @@ +/***************************************************************** + ** @author TTF T014 + ** @version 0.0.1 + ** @purpose 1:15.8, Ensure that template(present) base templates are not allowed to be modified to template(omit) + ** @verdict pass reject + *****************************************************************/ +// The following requirement is tested: +// Restriction d: +// A modified template may have a less strict restriction than the base template according to table 13B. + +module NegSem_1508_TemplateRestrictions_057 { + + type component GeneralComp { } + + type record ExampleType { + integer a, + boolean b optional + } + + template(present) ExampleType m_baseTemplate := { + a := 20, + b := true + } + + template(omit) ExampleType m_modifiedTemplate modifies m_baseTemplate := { + a := 21 + } + + testcase TC_NegSem_1508_TemplateRestrictions_057() runs on GeneralComp { + if (match({ 21, true }, m_modifiedTemplate)) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control{ + execute(TC_NegSem_1508_TemplateRestrictions_057()); + } +} \ No newline at end of file diff --git a/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_058.ttcn b/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_058.ttcn new file mode 100644 index 0000000..1264754 --- /dev/null +++ b/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_058.ttcn @@ -0,0 +1,40 @@ +/***************************************************************** + ** @author TTF T014 + ** @version 0.0.1 + ** @purpose 1:15.8, Ensure that template(present) base templates are not allowed to be modfied to template(value) + ** @verdict pass reject + *****************************************************************/ +// The following requirement is tested: +// Restriction d: +// A modified template may have a less strict restriction than the base template according to table 13B. + +module NegSem_1508_TemplateRestrictions_058 { + + type component GeneralComp { } + + type record ExampleType { + integer a, + boolean b optional + } + + template(present) ExampleType m_baseTemplate := { + a := 20, + b := true + } + + template(value) ExampleType m_modifiedTemplate modifies m_baseTemplate := { + a := 21 + } + + testcase TC_NegSem_1508_TemplateRestrictions_058() runs on GeneralComp { + if (match({ 21, true }, m_modifiedTemplate)) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control{ + execute(TC_NegSem_1508_TemplateRestrictions_058()); + } +} \ No newline at end of file diff --git a/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_059.ttcn b/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_059.ttcn new file mode 100644 index 0000000..78296a1 --- /dev/null +++ b/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_059.ttcn @@ -0,0 +1,40 @@ +/***************************************************************** + ** @author TTF T014 + ** @version 0.0.1 + ** @purpose 1:15.8, Ensure that unrestricted base templates are not allowed to be modified to template(omit) + ** @verdict pass reject + *****************************************************************/ +// The following requirement is tested: +// Restriction d: +// A modified template may have a less strict restriction than the base template according to table 13B. + +module NegSem_1508_TemplateRestrictions_059 { + + type component GeneralComp { } + + type record ExampleType { + integer a, + boolean b optional + } + + template ExampleType m_baseTemplate := { + a := 20, + b := true + } + + template(omit) ExampleType m_modifiedTemplate modifies m_baseTemplate := { + a := 21 + } + + testcase TC_NegSem_1508_TemplateRestrictions_059() runs on GeneralComp { + if (match({ 21, true }, m_modifiedTemplate)) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control{ + execute(TC_NegSem_1508_TemplateRestrictions_059()); + } +} \ No newline at end of file diff --git a/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_060.ttcn b/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_060.ttcn new file mode 100644 index 0000000..e90f565 --- /dev/null +++ b/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_060.ttcn @@ -0,0 +1,40 @@ +/***************************************************************** + ** @author TTF T014 + ** @version 0.0.1 + ** @purpose 1:15.8, Ensure that unrestricted base templates are not allowed to be modified to template(value) + ** @verdict pass reject + *****************************************************************/ +// The following requirement is tested: +// Restriction d: +// A modified template may have a less strict restriction than the base template according to table 13B. + +module NegSem_1508_TemplateRestrictions_060 { + + type component GeneralComp { } + + type record ExampleType { + integer a, + boolean b optional + } + + template ExampleType m_baseTemplate := { + a := 20, + b := true + } + + template(value) ExampleType m_modifiedTemplate modifies m_baseTemplate := { + a := 21 + } + + testcase TC_NegSem_1508_TemplateRestrictions_060() runs on GeneralComp { + if (match({ 21, true }, m_modifiedTemplate)) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control{ + execute(TC_NegSem_1508_TemplateRestrictions_060()); + } +} \ No newline at end of file diff --git a/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_061.ttcn b/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_061.ttcn new file mode 100644 index 0000000..f3a3989 --- /dev/null +++ b/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_061.ttcn @@ -0,0 +1,40 @@ +/***************************************************************** + ** @author TTF T014 + ** @version 0.0.1 + ** @purpose 1:15.8, Ensure that unrestricted base templates are not allowed to be modified to template(present) + ** @verdict pass reject + *****************************************************************/ +// The following requirement is tested: +// Restriction d: +// A modified template may have a less strict restriction than the base template according to table 13B. + +module NegSem_1508_TemplateRestrictions_061 { + + type component GeneralComp { } + + type record ExampleType { + integer a, + boolean b optional + } + + template ExampleType m_baseTemplate := { + a := 20, + b := true + } + + template(present) ExampleType m_modifiedTemplate modifies m_baseTemplate := { + a := 21 + } + + testcase TC_NegSem_1508_TemplateRestrictions_061() runs on GeneralComp { + if (match({ 21, true }, m_modifiedTemplate)) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control{ + execute(TC_NegSem_1508_TemplateRestrictions_061()); + } +} \ No newline at end of file diff --git a/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_027.ttcn b/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_027.ttcn index aff3ea3..717afb4 100644 --- a/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_027.ttcn +++ b/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_027.ttcn @@ -23,8 +23,6 @@ module Sem_1508_TemplateRestrictions_027 { b := true } -// shall be rejected as template(omit) is not an allowed restriction for template(value) -// templates template(omit) ExampleType m_modifiedTemplate modifies m_baseTemplate := { a := 21 } diff --git a/core_language/15_templates/1509_match_operation/Sem_1509_MatchOperation_009.ttcn b/core_language/15_templates/1509_match_operation/Sem_1509_MatchOperation_009.ttcn new file mode 100644 index 0000000..20b38a9 --- /dev/null +++ b/core_language/15_templates/1509_match_operation/Sem_1509_MatchOperation_009.ttcn @@ -0,0 +1,36 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:15.9, Ensure that the match operation works correctly if the set types are incompatible. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_1509_MatchOperation_009 language "TTCN-3:2016"{ + +type component GeneralComp { } + +type set MySet { + charstring field1, + boolean field2 +} + +template MySet mw_receiveTemplate := { + field1 := "ab*de", + field2 := ? +} + +testcase TC_Sem_1509_MatchOperation_009() runs on GeneralComp { + var integer v_value := 20; + + if (match(v_value, mw_receiveTemplate)) { + setverdict(fail); + } else { + setverdict(pass); + } +} + +control{ + execute(TC_Sem_1509_MatchOperation_009()); +} + +} \ No newline at end of file diff --git a/core_language/15_templates/1509_match_operation/Sem_1509_MatchOperation_013.ttcn b/core_language/15_templates/1509_match_operation/Sem_1509_MatchOperation_013.ttcn index a680265..fb85778 100644 --- a/core_language/15_templates/1509_match_operation/Sem_1509_MatchOperation_013.ttcn +++ b/core_language/15_templates/1509_match_operation/Sem_1509_MatchOperation_013.ttcn @@ -1,5 +1,5 @@ /***************************************************************** - ** @author STF 521 + ** @author STF 521, updated by STF 572 ** @version 0.0.1 ** @purpose 1:15.9, Ensure that if the expression-parameter evaluates to a literal value without explicit or implicit identification of its type, the type of the template instance-parameter shall be used as the type governor for the expression-parameter. ** @verdict pass accept, ttcn3verdict:pass @@ -16,7 +16,7 @@ const integer c_value := 1; testcase TC_Sem_1509_MatchOperation_013() runs on GeneralComp { - if (match(c_value,*)) { + if (match(c_value, ?)) { setverdict(pass); } else { setverdict(fail); diff --git a/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/NegSem_1511_ConcatenatingTemplatesOfStringAndListTypes_004.ttcn b/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/NegSem_1511_ConcatenatingTemplatesOfStringAndListTypes_004.ttcn index 7873088..114c3b4 100644 --- a/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/NegSem_1511_ConcatenatingTemplatesOfStringAndListTypes_004.ttcn +++ b/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/NegSem_1511_ConcatenatingTemplatesOfStringAndListTypes_004.ttcn @@ -16,7 +16,7 @@ type record MyRecord { template MyRecord m_receiveTemplate := { field1 := pattern "AB*DE", - field2 := "ABCC" & * & "EF" //only specific values allowed when there is no pattern keyword + field2 := "ABCC" & * & "EF" //AnyValueOrNone without a length restriction is not allowed in charstring concatenation } testcase TC_NegSem_1511_ConcatenatingTemplatesOfStringAndListTypes_004() runs on GeneralComp { diff --git a/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_016.ttcn b/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_016.ttcn new file mode 100644 index 0000000..16274c1 --- /dev/null +++ b/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_016.ttcn @@ -0,0 +1,39 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:15.11, Automatic escaping of characters when concatenating charstring templates + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// Single templates of charstring and universal charstring types shall contain evaluate only to specific values only, +// AnyValue with or without a length modifier, AnyValueOrNone with a length modifier or pattern. +// The concatenation of templates of character string types results in the sequential concatenation of the single templates +// from left to right. In case all operands are specific values, the result of concatenation will be a specific value. +// In all other cases, if possible, a pattern will be produced. When producing the pattern, the templates are first +// transformed to a character string according to table 14. In the next step, the strings are concatenated and a pattern is +// created from the concatenation result. +// Concatenation operand: Specific values (character strings) +// Transformed string: The character string is escaped by inserting the "\" character before each of the following +// characters: "#", "(", ")", "*", "+", "-", "?", "[", "\", "]", "^", "{", "|", "}". + +module Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_016 { + type component GeneralComp { } + template charstring m_str := "ABC"; + template charstring m_str2 := m_str & "?*"; + + testcase TC_Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_016() runs on GeneralComp { + log(m_str2); + if (match("ABCDE", m_str2)) { + setverdict(fail); + } else if (match("ABC?*", m_str2)) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_016()); + } +} \ No newline at end of file diff --git a/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_017.ttcn b/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_017.ttcn new file mode 100644 index 0000000..1287b88 --- /dev/null +++ b/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_017.ttcn @@ -0,0 +1,36 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:15.11, Concatenating charstring templates: AnyValue + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// Single templates of charstring and universal charstring types shall contain evaluate only to specific values only, +// AnyValue with or without a length modifier, AnyValueOrNone with a length modifier or pattern. +// The concatenation of templates of character string types results in the sequential concatenation of the single templates +// from left to right. In case all operands are specific values, the result of concatenation will be a specific value. +// In all other cases, if possible, a pattern will be produced. When producing the pattern, the templates are first +// transformed to a character string according to table 14. In the next step, the strings are concatenated and a pattern is +// created from the concatenation result. +// Concatenation operand: ? +// Transformed string: * + +module Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_017 { + type component GeneralComp { } + template charstring m_str := "ABC"; + template charstring m_str2 := m_str & ?; + + testcase TC_Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_017() runs on GeneralComp { + log(m_str2); + if (match("ABCXYZ", m_str2) and match("ABC", m_str2)) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_017()); + } +} \ No newline at end of file diff --git a/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_018.ttcn b/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_018.ttcn new file mode 100644 index 0000000..e16d584 --- /dev/null +++ b/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_018.ttcn @@ -0,0 +1,36 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:15.11, Concatenating charstring templates: ? length(0..infinity) + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// Single templates of charstring and universal charstring types shall contain evaluate only to specific values only, +// AnyValue with or without a length modifier, AnyValueOrNone with a length modifier or pattern. +// The concatenation of templates of character string types results in the sequential concatenation of the single templates +// from left to right. In case all operands are specific values, the result of concatenation will be a specific value. +// In all other cases, if possible, a pattern will be produced. When producing the pattern, the templates are first +// transformed to a character string according to table 14. In the next step, the strings are concatenated and a pattern is +// created from the concatenation result. +// Concatenation operand: ? length(0..infinity) +// Transformed string: * + +module Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_018 { + type component GeneralComp { } + template charstring m_str := "ABC"; + template charstring m_str2 := m_str & ? length(0..infinity); + + testcase TC_Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_018() runs on GeneralComp { + log(m_str2); + if (match("ABCXYZ", m_str2) and match("ABC", m_str2)) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_018()); + } +} \ No newline at end of file diff --git a/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_019.ttcn b/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_019.ttcn new file mode 100644 index 0000000..7645700 --- /dev/null +++ b/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_019.ttcn @@ -0,0 +1,36 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:15.11, Concatenating charstring templates: * length(0..infinity) + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// Single templates of charstring and universal charstring types shall contain evaluate only to specific values only, +// AnyValue with or without a length modifier, AnyValueOrNone with a length modifier or pattern. +// The concatenation of templates of character string types results in the sequential concatenation of the single templates +// from left to right. In case all operands are specific values, the result of concatenation will be a specific value. +// In all other cases, if possible, a pattern will be produced. When producing the pattern, the templates are first +// transformed to a character string according to table 14. In the next step, the strings are concatenated and a pattern is +// created from the concatenation result. +// Concatenation operand: * length(0..infinity) +// Transformed string: * + +module Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_019 { + type component GeneralComp { } + template charstring m_str := "ABC"; + template charstring m_str2 := m_str & * length(0..infinity); + + testcase TC_Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_019() runs on GeneralComp { + log(m_str2); + if (match("ABCXYZ", m_str2) and match("ABC", m_str2)) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_019()); + } +} \ No newline at end of file diff --git a/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_020.ttcn b/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_020.ttcn new file mode 100644 index 0000000..53bb4f7 --- /dev/null +++ b/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_020.ttcn @@ -0,0 +1,38 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:15.11, Concatenating charstring templates: ? length(0) + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// Single templates of charstring and universal charstring types shall contain evaluate only to specific values only, +// AnyValue with or without a length modifier, AnyValueOrNone with a length modifier or pattern. +// The concatenation of templates of character string types results in the sequential concatenation of the single templates +// from left to right. In case all operands are specific values, the result of concatenation will be a specific value. +// In all other cases, if possible, a pattern will be produced. When producing the pattern, the templates are first +// transformed to a character string according to table 14. In the next step, the strings are concatenated and a pattern is +// created from the concatenation result. +// Concatenation operand: ? length(0) +// Transformed string: empty string + +module Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_020 { + type component GeneralComp { } + template charstring m_str := "ABC"; + template charstring m_str2 := m_str & ? length(0); + + testcase TC_Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_020() runs on GeneralComp { + log(m_str2); + if (match("ABCD", m_str2)) { + setverdict(fail); + } else if (match("ABC", m_str2)) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_020()); + } +} \ No newline at end of file diff --git a/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_021.ttcn b/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_021.ttcn new file mode 100644 index 0000000..62ef163 --- /dev/null +++ b/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_021.ttcn @@ -0,0 +1,38 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:15.11, Concatenating charstring templates: * length(0) + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// Single templates of charstring and universal charstring types shall contain evaluate only to specific values only, +// AnyValue with or without a length modifier, AnyValueOrNone with a length modifier or pattern. +// The concatenation of templates of character string types results in the sequential concatenation of the single templates +// from left to right. In case all operands are specific values, the result of concatenation will be a specific value. +// In all other cases, if possible, a pattern will be produced. When producing the pattern, the templates are first +// transformed to a character string according to table 14. In the next step, the strings are concatenated and a pattern is +// created from the concatenation result. +// Concatenation operand: * length(0) +// Transformed string: empty string + +module Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_021 { + type component GeneralComp { } + template charstring m_str := "ABC"; + template charstring m_str2 := m_str & * length(0); + + testcase TC_Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_021() runs on GeneralComp { + log(m_str2); + if (match("ABCD", m_str2)) { + setverdict(fail); + } else if (match("ABC", m_str2)) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_021()); + } +} \ No newline at end of file diff --git a/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_022.ttcn b/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_022.ttcn new file mode 100644 index 0000000..965516f --- /dev/null +++ b/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_022.ttcn @@ -0,0 +1,38 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:15.11, Concatenating charstring templates: ? length(1) + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// Single templates of charstring and universal charstring types shall contain evaluate only to specific values only, +// AnyValue with or without a length modifier, AnyValueOrNone with a length modifier or pattern. +// The concatenation of templates of character string types results in the sequential concatenation of the single templates +// from left to right. In case all operands are specific values, the result of concatenation will be a specific value. +// In all other cases, if possible, a pattern will be produced. When producing the pattern, the templates are first +// transformed to a character string according to table 14. In the next step, the strings are concatenated and a pattern is +// created from the concatenation result. +// Concatenation operand: ? length(1) +// Transformed string: ? + +module Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_022 { + type component GeneralComp { } + template charstring m_str := "ABC"; + template charstring m_str2 := m_str & ? length(1); + + testcase TC_Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_022() runs on GeneralComp { + log(m_str2); + if (match("ABC", m_str2) or match("ABCDE", m_str2)) { + setverdict(fail); + } else if (match("ABCD", m_str2)) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_022()); + } +} \ No newline at end of file diff --git a/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_023.ttcn b/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_023.ttcn new file mode 100644 index 0000000..47feff2 --- /dev/null +++ b/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_023.ttcn @@ -0,0 +1,38 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:15.11, Concatenating charstring templates: * length(1) + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// Single templates of charstring and universal charstring types shall contain evaluate only to specific values only, +// AnyValue with or without a length modifier, AnyValueOrNone with a length modifier or pattern. +// The concatenation of templates of character string types results in the sequential concatenation of the single templates +// from left to right. In case all operands are specific values, the result of concatenation will be a specific value. +// In all other cases, if possible, a pattern will be produced. When producing the pattern, the templates are first +// transformed to a character string according to table 14. In the next step, the strings are concatenated and a pattern is +// created from the concatenation result. +// Concatenation operand: * length(1) +// Transformed string: ? + +module Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_023 { + type component GeneralComp { } + template charstring m_str := "ABC"; + template charstring m_str2 := m_str & * length(1); + + testcase TC_Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_023() runs on GeneralComp { + log(m_str2); + if (match("ABC", m_str2) or match("ABCDE", m_str2)) { + setverdict(fail); + } else if (match("ABCD", m_str2)) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_023()); + } +} \ No newline at end of file diff --git a/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_024.ttcn b/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_024.ttcn new file mode 100644 index 0000000..bc0a429 --- /dev/null +++ b/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_024.ttcn @@ -0,0 +1,38 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:15.11, Concatenating charstring templates: ? length(1..infinity) + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// Single templates of charstring and universal charstring types shall contain evaluate only to specific values only, +// AnyValue with or without a length modifier, AnyValueOrNone with a length modifier or pattern. +// The concatenation of templates of character string types results in the sequential concatenation of the single templates +// from left to right. In case all operands are specific values, the result of concatenation will be a specific value. +// In all other cases, if possible, a pattern will be produced. When producing the pattern, the templates are first +// transformed to a character string according to table 14. In the next step, the strings are concatenated and a pattern is +// created from the concatenation result. +// Concatenation operand: ? length(1..infinity) +// Transformed string: ?+ + +module Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_024 { + type component GeneralComp { } + template charstring m_str := "ABC"; + template charstring m_str2 := m_str & ? length(1..infinity); + + testcase TC_Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_024() runs on GeneralComp { + log(m_str2); + if (match("ABC", m_str2)) { + setverdict(fail); + } else if (match("ABCD", m_str2) and match("ABCDEFGHIJK", m_str2)) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_024()); + } +} \ No newline at end of file diff --git a/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_025.ttcn b/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_025.ttcn new file mode 100644 index 0000000..11e1e4a --- /dev/null +++ b/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_025.ttcn @@ -0,0 +1,38 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:15.11, Concatenating charstring templates: * length(1..infinity) + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// Single templates of charstring and universal charstring types shall contain evaluate only to specific values only, +// AnyValue with or without a length modifier, AnyValueOrNone with a length modifier or pattern. +// The concatenation of templates of character string types results in the sequential concatenation of the single templates +// from left to right. In case all operands are specific values, the result of concatenation will be a specific value. +// In all other cases, if possible, a pattern will be produced. When producing the pattern, the templates are first +// transformed to a character string according to table 14. In the next step, the strings are concatenated and a pattern is +// created from the concatenation result. +// Concatenation operand: * length(1..infinity) +// Transformed string: ?+ + +module Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_025 { + type component GeneralComp { } + template charstring m_str := "ABC"; + template charstring m_str2 := m_str & * length(1..infinity); + + testcase TC_Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_025() runs on GeneralComp { + log(m_str2); + if (match("ABC", m_str2)) { + setverdict(fail); + } else if (match("ABCD", m_str2) and match("ABCDEFGHIJK", m_str2)) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_025()); + } +} \ No newline at end of file diff --git a/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_026.ttcn b/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_026.ttcn new file mode 100644 index 0000000..967639e --- /dev/null +++ b/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_026.ttcn @@ -0,0 +1,38 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:15.11, Concatenating charstring templates: ? length(n) + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// Single templates of charstring and universal charstring types shall contain evaluate only to specific values only, +// AnyValue with or without a length modifier, AnyValueOrNone with a length modifier or pattern. +// The concatenation of templates of character string types results in the sequential concatenation of the single templates +// from left to right. In case all operands are specific values, the result of concatenation will be a specific value. +// In all other cases, if possible, a pattern will be produced. When producing the pattern, the templates are first +// transformed to a character string according to table 14. In the next step, the strings are concatenated and a pattern is +// created from the concatenation result. +// Concatenation operand: ? length(n) +// Transformed string: ?#(n) + +module Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_026 { + type component GeneralComp { } + template charstring m_str := "ABC"; + template charstring m_str2 := m_str & ? length(2); + + testcase TC_Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_026() runs on GeneralComp { + log(m_str2); + if (match("ABCD", m_str2) or match("ABCDEF", m_str2)) { + setverdict(fail); + } else if (match("ABCDE", m_str2)) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_026()); + } +} \ No newline at end of file diff --git a/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_027.ttcn b/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_027.ttcn new file mode 100644 index 0000000..9152fa0 --- /dev/null +++ b/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_027.ttcn @@ -0,0 +1,38 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:15.11, Concatenating charstring templates: * length(n) + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// Single templates of charstring and universal charstring types shall contain evaluate only to specific values only, +// AnyValue with or without a length modifier, AnyValueOrNone with a length modifier or pattern. +// The concatenation of templates of character string types results in the sequential concatenation of the single templates +// from left to right. In case all operands are specific values, the result of concatenation will be a specific value. +// In all other cases, if possible, a pattern will be produced. When producing the pattern, the templates are first +// transformed to a character string according to table 14. In the next step, the strings are concatenated and a pattern is +// created from the concatenation result. +// Concatenation operand: * length(n) +// Transformed string: ?#(n) + +module Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_027 { + type component GeneralComp { } + template charstring m_str := "ABC"; + template charstring m_str2 := m_str & * length(2); + + testcase TC_Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_027() runs on GeneralComp { + log(m_str2); + if (match("ABCD", m_str2) or match("ABCDEF", m_str2)) { + setverdict(fail); + } else if (match("ABCDE", m_str2)) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_027()); + } +} \ No newline at end of file diff --git a/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_028.ttcn b/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_028.ttcn new file mode 100644 index 0000000..73b12d5 --- /dev/null +++ b/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_028.ttcn @@ -0,0 +1,38 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:15.11, Concatenating charstring templates: ? length(n..infinity) + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// Single templates of charstring and universal charstring types shall contain evaluate only to specific values only, +// AnyValue with or without a length modifier, AnyValueOrNone with a length modifier or pattern. +// The concatenation of templates of character string types results in the sequential concatenation of the single templates +// from left to right. In case all operands are specific values, the result of concatenation will be a specific value. +// In all other cases, if possible, a pattern will be produced. When producing the pattern, the templates are first +// transformed to a character string according to table 14. In the next step, the strings are concatenated and a pattern is +// created from the concatenation result. +// Concatenation operand: ? length(n..infinity) +// Transformed string: ?#(n,) + +module Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_028 { + type component GeneralComp { } + template charstring m_str := "ABC"; + template charstring m_str2 := m_str & ? length(2..infinity); + + testcase TC_Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_028() runs on GeneralComp { + log(m_str2); + if (match("ABCD", m_str2)) { + setverdict(fail); + } else if (match("ABCDE", m_str2) and match("ABCDEFGHIJ", m_str2)) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_028()); + } +} \ No newline at end of file diff --git a/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_029.ttcn b/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_029.ttcn new file mode 100644 index 0000000..e0706e6 --- /dev/null +++ b/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_029.ttcn @@ -0,0 +1,38 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:15.11, Concatenating charstring templates: * length(n..infinity) + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// Single templates of charstring and universal charstring types shall contain evaluate only to specific values only, +// AnyValue with or without a length modifier, AnyValueOrNone with a length modifier or pattern. +// The concatenation of templates of character string types results in the sequential concatenation of the single templates +// from left to right. In case all operands are specific values, the result of concatenation will be a specific value. +// In all other cases, if possible, a pattern will be produced. When producing the pattern, the templates are first +// transformed to a character string according to table 14. In the next step, the strings are concatenated and a pattern is +// created from the concatenation result. +// Concatenation operand: * length(n..infinity) +// Transformed string: *#(n,) + +module Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_029 { + type component GeneralComp { } + template charstring m_str := "ABC"; + template charstring m_str2 := m_str & * length(2..infinity); + + testcase TC_Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_029() runs on GeneralComp { + log(m_str2); + if (match("ABCD", m_str2)) { + setverdict(fail); + } else if (match("ABCDE", m_str2) and match("ABCDEFGHIJ", m_str2)) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_029()); + } +} \ No newline at end of file diff --git a/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_030.ttcn b/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_030.ttcn new file mode 100644 index 0000000..1e00b00 --- /dev/null +++ b/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_030.ttcn @@ -0,0 +1,38 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:15.11, Concatenating charstring templates: ? length(n..m) + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// Single templates of charstring and universal charstring types shall contain evaluate only to specific values only, +// AnyValue with or without a length modifier, AnyValueOrNone with a length modifier or pattern. +// The concatenation of templates of character string types results in the sequential concatenation of the single templates +// from left to right. In case all operands are specific values, the result of concatenation will be a specific value. +// In all other cases, if possible, a pattern will be produced. When producing the pattern, the templates are first +// transformed to a character string according to table 14. In the next step, the strings are concatenated and a pattern is +// created from the concatenation result. +// Concatenation operand: ? length(n..m) +// Transformed string: ?#(n,m) + +module Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_030 { + type component GeneralComp { } + template charstring m_str := "ABC"; + template charstring m_str2 := m_str & ? length(2..4); + + testcase TC_Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_030() runs on GeneralComp { + log(m_str2); + if (match("ABCD", m_str2) or match("ABCDEFGH", m_str2)) { + setverdict(fail); + } else if (match("ABCDE", m_str2) and match("ABCDEFG", m_str2)) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_030()); + } +} \ No newline at end of file diff --git a/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_031.ttcn b/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_031.ttcn new file mode 100644 index 0000000..fdf7291 --- /dev/null +++ b/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_031.ttcn @@ -0,0 +1,38 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:15.11, Concatenating charstring templates: * length(n..m) + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// Single templates of charstring and universal charstring types shall contain evaluate only to specific values only, +// AnyValue with or without a length modifier, AnyValueOrNone with a length modifier or pattern. +// The concatenation of templates of character string types results in the sequential concatenation of the single templates +// from left to right. In case all operands are specific values, the result of concatenation will be a specific value. +// In all other cases, if possible, a pattern will be produced. When producing the pattern, the templates are first +// transformed to a character string according to table 14. In the next step, the strings are concatenated and a pattern is +// created from the concatenation result. +// Concatenation operand: * length(n..m) +// Transformed string: ?#(n,m) + +module Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_031 { + type component GeneralComp { } + template charstring m_str := "ABC"; + template charstring m_str2 := m_str & * length(2..4); + + testcase TC_Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_031() runs on GeneralComp { + log(m_str2); + if (match("ABCD", m_str2) or match("ABCDEFGH", m_str2)) { + setverdict(fail); + } else if (match("ABCDE", m_str2) and match("ABCDEFG", m_str2)) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_031()); + } +} \ No newline at end of file diff --git a/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_032.ttcn b/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_032.ttcn new file mode 100644 index 0000000..0547b1a --- /dev/null +++ b/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_032.ttcn @@ -0,0 +1,38 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:15.11, Concatenating charstring templates: pattern + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// Single templates of charstring and universal charstring types shall contain evaluate only to specific values only, +// AnyValue with or without a length modifier, AnyValueOrNone with a length modifier or pattern. +// The concatenation of templates of character string types results in the sequential concatenation of the single templates +// from left to right. In case all operands are specific values, the result of concatenation will be a specific value. +// In all other cases, if possible, a pattern will be produced. When producing the pattern, the templates are first +// transformed to a character string according to table 14. In the next step, the strings are concatenated and a pattern is +// created from the concatenation result. +// Concatenation operand: patern "content" +// Transformed string: "content" + +module Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_032 { + type component GeneralComp { } + template charstring m_str := "ABC"; + template charstring m_str2 := m_str & pattern "[EFG]"; + + testcase TC_Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_032() runs on GeneralComp { + log(m_str2); + if (match("ABC[DEF]", m_str2)) { + setverdict(fail); + } else if (match("ABCE", m_str2)) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_032()); + } +} \ No newline at end of file diff --git a/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_033.ttcn b/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_033.ttcn new file mode 100644 index 0000000..31e3574 --- /dev/null +++ b/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_033.ttcn @@ -0,0 +1,30 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:15.11, Concatenating charstring templates: the @nocase modifier + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// If one of the single templates is a pattern with the @nocase modifier, then all other single templates +// shall also be patterns with the @nocase modifier and the resulting pattern will also have the @nocase +// modifier. + +module Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_033 { + type component GeneralComp { } + template charstring m_str := pattern @nocase "ABC"; + template charstring m_str2 := m_str & pattern "DE"; + + testcase TC_Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_033() runs on GeneralComp { + log(m_str2); + if (match("aBcDe", m_str2)) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_033()); + } +} \ No newline at end of file diff --git a/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_034.ttcn b/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_034.ttcn new file mode 100644 index 0000000..293dc38 --- /dev/null +++ b/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_034.ttcn @@ -0,0 +1,45 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:15.11, Concatenating charstring templates: the @nocase modifier + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// Concatenation of character strings in a pattern definition always takes precedence over concatenation +// of templates. If it is necessary to concatenate a pattern definition with a following character string +// according to the template concatenation rules (thus automatically escaping the string), the pattern +// definition shall be enclosed into parentheses. + +module Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_034 { + +type component GeneralComp { } + +type record MyRecord { + charstring field1, + charstring field2 +} + +template MyRecord m_receiveTemplate := { + field1 := pattern "AB*DE", + field2 := (pattern "ABC") & * length(2) & "FG" // parentheses used to distinguish from pattern concatenation +} + +testcase TC_Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_034() runs on GeneralComp { + var MyRecord v_value := { + field1 := "AB*DE", + field2 := "ABCDEFG" + } + + if (match(v_value, m_receiveTemplate)) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_034()); +} + +} \ No newline at end of file diff --git a/core_language/15_templates/1512_the_omit_operation/NegSem_1512_TheOmitOperation_001.ttcn b/core_language/15_templates/1512_the_omit_operation/NegSem_1512_TheOmitOperation_001.ttcn new file mode 100644 index 0000000..283dae5 --- /dev/null +++ b/core_language/15_templates/1512_the_omit_operation/NegSem_1512_TheOmitOperation_001.ttcn @@ -0,0 +1,35 @@ +/*************************************************** + ** @author TTF 014 + ** @version 0.0.1 + ** @purpose 1:15.12, The omit operation + ** @verdict pass reject + ***************************************************/ + + /* The following requirements are tested: + * omit restriction: + * A template with the omit restriction shall cause an error if the operand not fulfils + * conditions of the omit template restriction + */ + +module NegSem_1512_TheOmitOperation_001 { + type component GeneralComp { + } + + type record ExampleType { + integer a, + boolean b optional + } + + testcase TC_NegSem_1512_TheOmitOperation_001() runs on GeneralComp { + + template ExampleType m_originalAny := ?; + + template (omit) ExampleType m_targetAny := omit(m_originalAny); // causes error + + setverdict(fail); + } + + control { + execute(TC_NegSem_1512_TheOmitOperation_001()); + }; +} \ No newline at end of file diff --git a/core_language/15_templates/1512_the_omit_operation/NegSem_1512_TheOmitOperation_002.ttcn b/core_language/15_templates/1512_the_omit_operation/NegSem_1512_TheOmitOperation_002.ttcn new file mode 100644 index 0000000..6071e47 --- /dev/null +++ b/core_language/15_templates/1512_the_omit_operation/NegSem_1512_TheOmitOperation_002.ttcn @@ -0,0 +1,35 @@ +/*************************************************** + ** @author TTF 014 + ** @version 0.0.1 + ** @purpose 1:15.12, The omit operation + ** @verdict pass reject + ***************************************************/ + + /* The following requirements are tested: + * omit restriction: + * A template with the omit restriction shall cause an error if the operand not fulfils + * conditions of the omit template restriction + */ + +module NegSem_1512_TheOmitOperation_002 { + type component GeneralComp { + } + + type record ExampleType { + integer a, + boolean b optional + } + + testcase TC_NegSem_1512_TheOmitOperation_002() runs on GeneralComp { + + template ExampleType m_originalAnyOrNone := *; + + template (omit) ExampleType m_targetAny := omit(m_originalAnyOrNone); // causes error + + setverdict(fail); + } + + control { + execute(TC_NegSem_1512_TheOmitOperation_002()); + }; +} \ No newline at end of file diff --git a/core_language/15_templates/1512_the_omit_operation/Sem_1512_TheOmitOperation_001.ttcn b/core_language/15_templates/1512_the_omit_operation/Sem_1512_TheOmitOperation_001.ttcn new file mode 100644 index 0000000..df71ffd --- /dev/null +++ b/core_language/15_templates/1512_the_omit_operation/Sem_1512_TheOmitOperation_001.ttcn @@ -0,0 +1,42 @@ +/*************************************************** + ** @author TTF 014 + ** @version 0.0.1 + ** @purpose 1:15.12, The omit operation + ** @verdict pass accept + ***************************************************/ + + /* The following requirements are tested: + * omit restriction: + * The omit operatoion checks if a template instance fullfils conditions of the omit restriction. + */ + +module Sem_1512_TheOmitOperation_001 { + + type component GeneralComp {} + + type record ExampleType { + integer a, + boolean b optional + } + + template ExampleType m_originalOmit := omit; + template(omit) ExampleType m_targetOmit := omit(m_originalOmit); + + testcase TC_Sem_1512_TheOmitOperation_001() runs on GeneralComp { + + var template(omit) ExampleType v_omit; + + v_omit := m_targetOmit; + + if ( ispresent(v_omit) ) { + setverdict(fail); + } else { + setverdict(pass); + } + } + + control { + execute(TC_Sem_1512_TheOmitOperation_001()); + }; +} + diff --git a/core_language/15_templates/1512_the_omit_operation/Sem_1512_TheOmitOperation_002.ttcn b/core_language/15_templates/1512_the_omit_operation/Sem_1512_TheOmitOperation_002.ttcn new file mode 100644 index 0000000..f3c4405 --- /dev/null +++ b/core_language/15_templates/1512_the_omit_operation/Sem_1512_TheOmitOperation_002.ttcn @@ -0,0 +1,42 @@ +/*************************************************** + ** @author TTF 014 + ** @version 0.0.1 + ** @purpose 1:15.12, The omit operation + ** @verdict pass accept + ***************************************************/ + + /* The following requirements are tested: + * omit restriction: + * The omit operatoion checks if a template instance fullfils conditions of the omit restriction. + */ + +module Sem_1512_TheOmitOperation_002 { + + type component GeneralComp {} + + type record ExampleType { + integer a, + boolean b optional + } + + template ExampleType m_originalValue := {1, true}; + template(omit) ExampleType m_targetValue := omit(m_originalValue); + + testcase TC_Sem_1512_TheOmitOperation_002() runs on GeneralComp { + var template(omit) ExampleType v_omit; + + v_omit := m_targetValue; + + if (match(valueof(v_omit.a), 1) and + match(ispresent(v_omit.b), true ) + ) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_1512_TheOmitOperation_002()); + }; +} \ No newline at end of file diff --git a/core_language/15_templates/1513_the_present_operation/NegSem_1512_ThePresentOperation_001.ttcn b/core_language/15_templates/1513_the_present_operation/NegSem_1512_ThePresentOperation_001.ttcn new file mode 100644 index 0000000..48aae6e --- /dev/null +++ b/core_language/15_templates/1513_the_present_operation/NegSem_1512_ThePresentOperation_001.ttcn @@ -0,0 +1,35 @@ +/*************************************************** + ** @author TTF 014 + ** @version 0.0.1 + ** @purpose 1:15.12, The present operation + ** @verdict pass reject + ***************************************************/ + + /* The following requirements are tested: + * present operation: + * A template with the present operationn shall cause an error if the operand not fulfils + * conditions of the present template restriction. + */ + +module NegSem_1512_ThePresentOperation_001 { + + type component GeneralComp {} + + type record ExampleType { + integer a, + boolean b optional + } + + testcase TC_NegSem_1512_ThePresentOperation_001() runs on GeneralComp { + + template ExampleType m_originalOmit := omit; + + template(present) ExampleType m_targetOmit := present(m_originalOmit); // causes error + + setverdict(fail); + } + + control { + execute(TC_NegSem_1512_ThePresentOperation_001()); + }; +} \ No newline at end of file diff --git a/core_language/15_templates/1513_the_present_operation/NegSem_1512_ThePresentOperation_002.ttcn b/core_language/15_templates/1513_the_present_operation/NegSem_1512_ThePresentOperation_002.ttcn new file mode 100644 index 0000000..7b29da9 --- /dev/null +++ b/core_language/15_templates/1513_the_present_operation/NegSem_1512_ThePresentOperation_002.ttcn @@ -0,0 +1,35 @@ +/*************************************************** + ** @author TTF 014 + ** @version 0.0.1 + ** @purpose 1:15.12, The present operation + ** @verdict pass reject + ***************************************************/ + + /* The following requirements are tested: + * omiut restriction: + * A template with the omit restriction shall cause an error if the operand not fulfils + * conditions of the omit template restriction + */ + +module NegSem_1512_ThePresentOperation_002 { + type component GeneralComp { + } + + type record ExampleType { + integer a, + boolean b optional + } + + testcase TC_NegSem_1512_ThePresentOperation_002() runs on GeneralComp { + + template ExampleType m_originalAnyOrNone := *; + + template (omit) ExampleType m_targetAny := present(m_originalAnyOrNone); // causes error + + setverdict(fail); + } + + control { + execute(TC_NegSem_1512_ThePresentOperation_002()); + }; +} \ No newline at end of file diff --git a/core_language/15_templates/1513_the_present_operation/Sem_1512_ThePresentOperation_001.ttcn b/core_language/15_templates/1513_the_present_operation/Sem_1512_ThePresentOperation_001.ttcn new file mode 100644 index 0000000..605adb6 --- /dev/null +++ b/core_language/15_templates/1513_the_present_operation/Sem_1512_ThePresentOperation_001.ttcn @@ -0,0 +1,38 @@ +/*************************************************** + * @author TTF 014 + * @version 0.0.1 + * @purpose 1:15.12, The present operation + * @verdict pass accept + ***************************************************/ +/* The following requirements are tested: + * present restriction: + * The present operatoion checks if a template instance fullfils conditions of the present template restriction. + */ +module Sem_1512_ThePresentOperation_001 { + type component GeneralComp { + } + + type record ExampleType { + integer a, boolean b optional + } + + template ExampleType m_originalValue := {1, true} + template(present) ExampleType m_targetValue := present(m_originalValue); + + testcase TC_Sem_1512_ThePresentOperation_001() runs on GeneralComp { + var template(present) ExampleType v_present; + + v_present := m_targetValue; + + if (match(valueof(v_present.a), 1) and + match(valueof(v_present.b), true)) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_1512_ThePresentOperation_001()); + }; +} \ No newline at end of file diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_036.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_036.ttcn old mode 100755 new mode 100644 diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_037.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_037.ttcn old mode 100755 new mode 100644 diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_038.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_038.ttcn old mode 100755 new mode 100644 diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_041.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_041.ttcn new file mode 100644 index 0000000..c4bc5fc --- /dev/null +++ b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_041.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @author STF T003 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// C.2.1 In addition to the general error causes in clause 16.1.2, error causes are: +// the template passed to the invalue parameter is not of type bitstring, hexstring, octetstring, charstring, universal charstring,record of, set of, or array. + +module NegSem_160102_predefined_functions_041 { + + type component GeneralComp { + } + template integer MyInt := 22; + + testcase TC_NegSem_160102_predefined_functions_041() runs on GeneralComp { + var integer v_i; + + v_i:=lengthof(MyInt); // error: template is an integer + setverdict(pass); + } + + control { + execute(TC_NegSem_160102_predefined_functions_041()); + } +} \ No newline at end of file diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_042.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_042.ttcn new file mode 100644 index 0000000..12e2249 --- /dev/null +++ b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_042.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @author STF T003 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// C.2.1 In addition to the general error causes in clause 16.1.2, error causes are: +// the template passed to the invalue parameter is not of type bitstring, hexstring, octetstring, charstring, universal charstring,record of, set of, or array. + +module NegSem_160102_predefined_functions_042 { + + type component GeneralComp { + } + template float MyFloat := 22.0; + + testcase TC_NegSem_160102_predefined_functions_042() runs on GeneralComp { + var integer v_i; + + v_i:=lengthof(MyFloat); // error: template is a float + setverdict(pass); + } + + control { + execute(TC_NegSem_160102_predefined_functions_042()); + } +} \ No newline at end of file diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_043.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_043.ttcn new file mode 100644 index 0000000..2243f81 --- /dev/null +++ b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_043.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @author STF T003 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// C.2.1 In addition to the general error causes in clause 16.1.2, error causes are: +// the template passed to the invalue parameter is not of type bitstring, hexstring, octetstring, charstring, universal charstring,record of, set of, or array. + +module NegSem_160102_predefined_functions_043 { + + type component GeneralComp { + } + template boolean MyBoolean := true; + + testcase TC_NegSem_160102_predefined_functions_043() runs on GeneralComp { + var integer v_i; + + v_i:=lengthof(MyBoolean); // error: template is a boolean + setverdict(pass); + } + + control { + execute(TC_NegSem_160102_predefined_functions_043()); + } +} \ No newline at end of file diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_044.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_044.ttcn new file mode 100644 index 0000000..03c9b7d --- /dev/null +++ b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_044.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @author STF T003 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// C.2.1 In addition to the general error causes in clause 16.1.2, error causes are: +// the template passed to the invalue parameter is not of type bitstring, hexstring, octetstring, charstring, universal charstring,record of, set of, or array. + +module NegSem_160102_predefined_functions_044 { + + type component GeneralComp { + } + template verdicttype MyVerdict := pass; + + testcase TC_NegSem_160102_predefined_functions_044() runs on GeneralComp { + var integer v_i; + + v_i:=lengthof(MyVerdict); // error: template is a verdicttype + setverdict(pass); + } + + control { + execute(TC_NegSem_160102_predefined_functions_044()); + } +} \ No newline at end of file diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_045.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_045.ttcn new file mode 100644 index 0000000..a131cf9 --- /dev/null +++ b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_045.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF T003 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// C.2.1 In addition to the general error causes in clause 16.1.2, error causes are: +// the template passed to the invalue parameter is not of type bitstring, hexstring, octetstring, charstring, universal charstring,record of, set of, or array. + +module NegSem_160102_predefined_functions_045 { + + type component GeneralComp { + } + + type enumerated EDays { + Monday(0), Tuesday(1), Wednesday(2), Thursday(3), Friday(4) + }; + + template EDays MyEnum := Monday; + + testcase TC_NegSem_160102_predefined_functions_045() runs on GeneralComp { + var integer v_i; + + v_i:=lengthof(MyEnum); // error: template is an enum + setverdict(pass); + } + + control { + execute(TC_NegSem_160102_predefined_functions_045()); + } +} \ No newline at end of file diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_046.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_046.ttcn new file mode 100644 index 0000000..941ed32 --- /dev/null +++ b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_046.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF T003 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// C.2.1 In addition to the general error causes in clause 16.1.2, error causes are: +// the template passed to the invalue parameter is not of type bitstring, hexstring, octetstring, charstring, universal charstring,record of, set of, or array. + +module NegSem_160102_predefined_functions_046 { + + type component GeneralComp { + } + + type union unionType { + charstring chocie1, + integer choice2}; + + template unionType MyUnion := {chocie1 := "111"}; + + testcase TC_NegSem_160102_predefined_functions_046() runs on GeneralComp { + var integer v_i; + + v_i:=lengthof(MyUnion); // error: template is an union + setverdict(pass); + } + + control { + execute(TC_NegSem_160102_predefined_functions_046()); + } +} \ No newline at end of file diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_047.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_047.ttcn new file mode 100644 index 0000000..6f26c65 --- /dev/null +++ b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_047.ttcn @@ -0,0 +1,31 @@ +/*************************************************** + ** @author STF T003 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// C.2.1 In addition to the general error causes in clause 16.1.2, error causes are: +// the template passed to the invalue parameter is not of type bitstring, hexstring, octetstring, charstring, universal charstring,record of, set of, or array. + +module NegSem_160102_predefined_functions_047 { + + type component GeneralComp { + } + + + testcase TC_NegSem_160102_predefined_functions_047() runs on GeneralComp { + var integer v_i; + var anytype anyType; + anyType.charstring := "abc"; + template anytype MyAnytype := anyType; + + v_i:=lengthof(MyAnytype); // error: template is an anytype + setverdict(pass); + } + + control { + execute(TC_NegSem_160102_predefined_functions_047()); + } +} \ No newline at end of file diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_048.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_048.ttcn new file mode 100644 index 0000000..ce9e5c1 --- /dev/null +++ b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_048.ttcn @@ -0,0 +1,29 @@ +/*************************************************** + ** @author STF T003 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// C4.2. In addition to the general error causes in clause 16.1.2, error causes are: +// the template passed to the invalue parameter is not of type bitstring, hexstring, octetstring, charstring, universal charstring,record of, set of, or array. + +module NegSem_160102_predefined_functions_048 { + + type component GeneralComp { + } + + + testcase TC_NegSem_160102_predefined_functions_048() runs on GeneralComp { + var universal charstring v_i; + template integer MyInt := 1; + + v_i:=substr(MyInt, 0, 1); // error: in_par template is an integer + setverdict(pass); + } + + control { + execute(TC_NegSem_160102_predefined_functions_048()); + } +} \ No newline at end of file diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_049.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_049.ttcn new file mode 100644 index 0000000..e955492 --- /dev/null +++ b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_049.ttcn @@ -0,0 +1,29 @@ +/*************************************************** + ** @author STF T003 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// C4.2. In addition to the general error causes in clause 16.1.2, error causes are: +// the template passed to the invalue parameter is not of type bitstring, hexstring, octetstring, charstring, universal charstring,record of, set of, or array. + +module NegSem_160102_predefined_functions_049 { + + type component GeneralComp { + } + + + testcase TC_NegSem_160102_predefined_functions_049() runs on GeneralComp { + var universal charstring v_i; + template float MyFloat := 1.0; + + v_i:=substr(MyFloat, 0, 1); // error: in_par template is a float + setverdict(pass); + } + + control { + execute(TC_NegSem_160102_predefined_functions_049()); + } +} \ No newline at end of file diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_050.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_050.ttcn new file mode 100644 index 0000000..8f106a0 --- /dev/null +++ b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_050.ttcn @@ -0,0 +1,29 @@ +/*************************************************** + ** @author STF T003 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// C4.2. In addition to the general error causes in clause 16.1.2, error causes are: +// the template passed to the invalue parameter is not of type bitstring, hexstring, octetstring, charstring, universal charstring,record of, set of, or array. + +module NegSem_160102_predefined_functions_050 { + + type component GeneralComp { + } + + + testcase TC_NegSem_160102_predefined_functions_050() runs on GeneralComp { + var universal charstring v_i; + template boolean MyBoolean := true; + + v_i:=substr(MyBoolean, 0, 1); // error: in_par template is a boolean + setverdict(pass); + } + + control { + execute(TC_NegSem_160102_predefined_functions_050()); + } +} \ No newline at end of file diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_051.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_051.ttcn new file mode 100644 index 0000000..1247fd5 --- /dev/null +++ b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_051.ttcn @@ -0,0 +1,29 @@ +/*************************************************** + ** @author STF T003 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// C4.2. In addition to the general error causes in clause 16.1.2, error causes are: +// the template passed to the invalue parameter is not of type bitstring, hexstring, octetstring, charstring, universal charstring,record of, set of, or array. + +module NegSem_160102_predefined_functions_051 { + + type component GeneralComp { + } + + + testcase TC_NegSem_160102_predefined_functions_051() runs on GeneralComp { + var universal charstring v_i; + template verdicttype MyVerdicttype := pass; + + v_i:=substr(MyVerdicttype, 0, 1); // error: in_par template is a verdicttype + setverdict(MyVerdicttype); + } + + control { + execute(TC_NegSem_160102_predefined_functions_051()); + } +} \ No newline at end of file diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_052.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_052.ttcn new file mode 100644 index 0000000..0a177f7 --- /dev/null +++ b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_052.ttcn @@ -0,0 +1,32 @@ +/*************************************************** + ** @author STF T003 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// C4.2. In addition to the general error causes in clause 16.1.2, error causes are: +// the template passed to the invalue parameter is not of type bitstring, hexstring, octetstring, charstring, universal charstring,record of, set of, or array. + +module NegSem_160102_predefined_functions_052 { + + type component GeneralComp { + } + + type enumerated EDays { + Monday(0), Tuesday(1), Wednesday(2), Thursday(3), Friday(4) + }; + + testcase TC_NegSem_160102_predefined_functions_052() runs on GeneralComp { + var universal charstring v_i; + template EDays MyEnum := Wednesday; + + v_i:=substr(MyEnum, 0, 1); // error: in_par template is an enum + setverdict(pass); + } + + control { + execute(TC_NegSem_160102_predefined_functions_052()); + } +} \ No newline at end of file diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_053.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_053.ttcn new file mode 100644 index 0000000..0a7807d --- /dev/null +++ b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_053.ttcn @@ -0,0 +1,34 @@ +/*************************************************** + ** @author STF T003 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// C4.2. In addition to the general error causes in clause 16.1.2, error causes are: +// the template passed to the invalue parameter is not of type bitstring, hexstring, octetstring, charstring, universal charstring,record of, set of, or array. + +module NegSem_160102_predefined_functions_053 { + + type component GeneralComp { + } + + type union unionType { + charstring chocie1, + integer choice2 + }; + + template unionType MyUnion := {chocie1 := "111"}; + + testcase TC_NegSem_160102_predefined_functions_053() runs on GeneralComp { + var universal charstring v_i; + + v_i:=substr(MyUnion, 0, 1); // error: in_par template is an union + setverdict(pass); + } + + control { + execute(TC_NegSem_160102_predefined_functions_053()); + } +} \ No newline at end of file diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_054.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_054.ttcn new file mode 100644 index 0000000..09614ad --- /dev/null +++ b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_054.ttcn @@ -0,0 +1,31 @@ +/*************************************************** + ** @author STF T003 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// C4.2. In addition to the general error causes in clause 16.1.2, error causes are: +// the template passed to the invalue parameter is not of type bitstring, hexstring, octetstring, charstring, universal charstring,record of, set of, or array. + +module NegSem_160102_predefined_functions_054 { + + type component GeneralComp { + } + + testcase TC_NegSem_160102_predefined_functions_054() runs on GeneralComp { + var universal charstring v_i; + + var anytype anyType; + anyType.charstring := "abc"; + template anytype MyAnytype := anyType; + + v_i:=substr(MyAnytype, 0, 1); // error: in_par template is an anytype + setverdict(pass); + } + + control { + execute(TC_NegSem_160102_predefined_functions_054()); + } +} \ No newline at end of file diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_055.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_055.ttcn new file mode 100644 index 0000000..910bc74 --- /dev/null +++ b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_055.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @author STF T003 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// C.2.2 In addition to the general error causes in clause 16.1.2, error causes are: +// the template passed to the inpar parameter is not of a record or set type. + +module NegSem_160102_predefined_functions_055 { + + type component GeneralComp { + } + template integer MyInt := 22; + + testcase TC_NegSem_160102_predefined_functions_055() runs on GeneralComp { + var integer v_i; + + v_i:=sizeof(MyInt); // error: template is an integer + setverdict(pass); + } + + control { + execute(TC_NegSem_160102_predefined_functions_055()); + } +} \ No newline at end of file diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_056.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_056.ttcn new file mode 100644 index 0000000..e29fe6f --- /dev/null +++ b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_056.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @author STF T003 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// C.2.2 In addition to the general error causes in clause 16.1.2, error causes are: +// the template passed to the inpar parameter is not of a record or set type. + +module NegSem_160102_predefined_functions_056 { + + type component GeneralComp { + } + template float MyFloat := 22.0; + + testcase TC_NegSem_160102_predefined_functions_056() runs on GeneralComp { + var integer v_i; + + v_i:=sizeof(MyFloat); // error: template is a float + setverdict(pass); + } + + control { + execute(TC_NegSem_160102_predefined_functions_056()); + } +} \ No newline at end of file diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_057.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_057.ttcn new file mode 100644 index 0000000..326daea --- /dev/null +++ b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_057.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @author STF T003 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// C.2.2 In addition to the general error causes in clause 16.1.2, error causes are: +// the template passed to the inpar parameter is not of a record or set type. + +module NegSem_160102_predefined_functions_057 { + + type component GeneralComp { + } + template boolean MyBoolean := true; + + testcase TC_NegSem_160102_predefined_functions_057() runs on GeneralComp { + var integer v_i; + + v_i:=sizeof(MyBoolean); // error: template is a boolean + setverdict(pass); + } + + control { + execute(TC_NegSem_160102_predefined_functions_057()); + } +} \ No newline at end of file diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_058.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_058.ttcn new file mode 100644 index 0000000..5a94498 --- /dev/null +++ b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_058.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @author STF T003 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// C.2.2 In addition to the general error causes in clause 16.1.2, error causes are: +// the template passed to the inpar parameter is not of a record or set type. + +module NegSem_160102_predefined_functions_058 { + + type component GeneralComp { + } + template verdicttype MyVerdict := pass; + + testcase TC_NegSem_160102_predefined_functions_058() runs on GeneralComp { + var integer v_i; + + v_i:=sizeof(MyVerdict); // error: template is a verdicttype + setverdict(pass); + } + + control { + execute(TC_NegSem_160102_predefined_functions_058()); + } +} \ No newline at end of file diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_059.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_059.ttcn new file mode 100644 index 0000000..8de20f7 --- /dev/null +++ b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_059.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF T003 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// C.2.2 In addition to the general error causes in clause 16.1.2, error causes are: +// the template passed to the inpar parameter is not of a record or set type. + +module NegSem_160102_predefined_functions_059 { + + type component GeneralComp { + } + + type enumerated EDays { + Monday(0), Tuesday(1), Wednesday(2), Thursday(3), Friday(4) + }; + + template EDays MyEnum := Monday; + + testcase TC_NegSem_160102_predefined_functions_059() runs on GeneralComp { + var integer v_i; + + v_i:=sizeof(MyEnum); // error: template is an enum + setverdict(pass); + } + + control { + execute(TC_NegSem_160102_predefined_functions_059()); + } +} \ No newline at end of file diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_060.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_060.ttcn new file mode 100644 index 0000000..c78892f --- /dev/null +++ b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_060.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF T003 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// C.2.2 In addition to the general error causes in clause 16.1.2, error causes are: +// the template passed to the inpar parameter is not of a record or set type. + +module NegSem_160102_predefined_functions_060 { + + type component GeneralComp { + } + + type union unionType { + charstring chocie1, + integer choice2}; + + template unionType MyUnion := {chocie1 := "111"}; + + testcase TC_NegSem_160102_predefined_functions_060() runs on GeneralComp { + var integer v_i; + + v_i:=sizeof(MyUnion); // error: template is an union + setverdict(pass); + } + + control { + execute(TC_NegSem_160102_predefined_functions_060()); + } +} \ No newline at end of file diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_061.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_061.ttcn new file mode 100644 index 0000000..107c405 --- /dev/null +++ b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_061.ttcn @@ -0,0 +1,30 @@ +/*************************************************** + ** @author STF T003 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// C.2.2 In addition to the general error causes in clause 16.1.2, error causes are: +// the template passed to the inpar parameter is not of a record or set type. +module NegSem_160102_predefined_functions_061 { + + type component GeneralComp { + } + + + testcase TC_NegSem_160102_predefined_functions_061() runs on GeneralComp { + var integer v_i; + var anytype anyType; + anyType.charstring := "abc"; + template anytype MyAnytype := anyType; + + v_i:=sizeof(MyAnytype); // error: template is an anytype + setverdict(pass); + } + + control { + execute(TC_NegSem_160102_predefined_functions_061()); + } +} \ No newline at end of file diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_062.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_062.ttcn new file mode 100644 index 0000000..6c06745 --- /dev/null +++ b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_062.ttcn @@ -0,0 +1,32 @@ +/*************************************************** + ** @author STF T003 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// C.2.2 In addition to the general error causes in clause 16.1.2, error causes are: +// the template passed to the inpar parameter is not of a record or set type. + +module NegSem_160102_predefined_functions_062 { + + type component GeneralComp { + } + + + type record of integer MyROItype; + + template MyROItype MyROI := {1,2,3}; + + testcase TC_NegSem_160102_predefined_functions_062() runs on GeneralComp { + var integer v_i; + + v_i:=sizeof(MyROI); // error: template is a record of integers + setverdict(pass, v_i); + } + + control { + execute(TC_NegSem_160102_predefined_functions_062()); + } +} \ No newline at end of file diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_063.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_063.ttcn new file mode 100644 index 0000000..7fa7af5 --- /dev/null +++ b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_063.ttcn @@ -0,0 +1,32 @@ +/*************************************************** + ** @author STF T003 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// C.2.2 In addition to the general error causes in clause 16.1.2, error causes are: +// the template passed to the inpar parameter is not of a record or set type. + +module NegSem_160102_predefined_functions_063 { + + type component GeneralComp { + } + + + type set of integer MySOItype; + + template MySOItype MySOI := {1,2,3}; + + testcase TC_NegSem_160102_predefined_functions_063() runs on GeneralComp { + var integer v_i; + + v_i:=sizeof(MySOI); // error: template is a set of integers + setverdict(pass, v_i); + } + + control { + execute(TC_NegSem_160102_predefined_functions_063()); + } +} \ No newline at end of file diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_026.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_026.ttcn old mode 100755 new mode 100644 diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_027.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_027.ttcn old mode 100755 new mode 100644 diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_028.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_028.ttcn old mode 100755 new mode 100644 diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_029.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_029.ttcn old mode 100755 new mode 100644 diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_034.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_034.ttcn old mode 100755 new mode 100644 diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_035.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_035.ttcn old mode 100755 new mode 100644 diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_036.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_036.ttcn old mode 100755 new mode 100644 diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_037.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_037.ttcn old mode 100755 new mode 100644 diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_042.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_042.ttcn old mode 100755 new mode 100644 diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_043.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_043.ttcn old mode 100755 new mode 100644 diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_044.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_044.ttcn old mode 100755 new mode 100644 diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_045.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_045.ttcn old mode 100755 new mode 100644 diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_046.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_046.ttcn index f6380b0..7fcdf9e 100755 --- a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_046.ttcn +++ b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_046.ttcn @@ -1,5 +1,5 @@ /*************************************************** - ** @author STF 487 (updated by STF 521) + ** @author STF 487 (updated by STF 521 and TTF T014) ** @version 0.0.2 ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) ** @verdict pass accept, ttcn3verdict:pass @@ -22,7 +22,7 @@ module Sem_160102_predefined_functions_046 { testcase TC_Sem_160102_predefined_functions_046 () runs on GeneralComp { - template MyRec v_4 := {1,false,-}; // record containing integer, boolean and optional elements + var template MyRec v_4 := {1,false,-}; // record containing integer, boolean and optional elements // record containing integer, boolean and optional elements // NOTE: different tools might use different whitespace formats if(match(any2unistr(v_4), pattern "\s#(){\s#()field1\s#():=\s#()1\s#(),\s#()field2\s#():=\s#()false\s#(),\s#()field3\s#():=\s#()((UNINITIALIZED)|\-)\s#()}\s#()" )) { diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_047.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_047.ttcn old mode 100755 new mode 100644 diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_048.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_048.ttcn old mode 100755 new mode 100644 diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_049.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_049.ttcn old mode 100755 new mode 100644 diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_050.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_050.ttcn old mode 100755 new mode 100644 diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_051.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_051.ttcn old mode 100755 new mode 100644 diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_052.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_052.ttcn old mode 100755 new mode 100644 diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_053.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_053.ttcn old mode 100755 new mode 100644 diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_054.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_054.ttcn old mode 100755 new mode 100644 diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_055.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_055.ttcn old mode 100755 new mode 100644 diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_056.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_056.ttcn old mode 100755 new mode 100644 diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_057.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_057.ttcn old mode 100755 new mode 100644 diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_058.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_058.ttcn old mode 100755 new mode 100644 diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_059.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_059.ttcn old mode 100755 new mode 100644 diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_060.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_060.ttcn old mode 100755 new mode 100644 diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_061.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_061.ttcn old mode 100755 new mode 100644 diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_063.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_063.ttcn old mode 100755 new mode 100644 diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_064.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_064.ttcn old mode 100755 new mode 100644 diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_065.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_065.ttcn old mode 100755 new mode 100644 diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_066.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_066.ttcn old mode 100755 new mode 100644 diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_067.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_067.ttcn old mode 100755 new mode 100644 diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_068.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_068.ttcn old mode 100755 new mode 100644 diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_069.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_069.ttcn old mode 100755 new mode 100644 diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_070.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_070.ttcn old mode 100755 new mode 100644 diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_071.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_071.ttcn old mode 100755 new mode 100644 diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_072.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_072.ttcn old mode 100755 new mode 100644 diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_073.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_073.ttcn old mode 100755 new mode 100644 diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_074.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_074.ttcn old mode 100755 new mode 100644 diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_075.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_075.ttcn old mode 100755 new mode 100644 diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_076.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_076.ttcn old mode 100755 new mode 100644 diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_077.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_077.ttcn old mode 100755 new mode 100644 diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_078.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_078.ttcn old mode 100755 new mode 100644 diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_079.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_079.ttcn old mode 100755 new mode 100644 diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_080.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_080.ttcn old mode 100755 new mode 100644 diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_081.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_081.ttcn old mode 100755 new mode 100644 diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_082.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_082.ttcn old mode 100755 new mode 100644 diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_090.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_090.ttcn old mode 100755 new mode 100644 diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_091.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_091.ttcn old mode 100755 new mode 100644 diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_092.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_092.ttcn old mode 100755 new mode 100644 diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_100.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_100.ttcn index 8fea3c0..dd50fa8 100644 --- a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_100.ttcn +++ b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_100.ttcn @@ -1,6 +1,6 @@ /*************************************************** - ** @author STF 521 - ** @version 0.0.1 + ** @author STF 521, updated by STF 572 + ** @version 0.0.2 ** @purpose 1:16.1.2, Ensure that predefined encvalue_unichar function works properly in case of encoding universal charstring ** @verdict pass accept, ttcn3verdict:pass @@ -25,7 +25,7 @@ module Sem_160102_predefined_functions_100 { var universal charstring v_test_enc_8 := encvalue_unichar(v_test,"UTF-8", "encoding_info_text"); //encode to universal charstring UTF-8 //Decoding: - var integer v_test_dec; + var charstring v_test_dec; var integer v_res:= decvalue_unichar(v_test_enc_8,v_test_dec,"UTF-8", "encoding_info_text"); //decode (UTF-8) if (v_res == 0) { diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_101.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_101.ttcn index cfedb69..a2c88d2 100644 --- a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_101.ttcn +++ b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_101.ttcn @@ -1,34 +1,44 @@ /*************************************************** - ** @author STF 548 + ** @author STF 548 ** @version 0.0.1 - ** @purpose 1:16.1.2, Verify that the encvalue function supports the dynamic_encoding parameter - ** @verdict pass accept, noexecution + ** @purpose 1:16.1.2, Ensure that predefined 'encvalue_o' function works properly in case of encoding to octetstring + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ -// The following requirements are tested: -// The optional dynamic_encoding parameter is used for dynamic selection of encode -// attribute of the inpar value for this single encvalue call. The rules for dynamic -// selection of the encode attribute are described in clause 27.9. -// NOTE: the test is not executed as it would require dedicated codec support +/* The following requirements are tested: +The encvalue_o function encodes a value or template into an octetstring. When the actual parameter that is passed +to inpar is a template, it shall resolve to a specific value. +- C.5.5 The encoding to octetstring function +*/ + module Sem_160102_predefined_functions_101 { + + type component GeneralComp { - type component GeneralComp { - } - - type integer I with { - encode "Codec 1"; - encode "Codec 2" - }; + } testcase TC_Sem_160102_predefined_functions_101 () runs on GeneralComp { - var template I v_test := 0; - var bitstring v_res := encvalue(v_test, -, "Codec 1"); - setverdict(pass); + + var integer v_int := 10 with { variant "32 bit" }; + var octetstring v_ref := '0A000000'O; // expected encoded value + + //Encoding: + var octetstring v_enc := encvalue_o(v_int); //encode to octetstring + + if (match(v_enc, v_ref)) { + setverdict(pass); + } else { + setverdict(fail,v_enc, v_ref); } - //control{ - // execute(TC_Sem_160102_predefined_functions_101()); - //} + } + + control{ + + execute(TC_Sem_160102_predefined_functions_101()); + + } } \ No newline at end of file diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_102.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_102.ttcn index 2877b29..c817a46 100644 --- a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_102.ttcn +++ b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_102.ttcn @@ -1,33 +1,44 @@ /*************************************************** - ** @author STF 548 + ** @author STF 548 ** @version 0.0.1 - ** @purpose 1:16.1.2, Verify that the dynamic_encoding parameter of the encvalue function can be explicitly skipped - ** @verdict pass accept, noexecution + ** @purpose 1:16.1.2, Ensure that predefined 'encvalue_o' function works properly in case of encoding to octetstring + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ -// The following requirements are tested: -// The optional dynamic_encoding parameter is used for dynamic selection of encode -// attribute of the inpar value for this single encvalue call. The rules for dynamic -// selection of the encode attribute are described in clause 27.9. + +/* The following requirements are tested: +The optional encoding_info parameter is used for passing additional encoding +information to the codec and, if it is omitted, no additional information is sent to the codec. +- C.5.5 The encoding to octetstring function +*/ + module Sem_160102_predefined_functions_102 { + + type component GeneralComp { - type component GeneralComp { - } - - type integer I with { variant "32 bit"}; + } testcase TC_Sem_160102_predefined_functions_102 () runs on GeneralComp { - var template I v_test := 0; - var bitstring v_res := encvalue(v_test, "encoding_info_text", -); - if (lengthof(v_res) == 32) { - setverdict(pass,v_res); - } else { - setverdict(fail, "Invalid encoding length"); - } + + var integer v_int := 10 with { variant "32 bit" }; + var octetstring v_ref := '0A000000'O ; // expected encoding + + //Encoding: + var octetstring v_enc := encvalue_o(v_int, "encoding information"); //encode to octetstring + + if (match(v_enc, v_ref)) { + setverdict(pass); + } else { + setverdict(fail,v_enc, v_ref); } + } + control{ + execute(TC_Sem_160102_predefined_functions_102()); + } } \ No newline at end of file diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_103.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_103.ttcn index 6d13d50..4872bbf 100644 --- a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_103.ttcn +++ b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_103.ttcn @@ -1,35 +1,44 @@ /*************************************************** - ** @author STF 548 + ** @author STF 548 ** @version 0.0.1 - ** @purpose 1:16.1.2, Verify that the decvalue function supports the dynamic_encoding parameter - ** @verdict pass accept, noexecution + ** @purpose 1:16.1.2, Ensure that predefined 'encvalue_o' function works properly in case of encoding a variable to octetstring + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ -// The following requirements are tested: -// The optional dynamic_encoding parameter is used for dynamic selection of encode -// attribute of the decoded_value parameter for this single decvalue call. The rules -// for dynamic selection of the encode attribute are described in clause 27.9. -// NOTE: the test is not executed as it would require dedicated codec support +/* The following requirements are tested: +The encvalue_o function encodes a value or template into an octetstring. When the actual parameter that is passed +to inpar is a template, it shall resolve to a specific value. +- C.5.5 The encoding to octetstring function +*/ + module Sem_160102_predefined_functions_103 { + + type integer MyInt with { variant "32 bit" }; + type component GeneralComp { - type component GeneralComp { - } - - type integer I with { - encode "Codec 1"; - encode "Codec 2" - }; + } testcase TC_Sem_160102_predefined_functions_103 () runs on GeneralComp { - var template I v_target := 0; - var bitstring v_src := oct2bit('00000000'O); - decvalue(v_src, v_target, -, "Codec 1"); - setverdict(pass); + + var octetstring v_ref := '0A000000'O; // expected encoding + + //Encoding: + var octetstring v_enc := encvalue_o(MyInt:10); //encode to universal charstring to octetstring + + if (match(v_enc, v_ref)) { + setverdict(pass); + } else { + setverdict(fail,v_enc, v_ref); } - //control{ - // execute(TC_Sem_160102_predefined_functions_103()); - //} + } + + control{ + + execute(TC_Sem_160102_predefined_functions_103()); + + } } \ No newline at end of file diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_104.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_104.ttcn index cb5c3a7..3b57971 100644 --- a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_104.ttcn +++ b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_104.ttcn @@ -1,34 +1,50 @@ /*************************************************** - ** @author STF 548 + ** @author STF 548 ** @version 0.0.1 - ** @purpose 1:16.1.2, Verify that the dynamic_encoding parameter of the decvalue function can be explicitly skipped - ** @verdict pass accept, noexecution + ** @purpose 1:16.1.2, Ensure that predefined 'encvalue_o' function works properly in case of encoding a variable to octetstring + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ -// The following requirements are tested: -// The optional dynamic_encoding parameter is used for dynamic selection of encode -// attribute of the decoded_value parameter for this single decvalue call. The rules -// for dynamic selection of the encode attribute are described in clause 27.9. + +/* The following requirements are tested: +The encvalue_o function encodes a value or template into an octetstring. When the actual parameter that is passed +to inpar is a template, it shall resolve to a specific value. +- C.5.5 The encoding to octetstring function +*/ + module Sem_160102_predefined_functions_104 { + + type component GeneralComp { - type component GeneralComp { - } - - type integer I with { variant "32 bit"}; + } + + type record MyPDU { + charstring field1 optional, + integer field2 + }; + + testcase TC_Sem_160102_predefined_functions_104 () runs on GeneralComp { - var template I v_target := 0; - var bitstring v_src := oct2bit('00000000'O); - var integer v_res := decvalue(v_src, v_target, "encoding_info_text", -); - if (v_res == 0) { - setverdict(pass, "Decoded value is: ", v_target); - } else { - setverdict(fail, "Invalid encoding length"); - } + + var template MyPDU v_temp := { "test",5}; + + //Encoding: + var octetstring v_enc := encvalue_o(v_temp); //encode the record to octetstring + + if (lengthof (v_enc) > 0) { + setverdict(pass); + } else { + setverdict(fail,v_enc); } + } + control{ + execute(TC_Sem_160102_predefined_functions_104()); + } } \ No newline at end of file diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_105.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_105.ttcn index f72be60..8c8f815 100644 --- a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_105.ttcn +++ b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_105.ttcn @@ -1,34 +1,43 @@ /*************************************************** - ** @author STF 548 + ** @author STF 548 ** @version 0.0.1 - ** @purpose 1:16.1.2, Verify that the encvalue_unichar function supports the dynamic_encoding parameter - ** @verdict pass accept, noexecution + ** @purpose 1:16.1.2, Ensure that predefined 'decvalue_o' function works properly in case of decoding an octetstring + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ -// The following requirements are tested: -// The optional dynamic_encoding parameter is used for dynamic selection of encode -// attribute of the inpar value for this single encvalue_unichar call. The rules for -// dynamic selection of the encode attribute are described in clause 27.9. -// NOTE: the test is not executed as it would require dedicated codec support +/* The following requirements are tested: +The decvalue_o function decodes an octetstring into a value. The test system shall suppose that the octetstring +encoded_value represents an encoded instance of the actual type of decoded_value. +- C.5.6 The decoding from octetstring function +*/ -module Sem_160102_predefined_functions_105 { - type component GeneralComp { - } - - type integer I with { - encode "Codec 1"; - encode "Codec 2" - }; +module Sem_160102_predefined_functions_105 { + + type component GeneralComp {} + type integer MyType with { variant "32 bit" } testcase TC_Sem_160102_predefined_functions_105 () runs on GeneralComp { - var template I v_test := 0; - var universal charstring v_res := encvalue_unichar(v_test, -, "Codec 1"); - setverdict(pass); + + var octetstring v_ref := '0A000000'O; // encoded value + + //Decoding: + var MyType v_dec; + var integer v_res := decvalue_o(v_ref, v_dec); // decode octetstream to integer + + if (match(v_res, 0) and match(v_dec, 10)) { + // successful decoding + setverdict(pass); + } else { + setverdict(fail,v_res); } - //control{ - // execute(TC_Sem_160102_predefined_functions_105()); - //} + } + + control{ + execute(TC_Sem_160102_predefined_functions_105()); + + } } \ No newline at end of file diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_106.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_106.ttcn index c20d41a..12e3e88 100644 --- a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_106.ttcn +++ b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_106.ttcn @@ -1,33 +1,43 @@ /*************************************************** - ** @author STF 548 + ** @author STF 548 ** @version 0.0.1 - ** @purpose 1:16.1.2, Verify that the dynamic_encoding parameter of the encvalue_unichar function can be explicitly skipped - ** @verdict pass accept, noexecution + ** @purpose 1:16.1.2, Ensure that predefined 'decvalue_o' function works properly in case of decoding an octetstring + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ -// The following requirements are tested: -// The optional dynamic_encoding parameter is used for dynamic selection of encode -// attribute of the inpar value for this single encvalue_unichar call. The rules for -// dynamic selection of the encode attribute are described in clause 27.9. -module Sem_160102_predefined_functions_106 { +/* The following requirements are tested: +The function shall return an integer value to indicate success or failure of the decoding below: +The return value 1 indicates an unspecified cause of decoding failure. This value is also returned if the +encoded_value parameter contains an unitialized value. +- C.5.6 The decoding from octetstring function +*/ - type component GeneralComp { - } - - type integer I with { variant "32 bit"}; + +module Sem_160102_predefined_functions_106 { + + type component GeneralComp {} testcase TC_Sem_160102_predefined_functions_106 () runs on GeneralComp { - var template I v_test := 100; - var universal charstring v_res := encvalue_unichar(v_test, "UTF-32LE", "encoding_info_text", -); - if (v_res == "d") { - setverdict(pass); - } else { - setverdict(fail, "Invalid encoding result"); - } + + var octetstring v_ref := ''O; // cannot decode this octetstring + + //Decoding: + var charstring v_dec; + var integer v_res := decvalue_o(v_ref, v_dec); // return value 1 indicates an unspecified cause of decoding failure + + if (match(v_res, 1)) { + // encoded_value parameter contains an unitialized value. + setverdict(pass); + } else { + setverdict(fail,v_res); } + } + control{ execute(TC_Sem_160102_predefined_functions_106()); + } } \ No newline at end of file diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_107.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_107.ttcn index 1cc78eb..83e5a81 100644 --- a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_107.ttcn +++ b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_107.ttcn @@ -1,35 +1,51 @@ /*************************************************** - ** @author STF 548 + ** @author STF 548 ** @version 0.0.1 - ** @purpose 1:16.1.2, Verify that the decvalue_unichar function supports the dynamic_encoding parameter - ** @verdict pass accept, noexecution + ** @purpose 1:16.1.2, Ensure that predefined 'decvalue_o' function works properly in case of decoding an octetstring + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ -// The following requirements are tested: -// The optional dynamic_encoding parameter is used for dynamic selection of encode -// attribute of the decoded_value parameter for this single decvalue_unichar call. -// The rules for dynamic selection of the encode attribute are described in clause 27.9. -// NOTE: the test is not executed as it would require dedicated codec support +/* The following requirements are tested: +The return value 2 indicates that decoding could not be completed as encoded_value did not contain +enough octets. +- C.5.6 The decoding from octetstring function +*/ -module Sem_160102_predefined_functions_107 { - type component GeneralComp { - } - - type integer I with { - encode "Codec 1"; - encode "Codec 2" - }; +module Sem_160102_predefined_functions_107 { + + type component GeneralComp {} + + type record MyPDU { + charstring field1 optional, + integer field2 + }; testcase TC_Sem_160102_predefined_functions_107 () runs on GeneralComp { - var template I v_target := 0; - var universal charstring v_src := "d"; - decvalue_unichar(v_src, v_target, "UTF-32LE", -, "Codec 1"); - setverdict(pass); + + var integer v_dec with { variant "32 bit" }; + var integer v_res; + var template MyPDU v_temp := {"testText",5}; + var octetstring v_ref := encvalue_o(v_temp); + //log(v_ref); //'74657374546578740005000000'O + v_ref := v_ref[1]; // trunk encoded octetstring + + //Decoding: + v_res := decvalue_o(v_ref, v_dec); // try to decode octetstream + + if (match(v_res, 2)) { + // octetstring encoded_value did not contain enough octets. + setverdict(pass); + } else { + setverdict(fail,v_res,v_ref); } - //control{ - // execute(TC_Sem_160102_predefined_functions_107()); - //} + } + + control{ + execute(TC_Sem_160102_predefined_functions_107()); + + } } \ No newline at end of file diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_108.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_108.ttcn index a4c0d03..059ba90 100644 --- a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_108.ttcn +++ b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_108.ttcn @@ -1,34 +1,41 @@ /*************************************************** - ** @author STF 548 + ** @author STF 572 (updated by TTF T014) ** @version 0.0.1 - ** @purpose 1:16.1.2, Verify that the dynamic_encoding parameter of the decvalue_unichar function can be explicitly skipped - ** @verdict pass accept, noexecution + ** @purpose 1:16.1.2, Ensure that the IUT recognizes any2unistr predefined functions with format "canonical" + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ -// The following requirements are tested: -// The optional dynamic_encoding parameter is used for dynamic selection of encode -// attribute of the decoded_value parameter for this single decvalue_unichar call. -// The rules for dynamic selection of the encode attribute are described in clause 27.9. -module Sem_160102_predefined_functions_108 { +/* The following requirements are tested: + C.1.33: When the optional format parameter takes the value "canonical": unbound fields are represented in the + output as "-", the fields and members of structured types are represented recursively in assignment notation. +*/ - type component GeneralComp { - } - - type integer I with { variant "32 bit"}; - testcase TC_Sem_160102_predefined_functions_108 () runs on GeneralComp { - var template I v_target := 0; - var universal charstring v_src := "d"; - var integer v_res := decvalue_unichar(v_src, v_target, "UTF-32LE", "encoding_info_text", -); - if (v_res == 0) { - setverdict(pass, "Decoded value is: ", v_target); - } else { - setverdict(fail, "Invalid encoding length"); - } +module Sem_160102_predefined_functions_108 { + + type record MyRec { + integer field1, + boolean field2, + integer field3 optional + }; + type component GeneralComp { } + testcase TC_Sem_160102_predefined_functions_108 () runs on GeneralComp { + + var template MyRec v_4 := {1,false,-}; + + if(match(any2unistr(v_4, "canonical"), pattern "\s#(,)\{\s#(,)field1\s#(,):=\s#(,)1\s#(,)\,\s#(,)field2\s#(,):=\s#(,)false\s#(,)\,\s#(,)field3\s#(,):=\s#(,)(\-)\s#(,)\}\s#(,)")) { + setverdict(pass,"Result: ",any2unistr(v_4)); + } else { + setverdict(fail,"Result is: ",any2unistr(v_4), " Expected:{ field1 := 1, field2 := false, field3 := UNINITIALIZED }"); + } + } + control{ execute(TC_Sem_160102_predefined_functions_108()); + } -} \ No newline at end of file +} diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_109.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_109.ttcn new file mode 100644 index 0000000..1add4ad --- /dev/null +++ b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_109.ttcn @@ -0,0 +1,41 @@ +/*************************************************** + ** @author STF 572 (updated by TTF T014) + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes any2unistr predefined functions with format "canonical" + ** @verdict pass accept, ttcn3verdict:pass + + ***************************************************/ + +/* The following requirements are tested: + C.1.33: If the actual value of the format parameter is different from the empty string and "canonical", the format of the result +produced by the function is either tool-specific if the tool supports the specified custom format or it is the same as the +string produced by the log operation (i.e. the same as if the parameter value was the empty string). +*/ + +module Sem_160102_predefined_functions_109 { + + type record MyRec { + integer field1, + boolean field2, + integer field3 optional + }; + type component GeneralComp { + } + + testcase TC_Sem_160102_predefined_functions_109 () runs on GeneralComp { + + var template MyRec v_4 := {1,false,-}; + + if(match(any2unistr(v_4, "SometingElse"), pattern "\s#(,)\{\s#(,)field1\s#(,):=\s#(,)1\s#(,)\,\s#(,)field2\s#(,):=\s#(,)false\s#(,)\,\s#(,)field3\s#(,):=\s#(,)(\-)\s#(,)\}\s#(,)" )) { + setverdict(pass,"Result: ",any2unistr(v_4)); + } else { + setverdict(fail,"Result is: ",any2unistr(v_4), " Expected:{ field1 := 1, field2 := false, field3 := UNINITIALIZED }"); + } + } + + control{ + execute(TC_Sem_160102_predefined_functions_109()); + + } + +} diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_110.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_110.ttcn new file mode 100644 index 0000000..e067417 --- /dev/null +++ b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_110.ttcn @@ -0,0 +1,51 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that predefined 'encvalue_o' function works properly in case of encoding a variable to octetstring + ** @verdict pass accept, ttcn3verdict:pass + + ***************************************************/ + +/* The following requirements are tested: + +- C.5.5 The encoding to octetstring function + * In case the encoded message is not octet-based and has a bit length not divisable by +8, the encoded message will be left-aligned in the returned octetstring and the least significant (8 - (bit length mod 8)) +bits in the least significant octet will be 0. The bit length can be assigned to a variable by usage of the formal out +parameter bit_length. +*/ + + +module Sem_160102_predefined_functions_110 { + + type component GeneralComp { + + } + + type bitstring MyPDU; + + + + testcase TC_Sem_160102_predefined_functions_110 () runs on GeneralComp { + + var MyPDU v_bitstr := '011'B; + var octetstring result := '0300000060'O; // bit length not divisable by 8, the encoded message will be left-aligned in the returned octetstring and the least significant (8 - (bit length mod 8)) bits in the least significant octet will be 0. + + //Encoding: + var octetstring v_enc := encvalue_o(v_bitstr); //encode the non octet based bitstring to octetstring + + if (lengthof (v_enc) > 0 and match(v_enc,result)) { + setverdict(pass); + } else { + setverdict(fail,v_enc); + } + + } + + control{ + + execute(TC_Sem_160102_predefined_functions_110()); + + } + +} \ No newline at end of file diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_111.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_111.ttcn new file mode 100644 index 0000000..7c06538 --- /dev/null +++ b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_111.ttcn @@ -0,0 +1,43 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that predefined 'encvalue_o' function works properly in case of encoding a variable to octetstring + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +/* The following requirements are tested: +- C.5.5 The encoding to octetstring function +* The optional dynamic_encoding parameter is used for dynamic selection of encode attribute of the inpar value for this single encvalue_o call. +*/ + +module Sem_160102_predefined_functions_111 { + + type component GeneralComp { + + } + + type record MyPDU{ + charstring a1 + }with { encode "PayloadCodec1" }; + + + + testcase TC_Sem_160102_predefined_functions_111 () runs on GeneralComp { + + var MyPDU v_rec := {a1 := "abcd"}; + + //Encoding: + var octetstring v_enc := encvalue_o(v_rec, "PayloadCodec1" ); + if (lengthof (v_enc) > 0) { + setverdict(pass, v_enc); + } else { + setverdict(fail,v_enc); + } + + } + + control{ + execute(TC_Sem_160102_predefined_functions_111()); + } + +} \ No newline at end of file diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_112.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_112.ttcn new file mode 100644 index 0000000..c54c84d --- /dev/null +++ b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_112.ttcn @@ -0,0 +1,49 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that predefined 'decvalue_o' function works properly in case of encoding a variable to octetstring + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +/* The following requirements are tested: + * The optional dynamic_encoding parameter is used for dynamic selection of encode attribute of the +decoded_value parameter for this single decvalue_o call. The rules for dynamic selection of the encode +attribute are described in clause 27.9. + * */ + +module Sem_160102_predefined_functions_112 { + + type component GeneralComp { + + } + + type record MyPDU{ + charstring a1 + }with { encode "PayloadCodec1" }; + + + + testcase TC_Sem_160102_predefined_functions_112 () runs on GeneralComp { + + var MyPDU v_rec := {a1 := "abcd"}; + var MyPDU v_dec; + var integer v_res; + + // Encoding: + var octetstring v_enc := encvalue_o(v_rec, "PayloadCodec1" ); + + // Decoding: + v_res := decvalue_o(v_enc, v_dec, "PayloadCodec1"); // try to decode octetstream + if (v_res == 0 and match(v_dec,v_rec)) { + setverdict(pass); + } else { + setverdict(fail,v_enc); + } + + } + + control{ + execute(TC_Sem_160102_predefined_functions_112()); + } + +} \ No newline at end of file diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_113.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_113.ttcn new file mode 100644 index 0000000..8af4c67 --- /dev/null +++ b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_113.ttcn @@ -0,0 +1,38 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +/* The following requirements are tested: + * When used on templates of character string types, specific value patterns that contain literal characters and the following metacharacters: "?", "*" + * are allowed in inpar and the function shall return the character representation of the matching mechanisms. + * */ + + +module Sem_160102_predefined_functions_113 { + + type component GeneralComp {} + + type universal charstring MyCharStringType; + + + testcase TC_Sem_160102_predefined_functions_113 () runs on GeneralComp { + + template(present) MyCharStringType v_template := pattern "a?"; + var MyCharStringType v_res; + v_res := substr(v_template,1,1); //expected result: "?" + + if( match(v_res,"?") ) { + setverdict(pass,v_res); + } else { + setverdict(fail,"The value of v_res:",v_res); + } + } + + control{ + execute(TC_Sem_160102_predefined_functions_113()); + } + +} \ No newline at end of file diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_114.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_114.ttcn new file mode 100644 index 0000000..24a5cd1 --- /dev/null +++ b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_114.ttcn @@ -0,0 +1,38 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +/* The following requirements are tested: + * When used on templates of character string types, specific value patterns that contain literal characters and the following metacharacters: "?", "*" + * are allowed in inpar and the function shall return the character representation of the matching mechanisms. + * */ + + +module Sem_160102_predefined_functions_114 { + + type component GeneralComp {} + + type universal charstring MyCharStringType; + + + testcase TC_Sem_160102_predefined_functions_114 () runs on GeneralComp { + + template MyCharStringType v_template := pattern "c*"; + var MyCharStringType v_res; + v_res := substr(v_template,1,1); //expected result: "*" + + if( match(v_res,"*") ) { + setverdict(pass,v_res); + } else { + setverdict(fail,"The value of v_res:",v_res); + } + } + + control{ + execute(TC_Sem_160102_predefined_functions_114()); + } + +} \ No newline at end of file diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_115.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_115.ttcn new file mode 100644 index 0000000..149737e --- /dev/null +++ b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_115.ttcn @@ -0,0 +1,39 @@ +/*************************************************** + ** @author STF T003 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +/* The following requirements are tested: + *16.1.2 Restriction a.3: + * any parameters of the functions lengthof may be partially initialized; */ + + +module Sem_160102_predefined_functions_115 { + + type component GeneralComp {} + + type record of integer RoI; + + + testcase TC_Sem_160102_predefined_functions_115 () runs on GeneralComp { + + var RoI v_Rec1; + var integer v_res; + + v_Rec1 :={-,0,-,2}; //partially initialized record of integers + v_res := lengthof(v_Rec1); //expected result: 4 + + if(v_res == 4) { + setverdict(pass,v_res); + } else { + setverdict(fail,"The value of v_res:",v_res); + } + } + + control{ + execute(TC_Sem_160102_predefined_functions_115()); + } + +} \ No newline at end of file diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_116.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_116.ttcn new file mode 100644 index 0000000..5f0f513 --- /dev/null +++ b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_116.ttcn @@ -0,0 +1,41 @@ +/*************************************************** + ** @author STF T003 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +/* The following requirements are tested: + *16.1.2 Restriction a.3: + * any parameters of the functions lengthof may be partially initialized; */ + + +module Sem_160102_predefined_functions_116 { + + type component GeneralComp {} + + type record of integer RoI; + + + testcase TC_Sem_160102_predefined_functions_116 () runs on GeneralComp { + + var RoI v_Rec1; + var RoI v_res; + var RoI v_expected; + + v_Rec1 := {-,0,-,2}; //partially initialized record of integers + v_res := replace(v_Rec1,0,1,{23}); + v_expected := {23,0,-,2}; + + if(match(v_res, v_expected)) { + setverdict(pass,v_res); + } else { + setverdict(fail,"The value of v_res:",v_res); + } + } + + control{ + execute(TC_Sem_160102_predefined_functions_116()); + } + +} \ No newline at end of file diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_117.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_117.ttcn new file mode 100644 index 0000000..de41268 --- /dev/null +++ b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_117.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF T014 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the actual parameter of the lengthof function can be a map + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// (C.2.1) For values of the map type, the fuction returns the number of key value pairs in the map. + +module Sem_160102_predefined_functions_117 { + + type component GeneralComp { + } + type map from charstring to integer TMap; + + testcase TC_Sem_160102_predefined_functions_117() runs on GeneralComp { + var TMap v_map := { + ["blue"] := 1, + ["black"] := 2, + ["white"] := 3 + }; + if (lengthof(v_map) == 3) { + setverdict(pass); + } else { + setverdict(fail, "Invalid length value"); + } + } + + control { + execute(TC_Sem_160102_predefined_functions_117()); + } +} \ No newline at end of file diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_118.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_118.ttcn new file mode 100644 index 0000000..fb7bf2c --- /dev/null +++ b/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_118.ttcn @@ -0,0 +1,49 @@ +/*************************************************** + ** @author STF 433, modified by TTF 014 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Verify that enum2int works correctly with typed enumerated items + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_160102_predefined_functions_118 { + type enumerated EnumeratedType {e_black, e_white}; + type enumerated EnumeratedTypeWithLabels1 {e_black (1), e_white}; + type enumerated EnumeratedTypeWithLabels2 {e_black (-1), e_white}; + type enumerated EnumeratedTypeWithLabels3 {e_black (-1), e_white , e_yellow (0) }; + type enumerated Fruits {e_apple, e_peach, e_cherry}; + +type component GeneralComp { +} + + +testcase TC_Sem_160102_predefined_functions_118 () runs on GeneralComp { + + var EnumeratedType vl_enum_black := e_black; + var EnumeratedType vl_enum_white := e_white; + var EnumeratedTypeWithLabels1 vl_enum1_black := e_black; + var EnumeratedTypeWithLabels1 vl_enum1_white := e_white; + var EnumeratedTypeWithLabels2 vl_enum2_black := e_black; + var EnumeratedTypeWithLabels2 vl_enum2_white := e_white; + var EnumeratedTypeWithLabels3 vl_enum3_black := e_black; + var EnumeratedTypeWithLabels3 vl_enum3_white := e_white; + var EnumeratedTypeWithLabels3 vl_enum3_yellow := e_yellow; + + + if( match(enum2int(EnumeratedTypeWithLabels1.e_black), 1) // EnumeratedTypeWithLabels1.e_black resolves to 1; please note that the type prefix was not available in older TTCN-3 versions + ) { + setverdict(pass); + } + else { + setverdict(fail); + } + + +} + + +control{ + + execute(TC_Sem_160102_predefined_functions_118()); + +} + +} diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160103_external_functions/Sem_160103_external_functions_003.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160103_external_functions/Sem_160103_external_functions_003.ttcn new file mode 100644 index 0000000..f7f964f --- /dev/null +++ b/core_language/16_functions_altsteps_testcases/1601_functions/160103_external_functions/Sem_160103_external_functions_003.ttcn @@ -0,0 +1,26 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.2 + ** @purpose 1:16.1.3, Ensure that the IUT recognizes external functions + ** @verdict pass accept, noexecution + ** @configuration external_functions + ***************************************************/ + +// Purpose: external functions returning templates were not allowed by the previous versions of the standard + +module Sem_160103_external_functions_003 { + + type component GeneralComp { + } + + external function xf_Sem_160103_external_functions_003() return template octetstring; + + testcase TC_Sem_160103_external_functions_003 () runs on GeneralComp { + setverdict(pass); + } + + control{ + execute(TC_Sem_160103_external_functions_003()); + } + +} diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160103_external_functions/Sem_160103_external_functions_004.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160103_external_functions/Sem_160103_external_functions_004.ttcn new file mode 100644 index 0000000..b955486 --- /dev/null +++ b/core_language/16_functions_altsteps_testcases/1601_functions/160103_external_functions/Sem_160103_external_functions_004.ttcn @@ -0,0 +1,24 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:16.1.3, Ensure that the IUT recognizes external functions with @control modifier + ** @verdict pass accept, noexecution + ** @configuration external_functions + ***************************************************/ + +module Sem_160103_external_functions_004 { + + type component GeneralComp { + } + + external function @control xf_Sem_160103_external_functions_001() return integer; + + testcase TC_Sem_160103_external_functions_004 () runs on GeneralComp { + setverdict(pass); + } + + control{ + execute(TC_Sem_160103_external_functions_004()); + } + +} diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160103_external_functions/Sem_160103_external_functions_005.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160103_external_functions/Sem_160103_external_functions_005.ttcn new file mode 100644 index 0000000..46c671c --- /dev/null +++ b/core_language/16_functions_altsteps_testcases/1601_functions/160103_external_functions/Sem_160103_external_functions_005.ttcn @@ -0,0 +1,23 @@ +/*************************************************** + ** @author STF 409, modfied by TTF 014 + ** @version 0.0.2 + ** @purpose 1:16.1.3, Ensure that external functions can return templates + ** @verdict pass accept, noexecution + ** @configuration external_functions + ***************************************************/ +module Sem_160103_external_functions_005 { + + type component GeneralComp { + } + + external function xf_Sem_160103_external_functions_005() return template octetstring; // external functions can return templates (in older TTCN-3 versions, it was not possible) + + testcase TC_Sem_160103_external_functions_005 () runs on GeneralComp { + setverdict(pass); + } + + control{ + execute(TC_Sem_160103_external_functions_005()); + } + +} diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_296.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_296.ttcn index 767b9b3..1535081 100644 --- a/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_296.ttcn +++ b/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_296.ttcn @@ -1,7 +1,7 @@ /*************************************************** ** @author STF 521 ** @version 0.0.1 - ** @purpose 1:16.1.4, verify that a function called in altstep local definitions cannot contain out parameters + ** @purpose 1:16.1.4, verify that a function called in altstep altstep local definitions cannot contain out parameters ** @verdict pass reject ***************************************************/ diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_297.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_297.ttcn index ff476c2..05a1267 100644 --- a/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_297.ttcn +++ b/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_297.ttcn @@ -1,7 +1,7 @@ /*************************************************** ** @author STF 521 ** @version 0.0.1 - ** @purpose 1:16.1.4, verify that a function called in altstep local definitions cannot contain inout parameters + ** @purpose 1:16.1.4, verify that a function called in altstep altstep local definitions cannot contain inout parameters ** @verdict pass reject ***************************************************/ diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_326.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_326.ttcn new file mode 100644 index 0000000..dfce32c --- /dev/null +++ b/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_326.ttcn @@ -0,0 +1,51 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that a function called in guards of alt statements cannot reference fuzzy variables + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// m) Referencing lazy or fuzzy variables, parameters or templates that have not been declared deterministic. + +module NegSem_160104_invoking_functions_from_specific_places_326 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + var @fuzzy integer v_int := f_eval(); + } + + function f_test() return boolean runs on GeneralComp { + if (v_int > 0) { //referencing a fuzzy variable from GeneralComp in an alt guard + return true; + } else { + return false; + } + } + + function f_eval() return integer runs on GeneralComp { + return 100; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_326() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + alt { + [f_test()] p.receive(integer:?) {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_326()); + } +} diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_327.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_327.ttcn new file mode 100644 index 0000000..0e32f66 --- /dev/null +++ b/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_327.ttcn @@ -0,0 +1,51 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that a function called in guards of alt statements cannot reference lazy variables + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// m) Referencing lazy or fuzzy variables, parameters or templates that have not been declared deterministic. + +module NegSem_160104_invoking_functions_from_specific_places_327 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + var @lazy integer v_int := f_eval(); + } + + function f_test() return boolean runs on GeneralComp { + if (v_int > 0) { //referencing a lazy variable from GeneralComp in an alt guard + return true; + } else { + return false; + } + } + + function f_eval() return integer runs on GeneralComp { + return 100; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_327() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + alt { + [f_test()] p.receive(integer:?) {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_327()); + } +} diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160105_explicit_control_functions/NegSem_160105_explicit_control_functions_001.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160105_explicit_control_functions/NegSem_160105_explicit_control_functions_001.ttcn new file mode 100644 index 0000000..d4c95a5 --- /dev/null +++ b/core_language/16_functions_altsteps_testcases/1601_functions/160105_explicit_control_functions/NegSem_160105_explicit_control_functions_001.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:16.1.5, Ensure that the IUT recognizes explicit control functions + ** @verdict pass reject, noexecute + ***************************************************/ + +// Tested restriction: +// a) No system and no mtc clause shall be declared. + +module NegSem_160105_explicit_control_functions_001 { + + type component GeneralComp { + } + + function @control f_NegSem_160105_explicit_control_functions_001() runs on GeneralComp system GeneralComp mtc GeneralComp { + execute(TC_NegSem_160105_explicit_control_functions_001()); + } + + testcase TC_NegSem_160105_explicit_control_functions_001 () runs on GeneralComp { + setverdict(pass); + } + + control{ + f_NegSem_160105_explicit_control_functions_001(); + } + +} diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160105_explicit_control_functions/NegSem_160105_explicit_control_functions_002.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160105_explicit_control_functions/NegSem_160105_explicit_control_functions_002.ttcn new file mode 100644 index 0000000..6f0a0c7 --- /dev/null +++ b/core_language/16_functions_altsteps_testcases/1601_functions/160105_explicit_control_functions/NegSem_160105_explicit_control_functions_002.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:16.1.5, Ensure that the IUT recognizes explicit control functions + ** @verdict pass reject, noexecute + ***************************************************/ + +// Tested restriction: +// b) The component type referenced in the runs on clause shall not contain any port definitions. + +module NegSem_160105_explicit_control_functions_002 { + + type port MyPort { + inout octetstring; + } + + type component GeneralComp { + MyPort P; + } + + function @control f_NegSem_160105_explicit_control_functions_002() runs on GeneralComp { + execute(TC_Sem_160105_explicit_control_functions_002()); + } + + testcase TC_NegSem_160105_explicit_control_functions_002 () runs on GeneralComp { + setverdict(pass); + } + + control{ + f_NegSem_160105_explicit_control_functions_002(); + } + +} diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160105_explicit_control_functions/NegSem_160105_explicit_control_functions_003.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160105_explicit_control_functions/NegSem_160105_explicit_control_functions_003.ttcn new file mode 100644 index 0000000..f1ba6b2 --- /dev/null +++ b/core_language/16_functions_altsteps_testcases/1601_functions/160105_explicit_control_functions/NegSem_160105_explicit_control_functions_003.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:16.1.5, Ensure that the IUT recognizes explicit control functions + ** @verdict pass reject, noexecute + ***************************************************/ + +// Tested restriction: +// c) Parameters and the return type shall not be of a port type and shall not be of a structured type that contains fields of a port type on any level of nesting. +// Testing the "return type shall not be of a port type" is not necessary, as ports can only be used in functions if +// -- The "runs on" component declares it - this contradicts to restriction b) tested in NegSem_160105_explicit_control_functions_002 +// -- The function receives the port as a formal parameter - tested in this TC + + +module NegSem_160105_explicit_control_functions_003 { + + type port MyPort { + inout octetstring; + } + + type component GeneralComp { + } + + function @control f_NegSem_160105_explicit_control_functions_003(MyPort p_port) runs on GeneralComp { + execute(TC_Sem_160105_explicit_control_functions_003()); + } + + testcase TC_NegSem_160105_explicit_control_functions_003 () runs on GeneralComp { + setverdict(pass); + } + + control{ + f_NegSem_160105_explicit_control_functions_003(); + } + +} diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160105_explicit_control_functions/NegSem_160105_explicit_control_functions_004.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160105_explicit_control_functions/NegSem_160105_explicit_control_functions_004.ttcn new file mode 100644 index 0000000..9c798c8 --- /dev/null +++ b/core_language/16_functions_altsteps_testcases/1601_functions/160105_explicit_control_functions/NegSem_160105_explicit_control_functions_004.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:16.1.5, Ensure that the IUT recognizes explicit control functions + ** @verdict pass reject, noexecute + ***************************************************/ + +// Tested restriction: +// d) Parameters and the return type of module control functions shall not be of a default type and shall not be of a structured type that contais fields of a default type on any level of nesting. + +module NegSem_160105_explicit_control_functions_004 { + + + type component GeneralComp { + timer t1 := 1.0; + } + + altstep a_default() runs on GeneralComp { + [] t1.timeout() { setverdict(pass) } + } + + + function @control f_NegSem_160105_explicit_control_functions_004(default as_default) runs on GeneralComp { + execute(TC_Sem_160105_explicit_control_functions_004()); + + } + + testcase TC_NegSem_160105_explicit_control_functions_004 () runs on GeneralComp { + setverdict(pass); + } + + control{ + var default d1 = activate(a_defalut()); + f_NegSem_160105_explicit_control_functions_004(d1); + } + +} diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160105_explicit_control_functions/NegSem_160105_explicit_control_functions_005.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160105_explicit_control_functions/NegSem_160105_explicit_control_functions_005.ttcn new file mode 100644 index 0000000..22eebc7 --- /dev/null +++ b/core_language/16_functions_altsteps_testcases/1601_functions/160105_explicit_control_functions/NegSem_160105_explicit_control_functions_005.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:16.1.5, Ensure that the IUT recognizes explicit control functions + ** @verdict pass reject, noexecute + ***************************************************/ + +// Tested restriction: +// d) Parameters and the return type of module control functions shall not be of a default type and shall not be of a structured type that contais fields of a default type on any level of nesting. + +module NegSem_160105_explicit_control_functions_005 { + + + type component GeneralComp { + timer t1 := 1.0; + } + + altstep a_default() runs on GeneralComp { + [] t1.timeout() { setverdict(pass) } + } + + + function @control f_NegSem_160105_explicit_control_functions_005() runs on GeneralComp return default { + var default d1 = activate(a_defalut()); + execute(TC_Sem_160105_explicit_control_functions_005()); + return d1; + } + + testcase TC_NegSem_160105_explicit_control_functions_005 () runs on GeneralComp { + setverdict(pass); + } + + control{ + var default d = f_NegSem_160105_explicit_control_functions_005(); + } + +} diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160105_explicit_control_functions/NegSem_160105_explicit_control_functions_006.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160105_explicit_control_functions/NegSem_160105_explicit_control_functions_006.ttcn new file mode 100644 index 0000000..da123fc --- /dev/null +++ b/core_language/16_functions_altsteps_testcases/1601_functions/160105_explicit_control_functions/NegSem_160105_explicit_control_functions_006.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:16.1.5, Ensure that the IUT recognizes explicit control functions + ** @verdict pass reject, noexecute + ***************************************************/ + +// Tested restriction: +// d) Parameters and the return type of module control functions shall not be of a default type and shall not be of a structured type that contais fields of a default type on any level of nesting. + +module NegSem_160105_explicit_control_functions_006 { + + + type component GeneralComp { + timer t1 := 1.0; + } + + altstep a_default() runs on GeneralComp { + [] t1.timeout() { setverdict(pass) } + } + + + function @control f_NegSem_160105_explicit_control_functions_006() runs on GeneralComp return default { + var default d1 = activate(a_defalut()); + execute(TC_Sem_160105_explicit_control_functions_006()); + return d1; + } + + testcase TC_NegSem_160105_explicit_control_functions_006 () runs on GeneralComp { + setverdict(pass); + } + + control{ + var default d = f_NegSem_160105_explicit_control_functions_006(); + } + +} diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160105_explicit_control_functions/NegSem_160105_explicit_control_functions_007.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160105_explicit_control_functions/NegSem_160105_explicit_control_functions_007.ttcn new file mode 100644 index 0000000..fc637cb --- /dev/null +++ b/core_language/16_functions_altsteps_testcases/1601_functions/160105_explicit_control_functions/NegSem_160105_explicit_control_functions_007.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:16.1.5, Ensure that the IUT recognizes explicit control functions + ** @verdict pass reject + ***************************************************/ + +// Tested restriction: +// f) Module control functions used as an execution entry point shall have public visibility. + +module NegSem_160105_explicit_control_functions_007 { + + type component GeneralComp { + } + + private function @control f_NegSem_160105_explicit_control_functions_007() runs on GeneralComp system GeneralComp mtc GeneralComp { + execute(TC_NegSem_160105_explicit_control_functions_007()); + } + + testcase TC_NegSem_160105_explicit_control_functions_007 () runs on GeneralComp { + setverdict(pass); + } + + control{ + f_NegSem_160105_explicit_control_functions_007(); + } + +} diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160105_explicit_control_functions/NegSem_160105_explicit_control_functions_008.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160105_explicit_control_functions/NegSem_160105_explicit_control_functions_008.ttcn new file mode 100644 index 0000000..6c48a91 --- /dev/null +++ b/core_language/16_functions_altsteps_testcases/1601_functions/160105_explicit_control_functions/NegSem_160105_explicit_control_functions_008.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:16.1.5, Ensure that the IUT recognizes explicit control functions + ** @verdict pass reject + ***************************************************/ + +// Tested restriction: +// f) Module control functions used as an execution entry point shall have public visibility. + +module NegSem_160105_explicit_control_functions_008 { + + type component GeneralComp { + } + + friend function @control f_NegSem_160105_explicit_control_functions_008() runs on GeneralComp system GeneralComp mtc GeneralComp { + execute(TC_NegSem_160105_explicit_control_functions_008()); + } + + testcase TC_NegSem_160105_explicit_control_functions_008 () runs on GeneralComp { + setverdict(pass); + } + + control{ + f_NegSem_160105_explicit_control_functions_008(); + } + +} diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160105_explicit_control_functions/NegSem_160105_explicit_control_functions_009.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160105_explicit_control_functions/NegSem_160105_explicit_control_functions_009.ttcn new file mode 100644 index 0000000..10cb0ae --- /dev/null +++ b/core_language/16_functions_altsteps_testcases/1601_functions/160105_explicit_control_functions/NegSem_160105_explicit_control_functions_009.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:16.1.5, Ensure that the IUT recognizes explicit control functions + ** @verdict pass reject + ***************************************************/ + +// Tested restriction: +// g) When invoking a module control function explicitly, the compatibility to the test component type of the invoking control component as described in clause 6.3.3 need to be fulfilled. + +module NegSem_160105_explicit_control_functions_009 { + + type component GeneralComp1 { + timer t_timer1; + } + + type component GeneralComp2 { + + } + + friend function @control f_NegSem_160105_explicit_control_functions_009() runs on GeneralComp1 { //GeneralComp1 is not compatible with GeneralComp2 -> error + execute(TC_NegSem_160105_explicit_control_functions_009()); + } + + testcase TC_NegSem_160105_explicit_control_functions_009 () runs on GeneralComp2 { + setverdict(pass); + } + + function control() runs on GeneralComp2 { + f_NegSem_160105_explicit_control_functions_009(); + } + +} diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160105_explicit_control_functions/Sem_160105_explicit_control_functions_001.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160105_explicit_control_functions/Sem_160105_explicit_control_functions_001.ttcn new file mode 100644 index 0000000..5b4ae77 --- /dev/null +++ b/core_language/16_functions_altsteps_testcases/1601_functions/160105_explicit_control_functions/Sem_160105_explicit_control_functions_001.ttcn @@ -0,0 +1,25 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:16.1.5, Ensure that the IUT recognizes explicit control functions + ** @verdict pass accept + ***************************************************/ + +module Sem_160105_explicit_control_functions_001 { + + type component GeneralComp { + } + + function @control f_Sem_160105_explicit_control_functions_001() { + execute(TC_Sem_160105_explicit_control_functions_001()); + } + + testcase TC_Sem_160105_explicit_control_functions_001 () runs on GeneralComp { + setverdict(pass); + } + + control{ + f_Sem_160105_explicit_control_functions_001(); + } + +} diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/160105_explicit_control_functions/Sem_160105_explicit_control_functions_002.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/160105_explicit_control_functions/Sem_160105_explicit_control_functions_002.ttcn new file mode 100644 index 0000000..d6331e7 --- /dev/null +++ b/core_language/16_functions_altsteps_testcases/1601_functions/160105_explicit_control_functions/Sem_160105_explicit_control_functions_002.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:16.1.5, Ensure that the IUT recognizes explicit control functions + ** @verdict pass accept + ***************************************************/ + +// Tested restriction: +// g) When invoking a module control function explicitly, the compatibility to the test component type of the invoking control component as described in clause 6.3.3 need to be fulfilled. + +module Sem_160105_explicit_control_functions_002 { + + type component GeneralComp1 { + timer t_timer1; + } + + type component GeneralComp2 { + timer t_timer1; + } + + friend function @control f_Sem_160105_explicit_control_functions_002() runs on GeneralComp2 { //GeneralComp2 is compatible with GeneralComp1 + execute(TC_Sem_160105_explicit_control_functions_002()); + } + + testcase TC_Sem_160105_explicit_control_functions_002 () runs on GeneralComp2 { + setverdict(pass); + } + + function control() runs on GeneralComp1 { + f_Sem_160105_explicit_control_functions_002(); + } + +} diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/1601_toplevel/NegSem_1601_toplevel_007.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/1601_toplevel/NegSem_1601_toplevel_007.ttcn new file mode 100644 index 0000000..b717a00 --- /dev/null +++ b/core_language/16_functions_altsteps_testcases/1601_functions/1601_toplevel/NegSem_1601_toplevel_007.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:16.1, Ensure that the IUT correctly handles function definitions + ** @verdict pass reject + ***************************************************/ +module NegSem_1601_toplevel_007 { + + +type component GeneralComp { +} + +function f_test ( integer p_integer := 0 ) system GeneralComp return integer { + + return p_integer+1; +} + +testcase TC_NegSem_1601_toplevel_007 () system GeneralComp { + + if(f_test(1)==2) { + setverdict(pass); + } + else { + setverdict(fail); + } + +} + + +control{ + + f_test(1); //attempt to invoke a function with system clause + execute(TC_NegSem_1601_toplevel_007()); + +} + +} diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/1601_toplevel/NegSem_1601_toplevel_008.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/1601_toplevel/NegSem_1601_toplevel_008.ttcn new file mode 100644 index 0000000..6889e0a --- /dev/null +++ b/core_language/16_functions_altsteps_testcases/1601_functions/1601_toplevel/NegSem_1601_toplevel_008.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:16.1, Ensure that the IUT correctly handles function definitions + ** @verdict pass reject + ***************************************************/ +module NegSem_1601_toplevel_008 { + + +type component GeneralComp { +} + +function f_test ( integer p_integer := 0 ) mtc GeneralComp return integer { + + return p_integer+1; +} + +testcase TC_NegSem_1601_toplevel_008 () mtc GeneralComp { + + if(f_test(1)==2) { + setverdict(pass); + } + else { + setverdict(fail); + } + +} + + +control{ + + f_test(1); //attempt to invoke a function with mtc clause + execute(TC_NegSem_1601_toplevel_008()); + +} + +} diff --git a/core_language/16_functions_altsteps_testcases/1601_functions/1601_toplevel/NegSem_1601_toplevel_009.ttcn b/core_language/16_functions_altsteps_testcases/1601_functions/1601_toplevel/NegSem_1601_toplevel_009.ttcn new file mode 100644 index 0000000..632fc79 --- /dev/null +++ b/core_language/16_functions_altsteps_testcases/1601_functions/1601_toplevel/NegSem_1601_toplevel_009.ttcn @@ -0,0 +1,43 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:16.1, Function without a runs on clause invoking a function with a runs on clause + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// 16.1.0.a) +// A function without runs on clause shall never invoke a function or altstep or activate +// an altstep as default with a runs on clause locally. + +module NegSem_1601_toplevel_009 { + + +type component GeneralComp { +} + +function f_test ( integer p_integer := 0 ) runs on GeneralComp return integer { + + return p_integer+1; +} + +testcase TC_NegSem_1601_toplevel_009 () runs on GeneralComp { + + if(f_test(1)==2) { + setverdict(pass); + } + else { + setverdict(fail); + } + +} + + +control{ + + f_test(1); //attempt to invoke a function with runs on clause + execute(TC_NegSem_1601_toplevel_009()); + +} + +} diff --git a/core_language/16_functions_altsteps_testcases/1602_altsteps/160201_invoking_altsteps/NegSyn_160201_invoking_altsteps_001.ttcn b/core_language/16_functions_altsteps_testcases/1602_altsteps/160201_invoking_altsteps/NegSyn_160201_invoking_altsteps_001.ttcn new file mode 100644 index 0000000..b3efc1b --- /dev/null +++ b/core_language/16_functions_altsteps_testcases/1602_altsteps/160201_invoking_altsteps/NegSyn_160201_invoking_altsteps_001.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF T003 + ** @version 0.0.1 + ** @purpose 1:16.2.1, Ensure that the IUT recognizes altstep definitions with @nodefault and correctly evaluates them + ** @verdict pass reject, noexecution + ***************************************************/ + +// If the @nodefault modifier is placed before a stand-alone altstep call, the implicit alt statement also contains the @nodefault modifier. + +module NegSyn_160201_invoking_altsteps_001 { + + type record MessageType { + integer field1, + charstring field2 + } + + type port loopbackPort message { + inout MessageType + } + + type component GeneralComp { + port loopbackPort messagePort + } + + // error: invalid @nodefault modifier + altstep @nodefault AltSet1() runs on GeneralComp { + + [] messagePort.receive { + setverdict(pass); + } + + } + + control {} + +} \ No newline at end of file diff --git a/core_language/16_functions_altsteps_testcases/1602_altsteps/160201_invoking_altsteps/Sem_160201_invoking_altsteps_005.ttcn b/core_language/16_functions_altsteps_testcases/1602_altsteps/160201_invoking_altsteps/Sem_160201_invoking_altsteps_005.ttcn new file mode 100644 index 0000000..eb41175 --- /dev/null +++ b/core_language/16_functions_altsteps_testcases/1602_altsteps/160201_invoking_altsteps/Sem_160201_invoking_altsteps_005.ttcn @@ -0,0 +1,67 @@ +/*************************************************** + ** @author STF T003 + ** @version 0.0.1 + ** @purpose 1:16.2.1, Ensure that the IUT recognizes altstep definitions and correctly evaluates them + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// If the @nodefault modifier is placed before a stand-alone altstep call, the implicit alt statement also contains the @nodefault modifier. + +module Sem_160201_invoking_altsteps_005 { + + type record MessageType { + integer field1, + charstring field2 + } + + type port loopbackPort message { + inout MessageType + } + + type component GeneralComp { + port loopbackPort messagePort + } + + // altstep + altstep AltSet1() runs on GeneralComp { + + [] messagePort.receive { + setverdict(pass); + } + + } + + function f1 ( ) runs on GeneralComp { + + var MessageType v_testMessage; + v_testMessage:= { + field1 := 1, + field2:= "test string" + } + + messagePort.send(v_testMessage) to mtc; + } + + testcase TC_Sem_160201_invoking_altsteps_005() runs on GeneralComp system GeneralComp { + + // create PTC + var GeneralComp ptc; + ptc:=GeneralComp.create; + connect(self:messagePort,ptc:messagePort); + ptc.start(f1()); + + @nodefault AltSet1(); // invoking altstep with @nodefault modifier + + //remove PTC + disconnect(self:messagePort,ptc:messagePort); + ptc.stop; + + } + + control { + + execute(TC_Sem_160201_invoking_altsteps_005()); + + } + +} \ No newline at end of file diff --git a/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_053.ttcn b/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_053.ttcn new file mode 100644 index 0000000..a7740f5 --- /dev/null +++ b/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_053.ttcn @@ -0,0 +1,56 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:16.2, Verify that a @control altstep can not be activated on other components + ** @verdict pass reject + ***************************************************/ +module NegSem_1602_toplevel_053 { + + type record MessageType { + integer field1, + charstring field2 + } + + type port loopbackPort message { + inout MessageType + } + + type component GeneralComp { + port loopbackPort messagePort + } + + function f_test ( integer p_integer := 0 ) runs on GeneralComp return integer { + + return p_integer+1; + } + + + altstep @control AltSet1() { + var integer v_LocalVar := f_test(); // local variable + + [] messagePort.receive { + setverdict(pass); + } + + } + + testcase TC_NegSem_1602_toplevel_053 () runs on GeneralComp { + var MessageType v_testMessage; + v_testMessage:= { + field1 := 1, + field2 := "test string" + } + + messagePort.send(v_testMessage); + + AltSet1(); //Trying to activate @control altstep on a component other than control component + + } + + control{ + + execute(TC_NegSem_1602_toplevel_053()); + + } + +} diff --git a/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_054.ttcn b/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_054.ttcn new file mode 100644 index 0000000..6c63858 --- /dev/null +++ b/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_054.ttcn @@ -0,0 +1,41 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:16.1, altsteps activated as default can non have port parameters + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction e) + +module NegSem_1602_toplevel_054 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + altstep a_test(P p_port) runs on GeneralComp + [] p_port.receive { + setverdict(pass); + } + } + + function f_behavior() runs on GeneralComp { + var default d_as = activate(a_test(p)) //altstep activated as default no longer can have port as parameter + } + + testcase TC_Sem_1602_toplevel_054() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + connect(mtc:p, v_ptc:p); + p.send(1); + v_ptc.start(f_behavior()); + v_ptc.done; + } + + control { + execute(TC_Sem_1602_toplevel_054()); + } +} diff --git a/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_055.ttcn b/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_055.ttcn new file mode 100644 index 0000000..23e4a4b --- /dev/null +++ b/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_055.ttcn @@ -0,0 +1,46 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:16.1, altsteps activated as default can non have port parameters + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction e) + +module Sem_1602_toplevel_055 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + altstep a_test(timer t_timer) runs on GeneralComp + [] any port.receive { + setverdict(pass); + } + [] t_timer.timeout() { + setverdict(pass); + } + + } + + function f_behavior() runs on GeneralComp { + timer t_timer := 1.0; + var default d_as = activate(a_test(t_timer)) //altstep activated as default no longer can have timer as parameter + } + + testcase TC_Sem_1602_toplevel_055() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + connect(mtc:p, v_ptc:p); + p.send(1); + v_ptc.start(f_behavior()); + v_ptc.done; + } + + control { + execute(TC_Sem_1602_toplevel_055()); + } +} diff --git a/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/Sem_1602_toplevel_004.ttcn b/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/Sem_1602_toplevel_004.ttcn new file mode 100644 index 0000000..ab8e58d --- /dev/null +++ b/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/Sem_1602_toplevel_004.ttcn @@ -0,0 +1,64 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:16.2, Ensure that the IUT recognizes interleave altstep definitions and correctly evaluates them + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_1602_toplevel_004 { + + type record MessageType { + integer field1, + charstring field2 + } + + type port loopbackPort message { + inout MessageType + } + + type component GeneralComp { + port loopbackPort messagePort + } + + altstep interleave AltSet1(MessageType msgt1, MessageType msgt2) runs on GeneralComp { + template MessageType t_msg_1 := msgt1; + template MessageType t_msg_2 := msgt2; + var boolean msgt1Received := false; + var boolean msgt2Received := false; + [] messagePort.receive(t_msg_1) { + msgt1Received := true; + if (msgt2Received) { + setverdict(pass); + } + } + [] messagePort.receive(t_msg_2) { + msgt2Received := true; + if (msgt1Received) { + setverdict(pass); + } + } + } + + testcase TC_Sem_1602_toplevel_004 () runs on GeneralComp { + var MessageType v_testMessage1:= { + field1 := 1, + field2 := "test string" + } + + var MessageType v_testMessage2:= { + field1 := 2, + field2 := "test string" + } + + messagePort.send(v_testMessage1); + messagePort.send(v_testMessage2); + + AltSet1({1, "test string"}, {2, "test string"}); + } + + control{ + + execute(TC_Sem_1602_toplevel_004()); + + } + +} diff --git a/core_language/16_functions_altsteps_testcases/1603_testcases/NegSyn_1603_testcases_001.ttcn b/core_language/16_functions_altsteps_testcases/1603_testcases/NegSyn_1603_testcases_001.ttcn new file mode 100644 index 0000000..63f70c9 --- /dev/null +++ b/core_language/16_functions_altsteps_testcases/1603_testcases/NegSyn_1603_testcases_001.ttcn @@ -0,0 +1,27 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:16.3, Ensure that the IUT properly evaluates invocation of testcases + ** @verdict pass reject, noexecute + ***************************************************/ +module NegSyn_1603_testcases_001 { + +type port GeneralPortType message { + inout octetstring; +} + +type component GeneralComp { + port GeneralPortType GeneralPort; +} + +testcase TC_NegSyn_1603_testcases_001 (GeneralPortType genPort) runs on GeneralComp { + setverdict(pass); +} + +control{ + + execute(TC_NegSyn_1603_testcases_001(GeneralPort)); //testcase parameter must not be port type + +} + +} diff --git a/core_language/16_functions_altsteps_testcases/1603_testcases/NegSyn_1603_testcases_002.ttcn b/core_language/16_functions_altsteps_testcases/1603_testcases/NegSyn_1603_testcases_002.ttcn new file mode 100644 index 0000000..60d0d1e --- /dev/null +++ b/core_language/16_functions_altsteps_testcases/1603_testcases/NegSyn_1603_testcases_002.ttcn @@ -0,0 +1,27 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:16.3, Ensure that the IUT properly evaluates invocation of testcases + ** @verdict pass reject, noexecute + ***************************************************/ +module NegSyn_1603_testcases_002 { + +altstep a_default() runs on GeneralComp { + [] GeneralPort.receive() { break } +} + +type component GeneralComp { + port GeneralPortType GeneralPort; +} + +testcase TC_NegSyn_1603_testcases_002 (default p_default) runs on GeneralComp { + setverdict(pass); +} + +control{ + var default v_default = activate(a_default); + execute(TC_NegSyn_1603_testcases_002(v_default)); //testcase parameter must not be default type + +} + +} diff --git a/core_language/16_functions_altsteps_testcases/1603_testcases/NegSyn_1603_testcases_003.ttcn b/core_language/16_functions_altsteps_testcases/1603_testcases/NegSyn_1603_testcases_003.ttcn new file mode 100644 index 0000000..d8b492d --- /dev/null +++ b/core_language/16_functions_altsteps_testcases/1603_testcases/NegSyn_1603_testcases_003.ttcn @@ -0,0 +1,22 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:16.3, Ensure that the IUT properly evaluates invocation of testcases + ** @verdict pass reject, noexecute + ***************************************************/ +module NegSyn_1603_testcases_003 { + +type component GeneralComp { +} + +testcase TC_NegSyn_1603_testcases_003 (timer p_timer) runs on GeneralComp { + setverdict(pass); +} + +control{ + timer t_timer := 1.0; + execute(TC_NegSyn_1603_testcases_003(t_timer)); //testcase parameter must not be timer type + +} + +} diff --git a/core_language/16_functions_altsteps_testcases/1603_testcases/NegSyn_1603_testcases_004.ttcn b/core_language/16_functions_altsteps_testcases/1603_testcases/NegSyn_1603_testcases_004.ttcn new file mode 100644 index 0000000..441cbec --- /dev/null +++ b/core_language/16_functions_altsteps_testcases/1603_testcases/NegSyn_1603_testcases_004.ttcn @@ -0,0 +1,30 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:16.3, Ensure that the IUT properly evaluates invocation of testcases with system clause + ** @verdict pass reject + ***************************************************/ + +module Syn_1603_testcases_001 { + +type component GeneralComp { +} + +testcase TC_Syn_1603_testcases_001 () runs on GeneralComp system GeneralComp { + f_executor(); + setverdict(pass); +} + +function f_executor () runs on GeneralComp system GeneralComp { + execute(TC_Syn_1603_testcases_001_1()); //TCs must not be executed from other component than control component +} + +testcase TC_Syn_1603_testcases_001_1 () runs on GeneralComp system GeneralComp { + setverdict(pass); +} + +control{ + execute(TC_Syn_1603_testcases_001()); +} + +} diff --git a/core_language/16_functions_altsteps_testcases/1603_testcases/NegSyn_1603_testcases_005.ttcn b/core_language/16_functions_altsteps_testcases/1603_testcases/NegSyn_1603_testcases_005.ttcn new file mode 100644 index 0000000..facbe42 --- /dev/null +++ b/core_language/16_functions_altsteps_testcases/1603_testcases/NegSyn_1603_testcases_005.ttcn @@ -0,0 +1,35 @@ +/*************************************************** + ** @author TTF T014 + ** @version 0.0.1 + ** @purpose 1:16.3, Ensure that in lack of clause "runs on" the test case has no ports, and no component constants and variables + ** @verdict pass reject, noexecute + ***************************************************/ + +module Syn_1603_testcases_005 { + + type port loopbackPort message { + inout integer + } + + type component GeneralComp { + port loopbackPort messagePort; + const integer c_i := 2; + var integer v_i := 2; + } + + testcase TC_Syn_1603_testcases_005 () { + messagePort.send(c_i); // Error: messagePort and c_i are unknown in this testcase + + if(match(v_i, c_i)){ + //Error: v_i and c_i are unknown + setverdict(pass); + }else{ + setverdict(fail, v_i, c_i); + } + } + + control{ + // execute(TC_Syn_1603_testcases_005 ()); + } + +} diff --git a/core_language/16_functions_altsteps_testcases/1603_testcases/NegSyn_1603_testcases_006.ttcn b/core_language/16_functions_altsteps_testcases/1603_testcases/NegSyn_1603_testcases_006.ttcn new file mode 100644 index 0000000..ad7c069 --- /dev/null +++ b/core_language/16_functions_altsteps_testcases/1603_testcases/NegSyn_1603_testcases_006.ttcn @@ -0,0 +1,38 @@ +/*************************************************** + ** @author TTF T014 + ** @version 0.0.1 + ** @purpose 1:16.3, Ensure that the IUT properly evaluates invocation of testcases without clause "runs on", but with clause "system" + ** @verdict pass reject, noexecute + ***************************************************/ +/** + * a) interface part (optional): denoted by the keyword runson which references the required component type for the MTC and makes the associated port names visible within the MTC behaviour. + * In case the runson clause is missing, the MTC created by the test case has no ports, and no component constants and variables; + */ +module NegSyn_1603_testcases_006 { + + type port loopbackPort message { + inout integer + } + + type component GeneralComp { + port loopbackPort messagePort; + const integer c_i := 2; + var integer v_i := 2; + } + + testcase TC_NegSyn_1603_testcases_006 () system GeneralComp { + // testcase without clause "runs on", but "system" clause is present + + messagePort.send(c_i); // Error: messagePort and c_i are unknown in this testcase + if(match(v_i, c_i)){ + setverdict(pass); + }else{ + setverdict(fail, v_i, c_i); + } + } + + control{ + execute(TC_NegSyn_1603_testcases_006()); + } + +} diff --git a/core_language/16_functions_altsteps_testcases/1603_testcases/Syn_1603_testcases_002.ttcn b/core_language/16_functions_altsteps_testcases/1603_testcases/Syn_1603_testcases_002.ttcn new file mode 100644 index 0000000..ba78dd8 --- /dev/null +++ b/core_language/16_functions_altsteps_testcases/1603_testcases/Syn_1603_testcases_002.ttcn @@ -0,0 +1,27 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:16.3, Ensure that the IUT properly evaluates invocation of testcases with system clause + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +//Enshure, that testcases may be executed from a function running on control component + +module Syn_1603_testcases_001 { + +type component GeneralComp { +} + +testcase TC_Syn_1603_testcases_001 () runs on GeneralComp system GeneralComp { + setverdict(pass); +} + +function @control f_control() { + execute(TC_Syn_1603_testcases_001()); +} + +control{ + f_control(); +} + +} diff --git a/core_language/16_functions_altsteps_testcases/1603_testcases/Syn_1603_testcases_003.ttcn b/core_language/16_functions_altsteps_testcases/1603_testcases/Syn_1603_testcases_003.ttcn new file mode 100644 index 0000000..2bd796e --- /dev/null +++ b/core_language/16_functions_altsteps_testcases/1603_testcases/Syn_1603_testcases_003.ttcn @@ -0,0 +1,23 @@ +/*************************************************** + ** @author TTF T014 + ** @version 0.0.1 + ** @purpose 1:16.3, Ensure that the IUT properly evaluates invocation of testcases without clause "runs on" + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/** + * a) interface part (optional): In case the "runs on" clause is missing, the MTC created by the test case has no ports, and no component constants and variables; + */ +module Syn_1603_testcases_003 { + + type component GeneralComp { } + + // testcase without clause "runs on" + testcase TC_Syn_1603_testcases_003 () { + setverdict(pass); + } + + control{ + execute(TC_Syn_1603_testcases_003()); + } + +} diff --git a/core_language/19_basic_program_statements/1901_assignments/Sem_1901_assignments_005.ttcn b/core_language/19_basic_program_statements/1901_assignments/Sem_1901_assignments_005.ttcn new file mode 100644 index 0000000..85eb6ef --- /dev/null +++ b/core_language/19_basic_program_statements/1901_assignments/Sem_1901_assignments_005.ttcn @@ -0,0 +1,45 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:19.1, Ensure that Ensure that the right-hand side of the assignment of a structured value is evaulted correctly + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirements are tested: + /* + * Restriction a) The right-hand side of an assignment shall evaluate to a value, or template, port or timer which is type + * compatible with the variable at the left-hand side of the assignment. + * */ + +module Sem_1901_assignments_005{ + +type component GeneralComp { +} + + type port MyMessagePortType message + { + address integer; + inout integer + } + +testcase TC_Sem_1901_assignments_005 () runs on GeneralComp system GeneralComp { + var MyMessagePortType v_j := null; + var MyMessagePortType v_i := v_j; // assignment + + + if (match(v_i, null)) { + setverdict(pass); // v_i is assigned with null + } + else { + setverdict(fail); + } +} + + +control{ + + execute(TC_Sem_1901_assignments_005()); + +} + +} diff --git a/core_language/19_basic_program_statements/1901_assignments/Sem_1901_assignments_006.ttcn b/core_language/19_basic_program_statements/1901_assignments/Sem_1901_assignments_006.ttcn new file mode 100644 index 0000000..de76f07 --- /dev/null +++ b/core_language/19_basic_program_statements/1901_assignments/Sem_1901_assignments_006.ttcn @@ -0,0 +1,44 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:19.1, Ensure that Ensure that the right-hand side of the assignment of a structured value is evaulted correctly + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirements are tested: + /* Restriction a) The right-hand side of an assignment shall evaluate to a value, or template, port or timer which is type + * compatible with the variable at the left-hand side of the assignment. + * */ + +module Sem_1901_assignments_006{ + +type component GeneralComp { +} + + type port MyMessagePortType message + { + address integer; + inout integer + } + +testcase TC_Sem_1901_assignments_006 () runs on GeneralComp system GeneralComp { + var timer v_j := null; + var timer v_i := v_j; // assignment + + + if (match(v_i, null)) { + setverdict(pass); // v_i is assigned with null + } + else { + setverdict(fail); + } +} + + +control{ + + execute(TC_Sem_1901_assignments_006()); + +} + +} diff --git a/core_language/19_basic_program_statements/1903_select_statements/190301_select_case_statement/._NegSem_190301_select_case_statement_002.ttcn b/core_language/19_basic_program_statements/1903_select_statements/190301_select_case_statement/._NegSem_190301_select_case_statement_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7d8c1ac695ff48dc1ebc963d0c6b37aac3d258db GIT binary patch literal 4096 zcmZQz6=P>$Vqox1Ojhs@R)|o50+1L3ClDJkFz{^v(m+1nBL)UWIUt(=a103vvYvJF zKU4cmKPLyQ( zq5nOA^)=}y;xia)nG1X+IMFO1h_0U16DMnhmU1V%$(Gz3ON zU^E0qLtr!nMnhmU1V%$(Gz6#<0*pXoKo|_?J3N)(cE67#ZwePO7sAx)wBAMO actual state and the component instance name, The actual state is always set to Inactive. + * */ +module Sem_1911_log_statement_006 { + + type component GeneralComp { + var NewComp vc_NewComp; + timer t := 5.0; + } + type component NewComp { } + +testcase TC_Sem_1911_log_statement_006 () runs on GeneralComp system GeneralComp{ + + var GeneralComp ptc := GeneralComp.create; + + log("Actual state and the component instance name : ", ptc); + + setverdict(pass); + +} + + +control{ + + execute(TC_Sem_1911_log_statement_006()); + +} + +} diff --git a/core_language/19_basic_program_statements/1911_log_statement/Sem_1911_log_statement_007.ttcn b/core_language/19_basic_program_statements/1911_log_statement/Sem_1911_log_statement_007.ttcn new file mode 100644 index 0000000..98f8be1 --- /dev/null +++ b/core_language/19_basic_program_statements/1911_log_statement/Sem_1911_log_statement_007.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:19.11, Ensure that the IUT properly evaluates log statements + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirements are tested: + /* + * checkstate operation -> return value (true or false) + * */ +module Sem_1911_log_statement_007 { + + type port MyMessagePortType message + { + inout integer + } + + type component GeneralComp { + port MyMessagePortType p_myPort; + } + + +testcase TC_Sem_1911_log_statement_007 () runs on GeneralComp{ + + log("Checkstate : ", p_myPort.checkstate("Started")); + setverdict(pass); + +} + +control{ + + execute(TC_Sem_1911_log_statement_007()); + +} + +} diff --git a/core_language/19_basic_program_statements/1911_log_statement/Sem_1911_log_statement_008.ttcn b/core_language/19_basic_program_statements/1911_log_statement/Sem_1911_log_statement_008.ttcn new file mode 100644 index 0000000..55aaae1 --- /dev/null +++ b/core_language/19_basic_program_statements/1911_log_statement/Sem_1911_log_statement_008.ttcn @@ -0,0 +1,31 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:20.5.2, Ensure that the IUT properly evaluates log statements + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirements are tested: + /* + * activate operation -> The actual state is always set to activated. + */ + +module Sem_1911_log_statement_008 { + + type component GeneralComp { + } + + altstep a() runs on GeneralComp + { + [] any port.receive {} + } + + testcase TC_Sem_1911_log_statement_008() runs on GeneralComp { + log("Activate: ", activate(a())); + setverdict(pass); + } + + control{ + execute(TC_Sem_1911_log_statement_008()); + } +} diff --git a/core_language/19_basic_program_statements/1911_log_statement/Sem_1911_log_statement_009.ttcn b/core_language/19_basic_program_statements/1911_log_statement/Sem_1911_log_statement_009.ttcn new file mode 100644 index 0000000..4edc627 --- /dev/null +++ b/core_language/19_basic_program_statements/1911_log_statement/Sem_1911_log_statement_009.ttcn @@ -0,0 +1,26 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:20.5.2, Ensure that the IUT properly evaluates log statements + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// match operation -> true/false + +module Sem_1911_log_statement_009 { + + type component GeneralComp { + } + + testcase TC_Sem_1911_log_statement_009() runs on GeneralComp { + var integer v_i := 1; + var integer v_j := 1; + log("Match operation: ", match(v_i,v_j)); + setverdict(pass); + } + + control{ + execute(TC_Sem_1911_log_statement_009()); + } +} diff --git a/core_language/19_basic_program_statements/1911_log_statement/Sem_1911_log_statement_010.ttcn b/core_language/19_basic_program_statements/1911_log_statement/Sem_1911_log_statement_010.ttcn new file mode 100644 index 0000000..569ef46 --- /dev/null +++ b/core_language/19_basic_program_statements/1911_log_statement/Sem_1911_log_statement_010.ttcn @@ -0,0 +1,26 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:20.5.2, Ensure that the IUT properly evaluates log statements + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// valueof operation -> the given value + +module Sem_1911_log_statement_010 { + + type component GeneralComp { + } + + testcase TC_Sem_1911_log_statement_010() runs on GeneralComp { + var integer v_i := 1; + + log("valueOf operation: ", valueof(v_i)); + setverdict(pass); + } + + control{ + execute(TC_Sem_1911_log_statement_010()); + } +} diff --git a/core_language/19_basic_program_statements/1911_log_statement/Sem_1911_log_statement_011.ttcn b/core_language/19_basic_program_statements/1911_log_statement/Sem_1911_log_statement_011.ttcn new file mode 100644 index 0000000..d882414 --- /dev/null +++ b/core_language/19_basic_program_statements/1911_log_statement/Sem_1911_log_statement_011.ttcn @@ -0,0 +1,25 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:20.5.2, Ensure that the IUT properly evaluates log statements + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// getverdict operation -> the given verdict (pass) + +module Sem_1911_log_statement_011 { + + type component GeneralComp { + } + + testcase TC_Sem_1911_log_statement_011() runs on GeneralComp { + setverdict(pass); + log("getverdict operation: ", getverdict); + + } + + control{ + execute(TC_Sem_1911_log_statement_011()); + } +} diff --git a/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/Sem_2002_TheAltStatement_015.ttcn b/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/Sem_2002_TheAltStatement_015.ttcn new file mode 100644 index 0000000..495d49e --- /dev/null +++ b/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/Sem_2002_TheAltStatement_015.ttcn @@ -0,0 +1,46 @@ +/***************************************************************** + ** @author TTF T003 (modified in TTF T014) + ** @version 0.0.1 + ** @purpose 20.2, Ensure that the alt statement with @nodefault ignores all active default alternatives. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + + +module Sem_2002_TheAltStatement_015 { + + type port MyPort message { + inout charstring + } + + type component GeneralComp { + port MyPort p; + timer t_myTimer := 3.0; + } + + altstep a_receive() runs on GeneralComp { + [] t_myTimer.timeout { + setverdict (fail); + } + [] p.receive { + setverdict(fail); + } + } + + testcase TC_Sem_2002_TheAltStatement_015() runs on GeneralComp system GeneralComp { + map(self:p, system: p); + p.send(charstring:"abc"); + + t_myTimer.start; + + activate(a_receive()); + alt @nodefault { + [else] { + setverdict(pass); + } + } + } + + control { + execute(TC_Sem_2002_TheAltStatement_015()); + } +} \ No newline at end of file diff --git a/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/Sem_2002_TheAltStatement_016.ttcn b/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/Sem_2002_TheAltStatement_016.ttcn new file mode 100644 index 0000000..32e6326 --- /dev/null +++ b/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/Sem_2002_TheAltStatement_016.ttcn @@ -0,0 +1,49 @@ +/***************************************************************** + ** @author TTF T014 + ** @version 0.0.1 + ** @purpose 1:20.2, Ensure that the alt-statement supports local definitions. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +/* + * An alt statement may define some local definitions before its alternative branches. + * These can be used by all the branches. + **/ +module Sem_2002_TheAltStatement_016 { + + type port MyPort message { + inout charstring + } + + type component GeneralComp { + port MyPort p; + } + + function fsend(in charstring tSend) runs on GeneralComp { + p.send(tSend) to all component; + } + + template charstring m_test := "ping"; + + testcase TC_Sem_2002_TheAltStatement_016() runs on GeneralComp system GeneralComp { + + var GeneralComp newComp1 := GeneralComp.create; // create parallel test component + + connect(mtc:p, newComp1:p); + newComp1.start(fsend("ping")); + alt { + var integer v_a := 2; // local variable + [] p.receive(m_test) { + if(match(v_a, 2)){ // check that local variable has value 2 + setverdict(pass); + }else{ + setverdict(fail); + } + } + } + } + + control { + execute(TC_Sem_2002_TheAltStatement_016()); + } + +} diff --git a/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/Sem_2002_TheAltStatement_017.ttcn b/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/Sem_2002_TheAltStatement_017.ttcn new file mode 100644 index 0000000..359ff53 --- /dev/null +++ b/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/Sem_2002_TheAltStatement_017.ttcn @@ -0,0 +1,44 @@ +/***************************************************************** + ** @author TTF T014 + ** @version 0.0.1 + ** @purpose 1:20.2, Ensure that the alt-statement supports local definitions. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +/* + * An alt statement may define some local definitions before its alternative branches. These can be used by all the branches. + **/ +module Sem_2002_TheAltStatement_017 { + + type port MyPort message { + inout charstring + } + + type component GeneralComp { + port MyPort p; + } + + template charstring m_test := "ping"; + template charstring m_test2 := "pong"; + + testcase TC_Sem_2002_TheAltStatement_017() runs on GeneralComp { + p.send(m_test); + alt { + var integer v_a := 2; // local variable + [] p.receive(m_test2) { // never executed + setverdict(fail); + } + [else]{ + if(match(v_a, 2)){ // check that local variable value is 2 + setverdict(pass); + }else{ + setverdict(fail); + } + } + } + } + + control { + execute(TC_Sem_2002_TheAltStatement_017()); + } + +} diff --git a/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/Sem_2002_TheAltStatement_018.ttcn b/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/Sem_2002_TheAltStatement_018.ttcn new file mode 100644 index 0000000..3b86320 --- /dev/null +++ b/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/Sem_2002_TheAltStatement_018.ttcn @@ -0,0 +1,48 @@ +/***************************************************************** + ** @author TTF T014 + ** @version 0.0.1 + ** @purpose 1:20.2, Ensure that the alt-statement supports local definitions. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +/* + * An alt statement may define some local definitions before its alternative branches. These can be used by all the branches. + **/ +module Sem_2002_TheAltStatement_018 { + + type port MyPort message { + inout charstring + } + + type component GeneralComp { + port MyPort p; + } + + template charstring m_test := "ping"; + template charstring m_test2 := "pong"; + + testcase TC_Sem_2002_TheAltStatement_018() runs on GeneralComp { + p.send(m_test); + timer t_timer := 5.0; + t_timer.start; + + alt { + var integer v_a := 2; // local variable + [] p.receive(m_test2) { + // never happen + setverdict(fail); + } + [] t_timer.timeout{ + if(match(v_a, 2)){ // check that local variable value is 2 + setverdict(pass); + }else{ + setverdict(fail); + } + } + } + } + + control { + execute(TC_Sem_2002_TheAltStatement_018()); + } + +} \ No newline at end of file diff --git a/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/Sem_2002_TheAltStatement_019.ttcn b/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/Sem_2002_TheAltStatement_019.ttcn new file mode 100644 index 0000000..6a2daa3 --- /dev/null +++ b/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/Sem_2002_TheAltStatement_019.ttcn @@ -0,0 +1,48 @@ +/***************************************************************** + ** @author TTF T014 + ** @version 0.0.1 + ** @purpose 1:20.2, Ensure that the alt-statement supports local definitions. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +/* + * If the alt statement contains local definitions before its first branch, + * these are evaluated before the snapshot is taken. When the alt statements executes the repeat operation, the + * whole alt statement, including the local definitions, is re-evaluated. + **/ +module Sem_2002_TheAltStatement_019 { + + type port MyPort message { + inout charstring + } + + type component GeneralComp { + port MyPort p; + } + + template charstring m_test := ""; + + testcase TC_Sem_2002_TheAltStatement_019() runs on GeneralComp { + p.send(m_test); + timer t_timer := 5.0; + t_timer.start; + alt { + var integer v_a := 2; // local variable + [] p.receive { + v_a := 1; // change value of local variable and repeat + repeat; + } + [] t_timer.timeout{ + if(match(v_a, 2)){ // check that local variable value remains 2 + setverdict(pass); + }else{ + setverdict(fail, v_a); + } + } + } + } + + control { + execute(TC_Sem_2002_TheAltStatement_019()); + } + +} \ No newline at end of file diff --git a/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/Sem_2002_TheAltStatement_020.ttcn b/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/Sem_2002_TheAltStatement_020.ttcn new file mode 100644 index 0000000..6e92e7f --- /dev/null +++ b/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/Sem_2002_TheAltStatement_020.ttcn @@ -0,0 +1,38 @@ +/***************************************************************** + ** @author TTF T014 + ** @version 0.0.1 + ** @purpose 1:20.2, Ensure that the alt-statement supports local definitions. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +/* + * Timer as local definition in alt-statement + **/ +module Sem_2002_TheAltStatement_020 { + + type port loopbackPort message { + inout charstring + } + + type component GeneralComp { + port loopbackPort p; + } + + template charstring m_test := "abc"; + + testcase TC_Sem_2002_TheAltStatement_020() runs on GeneralComp system GeneralComp { + + alt { + timer t_timer := 5.0; // local definition of timer + [else]{ + t_timer.start; // start local timer + setverdict(pass); // timeout event occurred + } + } + + } + + control { + execute(TC_Sem_2002_TheAltStatement_020()); + } + +} \ No newline at end of file diff --git a/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/Sem_2002_TheAltStatement_021.ttcn b/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/Sem_2002_TheAltStatement_021.ttcn new file mode 100644 index 0000000..a777cf4 --- /dev/null +++ b/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/Sem_2002_TheAltStatement_021.ttcn @@ -0,0 +1,43 @@ +/***************************************************************** + ** @author TTF T014 + ** @version 0.0.1 + ** @purpose 1:20.2, Ensure that the alt-statement supports local definitions. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +/* + * constant as local definition + **/ +module Sem_2002_TheAltStatement_021 { + + type port loopbackPort message { + inout charstring + } + + type component GeneralComp { + port loopbackPort p; + } + + template charstring m_test := "abc"; + + testcase TC_Sem_2002_TheAltStatement_021() runs on GeneralComp { + p.send(m_test); + timer t_timer := 3.0; + t_timer.start; + alt { + const float c_i := 5.0; // local definition of constant + [] p.receive(m_test) { + repeat; + } + [] t_timer.timeout { + if(match(c_i, 5.0)){ + setverdict(pass); + } + } + } + } + + control { + execute(TC_Sem_2002_TheAltStatement_021()); + } + +} \ No newline at end of file diff --git a/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/Sem_2002_TheAltStatement_022.ttcn b/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/Sem_2002_TheAltStatement_022.ttcn new file mode 100644 index 0000000..4faa452 --- /dev/null +++ b/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/Sem_2002_TheAltStatement_022.ttcn @@ -0,0 +1,51 @@ +/***************************************************************** + ** @author TTF T014 + ** @version 0.0.1 + ** @purpose 1:20.2, Ensure that the alt-statement supports local definitions. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +/* + * template as local definition + **/ +module Sem_2002_TheAltStatement_022 { + + type port loopbackPort message { + inout charstring + } + + type component GeneralComp { + port loopbackPort p; + } + + function fsend(in charstring tSend) runs on GeneralComp { + p.send(tSend) to all component; + } + + template charstring m_test := "abc"; + + testcase TC_Sem_2002_TheAltStatement_022() runs on GeneralComp system GeneralComp { + + var GeneralComp newComp1 := GeneralComp.create; // create parallel test component + + connect(mtc:p, newComp1:p); + connect(newComp1:p, mtc:p); + newComp1.start(fsend("abc")); + + timer t_timer := 3.0; + t_timer.start; + alt { + template charstring m_rec := "def"; // local definition of template + [] p.receive(m_test) { + if(match(valueof(m_rec), "def")){ // match local template definition inside alt statement + setverdict(pass); + } + } + + } + } + + control { + execute(TC_Sem_2002_TheAltStatement_022()); + } + +} \ No newline at end of file diff --git a/core_language/20_statement_and_operations_for_alt/2004_the_interleave_statement/._NegSem_2004_InterleaveStatement_002.ttcn b/core_language/20_statement_and_operations_for_alt/2004_the_interleave_statement/._NegSem_2004_InterleaveStatement_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2130c9c8721e79b5dd44658b3448c77b1ae2bccc GIT binary patch literal 4096 zcmZQz6=P>$Vqox1Ojhs@R)|o50+1L3ClDJkFz{^v(m+1nBL)UWIUt(=a103vvYvJF zKST$^0-$mMG%bukK2%&PIX_n~v7jI)RWB#8xTLf=H6Kf7%s{i3$kztVg G{~rK;R4ZZt literal 0 HcmV?d00001 diff --git a/core_language/20_statement_and_operations_for_alt/2004_the_interleave_statement/._Sem_2004_InterleaveStatement_004.ttcn b/core_language/20_statement_and_operations_for_alt/2004_the_interleave_statement/._Sem_2004_InterleaveStatement_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..bccf24ee505ae573fb9f9db45f025a5a4908c758 GIT binary patch literal 4096 zcmZQz6=P>$Vqox1Ojhs@R)|o50+1L3ClDJkFz{^v(m+1nBL)UWIUt(=a103vvYvJF zKU4EQ}pO^UT z`VRB-Lvq2F6Q~Wf(hkHeaLGJ&50OT)yd;kCd literal 0 HcmV?d00001 diff --git a/core_language/20_statement_and_operations_for_alt/2004_the_interleave_statement/._Sem_2004_InterleaveStatement_005.ttcn b/core_language/20_statement_and_operations_for_alt/2004_the_interleave_statement/._Sem_2004_InterleaveStatement_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..00b63bd01db40fe2a4170c6b0fe7787df7943afd GIT binary patch literal 4096 zcmZQz6=P>$Vqox1Ojhs@R)|o50+1L3ClDJkFz{^v(m+1nBL)UWIUt(=a103vvYvJF zKST$^0-$mMG%bukK2%&PIX_n~v7jI)RWB#8xTLf=H6E{oum z1ks~lGz3ONU^E0qLtr!nMnhmU1V%$(Gz3ONU^E0qLtr!naD@PukeOGKnpcvUpO=`EQ>l=XnpUEal#`g34eSd;bq#3>)&Fp>$S}zL G{|^9prz-vc literal 0 HcmV?d00001 diff --git a/core_language/20_statement_and_operations_for_alt/2004_the_interleave_statement/Sem_2004_InterleaveStatement_004.ttcn b/core_language/20_statement_and_operations_for_alt/2004_the_interleave_statement/Sem_2004_InterleaveStatement_004.ttcn index 54c1e56..620900c 100644 --- a/core_language/20_statement_and_operations_for_alt/2004_the_interleave_statement/Sem_2004_InterleaveStatement_004.ttcn +++ b/core_language/20_statement_and_operations_for_alt/2004_the_interleave_statement/Sem_2004_InterleaveStatement_004.ttcn @@ -38,6 +38,7 @@ module Sem_2004_InterleaveStatement_004 { var integer v_i; timer t_timer; pt_myPort1.send(MyMessageType:{1, "aaa", true}); + pt_myPort2.send(MyMessageType:{2, "bbb", true}); t_timer.start(1.0); interleave { @@ -48,6 +49,7 @@ module Sem_2004_InterleaveStatement_004 { v_counter := v_counter + 1; } log (v_counter); + setverdict(pass); } [] pt_myPort2.receive(MySig2) //boolean guard must be empty { diff --git a/core_language/20_statement_and_operations_for_alt/2004_the_interleave_statement/Sem_2004_InterleaveStatement_011.ttcn b/core_language/20_statement_and_operations_for_alt/2004_the_interleave_statement/Sem_2004_InterleaveStatement_011.ttcn new file mode 100644 index 0000000..040ad97 --- /dev/null +++ b/core_language/20_statement_and_operations_for_alt/2004_the_interleave_statement/Sem_2004_InterleaveStatement_011.ttcn @@ -0,0 +1,39 @@ +/***************************************************************** + ** @author STF 487, updated by STF 572 + ** @version 0.0.2 + ** @purpose 1:20.4, stop inside interleave + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// In the older versions of TTCN-3, stop was not allowed inside interleave. +// The test verifies that this restriction is no longer present in the tested +// tool. + +module Sem_2004_InterleaveStatement_011 { + + type port MyPort message { + inout charstring + } + + type component GeneralComp { + port MyPort p; + } + + testcase TC_Sem_2004_InterleaveStatement_011() runs on GeneralComp { + p.send(charstring:"foo"); + p.send(charstring:"bar"); + + interleave { + [] p.receive(charstring:"bar") { + setverdict(pass); + stop; + } + [] p.receive(charstring:"foo") { + } + } + } + + control{ + execute(TC_Sem_2004_InterleaveStatement_011()); + } +} \ No newline at end of file diff --git a/core_language/20_statement_and_operations_for_alt/2004_the_interleave_statement/Sem_2004_InterleaveStatement_012.ttcn b/core_language/20_statement_and_operations_for_alt/2004_the_interleave_statement/Sem_2004_InterleaveStatement_012.ttcn new file mode 100644 index 0000000..5899e89 --- /dev/null +++ b/core_language/20_statement_and_operations_for_alt/2004_the_interleave_statement/Sem_2004_InterleaveStatement_012.ttcn @@ -0,0 +1,42 @@ +/***************************************************************** + ** @author STF 487, updated by STF 572 + ** @version 0.0.2 + ** @purpose 1:20.4, return inside interleave + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// In the older versions of TTCN-3, stop was not allowed inside interleave. +// The test verifies that this restriction is no longer present in the tested +// tool. + +module Sem_2004_InterleaveStatement_012 { + + type port MyPort message { + inout charstring + } + + type component GeneralComp { + port MyPort p; + } + + function f_interleave() runs on GeneralComp { + interleave { + [] p.receive(charstring:"bar") { + setverdict(pass); + return; + } + [] p.receive(charstring:"foo") { + } + } + } + + testcase TC_Sem_2004_InterleaveStatement_012() runs on GeneralComp { + p.send(charstring:"foo"); + p.send(charstring:"bar"); + f_interleave(); + } + + control{ + execute(TC_Sem_2004_InterleaveStatement_012()); + } +} \ No newline at end of file diff --git a/core_language/20_statement_and_operations_for_alt/2004_the_interleave_statement/Sem_2004_InterleaveStatement_013.ttcn b/core_language/20_statement_and_operations_for_alt/2004_the_interleave_statement/Sem_2004_InterleaveStatement_013.ttcn new file mode 100644 index 0000000..6cf7e23 --- /dev/null +++ b/core_language/20_statement_and_operations_for_alt/2004_the_interleave_statement/Sem_2004_InterleaveStatement_013.ttcn @@ -0,0 +1,54 @@ +/***************************************************************** + ** @author TTF T014 + ** @version 0.0.1 + ** @purpose 1:20.4, Validate that interleave statements are properly handled with @nodefault clause. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +/** + * b) If none of the alternatives of the interleave statement can be executed, the default mechanism will be invoked. This means, according to the semantics of the default mechanism, the actual snapshot will be used to evaluate those altsteps that have been activated before entering the interleave statement. + * If the interleave statement contains the @nodefault modifier, all active default alternatives are ignored for + * the execution of this interleave statement. + * NOTE 2: The complete semantics of the default mechanism within an interleave statement is given by replacing the interleave statement by an equivalent set of nested alt statements. + * If the interleave statement contains the @nodefault modifier, it is equivalent with all replacement alt statement having the @nodefault modifier. The default mechanism applies for each of these alt statements. + */ + +module Sem_2004_InterleaveStatement_013 { + + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + altstep a() runs on GeneralComp { + [] p.receive(integer:?) { + setverdict(fail, "altstep a() invocated."); + break; + } + } + + testcase TC_Sem_2004_InterleaveStatement_013() runs on GeneralComp { + timer t := 3.0; + activate(a()); + t.start; + p.send(integer:1); + interleave @nodefault { + [] p.receive(integer:5) { + // not expected: should lead to default invocation, + // due to @nodefualt altstep a() never called + setverdict(fail); + } + [] t.timeout{ + setverdict(pass); + break; + } + } + } + + control{ + execute(TC_Sem_2004_InterleaveStatement_013()); + } +} \ No newline at end of file diff --git a/core_language/20_statement_and_operations_for_alt/2005_default_handling/200502_the_activate_operation/Sem_200502_the_activate_operation_003.ttcn b/core_language/20_statement_and_operations_for_alt/2005_default_handling/200502_the_activate_operation/Sem_200502_the_activate_operation_003.ttcn index de3d703..82151e4 100644 --- a/core_language/20_statement_and_operations_for_alt/2005_default_handling/200502_the_activate_operation/Sem_200502_the_activate_operation_003.ttcn +++ b/core_language/20_statement_and_operations_for_alt/2005_default_handling/200502_the_activate_operation/Sem_200502_the_activate_operation_003.ttcn @@ -1,7 +1,7 @@ /*************************************************** ** @author STF 470 ** @version 0.0.1 - ** @purpose 1:20.5.2, verify that passing component timer to activated altstep + ** @purpose 1:20.5.2, verify passing of a component timer to an activated altstep ** @verdict pass accept, ttcn3verdict:pass ***************************************************/ diff --git a/core_language/20_statement_and_operations_for_alt/2005_default_handling/200502_the_activate_operation/Sem_200502_the_activate_operation_007.ttcn b/core_language/20_statement_and_operations_for_alt/2005_default_handling/200502_the_activate_operation/Sem_200502_the_activate_operation_007.ttcn new file mode 100644 index 0000000..8003221 --- /dev/null +++ b/core_language/20_statement_and_operations_for_alt/2005_default_handling/200502_the_activate_operation/Sem_200502_the_activate_operation_007.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 470 (changed to positive by STF 572) + ** @version 0.0.2 + ** @purpose 1:20.5.2, verify no error is generated when passing local timer + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// In TTCN-3:2018 and earlier versions of the core language standard, there was a restriction +// on local timers: +// All timer instances in the actual parameter list shall be declared as component type local timers. +// +// The restriction is no longer present and local timers can be used as actual parameters. + +module Sem_200502_the_activate_operation_007 { + + type component GeneralComp { + } + + altstep a(timer t_tmr) runs on GeneralComp { + [] t_tmr.timeout {} + } + + testcase TC_Sem_200502_the_activate_operation_007() runs on GeneralComp { + if (true) { + timer t_local := 0.5; + t_local.start; + activate(a(t_local)); + } + any port.receive; + setverdict(pass); + } + + control{ + execute(TC_Sem_200502_the_activate_operation_007()); + } +} diff --git a/core_language/20_statement_and_operations_for_alt/2005_default_handling/200502_the_activate_operation/Sem_200502_the_activate_operation_008.ttcn b/core_language/20_statement_and_operations_for_alt/2005_default_handling/200502_the_activate_operation/Sem_200502_the_activate_operation_008.ttcn new file mode 100644 index 0000000..9cb206a --- /dev/null +++ b/core_language/20_statement_and_operations_for_alt/2005_default_handling/200502_the_activate_operation/Sem_200502_the_activate_operation_008.ttcn @@ -0,0 +1,53 @@ +/*************************************************** + ** @author STF 487 (changed to positive by STF 572) + ** @version 0.0.2 + ** @purpose 1:20.5.2, local timer as a parameter of activated altstep in module control + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// In TTCN-3:2018 and earlier versions of the core language standard, there was +// a restriction on control timers: +// For altsteps activated in module control or in functions or altsteps invoked +// directly or indirectly from module control, all timer instances in the actual +// parameter list shall be declared in the highest scope of the module control +// part (see clause 26.2). Timers from lower scopes of the module control part +// (i.e. from the nested statement blocks) are not allowed to occur in the actual +// parameter list. +// +// The restriction is no longer present and timers from lower scopes can be used +// as actual parameters. + + +module Sem_200502_the_activate_operation_008 { + + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + altstep a(timer t_tmr) { + [] t_tmr.timeout { log ("Timeout in default"); } + } + + testcase TC_Sem_200502_the_activate_operation_008() runs on GeneralComp { + setverdict(pass); + } + + function f_test() { + timer t_tmr := 1.0, t_tmr2; + t_tmr.start; + activate(a(t_tmr)); + alt { + [] t_tmr2.timeout { } + } + } + + control{ + f_test(); + execute(TC_Sem_200502_the_activate_operation_008()); + } +} diff --git a/core_language/20_statement_and_operations_for_alt/2005_default_handling/200502_the_activate_operation/Sem_200502_the_activate_operation_009.ttcn b/core_language/20_statement_and_operations_for_alt/2005_default_handling/200502_the_activate_operation/Sem_200502_the_activate_operation_009.ttcn new file mode 100644 index 0000000..46e42e3 --- /dev/null +++ b/core_language/20_statement_and_operations_for_alt/2005_default_handling/200502_the_activate_operation/Sem_200502_the_activate_operation_009.ttcn @@ -0,0 +1,57 @@ +/*************************************************** + ** @author STF 487 (changed to positive by STF 572) + ** @version 0.0.2 + ** @purpose 1:20.5.2, local timer (referenced through timer parameter) as a parameter of activated altstep in module control + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// In TTCN-3:2018 and earlier versions of the core language standard, there was +// a restriction on control timers: +// For altsteps activated in module control or in functions or altsteps invoked +// directly or indirectly from module control, all timer instances in the actual +// parameter list shall be declared in the highest scope of the module control +// part (see clause 26.2). Timers from lower scopes of the module control part +// (i.e. from the nested statement blocks) are not allowed to occur in the actual +// parameter list. +// +// The restriction is no longer present and timers from lower scopes can be used +// as actual parameters. + +module Sem_200502_the_activate_operation_009 { + + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + altstep a(timer t_tmr) { + [] t_tmr.timeout { log ("Timeout in default"); } + } + + testcase TC_Sem_200502_the_activate_operation_009() runs on GeneralComp { + setverdict(pass); + } + + function f_activate(timer t_tmr) { + activate(a(t_tmr)); + } + + function f_test() { + timer t_tmr := 1.0; + t_tmr.start; + f_activate(t_tmr); // t_tmr is a local timer, this should lead to an activation error in f_activate + } + + control{ + timer t_tmr2; + f_test(); + alt { + [] t_tmr2.timeout { } + } + execute(TC_Sem_200502_the_activate_operation_009()); + } +} diff --git a/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/NegSem_210101_connect_and_map_operations_015.ttcn b/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/NegSem_210101_connect_and_map_operations_015.ttcn new file mode 100644 index 0000000..3b815c5 --- /dev/null +++ b/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/NegSem_210101_connect_and_map_operations_015.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:21.1.1, Ensure that the the IUT does not allows two output port connection + ** @verdict pass reject + ***************************************************/ +//Test the two output port cannot connect +module NegSem_210101_connect_and_map_operations_015{ + + type port myport message { + out integer + } + + +type component Mysystem + { + port myport messagePort; + } + +testcase TC_NegSem_210101_connect_and_map_operations_015() runs on Mysystem system Mysystem { + var Mysystem MyCompA; + var Mysystem MyCompB; + +MyCompA:=Mysystem.create; +MyCompB:=Mysystem.create; +connect(MyCompA:messagePort,MyCompB:messagePort); //not allowed messageports are output + +} +control{ + execute(TC_NegSem_210101_connect_and_map_operations_015()); +} +} + diff --git a/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/NegSem_210101_connect_and_map_operations_016.ttcn b/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/NegSem_210101_connect_and_map_operations_016.ttcn new file mode 100644 index 0000000..bb8429b --- /dev/null +++ b/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/NegSem_210101_connect_and_map_operations_016.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 451 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:21.1.1, Ensure that IUT cannot map input port with output port + ** @verdict pass reject + ***************************************************/ + +// Mycompport A P1 is output port mapped to SUT in port +module NegSem_210101_connect_and_map_operations_016{ + + type port loopbackPort message { + inout integer + } +type port IntegerOutputPortType message { + out integer + } + +type component GeneralComp + { + + port IntegerOutputPortType MycomportA + } + +type component MyTestSystemInterface + { + port loopbackPort messagePort + } +// MyTestSystemInterface is the test system interface +testcase TC_NegSem_210101_connect_and_map_operations_016() runs on GeneralComp system MyTestSystemInterface { +// establishing the port connections +map(mtc:MycomportA, system:messagePort); //not allowed: MycomportA is out port, meanwhile MySysteminterface port is input + +} +control{ + execute(TC_NegSem_210101_connect_and_map_operations_016()); +} +} \ No newline at end of file diff --git a/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/NegSem_210101_connect_and_map_operations_017.ttcn b/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/NegSem_210101_connect_and_map_operations_017.ttcn new file mode 100644 index 0000000..70d5fe2 --- /dev/null +++ b/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/NegSem_210101_connect_and_map_operations_017.ttcn @@ -0,0 +1,43 @@ +/*************************************************** + ** @author STF 451 (updated by STF 521 and 572) + ** @version 0.0.3 + ** @purpose 1:21.1.1, Ensure that the the IUT doesn't allow connecting ports with empty outlists + ** @verdict pass reject + ***************************************************/ +// The following requirements are tested: +// For the connect operations, only consistent connections are allowed. +// a) Assuming the following: +// 1) ports PORT1 and PORT2 are the ports to be connected or mappde; +// 2) inlist-PORT1 defines the messages or procedures of the in-direction of PORT1; +// 3) outlist-PORT1defines the messages or procedures of the out-direction of PORT1; +// 4) inlist-PORT2 defines the messages or procedures of the in-direction of PORT2; and +// 5) outlist-PORT2 defines the messages or procedures of the out-direction of PORT2. +// b) The connect operation is allowed if and only if: +// 1) outlist-PORT1 ⊆ inlist-PORT2 and outlist-PORT2 ⊆ inlist-PORT1; and +// 2) neither PORT1 nor PORT2 are system port references; and +// 3) at least one of outlist-PORT1 or outlist-PORT2 is not empty. +// +// In this test, both outlists are empty + +module NegSem_210101_connect_and_map_operations_017 { + + type port myport message { + in integer + } + + type component Mysystem { + port myport messagePort; + } + + testcase TC_NegSem_210101_connect_and_map_operations_017() runs on Mysystem system Mysystem { + var Mysystem MyCompA := Mysystem.create, + MyCompB := Mysystem.create; + connect(MyCompA:messagePort, MyCompB:messagePort); + setverdict(pass); + } + + control { + execute(TC_NegSem_210101_connect_and_map_operations_017(), 5.0); + } +} + diff --git a/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/NegSem_210101_connect_and_map_operations_018.ttcn b/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/NegSem_210101_connect_and_map_operations_018.ttcn new file mode 100644 index 0000000..0a6b9c3 --- /dev/null +++ b/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/NegSem_210101_connect_and_map_operations_018.ttcn @@ -0,0 +1,48 @@ +/*************************************************** + ** @author STF 451 (updated by STF 521 and 572) + ** @version 0.0.3 + ** @purpose 1:21.1.1, Ensure that IUT cannot map ports with empty outlist-PORT1 and inlist-PORT2 + ** @verdict pass reject + ***************************************************/ +// For the connect operations, only consistent connections are allowed. +// a) Assuming the following: +// 1) ports PORT1 and PORT2 are the ports to be connected or mappde; +// 2) inlist-PORT1 defines the messages or procedures of the in-direction of PORT1; +// 3) outlist-PORT1defines the messages or procedures of the out-direction of PORT1; +// 4) inlist-PORT2 defines the messages or procedures of the in-direction of PORT2; and +// 5) outlist-PORT2 defines the messages or procedures of the out-direction of PORT2. +// c) The map operation is allowed if and only if: +// 1) PORT1 is a component port reference and PORT2 is a system port reference; and +// 2) outlist PORT1 ⊆ outlist-PORT2 and inlist-PORT2 ⊆ inlist-PORT1; and +// 3) at least one of outlist-PORT1 or inlist-PORT2 is not empty +// +// In this test, outlist-PORT1 and inlist-PORT2 are empty + +module NegSem_210101_connect_and_map_operations_018 { + + type port LoopbackPort message { + out integer + } + type port IntegerOutputPortType message { + in integer + } + + type component GeneralComp { + port IntegerOutputPortType MycomportA + } + + type component MyTestSystemInterface { + port LoopbackPort messagePort + } + + // MyTestSystemInterface is the test system interface + testcase TC_NegSem_210101_connect_and_map_operations_018() runs on GeneralComp system MyTestSystemInterface { + // establishing the port connections + map(mtc:MycomportA, system:messagePort); //not allowed: MycomportA is in port, meanwhile MySysteminterface port is output + setverdict(pass); + } + + control { + execute(TC_NegSem_210101_connect_and_map_operations_018()); + } +} \ No newline at end of file diff --git a/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/NegSem_210101_connect_and_map_operations_019.ttcn b/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/NegSem_210101_connect_and_map_operations_019.ttcn new file mode 100644 index 0000000..f0e121a --- /dev/null +++ b/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/NegSem_210101_connect_and_map_operations_019.ttcn @@ -0,0 +1,39 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:21.1.1, Verify that it is not possible to connect a system port + ** @verdict pass reject + ***************************************************/ +// For the connect operations, only consistent connections are allowed. +// a) Assuming the following: +// 1) ports PORT1 and PORT2 are the ports to be connected or mappde; +// 2) inlist-PORT1 defines the messages or procedures of the in-direction of PORT1; +// 3) outlist-PORT1defines the messages or procedures of the out-direction of PORT1; +// 4) inlist-PORT2 defines the messages or procedures of the in-direction of PORT2; and +// 5) outlist-PORT2 defines the messages or procedures of the out-direction of PORT2. +// b) The connect operation is allowed if and only if: +// 1) outlist-PORT1 ⊆ inlist-PORT2 and outlist-PORT2 ⊆ inlist-PORT1; and +// 2) neither PORT1 nor PORT2 are system port references; and +// 3) at least one of outlist-PORT1 or outlist-PORT2 is not empty. + +module NegSem_210101_connect_and_map_operations_019 { + + type port P message { + inout integer + } + + type component GeneralComp { + port P p; + } + + // MyTestSystemInterface is the test system interface + testcase TC_NegSem_210101_connect_and_map_operations_019() runs on GeneralComp system GeneralComp { + // establishing the port connections + connect(mtc:p, system:p); + setverdict(pass); + } + + control { + execute(TC_NegSem_210101_connect_and_map_operations_019()); + } +} \ No newline at end of file diff --git a/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/NegSem_210101_connect_and_map_operations_020.ttcn b/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/NegSem_210101_connect_and_map_operations_020.ttcn new file mode 100644 index 0000000..7c59b95 --- /dev/null +++ b/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/NegSem_210101_connect_and_map_operations_020.ttcn @@ -0,0 +1,40 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:21.1.1, Verify that it is not possible to map two component ports + ** @verdict pass reject + ***************************************************/ +// For the connect operations, only consistent connections are allowed. +// a) Assuming the following: +// 1) ports PORT1 and PORT2 are the ports to be connected or mappde; +// 2) inlist-PORT1 defines the messages or procedures of the in-direction of PORT1; +// 3) outlist-PORT1defines the messages or procedures of the out-direction of PORT1; +// 4) inlist-PORT2 defines the messages or procedures of the in-direction of PORT2; and +// 5) outlist-PORT2 defines the messages or procedures of the out-direction of PORT2. +// c) The map operation is allowed if and only if: +// 1) PORT1 is a component port reference and PORT2 is a system port reference; and +// 2) outlist PORT1 ⊆ outlist-PORT2 and inlist-PORT2 ⊆ inlist-PORT1; and +// 3) at least one of outlist-PORT1 or inlist-PORT2 is not empty + +module NegSem_210101_connect_and_map_operations_020 { + + type port P message { + inout integer + } + + type component GeneralComp { + port P p; + } + + // MyTestSystemInterface is the test system interface + testcase TC_NegSem_210101_connect_and_map_operations_020() runs on GeneralComp system GeneralComp { + // establishing the port connections + var GeneralComp v_ptc := GeneralComp.create; + map(mtc:p, v_ptc:p); + setverdict(pass); + } + + control { + execute(TC_NegSem_210101_connect_and_map_operations_020()); + } +} \ No newline at end of file diff --git a/core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/NegSem_210102_disconnect_and_unmap_operations_015.ttcn b/core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/NegSem_210102_disconnect_and_unmap_operations_015.ttcn new file mode 100644 index 0000000..8046acc --- /dev/null +++ b/core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/NegSem_210102_disconnect_and_unmap_operations_015.ttcn @@ -0,0 +1,32 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:21.1.2, Verify that the disconnect operation cannot contain a system port reference + ** @verdict pass reject + ***************************************************/ + +// The following requirements are tested: +// d) The disconnect operation parameters shall not contain a system port reference. + +module NegSem_210102_disconnect_and_unmap_operations_015 { + + type port P message { + inout integer + } + + type component GeneralComp + { + port P p; + } + + testcase TC_NegSem_210102_disconnect_and_unmap_operations_015() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + + connect(self:p, v_ptc:p); + disconnect(system:p); // system port reference: error expected + } + control{ + execute(TC_NegSem_210102_disconnect_and_unmap_operations_015()); + } +} + diff --git a/core_language/21_configuration_operations/2103_test_component_operations/210307_done_operation/NegSyn_210307_done_operation_005.ttcn b/core_language/21_configuration_operations/2103_test_component_operations/210307_done_operation/NegSyn_210307_done_operation_005.ttcn new file mode 100644 index 0000000..a939a48 --- /dev/null +++ b/core_language/21_configuration_operations/2103_test_component_operations/210307_done_operation/NegSyn_210307_done_operation_005.ttcn @@ -0,0 +1,33 @@ +/***************************************************************** + ** @author STF T003 + ** @version 0.0.1 + ** @purpose 1:21.3.7, Ensure that @nodefault modifier is allowed only in stand-alone done statements. + ** @verdict pass reject, noexecution + *****************************************************************/ + +// The following requirements are tested: +// Restrcition j): The @nodefault modifier is allowed only in stand-alone done statements. + +module NegSyn_210307_done_operation_005{ + + type component GeneralComp {} + + function f() runs on GeneralComp { + setverdict(pass); + } + + testcase TC_NegSyn_210307_done_operation_005() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc; + v_ptc := GeneralComp.create; + v_ptc.start(f()); + // error: The @nodefault modifier is allowed only in stand-alone done statements. + alt + { + [] @nodefault v_ptc.done { setverdict(fail, "The done operation didn't found stopped or killed component"); } + [else] { setverdict(pass); } + } + } + + control { + } +} \ No newline at end of file diff --git a/core_language/21_configuration_operations/2103_test_component_operations/210307_done_operation/Sem_210307_done_operation_013.ttcn b/core_language/21_configuration_operations/2103_test_component_operations/210307_done_operation/Sem_210307_done_operation_013.ttcn new file mode 100644 index 0000000..191199e --- /dev/null +++ b/core_language/21_configuration_operations/2103_test_component_operations/210307_done_operation/Sem_210307_done_operation_013.ttcn @@ -0,0 +1,35 @@ +/***************************************************************** + ** @author STF T003 + ** @version 0.0.1 + ** @purpose 1:21.3.7, Ensure that @nodefault modifier with done works properly + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// The following requirements are tested: + +// Restrcition j): The @nodefault modifier is allowed only in stand-alone done statements. + +module Sem_210307_done_operation_013 { + + type component GeneralComp {} + function f1 ( ) runs on GeneralComp {} + + testcase TC_Sem_210307_done_operation_013() runs on GeneralComp system GeneralComp { + var GeneralComp ptc; + var GeneralComp ptc2; + ptc:=GeneralComp.create alive; + ptc2:=GeneralComp.create alive; + + ptc.start(f1()); + ptc2.start(f1()); + + // done as stand-alone statement: + @nodefault all component.done; + + setverdict(pass); + + } + + control { + execute(TC_Sem_210307_done_operation_013(), 5.0); + } +} \ No newline at end of file diff --git a/core_language/21_configuration_operations/2103_test_component_operations/210307_done_operation/Sem_210307_done_operation_014.ttcn b/core_language/21_configuration_operations/2103_test_component_operations/210307_done_operation/Sem_210307_done_operation_014.ttcn new file mode 100644 index 0000000..c21ab82 --- /dev/null +++ b/core_language/21_configuration_operations/2103_test_component_operations/210307_done_operation/Sem_210307_done_operation_014.ttcn @@ -0,0 +1,37 @@ +/***************************************************************** + ** @author STF T003 + ** @version 0.0.1 + ** @purpose 1:21.3.7, Ensure that @nodefault modifier with done works properly + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// The following requirements are tested: + +// Restrcition j): The @nodefault modifier is allowed only in stand-alone done statements. + +module Sem_210307_done_operation_014 { + + type component GeneralComp {} + function f1 ( ) runs on GeneralComp {} + + testcase TC_Sem_210307_done_operation_014() runs on GeneralComp system GeneralComp { + var GeneralComp ptc; + var GeneralComp ptc2; + ptc:=GeneralComp.create alive; + ptc2:=GeneralComp.create alive; + + ptc.start(f1()); + ptc2.start(f1()); + + // same as @nodefault all component.done; + alt @nodefault { + [] all component.done {setverdict(pass); } + } + + + + } + + control { + execute(TC_Sem_210307_done_operation_014(), 5.0); + } +} \ No newline at end of file diff --git a/core_language/21_configuration_operations/2103_test_component_operations/210308_killed_operation/NegSyn_210308_killed_operation_005.ttcn b/core_language/21_configuration_operations/2103_test_component_operations/210308_killed_operation/NegSyn_210308_killed_operation_005.ttcn new file mode 100644 index 0000000..7d098a2 --- /dev/null +++ b/core_language/21_configuration_operations/2103_test_component_operations/210308_killed_operation/NegSyn_210308_killed_operation_005.ttcn @@ -0,0 +1,35 @@ +/***************************************************************** + ** @author STF T003 + ** @version 0.0.1 + ** @purpose 1:21.3.8, Ensure that the alive keyword is properly evaluated + ** @verdict pass reject, noexectuion + *****************************************************************/ + +// The following requirements are tested: +// Restrcition j): The @nodefault modifier is allowed only in stand-alone killed statements. + +module NegSyn_210308_killed_operation_005 { + + type component GeneralComp {} + function f1 ( ) runs on GeneralComp {} + + testcase TC_NegSyn_210308_killed_operation_005() runs on GeneralComp system GeneralComp { + + var GeneralComp ptc; + ptc:=GeneralComp.create alive; + ptc.start(f1()); + ptc.kill; + + // error: @nodefault before killed is not allowed, since it is not a stand-alone statement + alt { + [] @nodefault ptc.killed {setverdict(fail);} + [] ptc2.killed {setverdict(pass);} + } + + + } + + control { + // execute(TC_NegSyn_210308_killed_operation_005()); + } +} \ No newline at end of file diff --git a/core_language/21_configuration_operations/2103_test_component_operations/210308_killed_operation/Sem_210308_killed_operation_015.ttcn b/core_language/21_configuration_operations/2103_test_component_operations/210308_killed_operation/Sem_210308_killed_operation_015.ttcn new file mode 100644 index 0000000..1cc4f28 --- /dev/null +++ b/core_language/21_configuration_operations/2103_test_component_operations/210308_killed_operation/Sem_210308_killed_operation_015.ttcn @@ -0,0 +1,32 @@ +/***************************************************************** + ** @author STF T003 + ** @version 0.0.1 + ** @purpose 1:21.3.8, Ensure that @nodefault modifier works properly with killed operator + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// The following requirements are tested: + +// Restrcition j): The @nodefault modifier is allowed only in stand-alone killed statements. + +module Sem_210308_killed_operation_015 { + + type component GeneralComp {} + function f1 ( ) runs on GeneralComp {} + + testcase TC_Sem_210308_killed_operation_015() runs on GeneralComp system GeneralComp { + var GeneralComp ptc; + ptc:=GeneralComp.create alive; + + ptc.start(f1()); + ptc.kill; + + // killed as stand-alone statement: + @nodefault ptc.killed; + setverdict(pass); + + } + + control { + execute(TC_Sem_210308_killed_operation_015()); + } +} \ No newline at end of file diff --git a/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/NegSem_210310_call_test_component_operation_001.ttcn b/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/NegSem_210310_call_test_component_operation_001.ttcn new file mode 100644 index 0000000..1914ffa --- /dev/null +++ b/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/NegSem_210310_call_test_component_operation_001.ttcn @@ -0,0 +1,28 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:21.3.10, call operation with uncaught stop + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// In all other cases when theexecution is incomplete, the call operation ends with a test case error. + +module NegSem_210310_call_test_component_operation_001 { + + type component GeneralComp {} + + function f() runs on GeneralComp { + stop; + } + + testcase TC_NegSem_210310_call_test_component_operation_001() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + v_ptc.call(f()); + setverdict(pass); + } + + control { + execute(TC_NegSem_210310_call_test_component_operation_001(), 5.0); + } +} \ No newline at end of file diff --git a/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/NegSem_210310_call_test_component_operation_002.ttcn b/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/NegSem_210310_call_test_component_operation_002.ttcn new file mode 100644 index 0000000..add8d6e --- /dev/null +++ b/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/NegSem_210310_call_test_component_operation_002.ttcn @@ -0,0 +1,31 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:21.3.10, call operation with uncaught timeout + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// In all other cases when theexecution is incomplete, the call operation ends with a test case error. + +module NegSem_210310_call_test_component_operation_002 { + + type component GeneralComp {} + + function f() runs on GeneralComp { + timer t := 3.0; + t.start; + t.timeout; + setverdict(fail); // call timeout should occur before this + } + + testcase TC_NegSem_210310_call_test_component_operation_002() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + v_ptc.call(f(), 1.0); + setverdict(pass); + } + + control { + execute(TC_NegSem_210310_call_test_component_operation_002(), 5.0); + } +} \ No newline at end of file diff --git a/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/NegSem_210310_call_test_component_operation_003.ttcn b/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/NegSem_210310_call_test_component_operation_003.ttcn new file mode 100644 index 0000000..10523c0 --- /dev/null +++ b/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/NegSem_210310_call_test_component_operation_003.ttcn @@ -0,0 +1,30 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:21.3.10, repeated call of a non-alive component + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// If the called component is not created alive and has already been started or called once or if +// it has been killed, additional call operations are not allowed. + +module NegSem_210310_call_test_component_operation_003 { + + type component GeneralComp {} + + function f() runs on GeneralComp { + setverdict(pass); + } + + testcase TC_NegSem_210310_call_test_component_operation_003() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + v_ptc.call(f()); + v_ptc.call(f()); // error expected + setverdict(pass); + } + + control { + execute(TC_NegSem_210310_call_test_component_operation_003(), 5.0); + } +} \ No newline at end of file diff --git a/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/NegSem_210310_call_test_component_operation_004.ttcn b/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/NegSem_210310_call_test_component_operation_004.ttcn new file mode 100644 index 0000000..315742c --- /dev/null +++ b/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/NegSem_210310_call_test_component_operation_004.ttcn @@ -0,0 +1,28 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:21.3.10, call operation invoked on a non-component object + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// The ObjectReference shall be of a component type. + +module NegSem_210310_call_test_component_operation_004 { + + type component GeneralComp {} + + function f() runs on GeneralComp { + setverdict(pass); + } + + testcase TC_NegSem_210310_call_test_component_operation_004() runs on GeneralComp system GeneralComp { + timer t; + t.call(f()); + setverdict(pass); + } + + control { + execute(TC_NegSem_210310_call_test_component_operation_004(), 5.0); + } +} \ No newline at end of file diff --git a/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/NegSem_210310_call_test_component_operation_005.ttcn b/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/NegSem_210310_call_test_component_operation_005.ttcn new file mode 100644 index 0000000..4a5c71e --- /dev/null +++ b/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/NegSem_210310_call_test_component_operation_005.ttcn @@ -0,0 +1,32 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:21.3.10, calling a function on an incompatible component + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// The function or altstep invoked in a call test component operation shall have a runs on definition +// referencing a component type to which the called component is compatible (see clause 6.3.3). + +module NegSem_210310_call_test_component_operation_005 { + + type component GeneralComp {} + type component OtherComp { + var integer vc_int; + } + + function f() runs on OtherComp { + setverdict(pass); + } + + testcase TC_NegSem_210310_call_test_component_operation_005() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + v_ptc.call(f()); + setverdict(pass); + } + + control { + execute(TC_NegSem_210310_call_test_component_operation_005(), 5.0); + } +} \ No newline at end of file diff --git a/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/NegSem_210310_call_test_component_operation_006.ttcn b/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/NegSem_210310_call_test_component_operation_006.ttcn new file mode 100644 index 0000000..6f8bf8e --- /dev/null +++ b/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/NegSem_210310_call_test_component_operation_006.ttcn @@ -0,0 +1,33 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:21.3.10, call operation with a port parameter + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// Ports, defaults and timers shall not be passed into a function or altstep invoked in a call test +// component operation. All formal parameter types of the behaviour shall neither be of a port, +// default or timer type nor should contain a direct or indirect element or field of a port, default +// or timer type. + +module NegSem_210310_call_test_component_operation_006 { + type port P message { + inout integer; + } + type component GeneralComp {} + + function f(P p_par) runs on GeneralComp { + setverdict(pass); + } + + testcase TC_NegSem_210310_call_test_component_operation_006() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + v_ptc.call(f(null)); + setverdict(pass); + } + + control { + execute(TC_NegSem_210310_call_test_component_operation_006(), 5.0); + } +} \ No newline at end of file diff --git a/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/NegSem_210310_call_test_component_operation_007.ttcn b/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/NegSem_210310_call_test_component_operation_007.ttcn new file mode 100644 index 0000000..4735438 --- /dev/null +++ b/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/NegSem_210310_call_test_component_operation_007.ttcn @@ -0,0 +1,30 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:21.3.10, call operation with a timer parameter + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// Ports, defaults and timers shall not be passed into a function or altstep invoked in a call test +// component operation. All formal parameter types of the behaviour shall neither be of a port, +// default or timer type nor should contain a direct or indirect element or field of a port, default +// or timer type. + +module NegSem_210310_call_test_component_operation_007 { + type component GeneralComp {} + + function f(timer p_par) runs on GeneralComp { + setverdict(pass); + } + + testcase TC_NegSem_210310_call_test_component_operation_007() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + v_ptc.call(f(null)); + setverdict(pass); + } + + control { + execute(TC_NegSem_210310_call_test_component_operation_007(), 5.0); + } +} \ No newline at end of file diff --git a/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/NegSem_210310_call_test_component_operation_008.ttcn b/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/NegSem_210310_call_test_component_operation_008.ttcn new file mode 100644 index 0000000..12a7157 --- /dev/null +++ b/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/NegSem_210310_call_test_component_operation_008.ttcn @@ -0,0 +1,30 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:21.3.10, call operation with a parameter of the default type + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// Ports, defaults and timers shall not be passed into a function or altstep invoked in a call test +// component operation. All formal parameter types of the behaviour shall neither be of a port, +// default or timer type nor should contain a direct or indirect element or field of a port, default +// or timer type. + +module NegSem_210310_call_test_component_operation_008 { + type component GeneralComp {} + + function f(default p_par) runs on GeneralComp { + setverdict(pass); + } + + testcase TC_NegSem_210310_call_test_component_operation_008() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + v_ptc.call(f(null)); + setverdict(pass); + } + + control { + execute(TC_NegSem_210310_call_test_component_operation_008(), 5.0); + } +} \ No newline at end of file diff --git a/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/NegSem_210310_call_test_component_operation_009.ttcn b/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/NegSem_210310_call_test_component_operation_009.ttcn new file mode 100644 index 0000000..c0ba304 --- /dev/null +++ b/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/NegSem_210310_call_test_component_operation_009.ttcn @@ -0,0 +1,36 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:21.3.10, call operation with a port element in a parameter + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// Ports, defaults and timers shall not be passed into a function or altstep invoked in a call test +// component operation. All formal parameter types of the behaviour shall neither be of a port, +// default or timer type nor should contain a direct or indirect element or field of a port, default +// or timer type. + +module NegSem_210310_call_test_component_operation_009 { + type port P message { + inout integer; + } + type record R { + P field1 + } + type component GeneralComp {} + + function f(R p_par) runs on GeneralComp { + setverdict(pass); + } + + testcase TC_NegSem_210310_call_test_component_operation_009() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + v_ptc.call(f({ field1 := null })); + setverdict(pass); + } + + control { + execute(TC_NegSem_210310_call_test_component_operation_009(), 5.0); + } +} \ No newline at end of file diff --git a/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/NegSem_210310_call_test_component_operation_010.ttcn b/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/NegSem_210310_call_test_component_operation_010.ttcn new file mode 100644 index 0000000..eba633f --- /dev/null +++ b/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/NegSem_210310_call_test_component_operation_010.ttcn @@ -0,0 +1,33 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:21.3.10, call operation with a timer element in a parameter + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// Ports, defaults and timers shall not be passed into a function or altstep invoked in a call test +// component operation. All formal parameter types of the behaviour shall neither be of a port, +// default or timer type nor should contain a direct or indirect element or field of a port, default +// or timer type. + +module NegSem_210310_call_test_component_operation_010 { + type record R { + timer field1 + } + type component GeneralComp {} + + function f(R p_par) runs on GeneralComp { + setverdict(pass); + } + + testcase TC_NegSem_210310_call_test_component_operation_010() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + v_ptc.call(f({ field1 := null })); + setverdict(pass); + } + + control { + execute(TC_NegSem_210310_call_test_component_operation_010(), 5.0); + } +} \ No newline at end of file diff --git a/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/NegSem_210310_call_test_component_operation_011.ttcn b/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/NegSem_210310_call_test_component_operation_011.ttcn new file mode 100644 index 0000000..96cb37a --- /dev/null +++ b/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/NegSem_210310_call_test_component_operation_011.ttcn @@ -0,0 +1,33 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:21.3.10, call operation with a default element in a parameter + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// Ports, defaults and timers shall not be passed into a function or altstep invoked in a call test +// component operation. All formal parameter types of the behaviour shall neither be of a port, +// default or timer type nor should contain a direct or indirect element or field of a port, default +// or timer type. + +module NegSem_210310_call_test_component_operation_011 { + type record R { + default field1 + } + type component GeneralComp {} + + function f(R p_par) runs on GeneralComp { + setverdict(pass); + } + + testcase TC_NegSem_210310_call_test_component_operation_011() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + v_ptc.call(f({ field1 := null })); + setverdict(pass); + } + + control { + execute(TC_NegSem_210310_call_test_component_operation_011(), 5.0); + } +} \ No newline at end of file diff --git a/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/NegSem_210310_call_test_component_operation_012.ttcn b/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/NegSem_210310_call_test_component_operation_012.ttcn new file mode 100644 index 0000000..a3c74da --- /dev/null +++ b/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/NegSem_210310_call_test_component_operation_012.ttcn @@ -0,0 +1,33 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:21.3.10, call operation returning a port + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// The return value of the function or altstep invoked from a call test component operation neither +// be of a port, default or timer type nor should contain a direct or indirect element or field of +// a port, default or timer type. + +module NegSem_210310_call_test_component_operation_012 { + type port P message { + inout integer; + } + type component GeneralComp {} + + function f() runs on GeneralComp return P { + setverdict(pass); + return null; + } + + testcase TC_NegSem_210310_call_test_component_operation_012() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + v_ptc.call(f()); + setverdict(pass); + } + + control { + execute(TC_NegSem_210310_call_test_component_operation_012(), 5.0); + } +} \ No newline at end of file diff --git a/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/NegSem_210310_call_test_component_operation_013.ttcn b/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/NegSem_210310_call_test_component_operation_013.ttcn new file mode 100644 index 0000000..470c71f --- /dev/null +++ b/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/NegSem_210310_call_test_component_operation_013.ttcn @@ -0,0 +1,30 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:21.3.10, call operation returning a default + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// The return value of the function or altstep invoked from a call test component operation neither +// be of a port, default or timer type nor should contain a direct or indirect element or field of +// a port, default or timer type. + +module NegSem_210310_call_test_component_operation_013 { + type component GeneralComp {} + + function f() runs on GeneralComp return default { + setverdict(pass); + return null; + } + + testcase TC_NegSem_210310_call_test_component_operation_013() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + v_ptc.call(f()); + setverdict(pass); + } + + control { + execute(TC_NegSem_210310_call_test_component_operation_013(), 5.0); + } +} \ No newline at end of file diff --git a/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/NegSem_210310_call_test_component_operation_014.ttcn b/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/NegSem_210310_call_test_component_operation_014.ttcn new file mode 100644 index 0000000..793ae8a --- /dev/null +++ b/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/NegSem_210310_call_test_component_operation_014.ttcn @@ -0,0 +1,30 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:21.3.10, call operation returning a timer + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// The return value of the function or altstep invoked from a call test component operation neither +// be of a port, default or timer type nor should contain a direct or indirect element or field of +// a port, default or timer type. + +module NegSem_210310_call_test_component_operation_014 { + type component GeneralComp {} + + function f() runs on GeneralComp return timer { + setverdict(pass); + return null; + } + + testcase TC_NegSem_210310_call_test_component_operation_014() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + v_ptc.call(f()); + setverdict(pass); + } + + control { + execute(TC_NegSem_210310_call_test_component_operation_014(), 5.0); + } +} \ No newline at end of file diff --git a/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/NegSem_210310_call_test_component_operation_015.ttcn b/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/NegSem_210310_call_test_component_operation_015.ttcn new file mode 100644 index 0000000..39ad68b --- /dev/null +++ b/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/NegSem_210310_call_test_component_operation_015.ttcn @@ -0,0 +1,36 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:21.3.10, call operation returning a structured value containing a port element + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// The return value of the function or altstep invoked from a call test component operation neither +// be of a port, default or timer type nor should contain a direct or indirect element or field of +// a port, default or timer type. + +module NegSem_210310_call_test_component_operation_015 { + type port P message { + inout integer; + } + type record R { + P field1 + } + type component GeneralComp {} + + function f() runs on GeneralComp return R { + setverdict(pass); + return { field1 := null }; + } + + testcase TC_NegSem_210310_call_test_component_operation_015() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + v_ptc.call(f()); + setverdict(pass); + } + + control { + execute(TC_NegSem_210310_call_test_component_operation_015(), 5.0); + } +} \ No newline at end of file diff --git a/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/NegSem_210310_call_test_component_operation_016.ttcn b/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/NegSem_210310_call_test_component_operation_016.ttcn new file mode 100644 index 0000000..235ea69 --- /dev/null +++ b/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/NegSem_210310_call_test_component_operation_016.ttcn @@ -0,0 +1,33 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:21.3.10, call operation returning a structured value containing a default element + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// The return value of the function or altstep invoked from a call test component operation neither +// be of a port, default or timer type nor should contain a direct or indirect element or field of +// a port, default or timer type. + +module NegSem_210310_call_test_component_operation_016 { + type record R { + default field1 + } + type component GeneralComp {} + + function f() runs on GeneralComp return R { + setverdict(pass); + return { field1 := null }; + } + + testcase TC_NegSem_210310_call_test_component_operation_016() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + v_ptc.call(f()); + setverdict(pass); + } + + control { + execute(TC_NegSem_210310_call_test_component_operation_016(), 5.0); + } +} \ No newline at end of file diff --git a/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/NegSem_210310_call_test_component_operation_017.ttcn b/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/NegSem_210310_call_test_component_operation_017.ttcn new file mode 100644 index 0000000..512ab5d --- /dev/null +++ b/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/NegSem_210310_call_test_component_operation_017.ttcn @@ -0,0 +1,33 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:21.3.10, call operation returning a structured value containing a timer element + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// The return value of the function or altstep invoked from a call test component operation neither +// be of a port, default or timer type nor should contain a direct or indirect element or field of +// a port, default or timer type. + +module NegSem_210310_call_test_component_operation_017 { + type record R { + timer field1 + } + type component GeneralComp {} + + function f() runs on GeneralComp return R { + setverdict(pass); + return { field1 := null }; + } + + testcase TC_NegSem_210310_call_test_component_operation_017() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + v_ptc.call(f()); + setverdict(pass); + } + + control { + execute(TC_NegSem_210310_call_test_component_operation_017(), 5.0); + } +} \ No newline at end of file diff --git a/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/NegSem_210310_call_test_component_operation_018.ttcn b/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/NegSem_210310_call_test_component_operation_018.ttcn new file mode 100644 index 0000000..3824bf5 --- /dev/null +++ b/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/NegSem_210310_call_test_component_operation_018.ttcn @@ -0,0 +1,28 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:21.3.10, call operation with incompatible value in the timeout parameter + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// The optional SimpleExpression representing the timer value shall be of a float type. + +module NegSem_210310_call_test_component_operation_018 { + + type component GeneralComp {} + + function f() runs on GeneralComp { + setverdict(pass); + } + + testcase TC_NegSem_210310_call_test_component_operation_018() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + v_ptc.call(f(), "2.0"); + setverdict(pass); + } + + control { + execute(TC_NegSem_210310_call_test_component_operation_018(), 5.0); + } +} \ No newline at end of file diff --git a/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/NegSem_210310_call_test_component_operation_019.ttcn b/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/NegSem_210310_call_test_component_operation_019.ttcn new file mode 100644 index 0000000..788c181 --- /dev/null +++ b/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/NegSem_210310_call_test_component_operation_019.ttcn @@ -0,0 +1,29 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:21.3.10, call operation with a catch timeout clause but without a timeout value + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// The optional catch timeout clause may be present only if the timeout value has been defined. + +module NegSem_210310_call_test_component_operation_019 { + + type component GeneralComp {} + + function f() runs on GeneralComp { + setverdict(pass); + } + + testcase TC_NegSem_210310_call_test_component_operation_019() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + v_ptc.call(f()) catch(timeout) { + } + setverdict(pass); + } + + control { + execute(TC_NegSem_210310_call_test_component_operation_019(), 5.0); + } +} \ No newline at end of file diff --git a/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/NegSem_210310_call_test_component_operation_020.ttcn b/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/NegSem_210310_call_test_component_operation_020.ttcn new file mode 100644 index 0000000..a8618cf --- /dev/null +++ b/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/NegSem_210310_call_test_component_operation_020.ttcn @@ -0,0 +1,30 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:21.3.10, call operation with an incompatible variable in the value clause + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// The variable in the value clause shall be compatible with the return value of the invoked function. + +module NegSem_210310_call_test_component_operation_020 { + + type component GeneralComp {} + + function f() runs on GeneralComp return integer { + setverdict(pass); + return 1; + } + + testcase TC_NegSem_210310_call_test_component_operation_020() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + var charstring v_str; + v_ptc.call(f()) -> value v_str; + setverdict(pass); + } + + control { + execute(TC_NegSem_210310_call_test_component_operation_020(), 5.0); + } +} \ No newline at end of file diff --git a/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/NegSem_210310_call_test_component_operation_021.ttcn b/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/NegSem_210310_call_test_component_operation_021.ttcn new file mode 100644 index 0000000..eac43b6 --- /dev/null +++ b/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/NegSem_210310_call_test_component_operation_021.ttcn @@ -0,0 +1,29 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:21.3.10, call operation with a value clause calling a function with no return value + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// The variable in the value clause shall be compatible with the return value of the invoked function. + +module NegSem_210310_call_test_component_operation_021 { + + type component GeneralComp {} + + function f() runs on GeneralComp { + setverdict(pass); + } + + testcase TC_NegSem_210310_call_test_component_operation_021() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + var charstring v_str; + v_ptc.call(f()) -> value v_str; + setverdict(pass); + } + + control { + execute(TC_NegSem_210310_call_test_component_operation_021(), 5.0); + } +} \ No newline at end of file diff --git a/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/NegSem_210310_call_test_component_operation_022.ttcn b/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/NegSem_210310_call_test_component_operation_022.ttcn new file mode 100644 index 0000000..5177b37 --- /dev/null +++ b/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/NegSem_210310_call_test_component_operation_022.ttcn @@ -0,0 +1,33 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:21.3.10, call operation with an incompatible value in the verdict clause + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// The variable in the verdict clause shall be of type verdicttype. + +module NegSem_210310_call_test_component_operation_022 { + + type component GeneralComp {} + + function f() runs on GeneralComp { + setverdict(pass); + } + + testcase TC_NegSem_210310_call_test_component_operation_022() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + var integer v_verdict; + v_ptc.call(f()) -> verdict v_verdict; + if (v_verdict == 1) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_NegSem_210310_call_test_component_operation_022(), 5.0); + } +} \ No newline at end of file diff --git a/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/Sem_210310_call_test_component_operation_001.ttcn b/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/Sem_210310_call_test_component_operation_001.ttcn new file mode 100644 index 0000000..82c8220 --- /dev/null +++ b/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/Sem_210310_call_test_component_operation_001.ttcn @@ -0,0 +1,37 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:21.3.10, call operation calling a function with no timeout + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// Similar to the start operation on test components which is not blocking, the blocking call +// operation implicitly uses a start operation, but waits until either the started behaviour has +// terminated or some timeout has occurred. + +module Sem_210310_call_test_component_operation_001 { + + type component GeneralComp {} + + function f() runs on GeneralComp { + timer t := 1.0; + t.start; + t.timeout; + setverdict(pass); + } + + testcase TC_Sem_210310_call_test_component_operation_001() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + v_ptc.call(f()); + if (v_ptc.running) { + setverdict(fail); + } else { + setverdict(pass); + } + } + + control { + execute(TC_Sem_210310_call_test_component_operation_001(), 5.0); + } +} \ No newline at end of file diff --git a/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/Sem_210310_call_test_component_operation_002.ttcn b/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/Sem_210310_call_test_component_operation_002.ttcn new file mode 100644 index 0000000..35e5cf3 --- /dev/null +++ b/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/Sem_210310_call_test_component_operation_002.ttcn @@ -0,0 +1,42 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:21.3.10, call operation calling an altstep with no timeout + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// Similar to the start operation on test components which is not blocking, the blocking call +// operation implicitly uses a start operation, but waits until either the started behaviour has +// terminated or some timeout has occurred. + +module Sem_210310_call_test_component_operation_002 { + type port P message { + inout integer; + } + type component GeneralComp { + port P p; + } + + altstep a_test() runs on GeneralComp { + [] p.receive { + setverdict(pass); + } + } + + testcase TC_Sem_210310_call_test_component_operation_002() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p, v_ptc:p); + p.send(1); + v_ptc.call(a_test()); + if (v_ptc.running) { + setverdict(fail); + } else { + setverdict(pass); + } + } + + control { + execute(TC_Sem_210310_call_test_component_operation_002(), 5.0); + } +} \ No newline at end of file diff --git a/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/Sem_210310_call_test_component_operation_003.ttcn b/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/Sem_210310_call_test_component_operation_003.ttcn new file mode 100644 index 0000000..39b9c93 --- /dev/null +++ b/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/Sem_210310_call_test_component_operation_003.ttcn @@ -0,0 +1,37 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:21.3.10, call operation calling a function with timeout + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// A timeout duration in seconds can be given explicitly in the form of a SimpleExpression as +// an additional parameter to the call operation. If no timeout duration is given, an infinite +// timeout duration is used. + +module Sem_210310_call_test_component_operation_003 { + + type component GeneralComp {} + + function f() runs on GeneralComp { + timer t := 1.0; + t.start; + t.timeout; + setverdict(pass); + } + + testcase TC_Sem_210310_call_test_component_operation_003() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + v_ptc.call(f(), 2.0); + if (v_ptc.running) { + setverdict(fail); + } else { + setverdict(pass); + } + } + + control { + execute(TC_Sem_210310_call_test_component_operation_003(), 5.0); + } +} \ No newline at end of file diff --git a/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/Sem_210310_call_test_component_operation_004.ttcn b/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/Sem_210310_call_test_component_operation_004.ttcn new file mode 100644 index 0000000..0aae439 --- /dev/null +++ b/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/Sem_210310_call_test_component_operation_004.ttcn @@ -0,0 +1,37 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:21.3.10, call operation with catch stop + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// If the i incomplete execution occurs because the called component was stopped or killed and +// a catch stop clause is added to the call operation, the StatementBlock of that clause is +// executed before the call operation terminates. + +module Sem_210310_call_test_component_operation_004 { + + type component GeneralComp {} + + function f() runs on GeneralComp { + stop; + } + + testcase TC_Sem_210310_call_test_component_operation_004() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + var boolean v_stopped := false; + v_ptc.call(f()) catch (stop) { + v_stopped := true; + } + if (v_stopped) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_210310_call_test_component_operation_004(), 5.0); + } +} \ No newline at end of file diff --git a/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/Sem_210310_call_test_component_operation_005.ttcn b/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/Sem_210310_call_test_component_operation_005.ttcn new file mode 100644 index 0000000..684f767 --- /dev/null +++ b/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/Sem_210310_call_test_component_operation_005.ttcn @@ -0,0 +1,40 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:21.3.10, call operation with catch timeout + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// If the started behaviour does not terminate in the given timeout duration and a catch timout +// clause is added to the call operation, the called component is implicitly stopped and +// the StatementBlock of the catch timeout clause is executed before the call operation terminates. + +module Sem_210310_call_test_component_operation_005 { + + type component GeneralComp {} + + function f() runs on GeneralComp { + timer t := 3.0; + t.start; + t.timeout; + setverdict(fail); // call timeout should occur before this + } + + testcase TC_Sem_210310_call_test_component_operation_005() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + var boolean v_timeout := false; + v_ptc.call(f(), 1.0) catch(timeout) { + v_timeout := true; + } + if (v_timeout) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_210310_call_test_component_operation_005(), 5.0); + } +} \ No newline at end of file diff --git a/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/Sem_210310_call_test_component_operation_006.ttcn b/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/Sem_210310_call_test_component_operation_006.ttcn new file mode 100644 index 0000000..731a7d9 --- /dev/null +++ b/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/Sem_210310_call_test_component_operation_006.ttcn @@ -0,0 +1,37 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:21.3.10, call operation calling a function with out and inout parameters + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// After complete execution of the started behaviour, the out and inout actual parameters given +// to the actual parameter list of the called function or altstep instance will be updated in the +// same manner as if it was a normal function/altstep invocation. + +module Sem_210310_call_test_component_operation_006 { + + type component GeneralComp {} + + function f(out integer p_par1, inout integer p_par2) runs on GeneralComp { + p_par1 := 10; + p_par2 := p_par2 * 2; + setverdict(pass); + } + + testcase TC_Sem_210310_call_test_component_operation_006() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + var integer v_var1 := 0, v_var2 := 3; + v_ptc.call(f(v_var1, v_var2)); + if (v_var1 == 10 and v_var2 == 6) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_210310_call_test_component_operation_006(), 5.0); + } +} \ No newline at end of file diff --git a/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/Sem_210310_call_test_component_operation_007.ttcn b/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/Sem_210310_call_test_component_operation_007.ttcn new file mode 100644 index 0000000..4d3326d --- /dev/null +++ b/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/Sem_210310_call_test_component_operation_007.ttcn @@ -0,0 +1,45 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:21.3.10, call operation calling an altstep with out and inout parameters + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// After complete execution of the started behaviour, the out and inout actual parameters given +// to the actual parameter list of the called function or altstep instance will be updated in the +// same manner as if it was a normal function/altstep invocation. + +module Sem_210310_call_test_component_operation_007 { + type port P message { + inout integer; + } + type component GeneralComp { + port P p; + } + + altstep a_test(out integer p_par1, inout integer p_par2) runs on GeneralComp { + [] p.receive { + p_par1 := 10; + p_par2 := p_par2 * 2; + setverdict(pass); + } + } + + testcase TC_Sem_210310_call_test_component_operation_007() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + var integer v_var1 := 0, v_var2 := 3; + connect(self:p, v_ptc:p); + p.send(1); + v_ptc.call(a_test(v_var1, v_var2)); + if (v_var1 == 10 and v_var2 == 6) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_210310_call_test_component_operation_007(), 5.0); + } +} \ No newline at end of file diff --git a/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/Sem_210310_call_test_component_operation_008.ttcn b/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/Sem_210310_call_test_component_operation_008.ttcn new file mode 100644 index 0000000..90e2c50 --- /dev/null +++ b/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/Sem_210310_call_test_component_operation_008.ttcn @@ -0,0 +1,36 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:21.3.10, call operation with a value clause + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// Additionally, a redirect clause can be added to the operation which allows assignment of the return +// result (in case that the called function has a return clause) to a variable via the value sub-clause +// and also the assignment of the termination verdict of the called component via the verdict sub-clause. + +module Sem_210310_call_test_component_operation_008 { + + type component GeneralComp {} + + function f() runs on GeneralComp return integer { + setverdict(pass); + return 1; + } + + testcase TC_Sem_210310_call_test_component_operation_008() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + var integer v_int; + v_ptc.call(f()) -> value v_int; + if (v_int == 1) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_210310_call_test_component_operation_008(), 5.0); + } +} \ No newline at end of file diff --git a/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/Sem_210310_call_test_component_operation_009.ttcn b/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/Sem_210310_call_test_component_operation_009.ttcn new file mode 100644 index 0000000..fb77a40 --- /dev/null +++ b/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/Sem_210310_call_test_component_operation_009.ttcn @@ -0,0 +1,35 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:21.3.10, call operation with a verdict clause + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// Additionally, a redirect clause can be added to the operation which allows assignment of the return +// result (in case that the called function has a return clause) to a variable via the value sub-clause +// and also the assignment of the termination verdict of the called component via the verdict sub-clause. + +module Sem_210310_call_test_component_operation_009 { + + type component GeneralComp {} + + function f() runs on GeneralComp { + setverdict(pass); + } + + testcase TC_Sem_210310_call_test_component_operation_009() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + var verdicttype v_verdict; + v_ptc.call(f()) -> verdict v_verdict; + if (v_verdict == pass) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_210310_call_test_component_operation_009(), 5.0); + } +} \ No newline at end of file diff --git a/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/Sem_210310_call_test_component_operation_010.ttcn b/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/Sem_210310_call_test_component_operation_010.ttcn new file mode 100644 index 0000000..603f1b4 --- /dev/null +++ b/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/Sem_210310_call_test_component_operation_010.ttcn @@ -0,0 +1,37 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:21.3.10, call operation: no change in actual parameters after incomplete execution + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// In all cases of incomplete execution, the variables referenced in the value and verdict clause +// or in out and inout actual parameters will stay unchanged and no assignment will be made. + +module Sem_210310_call_test_component_operation_010 { + + type component GeneralComp {} + + function f(out integer p_par1, inout integer p_par2) runs on GeneralComp { + p_par1 := 10; + p_par2 := p_par2 * 2; + setverdict(pass); + stop; + } + + testcase TC_Sem_210310_call_test_component_operation_010() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + var integer v_var1 := 0, v_var2 := 3; + v_ptc.call(f(v_var1, v_var2)) catch (stop) {} + if (v_var1 == 0 and v_var2 == 3) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_210310_call_test_component_operation_010(), 5.0); + } +} \ No newline at end of file diff --git a/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/Sem_210310_call_test_component_operation_011.ttcn b/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/Sem_210310_call_test_component_operation_011.ttcn new file mode 100644 index 0000000..b65b295 --- /dev/null +++ b/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/Sem_210310_call_test_component_operation_011.ttcn @@ -0,0 +1,35 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:21.3.10, call operation: value clause ignored after incomplete execution + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// In all cases of incomplete execution, the variables referenced in the value and verdict clause +// or in out and inout actual parameters will stay unchanged and no assignment will be made. + +module Sem_210310_call_test_component_operation_011 { + + type component GeneralComp {} + + function f() runs on GeneralComp return integer { + setverdict(pass); + stop; + } + + testcase TC_Sem_210310_call_test_component_operation_011() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + var integer v_int := 0; + v_ptc.call(f()) -> value v_int catch(stop) {} + if (v_int == 0) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_210310_call_test_component_operation_011(), 5.0); + } +} \ No newline at end of file diff --git a/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/Sem_210310_call_test_component_operation_012.ttcn b/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/Sem_210310_call_test_component_operation_012.ttcn new file mode 100644 index 0000000..d72f958 --- /dev/null +++ b/core_language/21_configuration_operations/2103_test_component_operations/210310_call_test_component_operation/Sem_210310_call_test_component_operation_012.ttcn @@ -0,0 +1,35 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:21.3.10, call operation: verdict clause ignored after incomplete execution + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// In all cases of incomplete execution, the variables referenced in the value and verdict clause +// or in out and inout actual parameters will stay unchanged and no assignment will be made. + +module Sem_210310_call_test_component_operation_012 { + + type component GeneralComp {} + + function f() runs on GeneralComp { + setverdict(pass); + stop; + } + + testcase TC_Sem_210310_call_test_component_operation_012() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + var verdicttype v_verdict := none; + v_ptc.call(f()) -> verdict v_verdict catch(stop) {} + if (v_verdict == none) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_210310_call_test_component_operation_012(), 5.0); + } +} \ No newline at end of file diff --git a/core_language/22_communication_operations/2202_message_based_communication/220201_send_operation/NegSem_220201_SendOperation_012.ttcn b/core_language/22_communication_operations/2202_message_based_communication/220201_send_operation/NegSem_220201_SendOperation_012.ttcn new file mode 100644 index 0000000..7e3d0b8 --- /dev/null +++ b/core_language/22_communication_operations/2202_message_based_communication/220201_send_operation/NegSem_220201_SendOperation_012.ttcn @@ -0,0 +1,28 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:22.2.1, The ObjectReference shall be of a port type in send operation + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// Restection g) The ObjectReference shall be of a port type. + +module NegSem_220201_SendOperation_012 { + + + type component GeneralComp + { + var anytype p; + } + + testcase TC_NegSem_220201_SendOperation_012() runs on GeneralComp system GeneralComp { + p.send(0) to all component; // error: ObjectReference shall be of a port type + all component.done; + setverdict(pass); + } + + control { + execute(TC_NegSem_220201_SendOperation_012()); + } +} \ No newline at end of file diff --git a/core_language/22_communication_operations/2202_message_based_communication/220201_send_operation/NegSem_220201_SendOperation_013.ttcn b/core_language/22_communication_operations/2202_message_based_communication/220201_send_operation/NegSem_220201_SendOperation_013.ttcn new file mode 100644 index 0000000..b8c2118 --- /dev/null +++ b/core_language/22_communication_operations/2202_message_based_communication/220201_send_operation/NegSem_220201_SendOperation_013.ttcn @@ -0,0 +1,36 @@ +/***************************************************************** + ** @author STF T003 + ** @version 0.0.1 + ** @purpose 1:22.2.1, TemplateInstance shall be of a data type in send operation + ** @verdict pass reject, noexecution + *****************************************************************/ + +// The following requirements are tested: +// Restection h) TemplateInstance shall be of a data type. + +module NegSem_220201_SendOperation_013 { + + + type port loopbackPort message { + inout anytype + } + + + type component GeneralComp { + port loopbackPort messagePort + } + + testcase TC_NegSem_220201_SendOperation_013() runs on GeneralComp system GeneralComp { + + var GeneralComp ptc; + ptc:=GeneralComp.create alive; + + messagePort.send(ptc); //error: template instance shall be of a data type, not component + setverdict(pass); + + } + + control { + // execute(TC_NegSem_220201_SendOperation_013()); + } +} \ No newline at end of file diff --git a/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/NegSem_220202_ReceiveOperation_025.ttcn b/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/NegSem_220202_ReceiveOperation_025.ttcn new file mode 100644 index 0000000..6b3b817 --- /dev/null +++ b/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/NegSem_220202_ReceiveOperation_025.ttcn @@ -0,0 +1,45 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:22.2.2, Ensure that the referenced value associated with ValueRef or the return type associated with FunctionInstance followed +by the receive keyword, shall be of a port type. + ** @verdict pass reject + ***************************************************/ + +// The following requirements are tested: +/* Restriction n) The referenced value associated with ValueRef or the return type associated with FunctionInstance followed + * by the receive keyword, shall be of a port type. + * */ + +module NegSem_220202_ReceiveOperation_025 { + + + type port loopbackPort message { + inout integer + } + + type anytype anyType; + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_NegSem_220202_ReceiveOperation_025() runs on GeneralComp { + + var anyType nonMessagePort; + messagePort.send(2); + + alt { + [] nonMessagePort.receive(1) { // error: shall be of a port type. + setverdict(pass); + } + + } +} + +control{ + execute(TC_NegSem_220202_ReceiveOperation_025()); +} + +} diff --git a/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/NegSem_220202_ReceiveOperation_026.ttcn b/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/NegSem_220202_ReceiveOperation_026.ttcn new file mode 100644 index 0000000..4bd342f --- /dev/null +++ b/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/NegSem_220202_ReceiveOperation_026.ttcn @@ -0,0 +1,46 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:22.2.2, Ensure that the referenced value associated with ValueRef or the return type associated with FunctionInstance followed +by the receive keyword, shall be of a port type. + ** @verdict pass reject + ***************************************************/ + +// The following requirements are tested: +/* Restriction n) The referenced value associated with ValueRef or the return type associated with FunctionInstance followed + * by the receive keyword, shall be of a port type. + * */ + +module NegSem_220202_ReceiveOperation_026 { + + + type port loopbackPort message { + inout integer + } + + function f_port() return charstring{ + var charstring v_p := "not a port"; + return v_p; + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_NegSem_220202_ReceiveOperation_026() runs on GeneralComp { + messagePort.send(2); + + alt { + [] f_port().receive(1) { // error: shall be of a port type. + setverdict(pass); + } + + } +} + +control{ + execute(TC_NegSem_220202_ReceiveOperation_026()); +} + +} diff --git a/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/NegSem_220202_ReceiveOperation_027.ttcn b/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/NegSem_220202_ReceiveOperation_027.ttcn new file mode 100644 index 0000000..9264297 --- /dev/null +++ b/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/NegSem_220202_ReceiveOperation_027.ttcn @@ -0,0 +1,44 @@ +/*************************************************** + ** @author STF T003 + ** @version 0.0.1 + ** @purpose 1:22.2.2, Ensure that the referenced value associated with ValueRef or the return type associated with FunctionInstance followed +by the receive keyword, shall be of a port type. + ** @verdict pass reject + ***************************************************/ + +// The following requirements are tested: +// Restriction o) TemplateInstance shall be of a data type. + +module NegSem_220202_ReceiveOperation_027 { + + + type port loopbackPort message { + inout anytype + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_NegSem_220202_ReceiveOperation_027() runs on GeneralComp system GeneralComp { + var anytype Myint; + Myint.integer := 2; + messagePort.send(Myint); + + var GeneralComp ptc; + ptc:=GeneralComp.create alive; + + alt { + [] messagePort.receive(ptc) { // error: it should be TemplateInstance not component + setverdict(pass); + } + + } +} + +control{ + execute(TC_NegSem_220202_ReceiveOperation_027()); +} + +} diff --git a/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/NegSem_220202_ReceiveOperation_028.ttcn b/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/NegSem_220202_ReceiveOperation_028.ttcn new file mode 100644 index 0000000..aafae0b --- /dev/null +++ b/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/NegSem_220202_ReceiveOperation_028.ttcn @@ -0,0 +1,44 @@ +/*************************************************** + ** @author STF T003 + ** @version 0.0.1 + ** @purpose 1:22.2.2, Ensure that the IUT correctly handles message receiving operations + ** @verdict pass reject, ttcn3verdict:pass + ***************************************************/ +// The following requirements are tested: +// Restriction p) The @nodefault modifier is allowed only in stand-alone receive statements. + +module NegSem_220202_ReceiveOperation_028 { + + + type port loopbackPort message { + inout integer + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_NegSem_220202_ReceiveOperation_028() runs on GeneralComp { + + messagePort.send(2); + + alt { + [] messagePort.receive(1) { + setverdict(fail); + } + [] @nodefault messagePort.receive(2) { //error: @nodefault modifier is allowed only in stand-alone receive statements. + + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } +} + +control{ + execute(TC_NegSem_220202_ReceiveOperation_028()); +} + +} diff --git a/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/Sem_220202_ReceiveOperation_031.ttcn b/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/Sem_220202_ReceiveOperation_031.ttcn new file mode 100644 index 0000000..e883c1e --- /dev/null +++ b/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/Sem_220202_ReceiveOperation_031.ttcn @@ -0,0 +1,48 @@ +/*************************************************** + ** @author STF T003 + ** @version 0.0.1 + ** @purpose 1:22.2.2, Ensure that the IUT correctly handles message receiving operations + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +// Restriction p) The @nodefault modifier is allowed only in stand-alone receive statements. + +module Sem_220202_ReceiveOperation_031 { + + + type port loopbackPort message { + inout integer + } + + + type component GeneralComp { + port loopbackPort messagePort + } + + function f1 ( ) runs on GeneralComp { + messagePort.send(2) to mtc; + } + +testcase TC_Sem_220202_ReceiveOperation_031() runs on GeneralComp system GeneralComp { + + var integer MyInt := 2; + + // create PTC + var GeneralComp ptc; + ptc:=GeneralComp.create; + connect(self:messagePort,ptc:messagePort); + ptc.start(f1()); + + // receive message + @nodefault messagePort.receive(MyInt); // @nodefault modifier with stand-alone receive statement + setverdict(pass); + + //remove PTC + disconnect(self:messagePort,ptc:messagePort); + ptc.stop; +} + +control{ + execute(TC_Sem_220202_ReceiveOperation_031()); +} + +} diff --git a/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/NegSem_220203_TriggerOperation_025.ttcn b/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/NegSem_220203_TriggerOperation_025.ttcn new file mode 100644 index 0000000..1b4531b --- /dev/null +++ b/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/NegSem_220203_TriggerOperation_025.ttcn @@ -0,0 +1,42 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:22.2.3, Ensure that the IUT correctly handles message trigger operations + ** @verdict pass reject + ***************************************************/ + +// The following requirements are tested: +// Restection k) The ObjectReference shall be of a port type. + + +module NegSem_220203_TriggerOperation_025 { + + + type port loopbackPort message { + inout integer + } + +type component GeneralComp { + port loopbackPort messagePort; + var anytype p; +} + +testcase TC_NegSem_220203_TriggerOperation_025() runs on GeneralComp { + + timer t_timeout := 1.0; + t_timeout.start; + + messagePort.send(2); + + alt { + [] p.trigger(1) { // error: it shall be of a port type. + setverdict(pass); + } + } +} + +control{ + execute(TC_NegSem_220203_TriggerOperation_025()); +} + +} diff --git a/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/NegSem_220203_TriggerOperation_026.ttcn b/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/NegSem_220203_TriggerOperation_026.ttcn new file mode 100644 index 0000000..9f28019 --- /dev/null +++ b/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/NegSem_220203_TriggerOperation_026.ttcn @@ -0,0 +1,45 @@ +/*************************************************** + ** @author STF T003 + ** @version 0.0.1 + ** @purpose 1:22.2.3, Ensure that the IUT correctly handles message trigger operations + ** @verdict pass reject + ***************************************************/ + +// The following requirements are tested: +// Restection l) TemplateInstance shall be of a data type. + +module NegSem_220203_TriggerOperation_026 { + + + type port loopbackPort message { + inout anytype + } + +type component GeneralComp { + port loopbackPort messagePort; +} + +testcase TC_NegSem_220203_TriggerOperation_026() runs on GeneralComp system GeneralComp { + + timer t_timeout := 1.0; + t_timeout.start; + var anytype MyType; + MyType.integer := 2; + + var GeneralComp ptc; + ptc:=GeneralComp.create alive; + + messagePort.send(MyType); + + alt { + [] messagePort.trigger(ptc) { // error: TemplateInstance shall be of a data type, not component + setverdict(pass); + } + } +} + +control{ + execute(TC_NegSem_220203_TriggerOperation_026()); +} + +} diff --git a/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/Sem_220203_TriggerOperation_029.ttcn b/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/Sem_220203_TriggerOperation_029.ttcn new file mode 100644 index 0000000..4e7ff82 --- /dev/null +++ b/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/Sem_220203_TriggerOperation_029.ttcn @@ -0,0 +1,50 @@ +/***************************************************************** + ** @author STF T003 + ** @version 0.0.1 + ** @purpose 1:22.2.3, trigger with @nodefault modifier + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// Restriction m) The @nodefault modifier is allowed only in stand-alone trigger statements. + +module Sem_220203_TriggerOperation_029 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P messagePort; + } + + function f1 ( ) runs on GeneralComp { + messagePort.send(1) to mtc; + } + + + testcase TC_Sem_220203_TriggerOperation_029() runs on GeneralComp system GeneralComp { + var integer v_int; + + // create PTC + var GeneralComp ptc; + ptc:=GeneralComp.create; + connect(self:messagePort,ptc:messagePort); + ptc.start(f1()); + + @nodefault messagePort.trigger(integer:?) -> value v_int; // stand-alone statement @nodefault modifier + if (v_int == 1) { + setverdict(pass); + } else { + setverdict(fail); + } + + //remove PTC + disconnect(self:messagePort,ptc:messagePort); + ptc.stop; + + } + + control { + execute(TC_Sem_220203_TriggerOperation_029(), 5.0); + } +} \ No newline at end of file diff --git a/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/NegSem_220301_CallOperation_021.ttcn b/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/NegSem_220301_CallOperation_021.ttcn new file mode 100644 index 0000000..9c343c3 --- /dev/null +++ b/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/NegSem_220301_CallOperation_021.ttcn @@ -0,0 +1,29 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:22.3.1, verify that in call the ObjectReference shall be of a port type. + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// Restriction n) the ObjectReference shall be of a port type. + +module NegSem_220301_CallOperation_021 { + + signature S(); + + type component GeneralComp { + var anytype p; + } + + testcase TC_NegSem_220301_CallOperation_021() runs on GeneralComp system GeneralComp { + + p.call(S:{}) { // error: non port type + [] p.getreply(S:?) { setverdict(pass); } // error: non port type + } + } + + control { + execute(TC_NegSem_220301_CallOperation_021(), 5.0); + } +} \ No newline at end of file diff --git a/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/NegSem_220302_getcall_operation_020.ttcn b/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/NegSem_220302_getcall_operation_020.ttcn new file mode 100644 index 0000000..33e1ce0 --- /dev/null +++ b/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/NegSem_220302_getcall_operation_020.ttcn @@ -0,0 +1,44 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:22.3.1, verify tha in getcall the ObjectReference shall be of a port type. + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// Restriction n) the ObjectReference shall be of a port type. + +module NegSem_220302_getcall_operation_020 { + + signature S(); + + type port P procedure { + inout S; + } + + type component GeneralComp { + var anytype p; + } + + function f() runs on GeneralComp + { + alt + { + [] any from p.getcall { // error: not port type + + } + [else] { setverdict(pass); } + } + } + + + testcase TC_NegSem_220302_getcall_operation_020() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + v_ptc.start(f()); + v_ptc.done; + } + + control { + execute(TC_NegSem_220302_getcall_operation_020(), 5.0); + } +} \ No newline at end of file diff --git a/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/NegSyn_220302_getcall_operation_003.ttcn b/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/NegSyn_220302_getcall_operation_003.ttcn new file mode 100644 index 0000000..8004a1c --- /dev/null +++ b/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/NegSyn_220302_getcall_operation_003.ttcn @@ -0,0 +1,44 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.3.2, Verify that error occurs when using @nodefault in a not stand-alone getcall operation + ** @verdict pass reject, noexecution + *****************************************************************/ +// The following requirements are tested: +// Restriction o) The @nodefault modifier is allowed only in stand-alone getcall statements. + +module NegSyn_220302_getcall_operation_003 { + + signature S(); + + type port P procedure { + inout S; + } + + type component GeneralComp + { + port P p; + } + + function f() runs on GeneralComp + { + var integer v_index; + alt + { + [] @nodefault any port.getcall { setverdict(pass); } // error: modifier can not be used here, not stand-alone statement + [else] { setverdict(fail, "The any from getcall operation didn't match for some reason"); } + } + } + + testcase TC_NegSyn_220302_getcall_operation_003() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p, v_ptc:p); + p.call(S:{}, nowait); + v_ptc.start(f()); + v_ptc.done; + } + + control { + // execute(TC_NegSyn_220302_getcall_operation_003(), 5.0); + } +} \ No newline at end of file diff --git a/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/Sem_220302_getcall_operation_023.ttcn b/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/Sem_220302_getcall_operation_023.ttcn new file mode 100644 index 0000000..9019cb4 --- /dev/null +++ b/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/Sem_220302_getcall_operation_023.ttcn @@ -0,0 +1,40 @@ +/***************************************************************** + ** @author STF T003 + ** @version 0.0.1 + ** @purpose 1:22.3.2, Verify that getcall with @nodefault modifier works properly + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// The following requirements are tested: +// Restriction o) The @nodefault modifier is allowed only in stand-alone getcall statements. + +module Sem_220302_getcall_operation_023 { + signature S(); + + type port P procedure { + inout S; + } + + type component GeneralComp + { + port P p; + } + + function f() runs on GeneralComp + { + @nodefault p.getcall; // stand-alone getcall with @nodefault + setverdict(pass); + + } + + testcase TC_Sem_220302_getcall_operation_023() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p, v_ptc:p); + p.call(S:{}, nowait); + v_ptc.start(f()); + v_ptc.done; + } + + control { + execute(TC_Sem_220302_getcall_operation_023(), 5.0); + } +} \ No newline at end of file diff --git a/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/NegSem_220304_getreply_operation_023.ttcn b/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/NegSem_220304_getreply_operation_023.ttcn new file mode 100644 index 0000000..c2532c8 --- /dev/null +++ b/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/NegSem_220304_getreply_operation_023.ttcn @@ -0,0 +1,44 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:22.3.4, Verify that error occurs when .getreply operation is used on non port type + ** @verdict pass reject + *****************************************************************/ +// The following requirements are tested: +// Restriction l) The ObjectReference shall be of a port type. + +module NegSem_220304_getreply_operation_023 { + + signature S(); + + type port P procedure { + inout S; + } + + type component GeneralComp + { + port P p; + var anytype p2; + } + + function f() runs on GeneralComp + { + p.getcall(S:?); + p2.reply(S:{}); // error: non port type + } + + testcase TC_NegSem_220304_getreply_operation_023() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + var integer v_index; + connect(self:p, v_ptc:p); + p.call(S:{}, nowait); + v_ptc.start(f()); + v_ptc.done; + setverdict(pass); + + } + + control { + execute(TC_NegSem_220304_getreply_operation_023(), 5.0); + } +} \ No newline at end of file diff --git a/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/NegSyn_220304_getreply_operation_003.ttcn b/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/NegSyn_220304_getreply_operation_003.ttcn new file mode 100644 index 0000000..5e776db --- /dev/null +++ b/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/NegSyn_220304_getreply_operation_003.ttcn @@ -0,0 +1,46 @@ +/***************************************************************** + ** @author STF T003 + ** @version 0.0.1 + ** @purpose 1:22.3.4, Verify that error occurs when using @nodefault modifier in a non stand-alone any port.getreply operation + ** @verdict pass reject, noexecution + *****************************************************************/ +// The following requirements are tested: +// Restriction m) The @nodefault modifier is allowed only in stand-alone getreply statements. + +module NegSyn_220304_getreply_operation_003 { + + signature S(); + + type port P procedure { + inout S; + } + + type component GeneralComp + { + port P p; + } + + function f() runs on GeneralComp + { + p.getcall(S:?); + p.reply(S:{}); + } + + testcase TC_NegSyn_220304_getreply_operation_003() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + var integer v_index; + connect(self:p, v_ptc:p); + p.call(S:{}, nowait); + v_ptc.start(f()); + v_ptc.done; + alt + { + [] @nodefault any port.getreply { setverdict(pass); } // not allowed to use @nodefault modifer here + [else] { setverdict(fail, "The any from getreply operation didn't match for some reason"); } + } + } + + control { + //execute(TC_NegSyn_220304_getreply_operation_003(), 5.0); + } +} \ No newline at end of file diff --git a/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/Sem_220304_getreply_operation_024.ttcn b/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/Sem_220304_getreply_operation_024.ttcn new file mode 100644 index 0000000..51d50e5 --- /dev/null +++ b/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/Sem_220304_getreply_operation_024.ttcn @@ -0,0 +1,49 @@ +/***************************************************************** + ** @author STF T003 + ** @version 0.0.1 + ** @purpose 1:22.3.4, Verify that any from getreply is working with @nodefault modifier + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// The following requirements are tested: +// Restriction m) The @nodefault modifier is allowed only in stand-alone getreply statements. + +module Sem_220304_getreply_operation_024 { + signature S(); + + type port P procedure { + inout S; + } + + const integer c_portCount := 1; + type component GeneralComp + { + port P p[c_portCount]; + } + + function f() runs on GeneralComp + { + for(var integer i := 0; i < c_portCount; i := i + 1) { + p[0].getcall; // get call + p[0].reply(S:{}); // and send reply + } + } + + testcase TC_Sem_220304_getreply_operation_024() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + var integer v_i; + + connect(self:p[0], v_ptc:p[0]); + p[0].call(S:{}, nowait); + v_ptc.start(f()); + + // get reply from v_ptc + @nodefault p[0].getreply(S:{}); // getreply with @nodefault modifier + setverdict(pass); + + v_ptc.done; + } + + control { + execute(TC_Sem_220304_getreply_operation_024(), 5.0); + } +} \ No newline at end of file diff --git a/core_language/22_communication_operations/2203_procedure_based_communication/220305_raise_operation/NegSem_220305_raise_operation_011.ttcn b/core_language/22_communication_operations/2203_procedure_based_communication/220305_raise_operation/NegSem_220305_raise_operation_011.ttcn new file mode 100644 index 0000000..b5665fd --- /dev/null +++ b/core_language/22_communication_operations/2203_procedure_based_communication/220305_raise_operation/NegSem_220305_raise_operation_011.ttcn @@ -0,0 +1,41 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:22.3.5, ensure that error occured when using raise operation on a non port type + ** @verdict pass reject + *****************************************************************/ +// The following requirements are tested: +// g) The ObjectReference shall be of a port type. + +module NegSem_220305_raise_operation_011 { + signature S() exception(integer); + + type port P procedure { + inout S; + } + + type component GeneralComp + { + port P p; + var anytype p2; + } + + function f() runs on GeneralComp + { + p.getcall(S:?); + p2.raise(S, 1); // error: non port type + setverdict(pass); + } + + testcase TC_NegSem_220305_raise_operation_011() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p, v_ptc:p); + v_ptc.start(f()); + p.call(S:{}, nowait); // no processing of the exception to avoid possible errors in the catch operation + v_ptc.done; + } + + control { + execute(TC_NegSem_220305_raise_operation_011(), 5.0); + } +} diff --git a/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/NegSyn_220306_catch_operation_004.ttcn b/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/NegSyn_220306_catch_operation_004.ttcn new file mode 100644 index 0000000..5fb33a9 --- /dev/null +++ b/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/NegSyn_220306_catch_operation_004.ttcn @@ -0,0 +1,48 @@ +/***************************************************************** + ** @author STF T003 + ** @version 0.0.1 + ** @purpose 1:22.3.6, Verify that error occurs when any from catch is with @nodefault modifier in a non stand-alone statement + ** @verdict pass reject, noexecution + *****************************************************************/ +// The following requirements are tested: +// Restriction q) The @nodefault modifier is allowed only in stand-alone catch statements. + +module NegSyn_220306_catch_operation_004 { + signature S() exception(integer); + + type port P procedure { + inout S; + } + + const integer c_portCount := 4; + type component GeneralComp + { + port P p[c_portCount]; + } + + function f() runs on GeneralComp + { + for(var integer i := 0; i < c_portCount; i := i + 1) { + p[i].getcall; + if (i mod 2 == 1) { p[i].raise(S, 1) }; + } + } + testcase TC_NegSyn_220306_catch_operation_004() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + for(var integer i := 0; i < c_portCount; i := i + 1) { + connect(self:p[i], v_ptc:p[i]); + p[i].call(S:{}, nowait); + } + v_ptc.start(f()); + v_ptc.done; + alt + { + [] @nodefault any from p.catch { setverdict(pass); } // not allowed @nodefault modifier here + [else] { setverdict(fail, "The any from catch operation didn't match for some reason"); } + } + } + + control { + // execute(TC_NegSyn_220306_catch_operation_004(), 5.0); + } +} \ No newline at end of file diff --git a/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/Sem_220306_catch_operation_018.ttcn b/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/Sem_220306_catch_operation_018.ttcn new file mode 100644 index 0000000..b943540 --- /dev/null +++ b/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/Sem_220306_catch_operation_018.ttcn @@ -0,0 +1,47 @@ +/***************************************************************** + ** @author STF T003 + ** @version 0.0.1 + ** @purpose 1:22.3.6, Verify that catch with @nodefault modifier works properly + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// The following requirements are tested: +// Restriction q) The @nodefault modifier is allowed only in stand-alone catch statements. + +module Sem_220306_catch_operation_018 { + + signature S() exception(integer); + + type port P procedure { + inout S; + } + + const integer c_portCount := 1; + type component GeneralComp + { + port P p[c_portCount]; + } + + function f() runs on GeneralComp + { + p[0].getcall; // get call + p[0].raise(S, 1); // and raise an exception + } + testcase TC_Sem_220306_catch_operation_018() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + for(var integer i := 0; i < c_portCount; i := i + 1) { + connect(self:p[i], v_ptc:p[i]); + p[i].call(S:{}, nowait); + } + + v_ptc.start(f()); + v_ptc.done; + + // catch the raised exception from v_ptc + @nodefault p[0].catch; // catch with @nodefault in a stand-alone statement + setverdict(pass); + } + + control { + execute(TC_Sem_220306_catch_operation_018(), 5.0); + } +} \ No newline at end of file diff --git a/core_language/22_communication_operations/2204_the_check_operation/NegSem_2204_the_check_operation_006.ttcn b/core_language/22_communication_operations/2204_the_check_operation/NegSem_2204_the_check_operation_006.ttcn new file mode 100644 index 0000000..e17bcec --- /dev/null +++ b/core_language/22_communication_operations/2204_the_check_operation/NegSem_2204_the_check_operation_006.ttcn @@ -0,0 +1,36 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify that opreation check occurs error if non port type is used + ** @verdict pass reject + *****************************************************************/ +// The following requirements are tested: +// Restriction i) The ObjectReference shall be of a port type. + +module NegSem_2204_the_check_operation_006 { + + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + var anytype p2; + } + + testcase TC_NegSem_2204_the_check_operation_006() runs on GeneralComp { + p.send(integer:1); + alt + { + [] p2.check(receive) { // error: non port type + setverdict(pass, "Check operation successful"); + } + } + p.receive; + setverdict(pass, "Message still on the top of the queue"); + } + + control { + execute(TC_NegSem_2204_the_check_operation_006(), 5.0); + } +} \ No newline at end of file diff --git a/core_language/22_communication_operations/2204_the_check_operation/NegSyn_2204_the_check_operation_001.ttcn b/core_language/22_communication_operations/2204_the_check_operation/NegSyn_2204_the_check_operation_001.ttcn new file mode 100644 index 0000000..4501e01 --- /dev/null +++ b/core_language/22_communication_operations/2204_the_check_operation/NegSyn_2204_the_check_operation_001.ttcn @@ -0,0 +1,35 @@ +/***************************************************************** + ** @author STF T003 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify that port.check(receive) with @nodefault modifier raise error, if port.check is not a stand-alone statement. + ** @verdict pass reject, noexecution + *****************************************************************/ +// The following requirements are tested: +// Restriction j) The @nodefault modifier is allowed only in stand-alone check statements. + +module NegSyn_2204_the_check_operation_001 { + + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + testcase TC_NegSyn_2204_the_check_operation_001() runs on GeneralComp { + p.send(integer:1); + alt + { + [] @nodefault p.check(receive) { + // error: @nodefault modifier is not allowed here + setverdict(pass, "Check operation successful"); } + } + + setverdict(pass, "Message still on the top of the queue"); + } + + control { + //execute(TC_NegSyn_2204_the_check_operation_001(), 5.0); + } +} \ No newline at end of file diff --git a/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_121.ttcn b/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_121.ttcn new file mode 100644 index 0000000..313ad46 --- /dev/null +++ b/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_121.ttcn @@ -0,0 +1,52 @@ +/***************************************************************** + ** @author STF T003 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify that port.check(receive) with @nodefault works correctly inside alt + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// The following requirements are tested: +// Restriction j) The @nodefault modifier is allowed only in stand-alone check statements. + +module Sem_2204_the_check_operation_121 { + + type port P message { + inout integer; + address integer; + } + + type component GeneralComp { + port P p; + } + + function f1 ( ) runs on GeneralComp { + p.send(2) to mtc; + } + + testcase TC_Sem_2204_the_check_operation_121() runs on GeneralComp system GeneralComp { + var integer v_rec; + + // create PTC + var GeneralComp ptc; + ptc:=GeneralComp.create; + connect(self:p,ptc:p); + ptc.start(f1()); + + @nodefault p.check(receive(integer:?) -> value v_rec); // check with @nodefault modifier + + if(v_rec == 2){ + setverdict(pass, "Check operation successful"); + } + else{ + setverdict(fail); + } + + // remove PTC + disconnect(self:p,ptc:p); + ptc.stop; + + } + + control { + execute(TC_Sem_2204_the_check_operation_121(), 5.0); + } +} \ No newline at end of file diff --git a/core_language/23_timer_operations/2302_the_start_timer_operataion/NegSem_2302_timer_start_005.ttcn b/core_language/23_timer_operations/2302_the_start_timer_operataion/NegSem_2302_timer_start_005.ttcn new file mode 100644 index 0000000..36c2b96 --- /dev/null +++ b/core_language/23_timer_operations/2302_the_start_timer_operataion/NegSem_2302_timer_start_005.ttcn @@ -0,0 +1,24 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:23.2, Verify that the start operation applied to a non-timer reference produces an error + ** @verdict pass reject + ***************************************************/ +// The following requirement is tested +// b) The ObjectReference (in the timer start operation) shall be of the timer type. + +module NegSem_2302_timer_start_005 { + type component TComp{ + } + testcase TC_NegSem_2302_timer_start_005() runs on TComp{ + var float v_duration := 1.0; + v_duration.start; + setverdict(pass); + } + control{ + + execute(TC_NegSem_2302_timer_start_005()) + + + } +} \ No newline at end of file diff --git a/core_language/23_timer_operations/2303_the_stop_timer_operation/NegSem_2303_timer_stop_001.ttcn b/core_language/23_timer_operations/2303_the_stop_timer_operation/NegSem_2303_timer_stop_001.ttcn new file mode 100644 index 0000000..b1be565 --- /dev/null +++ b/core_language/23_timer_operations/2303_the_stop_timer_operation/NegSem_2303_timer_stop_001.ttcn @@ -0,0 +1,23 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:23.3, Verify that the stop operation applied to a non-timer reference produces an error + ** @verdict pass reject + ***************************************************/ +// The following requirement is tested +// a) The ObjectReference (in the timer stop operation) shall be of the timer type. + +module NegSem_2303_timer_stop_001 { + type component TComp{ + timer t_tmr; + } + testcase TC_NegSem_2303_timer_stop_001() runs on TComp{ + var float v_duration := 1.0; + t_tmr.start(v_duration); + v_duration.stop; + setverdict(pass); + } + control { + execute(TC_NegSem_2303_timer_stop_001()) + } +} \ No newline at end of file diff --git a/core_language/23_timer_operations/2304_the_read_timer_operation/NegSem_2304_the_read_timer_operation_001.ttcn b/core_language/23_timer_operations/2304_the_read_timer_operation/NegSem_2304_the_read_timer_operation_001.ttcn new file mode 100644 index 0000000..70d3a43 --- /dev/null +++ b/core_language/23_timer_operations/2304_the_read_timer_operation/NegSem_2304_the_read_timer_operation_001.ttcn @@ -0,0 +1,23 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:23.4, Verify that the read operation applied to a non-timer reference produces an error + ** @verdict pass reject + ***************************************************/ +// The following requirement is tested +// a) The ObjectReference (in the timer read operation) shall be of the timer type. + +module NegSem_2304_the_read_timer_operation_001 { + type component TComp { + timer t_tmr; + } + testcase TC_NegSem_2304_the_read_timer_operation_001() runs on TComp { + var float v_duration := 1.0; + t_tmr.start(v_duration); + var float v_elapsed := v_duration.read; + setverdict(pass); + } + control { + execute(TC_NegSem_2304_the_read_timer_operation_001()) + } +} \ No newline at end of file diff --git a/core_language/23_timer_operations/2305_the_running_timer_operation/NegSem_2305_the_running_timer_operation_001.ttcn b/core_language/23_timer_operations/2305_the_running_timer_operation/NegSem_2305_the_running_timer_operation_001.ttcn new file mode 100644 index 0000000..2f4f1ca --- /dev/null +++ b/core_language/23_timer_operations/2305_the_running_timer_operation/NegSem_2305_the_running_timer_operation_001.ttcn @@ -0,0 +1,23 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:23.5, Verify that the running operation applied to a non-timer reference produces an error + ** @verdict pass reject + ***************************************************/ +// The following requirement is tested +// a) The ObjectReference (in the timer running operation) shall be of the timer type. + +module NegSem_2305_the_running_timer_operation_001 { + type component TComp{ + timer t_tmr; + } + testcase TC_NegSem_2305_the_running_timer_operation_001() runs on TComp{ + var float v_duration := 1.0; + t_tmr.start(v_duration); + var boolean v_running := v_duration.running; + setverdict(pass); + } + control { + execute(TC_NegSem_2305_the_running_timer_operation_001()) + } +} \ No newline at end of file diff --git a/core_language/23_timer_operations/2306_the_timeout_operation/NegSem_2306_the_timeout_operation_001.ttcn b/core_language/23_timer_operations/2306_the_timeout_operation/NegSem_2306_the_timeout_operation_001.ttcn new file mode 100644 index 0000000..ff10ed5 --- /dev/null +++ b/core_language/23_timer_operations/2306_the_timeout_operation/NegSem_2306_the_timeout_operation_001.ttcn @@ -0,0 +1,23 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 1:23.6, Verify that the timeout operation applied to a non-timer reference produces an error + ** @verdict pass reject + ***************************************************/ +// The following requirement is tested +// e) The ObjectReference (in the timeout operation) shall be of the timer type. + +module NegSem_2306_the_timeout_operation_001 { + type component TComp{ + timer t_tmr; + } + testcase TC_NegSem_2306_the_timeout_operation_001() runs on TComp{ + var float v_duration := 1.0; + t_tmr.start(v_duration); + v_duration.timeout; + setverdict(pass); + } + control { + execute(TC_NegSem_2306_the_timeout_operation_001()) + } +} \ No newline at end of file diff --git a/core_language/23_timer_operations/2306_the_timeout_operation/NegSyn_2306_timer_timeout_008.ttcn b/core_language/23_timer_operations/2306_the_timeout_operation/NegSyn_2306_timer_timeout_008.ttcn new file mode 100644 index 0000000..2347ca3 --- /dev/null +++ b/core_language/23_timer_operations/2306_the_timeout_operation/NegSyn_2306_timer_timeout_008.ttcn @@ -0,0 +1,32 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:23.6, Ensure timer.timeout syntax + ** @verdict pass reject, noexecution + ***************************************************/ + + // The following requirement is tested: The timeout operation does not return any value and therefore shall not be used in an expression. + +module NegSyn_2306_timer_timeout_008 { + + type component TComp{ + + } + + testcase TC_NegSyn_2306_timer_timeout_008() runs on TComp{ + timer t_started_timer := 2.0; + t_started_timer.start; + + var integer v_res = t_started_timer.timeout + 1; // error: The timeout operation does not return any value and therefore shall not be used in an expression + + if(v_res == 0){ + setverdict(pass); + } else { + setverdict(fail); + } + } + + control{ + execute(TC_NegSyn_2306_timer_timeout_008()); + } +} diff --git a/core_language/23_timer_operations/2306_the_timeout_operation/NegSyn_2306_timer_timeout_009.ttcn b/core_language/23_timer_operations/2306_the_timeout_operation/NegSyn_2306_timer_timeout_009.ttcn new file mode 100644 index 0000000..828951e --- /dev/null +++ b/core_language/23_timer_operations/2306_the_timeout_operation/NegSyn_2306_timer_timeout_009.ttcn @@ -0,0 +1,30 @@ +/*************************************************** + ** @author STF T003 + ** @version 0.0.1 + ** @purpose 1:23.6, Ensure timer timeout raise error with @nodefault modifier + ** @verdict pass reject, noexecution + ***************************************************/ +// The following requirements are tested: +// Restriction g) The @nodefault modifier is allowed only in stand-alone timeout statements. + +module NegSyn_2306_timer_timeout_009 { + type component TComp{ + timer t_unstarted_timer; + timer t_started_timer := 2.0; + } + testcase TC_NegSyn_2306_timer_timeout_009() runs on TComp{ + t_started_timer.start; + alt + { + [] @nodefault t_unstarted_timer.timeout { // error: @nodefault modifier not allowed here + setverdict(pass); + } + [] t_started_timer.timeout { + setverdict(pass); + } + } + } + control{ + //execute(TC_NegSyn_2306_timer_timeout_009()) + } +} diff --git a/core_language/23_timer_operations/2306_the_timeout_operation/Sem_2306_timer_timeout_010.ttcn b/core_language/23_timer_operations/2306_the_timeout_operation/Sem_2306_timer_timeout_010.ttcn new file mode 100644 index 0000000..48a8daf --- /dev/null +++ b/core_language/23_timer_operations/2306_the_timeout_operation/Sem_2306_timer_timeout_010.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @author STF T003 + ** @version 0.0.1 + ** @purpose 1:23.6, Ensure any timer.timeout operation works with @nodefault modifier + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +// The following requirements are tested: +// Restriction g) The @nodefault modifier is allowed only in stand-alone timeout statements. + + +module Sem_2306_timer_timeout_010 { + type component TComp{ + timer t_timer := 1.0; + } + + testcase TC_Sem_2306_timer_timeout_010() runs on TComp{ + t_timer.start; + @nodefault t_timer.timeout; // timeout with @nodefault modifier + + if (t_timer.running ){ + setverdict(fail); + } + setverdict(pass); + } + control{ + execute(TC_Sem_2306_timer_timeout_010()) + } +} diff --git a/core_language/27_specifying_attributes/2701_attribute_mechanism/270101_scope_of_attributes/NegSem_270101_ScopeOfAttributes_001.ttcn b/core_language/27_specifying_attributes/2701_attribute_mechanism/270101_scope_of_attributes/NegSem_270101_ScopeOfAttributes_001.ttcn new file mode 100644 index 0000000..b45cb50 --- /dev/null +++ b/core_language/27_specifying_attributes/2701_attribute_mechanism/270101_scope_of_attributes/NegSem_270101_ScopeOfAttributes_001.ttcn @@ -0,0 +1,20 @@ +/***************************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:27.1.1, Ensure that attributes for language elements are accepted. + ** @verdict pass reject, noexecution + *****************************************************************/ + +/* Restriction a) At most one display attribute shall be applied to each definition, each individual field reference or +language element to which a with statement is associated.*/ + +module NegSem_270101_ScopeOfAttributes_001 { + + type record of integer IntegerList + with { + display "Blue" + display "Bold" + extension "MyRule" + } + +} \ No newline at end of file diff --git a/core_language/27_specifying_attributes/2701_attribute_mechanism/270101_scope_of_attributes/Syn_270101_ScopeOfAttributes_005.ttcn b/core_language/27_specifying_attributes/2701_attribute_mechanism/270101_scope_of_attributes/Syn_270101_ScopeOfAttributes_005.ttcn index c7a3ce8..6b13956 100644 --- a/core_language/27_specifying_attributes/2701_attribute_mechanism/270101_scope_of_attributes/Syn_270101_ScopeOfAttributes_005.ttcn +++ b/core_language/27_specifying_attributes/2701_attribute_mechanism/270101_scope_of_attributes/Syn_270101_ScopeOfAttributes_005.ttcn @@ -22,6 +22,6 @@ module Syn_270101_ScopeOfAttributes_004 { type MyRecord MyRecord2 with { - display(field1.innerField1) "colour red"; + display(field2.innerField1) "colour red"; } } \ No newline at end of file diff --git a/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules_for_attributes/27010200_general/Sem_27010200_general_001.ttcn b/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules_for_attributes/27010200_general/Sem_27010200_general_001.ttcn new file mode 100644 index 0000000..7abe354 --- /dev/null +++ b/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules_for_attributes/27010200_general/Sem_27010200_general_001.ttcn @@ -0,0 +1,36 @@ +/***************************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:27.1.2.0, Verify that attributes from lower scopes override attribute from higher scopes + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirement is tested: +// An attribute definition that is directly attached to a lower scope unit will override a general attribute +// definition in a higher scope and a type-specific attribute inherited from a type reference. + +module Sem_27010200_general_001 { + + type component GeneralComp { + } + + type record R { + } with { encode "RuleA" } + + type record of universal charstring RoUC; + + testcase TC_Sem_27010200_general_001 () runs on GeneralComp { + var RoUC v_enc := R.encode; + if(v_enc[0] == "RuleA") { + setverdict(pass); + } else { + setverdict(fail); + } + } + + + control{ + execute(TC_Sem_27010200_general_001()); + } + +} with { encode "GeneralRule" } \ No newline at end of file diff --git a/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules_for_attributes/27010200_general/Sem_27010200_general_002.ttcn b/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules_for_attributes/27010200_general/Sem_27010200_general_002.ttcn new file mode 100644 index 0000000..f304282 --- /dev/null +++ b/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules_for_attributes/27010200_general/Sem_27010200_general_002.ttcn @@ -0,0 +1,39 @@ +/***************************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:27.1.2.0, Verify that attributes from lower scopes override attribute from type reference + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirement is tested: +// An attribute definition that is directly attached to a lower scope unit will override a general attribute +// definition in a higher scope and a type-specific attribute inherited from a type reference. + +module Sem_27010200_general_002 { + + type component GeneralComp { + } + + type integer I with { encode "RuleA" } + + type record R { + I field1 + } with { encode(field1) "RuleB" } + + type record of universal charstring RoUC; + + testcase TC_Sem_27010200_general_002 () runs on GeneralComp { + var RoUC v_enc := R.field1.encode; + if(v_enc[0] == "RuleB") { + setverdict(pass); + } else { + setverdict(fail); + } + } + + + control{ + execute(TC_Sem_27010200_general_002()); + } + +} with { encode "GeneralRule" } \ No newline at end of file diff --git a/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules_for_attributes/27010200_general/Sem_27010200_general_003.ttcn b/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules_for_attributes/27010200_general/Sem_27010200_general_003.ttcn new file mode 100644 index 0000000..34f3f60 --- /dev/null +++ b/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules_for_attributes/27010200_general/Sem_27010200_general_003.ttcn @@ -0,0 +1,41 @@ +/***************************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:27.1.2.0, Verify that attributes from type reference override attributes from higher scopes + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirement is tested: +// Attributes inherited from a type reference will override general attributes from a higher scope unit +// containing the type reference. + +module Sem_27010200_general_003 { + + type component GeneralComp { + } + + type record MyRecordA { + } with { encode "RuleA" } + + type record MyRecordB + { + MyRecordA field + } with { encode "RuleB" } + + type record of universal charstring RoUC; + + testcase TC_Sem_27010200_general_003 () runs on GeneralComp { + var RoUC v_enc := MyRecordB.field.encode; + if(v_enc[0] == "RuleA") { + setverdict(pass); + } else { + setverdict(fail); + } + } + + + control{ + execute(TC_Sem_27010200_general_003()); + } + +} with { encode "GeneralRule" } \ No newline at end of file diff --git a/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules_for_attributes/27010200_general/Sem_27010200_general_004.ttcn b/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules_for_attributes/27010200_general/Sem_27010200_general_004.ttcn new file mode 100644 index 0000000..f862a86 --- /dev/null +++ b/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules_for_attributes/27010200_general/Sem_27010200_general_004.ttcn @@ -0,0 +1,33 @@ +/***************************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:27.1.2.0, Verify that attributes from lower scopes override attribute from higher scopes + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirement is tested: +// A with statement that is placed inside the scope of another with statement shall override the outermost with. + +module Sem_27010200_general_004 { + + type component GeneralComp { + } + + type record of universal charstring RoUC; + + testcase TC_Sem_27010200_general_004 () runs on GeneralComp { + const integer c_zero := 0; + var RoUC v_enc := c_zero.encode; + if(v_enc[0] == "RuleA") { + setverdict(pass); + } else { + setverdict(fail); + } + } with { encode "RuleA" } + + + control{ + execute(TC_Sem_27010200_general_004()); + } + +} with { encode "GeneralRule" } \ No newline at end of file diff --git a/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules_for_attributes/27010200_general/Sem_27010200_general_005.ttcn b/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules_for_attributes/27010200_general/Sem_27010200_general_005.ttcn new file mode 100644 index 0000000..a4a35a9 --- /dev/null +++ b/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules_for_attributes/27010200_general/Sem_27010200_general_005.ttcn @@ -0,0 +1,43 @@ +/***************************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:27.1.2.0, Verify that attributes from type reference override attributes from higher scopes + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirement is tested: +// Attributes inherited from a type reference will override general attributes from a higher scope unit. + +// Note: +// 1. The type R gets its attribute from the module +// 2. The constant c_r gets its attribute from two sources: the R type and the scope unit (the test case) +// 3. Because the R reference is preferred, the attribute originating from the module level will be used +// even though the scope unit where the c_r unit seemingly overrides it + + +module Sem_27010200_general_005 { + + type component GeneralComp { + } + + type record R { + } + + type record of universal charstring RoUC; + + testcase TC_Sem_27010200_general_005 () runs on GeneralComp { + const R c_r := {}; + var RoUC v_enc := c_r.encode; + if(v_enc[0] == "GeneralRule") { + setverdict(pass); + } else { + setverdict(fail); + } + } with { encode "RuleA" } + + + control{ + execute(TC_Sem_27010200_general_005()); + } + +} with { encode "GeneralRule" } \ No newline at end of file diff --git a/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules_for_attributes/27010200_general/Sem_27010200_general_006.ttcn b/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules_for_attributes/27010200_general/Sem_27010200_general_006.ttcn new file mode 100644 index 0000000..d005213 --- /dev/null +++ b/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules_for_attributes/27010200_general/Sem_27010200_general_006.ttcn @@ -0,0 +1,43 @@ +/***************************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:27.1.2.0, Verify that attributes from lower group scopes override attribute from higher group scopes + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirement is tested: +// A with statement that is placed inside the scope of another with statement shall override the outermost with. +// This shall also apply to the use of the with statement with groups. + +module Sem_27010200_general_006 { + + type component GeneralComp { + } + + group myPDUs + { + type record MyPDU1 { } + group mySpecialPDUs { + type record MyPDU2 { } + } with { extension "MySpecialRule" } + } with { + extension "MyRule"; + } + + type record of universal charstring RoUC; + + testcase TC_Sem_27010200_general_006 () runs on GeneralComp { + var RoUC v_enc1 := MyPDU1.extension, + v_enc2 := MyPDU2.extension; + if(v_enc1[0] == "MyRule" and v_enc2[0] == "MySpecialRule") { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_27010200_general_006()); + } + +} with { extension "GeneralRule" } \ No newline at end of file diff --git a/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules_for_attributes/27010200_general/Sem_27010200_general_007.ttcn b/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules_for_attributes/27010200_general/Sem_27010200_general_007.ttcn new file mode 100644 index 0000000..06788d0 --- /dev/null +++ b/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules_for_attributes/27010200_general/Sem_27010200_general_007.ttcn @@ -0,0 +1,42 @@ +/***************************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:27.1.2.0, Verify that in case of multiple attributes all attributes are overridden + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirement is tested: +// If multiple attributes of the same type are allowed, all of them are overridden unless specified otherwise. + +module Sem_27010200_general_007 { + + type component GeneralComp { + } + + group myPDUs + { + type record MyPDU1 { } + group mySpecialPDUs { + type record MyPDU2 { } + } with { extension "MySpecialRule" } + } with { + extension "MyRule"; + extension "MyAdditionalRule" + } + + type record of universal charstring RoUC; + + testcase TC_Sem_27010200_general_007 () runs on GeneralComp { + var RoUC v_enc := MyPDU2.extension; + if(lengthof(v_enc) == 1 and v_enc[0] == "MySpecialRule") { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_27010200_general_007()); + } + +} with { extension "GeneralRule" } \ No newline at end of file diff --git a/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules_for_attributes/27010200_general/Sem_27010200_general_008.ttcn b/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules_for_attributes/27010200_general/Sem_27010200_general_008.ttcn new file mode 100644 index 0000000..1ba620a --- /dev/null +++ b/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules_for_attributes/27010200_general/Sem_27010200_general_008.ttcn @@ -0,0 +1,42 @@ +/***************************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:27.1.2.0, Verify that attributes of synonym types do not override existing attributes of fields + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirement is tested: +// Attributes defined for a synonym type don't override existing attributes of fields or elements of this synonym type. + +module Sem_27010200_general_008 { + + type component GeneralComp { + } + + type record SourceType2 { + integer field1, + integer field2 + } with { encode "Rule1" } + + type SourceType2 SynonymType2 with { encode "Rule3" } + + type record of universal charstring RoUC; + + testcase TC_Sem_27010200_general_008 () runs on GeneralComp { + var RoUC v_enc1 := SynonymType2.encode, + v_enc2 := SynonymType2.field1.encode, + v_enc3 := SynonymType2.field2.encode; + if(lengthof(v_enc1) == 1 and v_enc1[0] == "Rule3" and + lengthof(v_enc2) == 1 and v_enc2[0] == "Rule1" and + lengthof(v_enc3) == 1 and v_enc3[0] == "Rule1") { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_27010200_general_008()); + } + +} \ No newline at end of file diff --git a/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules_for_attributes/27010200_general/Sem_27010200_general_009.ttcn b/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules_for_attributes/27010200_general/Sem_27010200_general_009.ttcn new file mode 100644 index 0000000..cccbb22 --- /dev/null +++ b/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules_for_attributes/27010200_general/Sem_27010200_general_009.ttcn @@ -0,0 +1,43 @@ +/***************************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:27.1.2.0, Verify that attributes of synonym types apply to fields with no existing attributes + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirement is tested: +// The attributes are applied to the fields or elements of synonym types only if the fields or elements have no +// valid attributes. + +module Sem_27010200_general_009 { + + type component GeneralComp { + } + + type record SourceType1 { + integer field1, + integer field2 + } + + type SourceType1 SynonymType1 with { encode "Rule2" } + + type record of universal charstring RoUC; + + testcase TC_Sem_27010200_general_009 () runs on GeneralComp { + var RoUC v_enc1 := SynonymType1.encode, + v_enc2 := SynonymType1.field1.encode, + v_enc3 := SynonymType1.field2.encode; + if(lengthof(v_enc1) == 1 and v_enc1[0] == "Rule2" and + lengthof(v_enc2) == 1 and v_enc2[0] == "Rule2" and + lengthof(v_enc3) == 1 and v_enc3[0] == "Rule2") { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_27010200_general_009()); + } + +} \ No newline at end of file diff --git a/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules_for_attributes/27010200_general/Sem_27010200_general_010.ttcn b/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules_for_attributes/27010200_general/Sem_27010200_general_010.ttcn new file mode 100644 index 0000000..24d59b6 --- /dev/null +++ b/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules_for_attributes/27010200_general/Sem_27010200_general_010.ttcn @@ -0,0 +1,42 @@ +/***************************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:27.1.2.0, Verify that @local attribute is not applied to lower scopes + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirement is tested: +// Attributes with the @local modifier override attributes from higher scope, but they are valid for the associated +// language element only. They do not affect definitions inside the associated language element as the @local +// attribute is completely transparent to lower scopes. + +module Sem_27010200_general_010 { + + type component GeneralComp { + } + + type record R { + integer field1, + integer field2 + } with { encode @local "Rule1" } + + type record of universal charstring RoUC; + + testcase TC_Sem_27010200_general_010 () runs on GeneralComp { + var RoUC v_enc1 := R.encode, + v_enc2 := R.field1.encode, + v_enc3 := R.field2.encode; + if(lengthof(v_enc1) == 1 and v_enc1[0] == "Rule1" and + lengthof(v_enc2) == 0 and + lengthof(v_enc3) == 0) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_27010200_general_010()); + } + +} \ No newline at end of file diff --git a/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules_for_attributes/27010200_general/Sem_27010200_general_011.ttcn b/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules_for_attributes/27010200_general/Sem_27010200_general_011.ttcn new file mode 100644 index 0000000..09b6e00 --- /dev/null +++ b/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules_for_attributes/27010200_general/Sem_27010200_general_011.ttcn @@ -0,0 +1,40 @@ +/***************************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:27.1.2.0, Verify that attributes from higher scopes are applied to lower scopes when @local attribute is between them + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirement is tested: +// Attributes from higher scope will still affect attributes in lower scopes even if the @local attribute is +// between them. + +module Sem_27010200_general_011 { + + type component GeneralComp { + } + + type record R { + integer field1, + integer field2 + } with { encode @local "Rule1" } + + type record of universal charstring RoUC; + + testcase TC_Sem_27010200_general_011 () runs on GeneralComp { + var RoUC v_enc1 := R.encode, + v_enc2 := R.field1.encode, + v_enc3 := R.field2.encode; + if(lengthof(v_enc1) == 1 and v_enc1[0] == "Rule1" and + lengthof(v_enc2) == 1 and v_enc2[0] == "GeneralRule" and + lengthof(v_enc3) == 1 and v_enc3[0] == "GeneralRule") { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_27010200_general_011()); + } +} with { encode "GeneralRule" } \ No newline at end of file diff --git a/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules_for_attributes/27010200_general/Sem_27010200_general_012.ttcn b/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules_for_attributes/27010200_general/Sem_27010200_general_012.ttcn new file mode 100644 index 0000000..9b84e7a --- /dev/null +++ b/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules_for_attributes/27010200_general/Sem_27010200_general_012.ttcn @@ -0,0 +1,41 @@ +/***************************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:27.1.2.0, Verify that override directive overrides attribute from a reference + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirement is tested: +// An attribute definition in a lower scope or those inherited from a referenced type can be overwritten +// in a higher scope by using the override directive. + +module Sem_27010200_general_012 { + + type component GeneralComp { + } + + type record MyRecordA { + integer field1 + } with { encode "RuleA" } + + // In the following, fieldA of a MyRecordB instance is encoded according to RuleB + type record MyRecordB { + MyRecordA fieldA + } with { encode override "RuleB" } + + type record of universal charstring RoUC; + + testcase TC_Sem_27010200_general_012 () runs on GeneralComp { + var RoUC v_enc1 := MyRecordB.fieldA.encode; + if(lengthof(v_enc1) == 1 and v_enc1[0] == "RuleB") { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_27010200_general_012()); + } + +} \ No newline at end of file diff --git a/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules_for_attributes/27010200_general/Sem_27010200_general_013.ttcn b/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules_for_attributes/27010200_general/Sem_27010200_general_013.ttcn new file mode 100644 index 0000000..0f448b7 --- /dev/null +++ b/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules_for_attributes/27010200_general/Sem_27010200_general_013.ttcn @@ -0,0 +1,44 @@ +/***************************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:27.1.2.0, Verify that override is applied to lower scopes that do not declare the attribute + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirement is tested: +// The override directive overrides the specified attribute for all declarations at all lower scopes +// that do not also declare the specified attribute. + +module Sem_27010200_general_013 { + + type component GeneralComp { + } + + type record R { + integer field1, + integer field2 + } with { encode "Rule1" } + + type record R2 { + R field + } + + type record of universal charstring RoUC; + + testcase TC_Sem_27010200_general_013 () runs on GeneralComp { + var RoUC v_enc1 := R.encode, + v_enc2 := R2.encode, + v_enc3 := R2.field.encode; + if(lengthof(v_enc1) == 1 and v_enc1[0] == "Rule1" and + lengthof(v_enc2) == 1 and v_enc2[0] == "GeneralRule" and + lengthof(v_enc3) == 1 and v_enc3[0] == "GeneralRule") { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_27010200_general_013()); + } +} with { encode override "GeneralRule" } \ No newline at end of file diff --git a/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules_for_attributes/27010200_general/Sem_27010200_general_014.ttcn b/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules_for_attributes/27010200_general/Sem_27010200_general_014.ttcn new file mode 100644 index 0000000..edf754d --- /dev/null +++ b/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules_for_attributes/27010200_general/Sem_27010200_general_014.ttcn @@ -0,0 +1,44 @@ +/***************************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:27.1.2.0, Verify that explicit attribute declaration prevents overwriting + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirement is tested: +// The override directive overrides the specified attribute for all declarations at all lower scopes +// that do not also declare the specified attribute. + +module Sem_27010200_general_014 { + + type component GeneralComp { + } + + // In the following, rule "RuleB" is overridden by "RuleC" for fieldC, but it is + // not overridden by "RuleA" of the group because the direct attachment to fieldC and + // MyRecordC override the encode of the outer scope. + group myGroup { + type record MyRecordC { + integer field1 + } with { encode override "RuleB" } + + type record MyRecordD { + MyRecordC fieldC + } with { encode override (fieldC) "RuleC" } + } with { encode override "RuleA" } + + type record of universal charstring RoUC; + + testcase TC_Sem_27010200_general_014 () runs on GeneralComp { + var RoUC v_enc1 := MyRecordD.fieldC.encode; + if(lengthof(v_enc1) == 1 and v_enc1[0] == "RuleC") { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_27010200_general_014()); + } +} \ No newline at end of file diff --git a/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules_for_attributes/27010200_general/Sem_27010200_general_015.ttcn b/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules_for_attributes/27010200_general/Sem_27010200_general_015.ttcn new file mode 100644 index 0000000..371f9f1 --- /dev/null +++ b/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules_for_attributes/27010200_general/Sem_27010200_general_015.ttcn @@ -0,0 +1,43 @@ +/***************************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:27.1.2.0, Verify that override directive applied to a type reference does not affect the referenced type + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirement is tested: +// If the override directive is applied to a type reference, it doesn't affect the attributes of the +// original referenced type. + +module Sem_27010200_general_015 { + + type component GeneralComp { + } + + type record MyRecordA { + integer field1 + } with { encode override "RuleA" } + + type record MyRecordB { + MyRecordA fieldA + } with { encode override "RuleB" } + + // The following template will use "RuleA" as the override directive for MyRecordB affects only + // MyRecordB.fieldA, but not the original MyRecordA. + template MyRecordA mw_msg := ?; + + type record of universal charstring RoUC; + + testcase TC_Sem_27010200_general_015 () runs on GeneralComp { + var RoUC v_enc1 := mw_msg.encode; + if(lengthof(v_enc1) == 1 and v_enc1[0] == "RuleA") { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_27010200_general_015()); + } +} \ No newline at end of file diff --git a/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules_for_attributes/27010200_general/Sem_27010200_general_016.ttcn b/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules_for_attributes/27010200_general/Sem_27010200_general_016.ttcn new file mode 100644 index 0000000..32e41bd --- /dev/null +++ b/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules_for_attributes/27010200_general/Sem_27010200_general_016.ttcn @@ -0,0 +1,49 @@ +/***************************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:27.1.2.0, Verify that override directive applied to a synonym type overrides field attributes + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirement is tested: +// Override attribute applied to a synonym type(clause 6.4) overrides attributes of all fields or +// elements of the synonym type unless the synonym type definition contains an explicit attribute +// definition for the field or element + +module Sem_27010200_general_016 { + + type component GeneralComp { + } + + // MyRecordG and its "field1" member will be encoded with "RuleB", but its field2 member + // will be encoded with "RuleA", because there's an encode attribute explicitly declared + // for this field. + type record MyRecordF { + integer field1, + integer field2 + } with { encode "RuleA" } + + type MyRecordF MyRecordG with { + encode override "RuleB"; + encode(field2) "RuleA" + } + + type record of universal charstring RoUC; + + testcase TC_Sem_27010200_general_016 () runs on GeneralComp { + var RoUC v_enc1 := MyRecordG.encode, + v_enc2 := MyRecordG.field1.encode, + v_enc3 := MyRecordG.field2.encode; + if(lengthof(v_enc1) == 1 and v_enc1[0] == "RuleB" and + lengthof(v_enc2) == 1 and v_enc2[0] == "RuleB" and + lengthof(v_enc3) == 1 and v_enc3[0] == "RuleA") { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_27010200_general_016()); + } +} \ No newline at end of file diff --git a/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules_for_attributes/27010201_rules_for_variant_attributes/Sem_27010201_rules_for_variant_attributes_001.ttcn b/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules_for_attributes/27010201_rules_for_variant_attributes/Sem_27010201_rules_for_variant_attributes_001.ttcn new file mode 100644 index 0000000..dcc82e3 --- /dev/null +++ b/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules_for_attributes/27010201_rules_for_variant_attributes/Sem_27010201_rules_for_variant_attributes_001.ttcn @@ -0,0 +1,43 @@ +/***************************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:27.1.2.1, Verify that variant attributes can be overridden + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirement is tested: +// A variant attribute overwrites a current variant attribute according to the rules defined +// in clause 27.1.2; + +module Sem_27010201_rules_for_variant_attributes_001 { + + type component GeneralComp { + } + + type record MyRecordA { + } with { variant "VariantA" } + + type record MyRecordB + { + MyRecordA field + } with { variant "VariantB" } + + type record of universal charstring RoUC; + + testcase TC_Sem_27010201_rules_for_variant_attributes_001 () runs on GeneralComp { + var RoUC v_var1 := MyRecordB.variant, + v_var2 := MyRecordB.field.variant; + if(v_var1[0] == "VariantB" and + v_var2[0] == "VariantA") { + setverdict(pass); + } else { + setverdict(fail); + } + } + + + control{ + execute(TC_Sem_27010201_rules_for_variant_attributes_001()); + } + +} with { encode "GeneralRule" } \ No newline at end of file diff --git a/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules_for_attributes/27010201_rules_for_variant_attributes/Sem_27010201_rules_for_variant_attributes_002.ttcn b/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules_for_attributes/27010201_rules_for_variant_attributes/Sem_27010201_rules_for_variant_attributes_002.ttcn new file mode 100644 index 0000000..b8cfd1f --- /dev/null +++ b/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules_for_attributes/27010201_rules_for_variant_attributes/Sem_27010201_rules_for_variant_attributes_002.ttcn @@ -0,0 +1,38 @@ +/***************************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:27.1.2.1, Verify that encode attribute change disables existing variant attributes + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirement is tested: +// An encoding attribute, which overwrites a current encoding attribute according to +// the rules defined in clause 27.1.2, also overwrites a corresponding current variant +// attribute, i.e. no new variant attribute is provided, but the current variant attribute +// becomes inactive. + +module Sem_27010201_rules_for_variant_attributes_002 { + + type component GeneralComp { + } + + type record MyRecordA { + } with { encode "RuleA" } + + type record of universal charstring RoUC; + + testcase TC_Sem_27010201_rules_for_variant_attributes_002 () runs on GeneralComp { + var RoUC v_var := MyRecordA.variant; + if(lengthof(v_var) == 0) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + + control{ + execute(TC_Sem_27010201_rules_for_variant_attributes_002()); + } + +} with { encode "GeneralRule" variant "Variant1" } \ No newline at end of file diff --git a/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules_for_attributes/27010201_rules_for_variant_attributes/Sem_27010201_rules_for_variant_attributes_003.ttcn b/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules_for_attributes/27010201_rules_for_variant_attributes/Sem_27010201_rules_for_variant_attributes_003.ttcn new file mode 100644 index 0000000..b559768 --- /dev/null +++ b/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules_for_attributes/27010201_rules_for_variant_attributes/Sem_27010201_rules_for_variant_attributes_003.ttcn @@ -0,0 +1,38 @@ +/***************************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:27.1.2.1, Verify that encode attribute repeating doesn't disable existing variant attributes + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirement is tested: +// An encoding attribute, which overwrites a current encoding attribute according to +// the rules defined in clause 27.1.2, also overwrites a corresponding current variant +// attribute, i.e. no new variant attribute is provided, but the current variant attribute +// becomes inactive. + +module Sem_27010201_rules_for_variant_attributes_003 { + + type component GeneralComp { + } + + type record MyRecordA { + } with { encode "GeneralRule" } // the same as in upper scope, variant should not change + + type record of universal charstring RoUC; + + testcase TC_Sem_27010201_rules_for_variant_attributes_003 () runs on GeneralComp { + var RoUC v_var := MyRecordA.variant; + if(lengthof(v_var) == 1 and v_var[0] == "Variant1") { + setverdict(pass); + } else { + setverdict(fail); + } + } + + + control{ + execute(TC_Sem_27010201_rules_for_variant_attributes_003()); + } + +} with { encode "GeneralRule" variant "Variant1" } \ No newline at end of file diff --git a/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules_for_attributes/27010202_rules_for_multiple_encodings/Sem_27010202_rules_for_multiple_encodings_001.ttcn b/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules_for_attributes/27010202_rules_for_multiple_encodings/Sem_27010202_rules_for_multiple_encodings_001.ttcn new file mode 100644 index 0000000..2cdd801 --- /dev/null +++ b/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules_for_attributes/27010202_rules_for_multiple_encodings/Sem_27010202_rules_for_multiple_encodings_001.ttcn @@ -0,0 +1,48 @@ +/***************************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:27.1.2.2, Verify that listed encode attributes retain variants + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirement is tested: +// Explicitly listed encode attributes that occur on the higher scope and are not overwritten +// will retain all variants related to them. + +module Sem_27010202_rules_for_multiple_encodings_001 { + + type component GeneralComp { + } + + type integer Int with { + encode "CodecA"; variant "CodecA"."Rule1"; + encode "CodecB"; variant "CodecB"."Rule2"; + } + + // Modifying list of allowed encodings + type Int Int2 with { + encode "CodecA"; // variant "CodecA"."Rule1" is kept + encode "CodecC"; variant "CodecC"."Rule6"; // new encoding and related variant + // "CodecB" encoding together with its variant are discarded as "CodecB" is not + // explicitly referenced + } + + type record of universal charstring RoUC; + + testcase TC_Sem_27010202_rules_for_multiple_encodings_001 () runs on GeneralComp { + var RoUC v_var1 := Int2.variant("CodecA"), + v_var2 := Int2.variant("CodecC"); + if(lengthof(v_var1) == 1 and v_var1[0] == "Rule1" and + lengthof(v_var2) == 1 and v_var2[0] == "Rule6") { + setverdict(pass); + } else { + setverdict(fail); + } + } + + + control{ + execute(TC_Sem_27010202_rules_for_multiple_encodings_001()); + } + +} \ No newline at end of file diff --git a/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules_for_attributes/27010202_rules_for_multiple_encodings/Sem_27010202_rules_for_multiple_encodings_002.ttcn b/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules_for_attributes/27010202_rules_for_multiple_encodings/Sem_27010202_rules_for_multiple_encodings_002.ttcn new file mode 100644 index 0000000..c467a64 --- /dev/null +++ b/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules_for_attributes/27010202_rules_for_multiple_encodings/Sem_27010202_rules_for_multiple_encodings_002.ttcn @@ -0,0 +1,47 @@ +/***************************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:27.1.2.2, Verify that encoding related variant doesn't overwrite variants of other encodings + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirement is tested: +// An encoding related variant will overwrite only variants related to the same encoding. + +module Sem_27010202_rules_for_multiple_encodings_002 { + + type component GeneralComp { + } + + type integer Int with { + encode "CodecA"; variant "CodecA"."Rule1"; + encode "CodecB"; variant "CodecB"."Rule2"; + } + + // Overwriting variant with an encoding reference + type Int Int3 with { + variant "CodecB"."Rule4"; // new variant for encoding "CodecB" overwrites + // the original variant "CodecB"."Rule2" + // Variant "CodecA"."Rule1" is unchanged as this definition contains no reference + // to "CodecB" + } + + type record of universal charstring RoUC; + + testcase TC_Sem_27010202_rules_for_multiple_encodings_002 () runs on GeneralComp { + var RoUC v_var1 := Int3.variant("CodecA"), + v_var2 := Int3.variant("CodecB"); + if(lengthof(v_var1) == 1 and v_var1[0] == "Rule1" and + lengthof(v_var2) == 1 and v_var2[0] == "Rule4") { + setverdict(pass); + } else { + setverdict(fail); + } + } + + + control{ + execute(TC_Sem_27010202_rules_for_multiple_encodings_002()); + } + +} \ No newline at end of file diff --git a/core_language/27_specifying_attributes/2705_variant_attributes/Sem_2705_variant_attributes_002.ttcn b/core_language/27_specifying_attributes/2705_variant_attributes/Sem_2705_variant_attributes_002.ttcn index d84165d..55a2ec3 100644 --- a/core_language/27_specifying_attributes/2705_variant_attributes/Sem_2705_variant_attributes_002.ttcn +++ b/core_language/27_specifying_attributes/2705_variant_attributes/Sem_2705_variant_attributes_002.ttcn @@ -16,12 +16,12 @@ module Sem_2705_variant_attributes_002 { type record MyPDU { integer field1, boolean field2 - } with { variant "Rule A" encode "Rule B" encode "Rule C" } + } with { variant "Rule A" variant "Rule B" variant "Rule C" } type record of universal charstring RoUC; testcase TC_Sem_2705_variant_attributes_002 () runs on GeneralComp { - var RoUC v_enc := MyPDU.encode; + var RoUC v_enc := MyPDU.variant; if(v_enc == { "Rule A", "Rule B", "Rule C" }) { setverdict(pass); } else { diff --git a/core_language/27_specifying_attributes/2707_optional_attributes/Sem_2707_OptionalAttributes_009.ttcn b/core_language/27_specifying_attributes/2707_optional_attributes/Sem_2707_OptionalAttributes_009.ttcn new file mode 100644 index 0000000..4816404 --- /dev/null +++ b/core_language/27_specifying_attributes/2707_optional_attributes/Sem_2707_OptionalAttributes_009.ttcn @@ -0,0 +1,105 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:27.7, Ensure that the IUT correctly handles attribute definitions and their scoping rules + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + + // Restriction b) At most one optional attribute shall be applied to each definition, each individual field reference or language element to which a with statement is associated. + +module Sem_2707_OptionalAttributes_009 { + + type enumerated EnumeratedType {e_black, e_white}; + + type record RecordType { + integer a optional, + integer b optional + } + + type set SetType { + integer a optional, + integer b optional + } + + type record length (1..2) of integer IntegerList; + + type set length (1..2) of integer IntegerUList; + + type union UnionType { + integer a, + EnumeratedType b, + boolean c + } + + type record MessageType { + integer field1, + charstring field2, + boolean field3, + integer field4[4], + EnumeratedType field5, + RecordType field6, + SetType field7, + UnionType field8, + IntegerList field9, + IntegerUList field10 + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + + template MessageType mw_matchingTemplate:= + { + field1 := 1, + field2 := "test string", + field3 := true, + field4 := {1,2,3,4}, + field5 := e_black, + field6 := {a:=omit,b:=omit}, + field7 := {a:=omit,b:=omit}, + field8 := {a:=1}, + field9 := {1}, + field10 := {1,2} + } + + function f_function() runs on GeneralComp return MessageType { + var MessageType v_testMessage:= { + field1 := 1, + field2 := "test string", + field3 := true, + field4 := {1,2,3,4}, + field5 := e_black, + field6 := {a:=-,b:=-}, + field7 := {a:=-,b:=-}, + field8 := {a:=1}, + field9 := {1}, + field10 := {1,2} + } + return v_testMessage; +} with {optional "implicit omit"} + +testcase TC_Sem_2707_OptionalAttributes_009() runs on GeneralComp { + + var MessageType v_testMessage; + + + v_testMessage:= f_function(); + + if(match(v_testMessage,mw_matchingTemplate)){ + setverdict(pass); + } + else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_2707_OptionalAttributes_009()); +} + +} diff --git a/core_language/27_specifying_attributes/2708_Retrieving_attribute_values/NegSem_2708_Retrieving_attribute_values_001.ttcn b/core_language/27_specifying_attributes/2708_Retrieving_attribute_values/NegSem_2708_Retrieving_attribute_values_001.ttcn new file mode 100644 index 0000000..5d0c08f --- /dev/null +++ b/core_language/27_specifying_attributes/2708_Retrieving_attribute_values/NegSem_2708_Retrieving_attribute_values_001.ttcn @@ -0,0 +1,56 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:27.8, Ensure that the IUT correctly handles attribute definitions and their scoping rules + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +/* If the attribute can occur multiple times (encode, variant, extension), the operation +returns a record of universal charstring type. If such an attribute is not present, the operation returns an +empty record of value. + +Restriction c) An error shall be produced if the Expression in the optional parameters is not one of the valid encode +attributes. + */ + +module NegSem_2708_Retrieving_attribute_values_001 { + + type component GeneralComp {} + +// MyPDU1 will be displayed as PDU + type record MyPDU1 { integer field1 } with { + display "testDisplayValue"; + encode "Codec1"; + variant "Codec1"."Rule1A"; + variant "Codec1"."Rule1B"; + encode "Codec2"; + variant "Codec2"."Rule2A"; + variant "Codec2"."Rule2B"; + } + + type record of universal charstring RUC; + + + +testcase TC_NegSem_2708_Retrieving_attribute_values_001() runs on GeneralComp { + + var MyPDU1 v_pdu; + var universal charstring v_display; + + var RUC v_encoding, v_variants; + + v_variants := v_pdu.variant("OtherCodec"); // produces an error as there is no such encode attribute as "OtherCodec" + + if (match(v_variants, {"OtherCodec"}) ) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_NegSem_2708_Retrieving_attribute_values_001()); +} + +} diff --git a/core_language/27_specifying_attributes/2708_Retrieving_attribute_values/NegSyn_2708_Retrieving_attribute_values_001.ttcn b/core_language/27_specifying_attributes/2708_Retrieving_attribute_values/NegSyn_2708_Retrieving_attribute_values_001.ttcn new file mode 100644 index 0000000..3969b76 --- /dev/null +++ b/core_language/27_specifying_attributes/2708_Retrieving_attribute_values/NegSyn_2708_Retrieving_attribute_values_001.ttcn @@ -0,0 +1,20 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:27.8, Ensure that the IUT correctly handles attribute definitions and their scoping rules + ** @verdict pass reject, noexecution + ***************************************************/ + +// The following requirement is tested: +/* +Restriction b) The Expression in optional parameter of the operation shall be of the universal charstring type. + */ + +module NegSyn_2708_Retrieving_attribute_values_001 { + + type record MyPDU1 { integer field1 } with { + display 'FFFF'H; // error: type shall be universal charstring + encode "Codec1"; + } + +} diff --git a/core_language/27_specifying_attributes/2708_Retrieving_attribute_values/Sem_2708_Retrieving_attribute_values_001.ttcn b/core_language/27_specifying_attributes/2708_Retrieving_attribute_values/Sem_2708_Retrieving_attribute_values_001.ttcn new file mode 100644 index 0000000..c26c2ff --- /dev/null +++ b/core_language/27_specifying_attributes/2708_Retrieving_attribute_values/Sem_2708_Retrieving_attribute_values_001.ttcn @@ -0,0 +1,52 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:27.8, Ensure that the IUT correctly handles attribute definitions and their scoping rules + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// The return value of the operations for retrieving attribute values is of a universal charstring type in case of attributes that can be present only once (display, optional). If such an attribute is not defined, the operation returns an empty string. + +// Restriction b) The Expression in optional parameter of the operation shall be of the universal charstring type. + +module Sem_2708_Retrieving_attribute_values_001 { + type component GeneralComp {} + +// MyPDU1 will be displayed as PDU + type record MyPDU1 {integer field1 } with { + display "testDisplayValue"; + encode "Codec1"; + variant "Codec1"."Rule1A"; + variant "Codec1"."Rule1B"; + encode "Codec2"; + variant "Codec2"."Rule2A"; + variant "Codec2"."Rule2B"; + } + + type record of universal charstring RUC; + + + +testcase TC_Sem_2708_Retrieving_attribute_values_001() runs on GeneralComp { + + var MyPDU1 v_pdu; + var universal charstring v_display; + + var RUC v_encoding, v_variants; + + v_display := v_pdu.display; // v_display will contain "testDisplayValue" + v_display := v_variants.display; // v_display will contain "" as no display attribute is given + + if (match(v_pdu.display, "testDisplayValue") and match(v_variants.display, "")) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_2708_Retrieving_attribute_values_001()); +} + +} diff --git a/core_language/27_specifying_attributes/2708_Retrieving_attribute_values/Sem_2708_Retrieving_attribute_values_002.ttcn b/core_language/27_specifying_attributes/2708_Retrieving_attribute_values/Sem_2708_Retrieving_attribute_values_002.ttcn new file mode 100644 index 0000000..19ae6d5 --- /dev/null +++ b/core_language/27_specifying_attributes/2708_Retrieving_attribute_values/Sem_2708_Retrieving_attribute_values_002.ttcn @@ -0,0 +1,56 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:27.8, Ensure that the IUT correctly handles attribute definitions and their scoping rules + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +/* The operation for getting a variant attribute value may be followed by an optional parameter. If no parameter is +present, the operation returns only variants that are not bound to any particular encoding. If the parameter is present, the +returned value will containt variants that are bound to the encoding referenced by the parameter. + */ + + // Restriction a) The optional parameter of the operation shall be used only for getting variant attributes. + + +module Sem_2708_Retrieving_attribute_values_002 { + type component GeneralComp {} + +// MyPDU1 will be displayed as PDU + type record MyPDU1 { integer field1 } with { + display "testDisplayValue"; + encode "Codec1"; + variant "Codec1"."Rule1A"; + variant "Codec1"."Rule1B"; + encode "Codec2"; + variant "Codec2"."Rule2A"; + variant "Codec2"."Rule2B"; + } + + type record of universal charstring RUC; + + + +testcase TC_Sem_2708_Retrieving_attribute_values_002() runs on GeneralComp { + + var MyPDU1 v_pdu; + var universal charstring v_display; + + var RUC v_encoding, v_variants; + + v_encoding := v_pdu.encode; // v_encoding will contain { "Codec1", "Codec2" } + v_variants := v_pdu.variant; // v_variants will contain { "CommonRule" } + + if (match(v_pdu.encode, { "Codec1", "Codec2" })) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_2708_Retrieving_attribute_values_002()); +} + +} diff --git a/core_language/27_specifying_attributes/2708_Retrieving_attribute_values/Sem_2708_Retrieving_attribute_values_003.ttcn b/core_language/27_specifying_attributes/2708_Retrieving_attribute_values/Sem_2708_Retrieving_attribute_values_003.ttcn new file mode 100644 index 0000000..d4be69e --- /dev/null +++ b/core_language/27_specifying_attributes/2708_Retrieving_attribute_values/Sem_2708_Retrieving_attribute_values_003.ttcn @@ -0,0 +1,64 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:27.8, Ensure that the IUT correctly handles attribute definitions and their scoping rules + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +/* The operation for getting a variant attribute value may be followed by an optional parameter. If no parameter is +present, the operation returns only variants that are not bound to any particular encoding. If the parameter is present, the +returned value will containt variants that are bound to the encoding referenced by the parameter. */ + + // Restriction a) The optional parameter of the operation shall be used only for getting variant attributes. + + +module Sem_2708_Retrieving_attribute_values_003 { + type component GeneralComp {} + +// MyPDU1 will be displayed as PDU + type record MyPDU1 { integer field1 } with { + display "testDisplayValue"; + encode "Codec1"; + variant "Codec1"."Rule1A"; + variant "Codec1"."Rule1B"; + encode "Codec2"; + variant "Codec2"."Rule2A"; + variant "Codec2"."Rule2B"; + } + + type record of universal charstring RUC; + +testcase TC_Sem_2708_Retrieving_attribute_values_003() runs on GeneralComp { + + var MyPDU1 v_pdu; + + var RUC v_encoding; + var RUC v_variantsforCodec1,v_variantsforCodec2; + + v_encoding := v_pdu.encode; + + // retrieve variants for all defined encodings + for (var integer item := 0; item < lengthof(v_encoding); item := item + 1) { + if(v_encoding[item] == "Codec1"){ + v_variantsforCodec1 := v_pdu.variant(v_encoding[item]); // collect all variants + } + + if(v_encoding[item] == "Codec2"){ + v_variantsforCodec2 := v_pdu.variant(v_encoding[item]); // collect all variants + } + } + + + if (match(v_variantsforCodec1, { "Rule1A", "Rule1B"}) and match(v_variantsforCodec2, {"Rule2A", "Rule2B" })) { + setverdict(pass); + } else { + setverdict(fail,v_variantsforCodec1, v_variantsforCodec2); + } +} + +control{ + execute(TC_Sem_2708_Retrieving_attribute_values_003()); +} + +} diff --git a/core_language/27_specifying_attributes/2708_Retrieving_attribute_values/Sem_2708_Retrieving_attribute_values_004.ttcn b/core_language/27_specifying_attributes/2708_Retrieving_attribute_values/Sem_2708_Retrieving_attribute_values_004.ttcn new file mode 100644 index 0000000..716c54d --- /dev/null +++ b/core_language/27_specifying_attributes/2708_Retrieving_attribute_values/Sem_2708_Retrieving_attribute_values_004.ttcn @@ -0,0 +1,54 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:27.8, Ensure that the IUT correctly handles attribute definitions and their scoping rules + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +/* If the attribute can occur multiple times (encode, variant, extension), the operation +returns a record of universal charstring type. If such an attribute is not present, the operation returns an +empty record of value. */ + + // Restriction a) The optional parameter of the operation shall be used only for getting variant attributes. + +module Sem_2708_Retrieving_attribute_values_004 { + type component GeneralComp {} + +// MyPDU1 will be displayed as PDU + type record MyPDU1 { integer field1 } with { + display "testDisplayValue"; + encode "Codec1"; + variant "Codec1"."Rule1A"; + variant "Codec1"."Rule1B"; + encode "Codec2"; + variant "Codec2"."Rule2A"; + variant "Codec2"."Rule2B"; + } + + type record of universal charstring RUC; + + + +testcase TC_Sem_2708_Retrieving_attribute_values_004() runs on GeneralComp { + + var MyPDU1 v_pdu; + + var RUC v_encoding, v_variants; + + v_encoding := v_pdu.encode; // v_encoding will contain { "Codec1", "Codec2" } + + v_variants := v_pdu.variant; // shall contain {} + + if (match(v_variants, {}) ) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_2708_Retrieving_attribute_values_004()); +} + +} diff --git a/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010206_superset/Sem_B010206_superset_009.ttcn b/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010206_superset/Sem_B010206_superset_009.ttcn new file mode 100644 index 0000000..f7598bf --- /dev/null +++ b/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010206_superset/Sem_B010206_superset_009.ttcn @@ -0,0 +1,49 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:B.1.2.6, Ensure that the IUT correctly handles template matching of superset definition + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + + //Restriction g) Templates in SuperSet's argument shall obey the present template restriction + +module Sem_B010206_superset_009 { + + type set of integer SoI; + + type port loopbackPort message { + inout SoI + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010206_superset_009() runs on GeneralComp { + + var SoI v_testMessage; + + template SoI mw_matchingTemplate:= superset(1, complement(5, 6)); //template is a set of integers + + + v_testMessage:={1,2}; + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } +} + +control{ + execute(TC_Sem_B010206_superset_009()); +} + +} + \ No newline at end of file diff --git a/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010206_superset/Sem_B010206_superset_010.ttcn b/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010206_superset/Sem_B010206_superset_010.ttcn new file mode 100644 index 0000000..247de7d --- /dev/null +++ b/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010206_superset/Sem_B010206_superset_010.ttcn @@ -0,0 +1,49 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:B.1.2.6, Ensure that the IUT correctly handles template matching of superset definition + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + + //Restriction g) Templates in SuperSet's argument shall obey the present template restriction + +module Sem_B010206_superset_010 { + + type set of charstring SoI; + + type port loopbackPort message { + inout SoI + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010206_superset_010() runs on GeneralComp { + + var SoI v_testMessage; + + template SoI mw_matchingTemplate:= superset(pattern "[^a-z]", pattern "[^A-Z]"); //template is a set of charstrings + + + v_testMessage:={"1","2"}; + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } +} + +control{ + execute(TC_Sem_B010206_superset_010()); +} + +} + \ No newline at end of file diff --git a/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010206_superset/Sem_B010206_superset_011.ttcn b/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010206_superset/Sem_B010206_superset_011.ttcn new file mode 100644 index 0000000..0b53613 --- /dev/null +++ b/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010206_superset/Sem_B010206_superset_011.ttcn @@ -0,0 +1,49 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:B.1.2.6, Ensure that the IUT correctly handles template matching of superset definition + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + + //Restriction g) Templates in SuperSet's argument shall obey the present template restriction + +module Sem_B010206_superset_011 { + + type set of charstring SoI; + + type port loopbackPort message { + inout SoI + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010206_superset_011() runs on GeneralComp { + + var SoI v_testMessage; + + template SoI mw_matchingTemplate:= superset(pattern "[a-z]", pattern "[A-Z]"); //template is a set of charstrings + + + v_testMessage:={"b","B"}; + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } +} + +control{ + execute(TC_Sem_B010206_superset_011()); +} + +} + \ No newline at end of file diff --git a/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010207_subset/Sem_B010207_subset_009.ttcn b/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010207_subset/Sem_B010207_subset_009.ttcn new file mode 100644 index 0000000..dc9d203 --- /dev/null +++ b/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010207_subset/Sem_B010207_subset_009.ttcn @@ -0,0 +1,57 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:B.1.2.7, Ensure that the IUT correctly handles template matching of subset definition + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +//Restriction g) Templates in SubSet's argument shall obey the present template restriction. + +module Sem_B010207_subset_009 { + + + type record MessageType { + set of integer field1 + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010207_subset_009() runs on GeneralComp { + + var MessageType v_testMessage; + + + template MessageType mw_matchingTemplate:= + { + field1 := subset(1, complement(5, 6)) // complement + } + + v_testMessage:= { + field1 := {1,3} + } + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } +} + +control{ + execute(TC_Sem_B010207_subset_009()); +} + +} + \ No newline at end of file diff --git a/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010207_subset/Sem_B010207_subset_010.ttcn b/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010207_subset/Sem_B010207_subset_010.ttcn new file mode 100644 index 0000000..7f92514 --- /dev/null +++ b/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010207_subset/Sem_B010207_subset_010.ttcn @@ -0,0 +1,57 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:B.1.2.7, Ensure that the IUT correctly handles template matching of subset definition + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +//Restriction g) Templates in SubSet's argument shall obey the present template restriction. + +module Sem_B010207_subset_010 { + + + type record MessageType { + set of charstring field1 + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010207_subset_010() runs on GeneralComp { + + var MessageType v_testMessage; + + + template MessageType mw_matchingTemplate:= + { + field1 := subset(pattern "[^a-z]", pattern "[^A-Z]") // pattern + } + + v_testMessage:= { + field1 := {"1","2"} + } + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } +} + +control{ + execute(TC_Sem_B010207_subset_010()); +} + +} + \ No newline at end of file diff --git a/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010207_subset/Sem_B010207_subset_011.ttcn b/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010207_subset/Sem_B010207_subset_011.ttcn new file mode 100644 index 0000000..f259810 --- /dev/null +++ b/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010207_subset/Sem_B010207_subset_011.ttcn @@ -0,0 +1,57 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:B.1.2.7, Ensure that the IUT correctly handles template matching of subset definition + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +//Restriction g) Templates in SubSet's argument shall obey the present template restriction. + +module Sem_B010207_subset_011 { + + + type record MessageType { + set of charstring field1 + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010207_subset_011() runs on GeneralComp { + + var MessageType v_testMessage; + + + template MessageType mw_matchingTemplate:= + { + field1 := subset(pattern "[a-z]", pattern "[A-Z]") // pattern + } + + v_testMessage:= { + field1 := {"2", "3"} // does not match + } + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(fail); + } + [] messagePort.receive { + setverdict(pass); + } + } +} + +control{ + execute(TC_Sem_B010207_subset_011()); +} + +} + \ No newline at end of file diff --git a/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010207_subset/Sem_B010207_subset_012.ttcn b/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010207_subset/Sem_B010207_subset_012.ttcn new file mode 100644 index 0000000..d4a1ee8 --- /dev/null +++ b/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010207_subset/Sem_B010207_subset_012.ttcn @@ -0,0 +1,57 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:B.1.2.7, Ensure that the IUT correctly handles template matching of subset definition + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +//Restriction g) Templates in SubSet's argument shall obey the present template restriction. + +module Sem_B010207_subset_012 { + + + type record MessageType { + set of charstring field1 + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010207_subset_012() runs on GeneralComp { + + var MessageType v_testMessage; + + + template MessageType mw_matchingTemplate:= + { + field1 := subset(pattern "[^a-z]", pattern "[^A-Z]") // pattern + } + + v_testMessage:= { + field1 := {"1","2"} + } + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } +} + +control{ + execute(TC_Sem_B010207_subset_012()); +} + +} + \ No newline at end of file diff --git a/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010207_subset/Sem_B010207_subset_013.ttcn b/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010207_subset/Sem_B010207_subset_013.ttcn new file mode 100644 index 0000000..4b9acb4 --- /dev/null +++ b/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010207_subset/Sem_B010207_subset_013.ttcn @@ -0,0 +1,57 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:B.1.2.7, Ensure that the IUT correctly handles template matching of subset definition + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +//Restriction g) Templates in SubSet's argument shall obey the present template restriction. + +module Sem_B010207_subset_013 { + + + type record MessageType { + set of charstring field1 + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010207_subset_013() runs on GeneralComp { + + var MessageType v_testMessage; + + + template MessageType mw_matchingTemplate:= + { + field1 := subset(pattern "[a-z]", pattern "[A-Z]") // pattern + } + + v_testMessage:= { + field1 := {"2", "3"} // does not match + } + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(fail); + } + [] messagePort.receive { + setverdict(pass); + } + } +} + +control{ + execute(TC_Sem_B010207_subset_013()); +} + +} + \ No newline at end of file diff --git a/core_language/B_matching_incoming_values/B01_template_matching/B0103_matching_inside_values/B010303_permutation/._NegSem_B010303_permutation_006.ttcn b/core_language/B_matching_incoming_values/B01_template_matching/B0103_matching_inside_values/B010303_permutation/._NegSem_B010303_permutation_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..fcd4ae23b252cac3c6d5e762ee8009b34c02d6a1 GIT binary patch literal 4096 zcmZQz6=P>$Vqox1Ojhs@R)|o50+1L3ClDJkFz{^v(m+1nBL)UWIUt(=a103vvYvJF zKST$^0-$mMG%bukK2%&PIX_n~v7jI)RWB#8xTLf=H6 value v_rcv) { + log("JSON message: ", v_rcv); + if (matchFile(v_rcv, "Pos_0603_name_conversion_rules_001.json", v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference JSON"); + } + [] p.receive { + setverdict(fail, "JSON decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_0603_name_conversion_rules_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} //end module \ No newline at end of file diff --git a/json/06_using_ttcn3_as_json_schema/0603_name_conversion_rules/Pos_0603_name_conversion_rules_002/Pos_0603_name_conversion_rules_002.json b/json/06_using_ttcn3_as_json_schema/0603_name_conversion_rules/Pos_0603_name_conversion_rules_002/Pos_0603_name_conversion_rules_002.json new file mode 100644 index 0000000..f5ac01f --- /dev/null +++ b/json/06_using_ttcn3_as_json_schema/0603_name_conversion_rules/Pos_0603_name_conversion_rules_002/Pos_0603_name_conversion_rules_002.json @@ -0,0 +1,6 @@ +{ + "Pos_0603_name_conversion_rules_002.MyRec":{ + "int__value": 5, + "charString___value": "abcdef" + } +} diff --git a/json/06_using_ttcn3_as_json_schema/0603_name_conversion_rules/Pos_0603_name_conversion_rules_002/Pos_0603_name_conversion_rules_002.ttcn b/json/06_using_ttcn3_as_json_schema/0603_name_conversion_rules/Pos_0603_name_conversion_rules_002/Pos_0603_name_conversion_rules_002.ttcn new file mode 100644 index 0000000..a2fb650 --- /dev/null +++ b/json/06_using_ttcn3_as_json_schema/0603_name_conversion_rules/Pos_0603_name_conversion_rules_002/Pos_0603_name_conversion_rules_002.ttcn @@ -0,0 +1,107 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:6.3, Verify that character substitutions is applied correctly (each character string being mapped to a TTCN-3 name). + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + * The following character substitutions shall be applied, in order that each character string being mapped to a TTCN-3 name, + * where each substitution (except the first) shall be applied to the result of the previous transformation: + * b) a sequence of two or more "_" (Low Line) characters shall be replaced with a single "_" (Low Line); + * */ + +module Pos_0603_name_conversion_rules_002 { + + import from JSON all; + + type record MyRec { + integer int_value, + charstring charString_value + } + with { + encode "JSON"; + variant(int_value) + "name as 'int__value'"; + variant(charString_value) + "name as 'charString___value'" + }; + /* Note: The reference JSON contains this: + * + * { "Pos_0603_name_conversion_rules_002.MyRec":{"int__value": 5,"charString___value": "abcdef"}} + */ + + + template MyRec m_msg := { + int_value := 5, + charString_value := "abcdef" + } + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw with { + encode "Text" + }; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference JSON file and returns true if they represent the same JSON structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the JSON data + * @param p_referenceJsonFile the JSON data + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference JSON file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceJsonFile represent the same JSON data + */ + external function matchFile(Raw p_textToMatch, File p_referenceJsonFile, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_0603_name_conversion_rules_002() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self: p, system: p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference JSON file + [] p.check(receive(Raw: ? ) -> value v_rcv) { + log("JSON message: ", v_rcv); + if (matchFile(v_rcv, "Pos_0603_name_conversion_rules_002.json", v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference JSON"); + } + [] p.receive { + setverdict(fail, "JSON decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_0603_name_conversion_rules_002(), PX_TC_EXECUTION_TIMEOUT); + } + +} //end module \ No newline at end of file diff --git a/json/06_using_ttcn3_as_json_schema/0603_name_conversion_rules/Pos_0603_name_conversion_rules_003/Pos_0603_name_conversion_rules_003.json b/json/06_using_ttcn3_as_json_schema/0603_name_conversion_rules/Pos_0603_name_conversion_rules_003/Pos_0603_name_conversion_rules_003.json new file mode 100644 index 0000000..bf0ce00 --- /dev/null +++ b/json/06_using_ttcn3_as_json_schema/0603_name_conversion_rules/Pos_0603_name_conversion_rules_003/Pos_0603_name_conversion_rules_003.json @@ -0,0 +1,6 @@ +{ + "Pos_0603_name_conversion_rules_003.MyRec":{ + "_int_value": 5, + "charString_value_": "abcdef" + } +} diff --git a/json/06_using_ttcn3_as_json_schema/0603_name_conversion_rules/Pos_0603_name_conversion_rules_003/Pos_0603_name_conversion_rules_003.ttcn b/json/06_using_ttcn3_as_json_schema/0603_name_conversion_rules/Pos_0603_name_conversion_rules_003/Pos_0603_name_conversion_rules_003.ttcn new file mode 100644 index 0000000..1e4e59b --- /dev/null +++ b/json/06_using_ttcn3_as_json_schema/0603_name_conversion_rules/Pos_0603_name_conversion_rules_003/Pos_0603_name_conversion_rules_003.ttcn @@ -0,0 +1,107 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:6.3, Verify that character substitutions is applied correctly (each character string being mapped to a TTCN-3 name). + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + * The following character substitutions shall be applied, in order that each character string being mapped to a TTCN-3 name, + * where each substitution (except the first) shall be applied to the result of the previous transformation: + * "_" (Low Line) characters occurring at the beginning or at the end of the name shall be removed; + * */ + +module Pos_0603_name_conversion_rules_003 { + + import from JSON all; + + type record MyRec { + integer int_value, + charstring charString_value + } + with { + encode "JSON"; + variant(int_value) + "name as '_int_value'"; + variant(charString_value) + "name as 'charString_value_'" + }; + /* Note: The reference JSON contains this: + * + * { "Pos_0603_name_conversion_rules_003.MyRec":{"_int_value": 5,"charString_value_": "abcdef"}} + */ + + + template MyRec m_msg := { + int_value := 5, + charString_value := "abcdef" + } + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw with { + encode "Text" + }; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference JSON file and returns true if they represent the same JSON structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the JSON data + * @param p_referenceJsonFile the JSON data + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference JSON file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceJsonFile represent the same JSON data + */ + external function matchFile(Raw p_textToMatch, File p_referenceJsonFile, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_0603_name_conversion_rules_003() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self: p, system: p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference JSON file + [] p.check(receive(Raw: ? ) -> value v_rcv) { + log("JSON message: ", v_rcv); + if (matchFile(v_rcv, "Pos_0603_name_conversion_rules_003.json", v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference JSON"); + } + [] p.receive { + setverdict(fail, "JSON decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_0603_name_conversion_rules_003(), PX_TC_EXECUTION_TIMEOUT); + } + +} //end module \ No newline at end of file diff --git a/json/06_using_ttcn3_as_json_schema/0603_name_conversion_rules/Pos_0603_name_conversion_rules_004/Pos_0603_name_conversion_rules_004.json b/json/06_using_ttcn3_as_json_schema/0603_name_conversion_rules/Pos_0603_name_conversion_rules_004/Pos_0603_name_conversion_rules_004.json new file mode 100644 index 0000000..6f62fb9 --- /dev/null +++ b/json/06_using_ttcn3_as_json_schema/0603_name_conversion_rules/Pos_0603_name_conversion_rules_004/Pos_0603_name_conversion_rules_004.json @@ -0,0 +1,6 @@ +{ + "Pos_0603_name_conversion_rules_004.MyRec":{ + "1charString_value1": "5", + "2charString_value2": "abcdef" + } +} diff --git a/json/06_using_ttcn3_as_json_schema/0603_name_conversion_rules/Pos_0603_name_conversion_rules_004/Pos_0603_name_conversion_rules_004.ttcn b/json/06_using_ttcn3_as_json_schema/0603_name_conversion_rules/Pos_0603_name_conversion_rules_004/Pos_0603_name_conversion_rules_004.ttcn new file mode 100644 index 0000000..d7b25f8 --- /dev/null +++ b/json/06_using_ttcn3_as_json_schema/0603_name_conversion_rules/Pos_0603_name_conversion_rules_004/Pos_0603_name_conversion_rules_004.ttcn @@ -0,0 +1,107 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:6.3, Verify that character substitutions is applied correctly (each character string being mapped to a TTCN-3 name). + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + * The following character substitutions shall be applied, in order that each character string being mapped to a TTCN-3 name, + * where each substitution (except the first) shall be applied to the result of the previous transformation: + * if a character string starts with a digit (Digit Zero to Digit Nine), it shall be prefixed with an "x" (Latin Small Letter X) character; + * */ + +module Pos_0603_name_conversion_rules_004 { + + import from JSON all; + + type record MyRec { + charstring x1charString_value1, + charstring x2charString_value2 + } + with { + encode "JSON"; + variant(x1charString_value1) + "name as '1charString_value1'" + variant(x2charString_value2) + "name as '2charString_value2'" + }; + /* Note: The reference JSON contains this: + * + * { "Pos_0603_name_conversion_rules_004.MyRec":{"1charString_value1": "5","2charString_value2": "abcdef"}} + */ + + + template MyRec m_msg := { + x1charString_value1 := "5", + x2charString_value2 := "abcdef" + } + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw with { + encode "Text" + }; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference JSON file and returns true if they represent the same JSON structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the JSON data + * @param p_referenceJsonFile the JSON data + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference JSON file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceJsonFile represent the same JSON data + */ + external function matchFile(Raw p_textToMatch, File p_referenceJsonFile, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_0603_name_conversion_rules_004() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self: p, system: p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference JSON file + [] p.check(receive(Raw: ? ) -> value v_rcv) { + log("JSON message: ", v_rcv); + if (matchFile(v_rcv, "Pos_0603_name_conversion_rules_004.json", v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference JSON"); + } + [] p.receive { + setverdict(fail, "JSON decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_0603_name_conversion_rules_004(), PX_TC_EXECUTION_TIMEOUT); + } + +} //end module \ No newline at end of file diff --git a/json/06_using_ttcn3_as_json_schema/0603_name_conversion_rules/Pos_0603_name_conversion_rules_005/Pos_0603_name_conversion_rules_005.json b/json/06_using_ttcn3_as_json_schema/0603_name_conversion_rules/Pos_0603_name_conversion_rules_005/Pos_0603_name_conversion_rules_005.json new file mode 100644 index 0000000..9b31e7e --- /dev/null +++ b/json/06_using_ttcn3_as_json_schema/0603_name_conversion_rules/Pos_0603_name_conversion_rules_005/Pos_0603_name_conversion_rules_005.json @@ -0,0 +1,5 @@ +{ + "Pos_0603_name_conversion_rules_005.MyRec":{ + "%@": "5" + } +} diff --git a/json/06_using_ttcn3_as_json_schema/0603_name_conversion_rules/Pos_0603_name_conversion_rules_005/Pos_0603_name_conversion_rules_005.ttcn b/json/06_using_ttcn3_as_json_schema/0603_name_conversion_rules/Pos_0603_name_conversion_rules_005/Pos_0603_name_conversion_rules_005.ttcn new file mode 100644 index 0000000..e215c16 --- /dev/null +++ b/json/06_using_ttcn3_as_json_schema/0603_name_conversion_rules/Pos_0603_name_conversion_rules_005/Pos_0603_name_conversion_rules_005.ttcn @@ -0,0 +1,103 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:6.3, Verify that character substitutions is applied correctly (each character string being mapped to a TTCN-3 name). + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + * The following character substitutions shall be applied, in order that each character string being mapped to a TTCN-3 name, + * where each substitution (except the first) shall be applied to the result of the previous transformation: + * e) if a character string is empty, it shall be replaced by "x" (Latin Small Letter X); + * */ + +module Pos_0603_name_conversion_rules_005 { + + import from JSON all; + + type record MyRec { + charstring x + } + with { + encode "JSON"; + variant(x) + "name as '%@'" + }; + /* Note: The reference JSON contains this: + * + * { "Pos_0603_name_conversion_rules_005.MyRec":{"%@": "5"} + */ + + + template MyRec m_msg := { + x := "5" + } + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw with { + encode "Text" + }; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference JSON file and returns true if they represent the same JSON structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the JSON data + * @param p_referenceJsonFile the JSON data + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference JSON file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceJsonFile represent the same JSON data + */ + external function matchFile(Raw p_textToMatch, File p_referenceJsonFile, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_0603_name_conversion_rules_005() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self: p, system: p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference JSON file + [] p.check(receive(Raw: ? ) -> value v_rcv) { + log("JSON message: ", v_rcv); + if (matchFile(v_rcv, "Pos_0603_name_conversion_rules_005.json", v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference JSON"); + } + [] p.receive { + setverdict(fail, "JSON decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_0603_name_conversion_rules_005(), PX_TC_EXECUTION_TIMEOUT); + } + +} //end module \ No newline at end of file diff --git a/json/06_using_ttcn3_as_json_schema/0603_name_conversion_rules/Pos_0603_name_conversion_rules_006/Pos_0603_name_conversion_rules_006.json b/json/06_using_ttcn3_as_json_schema/0603_name_conversion_rules/Pos_0603_name_conversion_rules_006/Pos_0603_name_conversion_rules_006.json new file mode 100644 index 0000000..c634409 --- /dev/null +++ b/json/06_using_ttcn3_as_json_schema/0603_name_conversion_rules/Pos_0603_name_conversion_rules_006/Pos_0603_name_conversion_rules_006.json @@ -0,0 +1,7 @@ +{ + "Pos_0603_name_conversion_rules_006.MyRec":{ + "key_%": "1", + "key": "2", + "key_#": "3" + } +} diff --git a/json/06_using_ttcn3_as_json_schema/0603_name_conversion_rules/Pos_0603_name_conversion_rules_006/Pos_0603_name_conversion_rules_006.ttcn b/json/06_using_ttcn3_as_json_schema/0603_name_conversion_rules/Pos_0603_name_conversion_rules_006/Pos_0603_name_conversion_rules_006.ttcn new file mode 100644 index 0000000..203c6de --- /dev/null +++ b/json/06_using_ttcn3_as_json_schema/0603_name_conversion_rules/Pos_0603_name_conversion_rules_006/Pos_0603_name_conversion_rules_006.ttcn @@ -0,0 +1,115 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:6.3, Verify that character substitutions is applied correctly (each character string being mapped to a TTCN-3 name). + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + * The following character substitutions shall be applied, in order that each character string being mapped to a TTCN-3 name, + * where each substitution (except the first) shall be applied to the result of the previous transformation: + * f) if the TTCN‑3 name being generated is identical to a previously generated TTCN‑3 identifier in the same scope, then a postfix shall be appended to the character string generated by the above rules. If a field name of a TTCN-3 structured type is clashing with a type's name used in the same structured type, the field's name shall be postfixed. The postfix shall consist of a "_" (Low Line) followed by an integer. This integer shall be the least positive integer such that the new identifier is different from the identifier of any previously generated identifier in the same scope (i.e. the first postfix applied by this mechanism is "_1"). + * */ +module Pos_0603_name_conversion_rules_006 { + + import from JSON all; + + type record MyRec { + charstring key, + charstring key1, + charstring key2 + + } + with { + encode "JSON"; + variant(key) + "name as 'key_%'" + variant(key1) + "name as 'key'" + variant(key2) + "name as 'key_#'" + }; + /* Note: The reference JSON contains this: + * + * { "Pos_0603_name_conversion_rules_006.MyRec":{ + * "key_%": "1", + * "key": "2" , + * "key_#": "3" + } + */ + + template MyRec m_msg := { + key := "1", + key1 := "2", + key2 := "3" + } + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw with { + encode "Text" + }; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference JSON file and returns true if they represent the same JSON structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the JSON data + * @param p_referenceJsonFile the JSON data + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference JSON file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceJsonFile represent the same JSON data + */ + external + function matchFile(Raw p_textToMatch, File p_referenceJsonFile, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_0603_name_conversion_rules_006() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self: p, system: p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference JSON file + [] p.check(receive(Raw: ? ) -> value v_rcv) { + log("JSON message: ", v_rcv); + if (matchFile(v_rcv, "Pos_0603_name_conversion_rules_006.json", v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference JSON"); + } + [] p.receive { + setverdict(fail, "JSON decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_0603_name_conversion_rules_006(), PX_TC_EXECUTION_TIMEOUT); + } + +} //end module \ No newline at end of file diff --git a/json/06_using_ttcn3_as_json_schema/0603_name_conversion_rules/Pos_0603_name_conversion_rules_007/Pos_0603_name_conversion_rules_007.json b/json/06_using_ttcn3_as_json_schema/0603_name_conversion_rules/Pos_0603_name_conversion_rules_007/Pos_0603_name_conversion_rules_007.json new file mode 100644 index 0000000..4ea9f2d --- /dev/null +++ b/json/06_using_ttcn3_as_json_schema/0603_name_conversion_rules/Pos_0603_name_conversion_rules_007/Pos_0603_name_conversion_rules_007.json @@ -0,0 +1,5 @@ +{ + "Pos_0603_name_conversion_rules_007.MyRec":{ + "record":"1" + } +} diff --git a/json/06_using_ttcn3_as_json_schema/0603_name_conversion_rules/Pos_0603_name_conversion_rules_007/Pos_0603_name_conversion_rules_007.ttcn b/json/06_using_ttcn3_as_json_schema/0603_name_conversion_rules/Pos_0603_name_conversion_rules_007/Pos_0603_name_conversion_rules_007.ttcn new file mode 100644 index 0000000..7e928cf --- /dev/null +++ b/json/06_using_ttcn3_as_json_schema/0603_name_conversion_rules/Pos_0603_name_conversion_rules_007/Pos_0603_name_conversion_rules_007.ttcn @@ -0,0 +1,103 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:6.3, Verify that character substitutions is applied correctly (each character string being mapped to a TTCN-3 name). + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + * The following character substitutions shall be applied, in order that each character string being mapped to a TTCN-3 name, + * where each substitution (except the first) shall be applied to the result of the previous transformation: + * f) TTCN‑3 names that are one of the TTCN-3 keywords (see clause A.1.5 of ETSI ES 201 873‑1 [0]) or names of predefined functions (see clause 16.1.2 of ETSI ES 201 873‑1 [0]) after applying the postfix to clashing names, shall be suffixed by a single "_" (Low Line) character. + * */ +module Pos_0603_name_conversion_rules_007 { + + import from JSON all; + + type record MyRec { + charstring record_ + + } + with { + encode "JSON"; + variant(record_) + "name as 'record'" + }; + /* Note: The reference JSON contains this: + * + * { "Pos_0603_name_conversion_rules_007.MyRec":{"record": "1"} } + */ + + template MyRec m_msg := { + record_ := "1" + } + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw with { + encode "Text" + }; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference JSON file and returns true if they represent the same JSON structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the JSON data + * @param p_referenceJsonFile the JSON data + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference JSON file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceJsonFile represent the same JSON data + */ + external + function matchFile(Raw p_textToMatch, File p_referenceJsonFile, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_0603_name_conversion_rules_007() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self: p, system: p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference JSON file + [] p.check(receive(Raw: ? ) -> value v_rcv) { + log("JSON message: ", v_rcv); + if (matchFile(v_rcv, "Pos_0603_name_conversion_rules_007.json", v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference JSON"); + } + [] p.receive { + setverdict(fail, "JSON decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_0603_name_conversion_rules_007(), PX_TC_EXECUTION_TIMEOUT); + } + +} //end module diff --git a/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060401_json_numbers/Neg_0600401_json_numbers_001/Neg_0600401_json_numbers_001.ttcn b/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060401_json_numbers/Neg_0600401_json_numbers_001/Neg_0600401_json_numbers_001.ttcn new file mode 100644 index 0000000..022d7a7 --- /dev/null +++ b/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060401_json_numbers/Neg_0600401_json_numbers_001/Neg_0600401_json_numbers_001.ttcn @@ -0,0 +1,59 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:6.4.1, Verify number to integer decode is not allowed + ** @verdict pass reject + ***************************************************/ +/* + * Attempts to decode a JSON number value with either a fraction or an exponent part + * or both into this JSON.Integer type shall cause a decoding failure. + * */ + +module Neg_0600401_json_numbers_001 { + + import from JSON all; + + template JSON.Number m_msg := 15.7 with { encode "JSON" }; // JSON:number + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw with { encode "Text" }; + + type port P message { + inout all; + } + + type component C { + port P p; + } + + testcase TC_Neg_0600401_json_numbers_001() runs on C system C { + + var JSON.Integer v_rcv; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + alt { + [] p.check(receive(m_msg) -> value v_rcv) { + log("JSON message: ", v_rcv); + // error: JSON:number can not be decoded as JSON:Integer + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + + unmap(self:p, system:p); + } + + control { + execute(TC_Neg_0600401_json_numbers_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060401_json_numbers/Neg_0600401_json_numbers_002/Neg_0600401_json_numbers_002.json b/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060401_json_numbers/Neg_0600401_json_numbers_002/Neg_0600401_json_numbers_002.json new file mode 100644 index 0000000..46fc09b --- /dev/null +++ b/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060401_json_numbers/Neg_0600401_json_numbers_002/Neg_0600401_json_numbers_002.json @@ -0,0 +1,3 @@ +{ +"string": "infinity" +} diff --git a/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060401_json_numbers/Neg_0600401_json_numbers_002/Neg_0600401_json_numbers_002.ttcn b/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060401_json_numbers/Neg_0600401_json_numbers_002/Neg_0600401_json_numbers_002.ttcn new file mode 100644 index 0000000..9f085de --- /dev/null +++ b/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060401_json_numbers/Neg_0600401_json_numbers_002/Neg_0600401_json_numbers_002.ttcn @@ -0,0 +1,18 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:6.4.1, Verify that number is correctly mapped to during JSON encode. + ** @verdict pass reject + ***************************************************/ +/* + * JSON numbers: + * 6.4.1: No special values (as –infinity, infinity or NaN) are allowed. + * */ + +module Neg_0600401_json_numbers_002 { + + import from JSON all; + + template Number m_msg := infinity; // error: special float value, not allowed! + +} diff --git a/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060401_json_numbers/Neg_0600401_json_numbers_003/Neg_0600401_json_numbers_003.json b/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060401_json_numbers/Neg_0600401_json_numbers_003/Neg_0600401_json_numbers_003.json new file mode 100644 index 0000000..ee1128f --- /dev/null +++ b/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060401_json_numbers/Neg_0600401_json_numbers_003/Neg_0600401_json_numbers_003.json @@ -0,0 +1,3 @@ +{ +"string": "-infinity" +} diff --git a/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060401_json_numbers/Neg_0600401_json_numbers_003/Neg_0600401_json_numbers_003.ttcn b/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060401_json_numbers/Neg_0600401_json_numbers_003/Neg_0600401_json_numbers_003.ttcn new file mode 100644 index 0000000..ab40f12 --- /dev/null +++ b/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060401_json_numbers/Neg_0600401_json_numbers_003/Neg_0600401_json_numbers_003.ttcn @@ -0,0 +1,18 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:6.4.1, Verify that -infinity can not be assigned to a JSON.Number. + ** @verdict pass reject + ***************************************************/ +/* + * JSON numbers: + * 6.4.1: No special values (as –infinity, infinity or NaN) are allowed. + * */ + +module Neg_0600401_json_numbers_003 { + + import from JSON all; + + template JSON.Number m_msg := -infinity; // error: -infinity is not alloewed. + +} diff --git a/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060401_json_numbers/Neg_0600401_json_numbers_004/Neg_0600401_json_numbers_004.ttcn b/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060401_json_numbers/Neg_0600401_json_numbers_004/Neg_0600401_json_numbers_004.ttcn new file mode 100644 index 0000000..c6d18d5 --- /dev/null +++ b/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060401_json_numbers/Neg_0600401_json_numbers_004/Neg_0600401_json_numbers_004.ttcn @@ -0,0 +1,18 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:6.4.1, Verify that NaN can not be assigned to a JSON.Number + ** @verdict pass reject + ***************************************************/ +/* + * JSON numbers: + * 6.4.1: No special values (as –infinity, infinity or NaN) are allowed. + * */ + +module Neg_0600401_json_numbers_007 { + + import from JSON all; + + template JSON.Number m_msg := not_a_number; // error: special float value NaN, not allowed! + +} diff --git a/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060401_json_numbers/Neg_0600401_json_numbers_004/Pos_0600401_json_numbers_007.json b/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060401_json_numbers/Neg_0600401_json_numbers_004/Pos_0600401_json_numbers_007.json new file mode 100644 index 0000000..5eaaeff --- /dev/null +++ b/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060401_json_numbers/Neg_0600401_json_numbers_004/Pos_0600401_json_numbers_007.json @@ -0,0 +1,3 @@ +{ +"string": "not_a_number" +} diff --git a/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060401_json_numbers/Pos_0600401_json_numbers_001/Pos_0600401_json_numbers_001.json b/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060401_json_numbers/Pos_0600401_json_numbers_001/Pos_0600401_json_numbers_001.json new file mode 100644 index 0000000..eca41a1 --- /dev/null +++ b/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060401_json_numbers/Pos_0600401_json_numbers_001/Pos_0600401_json_numbers_001.json @@ -0,0 +1,3 @@ +{ +"JSON.Number": 2.147483647E9 +} diff --git a/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060401_json_numbers/Pos_0600401_json_numbers_001/Pos_0600401_json_numbers_001.ttcn b/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060401_json_numbers/Pos_0600401_json_numbers_001/Pos_0600401_json_numbers_001.ttcn new file mode 100644 index 0000000..aadeeb6 --- /dev/null +++ b/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060401_json_numbers/Pos_0600401_json_numbers_001/Pos_0600401_json_numbers_001.ttcn @@ -0,0 +1,85 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:6.4.1, Verify that numbers are correctly mapped to JSON. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + * JSON numbers are represented as base 10 decimal digits containing a mandatory integer + * component that can be prefixed with an optional minus sign, and can be followed by a + * fraction part, an exponent part or both. Leading zeros are not allowed. JSON does not + * distinguish numbers based on their value sets like integers and reals, like other languages do. + * No special values (as –infinity, infinity or NaN) are allowed. + */ + +module Pos_0600401_json_numbers_001 { + + import from JSON all; + + template Number m_msg := 2147483647.0; // float + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw with { encode "Text" }; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference JSON file and returns true if they represent the same JSON structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the JSON data + * @param p_referenceJsonFile the JSON data + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference JSON file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceJsonFile represent the same JSON data + */ + external function matchFile(Raw p_textToMatch, File p_referenceJsonFile, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_0600401_json_numbers_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference JSON file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("JSON message: ", v_rcv); + if (matchFile(v_rcv, "Pos_0600401_json_numbers_001.json", v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference JSON"); + } + [] p.receive { + setverdict(fail, "JSON decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_0600401_json_numbers_001(), PX_TC_EXECUTION_TIMEOUT); + } +} diff --git a/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060401_json_numbers/Pos_0600401_json_numbers_002/Pos_0600401_json_numbers_002.json b/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060401_json_numbers/Pos_0600401_json_numbers_002/Pos_0600401_json_numbers_002.json new file mode 100644 index 0000000..9dd73ae --- /dev/null +++ b/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060401_json_numbers/Pos_0600401_json_numbers_002/Pos_0600401_json_numbers_002.json @@ -0,0 +1,3 @@ +{ +"JSON.Integer": 10 +} diff --git a/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060401_json_numbers/Pos_0600401_json_numbers_002/Pos_0600401_json_numbers_002.ttcn b/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060401_json_numbers/Pos_0600401_json_numbers_002/Pos_0600401_json_numbers_002.ttcn new file mode 100644 index 0000000..4e0b2f0 --- /dev/null +++ b/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060401_json_numbers/Pos_0600401_json_numbers_002/Pos_0600401_json_numbers_002.ttcn @@ -0,0 +1,86 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:6.4.1, Verify that integer is correctly mapped to during JSON encode. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + * JSON numbers are represented as base 10 decimal digits containing a mandatory integer + * component that can be prefixed with an optional minus sign, and can be followed by a + * fraction part, an exponent part or both. Leading zeros are not allowed. JSON does not + * distinguish numbers based on their value sets like integers and reals, like other languages do. + * No special values (as –infinity, infinity or NaN) are allowed. + */ + +module Pos_0600401_json_numbers_002 { + + import from JSON all; + + template Integer m_msg := 10; // integer + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw with { encode "Text" }; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference JSON file and returns true if they represent the same JSON structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the JSON data + * @param p_referenceJsonFile the JSON data + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference JSON file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceJsonFile represent the same JSON data + */ + external function matchFile(Raw p_textToMatch, File p_referenceJsonFile, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_0600401_json_numbers_002() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference JSON file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("JSON message: ", v_rcv); + if (matchFile(v_rcv, "Pos_0600401_json_numbers_002.json", v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference JSON"); + } + [] p.receive { + setverdict(fail, "JSON decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_0600401_json_numbers_002(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060401_json_numbers/Pos_0600401_json_numbers_003/Pos_0600401_json_numbers_003.json b/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060401_json_numbers/Pos_0600401_json_numbers_003/Pos_0600401_json_numbers_003.json new file mode 100644 index 0000000..cd17de4 --- /dev/null +++ b/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060401_json_numbers/Pos_0600401_json_numbers_003/Pos_0600401_json_numbers_003.json @@ -0,0 +1,3 @@ +{ +"JSON.Number": 1.0 +} diff --git a/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060401_json_numbers/Pos_0600401_json_numbers_003/Pos_0600401_json_numbers_003.ttcn b/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060401_json_numbers/Pos_0600401_json_numbers_003/Pos_0600401_json_numbers_003.ttcn new file mode 100644 index 0000000..676c3ce --- /dev/null +++ b/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060401_json_numbers/Pos_0600401_json_numbers_003/Pos_0600401_json_numbers_003.ttcn @@ -0,0 +1,83 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:6.4.1, Verify that number is correctly mapped to during JSON encode. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + * JSON numbers: The beginning character of the exponent part can be both "e" and "E". + * This is not controlled by any of the encoding instructions but left as a tool implementation option. + */ + +module Pos_0600401_json_numbers_003 { + + import from JSON all; + + template Number m_msg := 10E-1; // float with E-1 (10E-1 == 1) + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw with { encode "Text" }; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference JSON file and returns true if they represent the same JSON structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the JSON data + * @param p_referenceJsonFile the JSON data + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference JSON file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceJsonFile represent the same JSON data + */ + external function matchFile(Raw p_textToMatch, File p_referenceJsonFile, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_0600401_json_numbers_003() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference JSON file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("JSON message: ", v_rcv); + if (matchFile(v_rcv, "Pos_0600401_json_numbers_003.json", v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference JSON"); + } + [] p.receive { + setverdict(fail, "JSON decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_0600401_json_numbers_003(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060401_json_numbers/Pos_0600401_json_numbers_004/Pos_0600401_json_numbers_004.json b/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060401_json_numbers/Pos_0600401_json_numbers_004/Pos_0600401_json_numbers_004.json new file mode 100644 index 0000000..cd17de4 --- /dev/null +++ b/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060401_json_numbers/Pos_0600401_json_numbers_004/Pos_0600401_json_numbers_004.json @@ -0,0 +1,3 @@ +{ +"JSON.Number": 1.0 +} diff --git a/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060401_json_numbers/Pos_0600401_json_numbers_004/Pos_0600401_json_numbers_004.ttcn b/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060401_json_numbers/Pos_0600401_json_numbers_004/Pos_0600401_json_numbers_004.ttcn new file mode 100644 index 0000000..ae401ae --- /dev/null +++ b/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060401_json_numbers/Pos_0600401_json_numbers_004/Pos_0600401_json_numbers_004.ttcn @@ -0,0 +1,88 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:6.4.1, Verify that number is correctly mapped to during JSON encode. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + * JSON numbers: The beginning character of the exponent part can be both "e" and "E". + * This is not controlled by any of the encoding instructions but left as a tool implementation option. + */ + +module Pos_0600401_json_numbers_004 { + + import from JSON all; + + template Number m_msg := 1.0; + + /* Note: the reference JSON file contains the following: + * {"float": 10e-1}*/ + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw with { encode "Text" }; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference JSON file and returns true if they represent the same JSON structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the JSON data + * @param p_referenceJsonFile the JSON data + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference JSON file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceJsonFile represent the same JSON data + */ + external function matchFile(Raw p_textToMatch, File p_referenceJsonFile, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_0600401_json_numbers_004() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference JSON file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("JSON message: ", v_rcv); + if (matchFile(v_rcv, "Pos_0600401_json_numbers_004.json", v_matchError)) { + + /* Note: Pos_0600401_json_numbers_003.json contains: {"float" : 10e-1} */ + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference JSON"); + } + [] p.receive { + setverdict(fail, "JSON decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_0600401_json_numbers_004(), PX_TC_EXECUTION_TIMEOUT); + } + +} \ No newline at end of file diff --git a/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060402_json_ strings/Pos_0600402_json_strings_001/Pos_0600402_json_strings_001.json b/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060402_json_ strings/Pos_0600402_json_strings_001/Pos_0600402_json_strings_001.json new file mode 100644 index 0000000..3e4c28a --- /dev/null +++ b/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060402_json_ strings/Pos_0600402_json_strings_001/Pos_0600402_json_strings_001.json @@ -0,0 +1,3 @@ +{ +"JSON.String": "Hello World!" +} diff --git a/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060402_json_ strings/Pos_0600402_json_strings_001/Pos_0600402_json_strings_001.ttcn b/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060402_json_ strings/Pos_0600402_json_strings_001/Pos_0600402_json_strings_001.ttcn new file mode 100644 index 0000000..efe59a2 --- /dev/null +++ b/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060402_json_ strings/Pos_0600402_json_strings_001/Pos_0600402_json_strings_001.ttcn @@ -0,0 +1,86 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:6.4.2, Verify that strings are correctly mapped to JSON. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + * A JSON string is a sequence of zero or more Unicode characters, enclosed in a pair of quotation mark + * characters (""", char(U22)). Any characters may be escaped by the escape sequence: "\u", + * where represents four hexadecimal digits, but the icharacters: quotation mark (""", char(U22)) + * , reverse solidus ("\", char(U5C)) and all C0 control characters (char(U0) through char(U1F)) shall + * be escaped. + */ + +module Pos_0600402_json_strings_001 { + + import from JSON all; + + template String m_msg := "Hello World!"; + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw with { encode "Text" }; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference JSON file and returns true if they represent the same JSON structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the JSON data + * @param p_referenceJsonFile the JSON data + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference JSON file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceJsonFile represent the same JSON data + */ + external function matchFile(Raw p_textToMatch, File p_referenceJsonFile, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_0600402_json_strings_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference JSON file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("JSON message: ", v_rcv); + if (matchFile(v_rcv, "Pos_0600402_json_strings_001.json", v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference JSON"); + } + [] p.receive { + setverdict(fail, "JSON decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_0600402_json_strings_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060402_json_ strings/Pos_0600402_json_strings_002/Pos_0600402_json_strings_002.json b/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060402_json_ strings/Pos_0600402_json_strings_002/Pos_0600402_json_strings_002.json new file mode 100644 index 0000000..c225ed2 --- /dev/null +++ b/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060402_json_ strings/Pos_0600402_json_strings_002/Pos_0600402_json_strings_002.json @@ -0,0 +1,3 @@ +{ +"JSON.String": "\"\\\/\b\f\n\r\t" +} diff --git a/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060402_json_ strings/Pos_0600402_json_strings_002/Pos_0600402_json_strings_002.ttcn b/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060402_json_ strings/Pos_0600402_json_strings_002/Pos_0600402_json_strings_002.ttcn new file mode 100644 index 0000000..cfe19f2 --- /dev/null +++ b/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060402_json_ strings/Pos_0600402_json_strings_002/Pos_0600402_json_strings_002.ttcn @@ -0,0 +1,95 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:6.4.2, Verify that strings are correctly mapped to JSON. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + * A JSON string is a sequence of zero or more Unicode characters, enclosed in a pair of quotation mark + * characters (""", char(U22)). Any characters may be escaped by the escape sequence: "\u", + * where represents four hexadecimal digits, but the icharacters: quotation mark (""", char(U22)) + * , reverse solidus ("\", char(U5C)) and all C0 control characters (char(U0) through char(U1F)) shall + * be escaped. + */ + +module Pos_0600402_json_strings_002 { + + import from JSON all; + + template String m_msg := char(U22) & + char(U5C)& + char(U2F) & + char(U8) & + char(UC) & + char(UA)& + char(UD)& + char(U9); // Note: these characters should be escaped: \"\\\/\b\f\n\r\t + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw with { encode "Text" }; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference JSON file and returns true if they represent the same JSON structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the JSON data + * @param p_referenceJsonFile the JSON data + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference JSON file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceJsonFile represent the same JSON data + */ + external function matchFile(Raw p_textToMatch, File p_referenceJsonFile, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_0600402_json_strings_002() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference JSON file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("JSON message: ", v_rcv); + if (matchFile(v_rcv, "Pos_0600402_json_strings_002.json", v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference JSON"); + } + [] p.receive { + setverdict(fail, "JSON decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_0600402_json_strings_002(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060403_json_arrays/Pos_060403_json_arrays_001/Pos_060403_json_arrays_001.json b/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060403_json_arrays/Pos_060403_json_arrays_001/Pos_060403_json_arrays_001.json new file mode 100644 index 0000000..b8ad58d --- /dev/null +++ b/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060403_json_arrays/Pos_060403_json_arrays_001/Pos_060403_json_arrays_001.json @@ -0,0 +1,3 @@ +{ + "Pos_060403_json_arrays_001.MyArrayType":["abcdefg",1.2,2,[1,2,3,4,5,6],null] +} diff --git a/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060403_json_arrays/Pos_060403_json_arrays_001/Pos_060403_json_arrays_001.ttcn b/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060403_json_arrays/Pos_060403_json_arrays_001/Pos_060403_json_arrays_001.ttcn new file mode 100644 index 0000000..b9f643b --- /dev/null +++ b/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060403_json_arrays/Pos_060403_json_arrays_001/Pos_060403_json_arrays_001.ttcn @@ -0,0 +1,90 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:6.4.3, Verify that arrays are correctly mapped to JSON. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + * JSON arrays can contain a sequence of zero or more JSON values, i.e. the array members may be of different JSON "types". + */ + +module Pos_060403_json_arrays_001{ + + import from JSON all; + + type JSON.Array MyArrayType; + + template MyArrayType m_msg := { + { str := "abcdefg" }, + { num := 1.2 }, + { int := 2 }, + { intArray := { 1, 2, 3, 4, 5, 6 } }, + { null_ := null_ } + }; + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw with { encode "Text" }; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference JSON file and returns true if they represent the same JSON structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the JSON data + * @param p_referenceJsonFile the JSON data + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference JSON file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceJsonFile represent the same JSON data + */ + external function matchFile(Raw p_textToMatch, File p_referenceJsonFile, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_060403_json_arrays_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference JSON file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("JSON message: ", v_rcv); + if (matchFile(v_rcv, "Pos_060403_json_arrays_001.json", v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference JSON"); + } + [] p.receive { + setverdict(fail, "JSON decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_060403_json_arrays_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060403_json_arrays/Pos_060403_json_arrays_002/Pos_060403_json_arrays_002.json b/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060403_json_arrays/Pos_060403_json_arrays_002/Pos_060403_json_arrays_002.json new file mode 100644 index 0000000..ffeff72 --- /dev/null +++ b/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060403_json_arrays/Pos_060403_json_arrays_002/Pos_060403_json_arrays_002.json @@ -0,0 +1,3 @@ +{ + "JSON.StrArray" :["item1","item2","item3"] +} diff --git a/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060403_json_arrays/Pos_060403_json_arrays_002/Pos_060403_json_arrays_002.ttcn b/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060403_json_arrays/Pos_060403_json_arrays_002/Pos_060403_json_arrays_002.ttcn new file mode 100644 index 0000000..baf8e75 --- /dev/null +++ b/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060403_json_arrays/Pos_060403_json_arrays_002/Pos_060403_json_arrays_002.ttcn @@ -0,0 +1,82 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:6.4.3, Verify that arrays are correctly mapped to JSON. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + * JSON arrays can contain a sequence of zero or more JSON values, i.e. the array members may be of different JSON "types". + */ + +module Pos_060403_json_arrays_002{ + + import from JSON all; + + template StrArray m_msg := { "item1", "item2", "item3"}; // JSON:String array + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw with { encode "Text" }; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference JSON file and returns true if they represent the same JSON structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the JSON data + * @param p_referenceJsonFile the JSON data + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference JSON file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceJsonFile represent the same JSON data + */ + external function matchFile(Raw p_textToMatch, File p_referenceJsonFile, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_060403_json_arrays_002() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference JSON file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("JSON message: ", v_rcv); + if (matchFile(v_rcv, "Pos_060403_json_arrays_002.json", v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference JSON"); + } + [] p.receive { + setverdict(fail, "JSON decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_060403_json_arrays_002(), PX_TC_EXECUTION_TIMEOUT); + } + +} \ No newline at end of file diff --git a/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060403_json_arrays/Pos_060403_json_arrays_003/Pos_060403_json_arrays_003.json b/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060403_json_arrays/Pos_060403_json_arrays_003/Pos_060403_json_arrays_003.json new file mode 100644 index 0000000..aa8a34f --- /dev/null +++ b/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060403_json_arrays/Pos_060403_json_arrays_003/Pos_060403_json_arrays_003.json @@ -0,0 +1,3 @@ +{ + "JSON.NumArray":[1.51E1,1.52E1,1.53E1] +} diff --git a/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060403_json_arrays/Pos_060403_json_arrays_003/Pos_060403_json_arrays_003.ttcn b/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060403_json_arrays/Pos_060403_json_arrays_003/Pos_060403_json_arrays_003.ttcn new file mode 100644 index 0000000..21b499c --- /dev/null +++ b/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060403_json_arrays/Pos_060403_json_arrays_003/Pos_060403_json_arrays_003.ttcn @@ -0,0 +1,82 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:6.4.3, Verify that arrays are correctly mapped to JSON. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + * JSON arrays can contain a sequence of zero or more JSON values, i.e. the array members may be of different JSON "types". + */ + +module Pos_060403_json_arrays_003{ + + import from JSON all; + + template NumArray m_msg := { 15.1, 15.2, 15.3}; // JSON:Number array + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw with { encode "Text" }; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference JSON file and returns true if they represent the same JSON structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the JSON data + * @param p_referenceJsonFile the JSON data + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference JSON file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceJsonFile represent the same JSON data + */ + external function matchFile(Raw p_textToMatch, File p_referenceJsonFile, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_060403_json_arrays_003() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference JSON file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("JSON message: ", v_rcv); + if (matchFile(v_rcv, "Pos_060403_json_arrays_003.json", v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference JSON"); + } + [] p.receive { + setverdict(fail, "JSON decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_060403_json_arrays_003(), PX_TC_EXECUTION_TIMEOUT); + } + +} \ No newline at end of file diff --git a/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060403_json_arrays/Pos_060403_json_arrays_004/Pos_060403_json_arrays_004.json b/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060403_json_arrays/Pos_060403_json_arrays_004/Pos_060403_json_arrays_004.json new file mode 100644 index 0000000..f6882c0 --- /dev/null +++ b/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060403_json_arrays/Pos_060403_json_arrays_004/Pos_060403_json_arrays_004.json @@ -0,0 +1,3 @@ +{ + "JSON.IntArray":[1,2,3,4,5] +} diff --git a/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060403_json_arrays/Pos_060403_json_arrays_004/Pos_060403_json_arrays_004.ttcn b/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060403_json_arrays/Pos_060403_json_arrays_004/Pos_060403_json_arrays_004.ttcn new file mode 100644 index 0000000..3a34e86 --- /dev/null +++ b/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060403_json_arrays/Pos_060403_json_arrays_004/Pos_060403_json_arrays_004.ttcn @@ -0,0 +1,82 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:6.4.3, Verify that arrays are correctly mapped to JSON. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + * JSON arrays can contain a sequence of zero or more JSON values, i.e. the array members may be of different JSON "types". + */ + +module Pos_060403_json_arrays_004{ + + import from JSON all; + + template IntArray m_msg := {1,2,3,4,5}; // JSON:Integer array + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw with { encode "Text" }; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference JSON file and returns true if they represent the same JSON structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the JSON data + * @param p_referenceJsonFile the JSON data + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference JSON file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceJsonFile represent the same JSON data + */ + external function matchFile(Raw p_textToMatch, File p_referenceJsonFile, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_060403_json_arrays_004() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference JSON file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("JSON message: ", v_rcv); + if (matchFile(v_rcv, "Pos_060403_json_arrays_004.json", v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference JSON"); + } + [] p.receive { + setverdict(fail, "JSON decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_060403_json_arrays_004(), PX_TC_EXECUTION_TIMEOUT); + } + +} \ No newline at end of file diff --git a/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060403_json_arrays/Pos_060403_json_arrays_005/Pos_060403_json_arrays_005.json b/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060403_json_arrays/Pos_060403_json_arrays_005/Pos_060403_json_arrays_005.json new file mode 100644 index 0000000..cb4fc6f --- /dev/null +++ b/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060403_json_arrays/Pos_060403_json_arrays_005/Pos_060403_json_arrays_005.json @@ -0,0 +1,3 @@ +{ + "JSON.BoolArray":[true,true,false,true,false] +} diff --git a/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060403_json_arrays/Pos_060403_json_arrays_005/Pos_060403_json_arrays_005.ttcn b/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060403_json_arrays/Pos_060403_json_arrays_005/Pos_060403_json_arrays_005.ttcn new file mode 100644 index 0000000..0cc4386 --- /dev/null +++ b/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060403_json_arrays/Pos_060403_json_arrays_005/Pos_060403_json_arrays_005.ttcn @@ -0,0 +1,82 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:6.4.3, Verify that arrays are correctly mapped to JSON. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + * JSON arrays can contain a sequence of zero or more JSON values, i.e. the array members may be of different JSON "types". + */ + +module Pos_060403_json_arrays_005{ + + import from JSON all; + + template BoolArray m_msg := {true, true, false, true, false }; // JSON:Boolean array + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw with { encode "Text" }; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference JSON file and returns true if they represent the same JSON structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the JSON data + * @param p_referenceJsonFile the JSON data + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference JSON file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceJsonFile represent the same JSON data + */ + external function matchFile(Raw p_textToMatch, File p_referenceJsonFile, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_060403_json_arrays_005() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference JSON file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("JSON message: ", v_rcv); + if (matchFile(v_rcv, "Pos_060403_json_arrays_005.json", v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference JSON"); + } + [] p.receive { + setverdict(fail, "JSON decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_060403_json_arrays_005(), PX_TC_EXECUTION_TIMEOUT); + } + +} \ No newline at end of file diff --git a/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060403_json_arrays/Pos_060403_json_arrays_006/Pos_060403_json_arrays_006.json b/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060403_json_arrays/Pos_060403_json_arrays_006/Pos_060403_json_arrays_006.json new file mode 100644 index 0000000..b73348f --- /dev/null +++ b/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060403_json_arrays/Pos_060403_json_arrays_006/Pos_060403_json_arrays_006.json @@ -0,0 +1,3 @@ +{ + "JSON.ObjArray":[{"string1": "item1"},{"string2": "item2"}] +} diff --git a/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060403_json_arrays/Pos_060403_json_arrays_006/Pos_060403_json_arrays_006.ttcn b/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060403_json_arrays/Pos_060403_json_arrays_006/Pos_060403_json_arrays_006.ttcn new file mode 100644 index 0000000..057cefd --- /dev/null +++ b/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060403_json_arrays/Pos_060403_json_arrays_006/Pos_060403_json_arrays_006.ttcn @@ -0,0 +1,88 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:6.4.3, Verify that arrays are correctly mapped to JSON. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + * JSON arrays can contain a sequence of zero or more JSON values, i.e. the array members may be of different JSON "types". + */ + +module Pos_060403_json_arrays_006{ + + import from JSON all; + //[{"string1": "item1"},{"string2": "item2"}] + const ObjectMember v_rec1 := {name := "string1", value_ := {str := "item1" }}; + const ObjectMember v_rec2 := {name := "string2", value_ := {str := "item2" }}; + + const Object v_member1 := { memberList:= {v_rec1} }; + const Object v_member2 := { memberList:= {v_rec2} }; + + template ObjArray m_msg := { v_member1, v_member2}; // JSON:Object array + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw with { encode "Text" }; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference JSON file and returns true if they represent the same JSON structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the JSON data + * @param p_referenceJsonFile the JSON data + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference JSON file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceJsonFile represent the same JSON data + */ + external function matchFile(Raw p_textToMatch, File p_referenceJsonFile, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_060403_json_arrays_006() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference JSON file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("JSON message: ", v_rcv); + if (matchFile(v_rcv, "Pos_060403_json_arrays_006.json", v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference JSON"); + } + [] p.receive { + setverdict(fail, "JSON decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_060403_json_arrays_006(), PX_TC_EXECUTION_TIMEOUT); + } + +} \ No newline at end of file diff --git a/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060404_json_objects/Pos_060404_json_objects_001/Pos_060404_json_objects_001.json b/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060404_json_objects/Pos_060404_json_objects_001/Pos_060404_json_objects_001.json new file mode 100644 index 0000000..1a3e779 --- /dev/null +++ b/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060404_json_objects/Pos_060404_json_objects_001/Pos_060404_json_objects_001.json @@ -0,0 +1,6 @@ +{ + "Pos_060404_json_objects_001.MyObject":{ + "string1": "item1", + "integer1": 11 + } +} diff --git a/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060404_json_objects/Pos_060404_json_objects_001/Pos_060404_json_objects_001.ttcn b/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060404_json_objects/Pos_060404_json_objects_001/Pos_060404_json_objects_001.ttcn new file mode 100644 index 0000000..1c6b72b --- /dev/null +++ b/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060404_json_objects/Pos_060404_json_objects_001/Pos_060404_json_objects_001.ttcn @@ -0,0 +1,93 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:6.4.4, Verify that Object is correctly mapped to JSON. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + * Ensure that JSON.Object is correctly encoded. + */ + +module Pos_060404_json_objects_001{ + + import from JSON all; + + type JSON.Object MyObject; + + template MyObject m_msg := { + { + {name := "string1", value_ := {str := "item1"}}, + {name := "integer1", value_ := { int := 11}} + } + }; + + /* The encoded JSON should be: + * {"string1": "item1","integer1": 11} + * */ + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw with { encode "Text" }; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference JSON file and returns true if they represent the same JSON structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the JSON data + * @param p_referenceJsonFile the JSON data + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference JSON file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceJsonFile represent the same JSON data + */ + external function matchFile(Raw p_textToMatch, File p_referenceJsonFile, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_060404_json_objects_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference JSON file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("JSON message: ", v_rcv); + if (matchFile(v_rcv, "Pos_060404_json_objects_001.json", v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference JSON"); + } + [] p.receive { + setverdict(fail, "JSON decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_060404_json_objects_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060405_json_literals/Pos_060405_json_literals_001/Pos_060405_json_literals_001.json b/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060405_json_literals/Pos_060405_json_literals_001/Pos_060405_json_literals_001.json new file mode 100644 index 0000000..c9145d4 --- /dev/null +++ b/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060405_json_literals/Pos_060405_json_literals_001/Pos_060405_json_literals_001.json @@ -0,0 +1,3 @@ +{ + "JSON.Bool":true +} diff --git a/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060405_json_literals/Pos_060405_json_literals_001/Pos_060405_json_literals_001.ttcn b/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060405_json_literals/Pos_060405_json_literals_001/Pos_060405_json_literals_001.ttcn new file mode 100644 index 0000000..384cbe2 --- /dev/null +++ b/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060405_json_literals/Pos_060405_json_literals_001/Pos_060405_json_literals_001.ttcn @@ -0,0 +1,83 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:6.4.4, Verify that literals are correctly mapped to JSON. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + * JSON specifies three literal values: true, false and null. These are mapped to the TTCN-3 types: boolean, enum + */ + +module Pos_060405_json_literals_001{ + + import from JSON all; + + template Bool m_msg := true; + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw with { encode "Text" }; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference JSON file and returns true if they represent the same JSON structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the JSON data + * @param p_referenceJsonFile the JSON data + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference JSON file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceJsonFile represent the same JSON data + */ + external function matchFile(Raw p_textToMatch, File p_referenceJsonFile, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_060405_json_literals_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference JSON file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("JSON message: ", v_rcv); + if (matchFile(v_rcv, "Pos_060405_json_literals_001.json", v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference JSON"); + } + [] p.receive { + setverdict(fail, "JSON decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_060405_json_literals_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} \ No newline at end of file diff --git a/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060405_json_literals/Pos_060405_json_literals_002/Pos_060405_json_literals_002.json b/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060405_json_literals/Pos_060405_json_literals_002/Pos_060405_json_literals_002.json new file mode 100644 index 0000000..b86feb4 --- /dev/null +++ b/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060405_json_literals/Pos_060405_json_literals_002/Pos_060405_json_literals_002.json @@ -0,0 +1,3 @@ +{ + "JSON.Bool":false +} diff --git a/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060405_json_literals/Pos_060405_json_literals_002/Pos_060405_json_literals_002.ttcn b/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060405_json_literals/Pos_060405_json_literals_002/Pos_060405_json_literals_002.ttcn new file mode 100644 index 0000000..14a796f --- /dev/null +++ b/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060405_json_literals/Pos_060405_json_literals_002/Pos_060405_json_literals_002.ttcn @@ -0,0 +1,83 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:6.4.4, Verify that literals are correctly mapped to JSON. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + * JSON specifies three literal values: true, false and null. These are mapped to the TTCN-3 types: boolean, enum + */ + +module Pos_060405_json_literals_002{ + + import from JSON all; + + template Bool m_msg := false; + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw with { encode "Text" }; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference JSON file and returns true if they represent the same JSON structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the JSON data + * @param p_referenceJsonFile the JSON data + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference JSON file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceJsonFile represent the same JSON data + */ + external function matchFile(Raw p_textToMatch, File p_referenceJsonFile, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_060405_json_literals_002() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference JSON file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("JSON message: ", v_rcv); + if (matchFile(v_rcv, "Pos_060405_json_literals_002.json", v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference JSON"); + } + [] p.receive { + setverdict(fail, "JSON decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_060405_json_literals_002(), PX_TC_EXECUTION_TIMEOUT); + } + +} \ No newline at end of file diff --git a/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060405_json_literals/Pos_060405_json_literals_003/Pos_060405_json_literals_003.json b/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060405_json_literals/Pos_060405_json_literals_003/Pos_060405_json_literals_003.json new file mode 100644 index 0000000..b7e99b2 --- /dev/null +++ b/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060405_json_literals/Pos_060405_json_literals_003/Pos_060405_json_literals_003.json @@ -0,0 +1,3 @@ +{ + "JSON.Null":null +} diff --git a/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060405_json_literals/Pos_060405_json_literals_003/Pos_060405_json_literals_003.ttcn b/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060405_json_literals/Pos_060405_json_literals_003/Pos_060405_json_literals_003.ttcn new file mode 100644 index 0000000..756c646 --- /dev/null +++ b/json/06_using_ttcn3_as_json_schema/0604_mapping_of_json_values/060405_json_literals/Pos_060405_json_literals_003/Pos_060405_json_literals_003.ttcn @@ -0,0 +1,83 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:6.4.4, Verify that literals are correctly mapped to JSON. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + * JSON specifies three literal values: true, false and null. These are mapped to the TTCN-3 types: boolean, enum + */ + +module Pos_060405_json_literals_003{ + + import from JSON all; + + template Null m_msg := null_; + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw with { encode "Text" }; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference JSON file and returns true if they represent the same JSON structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the JSON data + * @param p_referenceJsonFile the JSON data + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference JSON file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceJsonFile represent the same JSON data + */ + external function matchFile(Raw p_textToMatch, File p_referenceJsonFile, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_060405_json_literals_003() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference JSON file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("JSON message: ", v_rcv); + if (matchFile(v_rcv, "Pos_060405_json_literals_003.json", v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference JSON"); + } + [] p.receive { + setverdict(fail, "JSON decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_060405_json_literals_003(), PX_TC_EXECUTION_TIMEOUT); + } + +} \ No newline at end of file diff --git a/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/0702010_union_and_anytype/Pos_0702010_union_and_anytype_001/Pos_0702010_union_and_anytype_001.json b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/0702010_union_and_anytype/Pos_0702010_union_and_anytype_001/Pos_0702010_union_and_anytype_001.json new file mode 100644 index 0000000..2854295 --- /dev/null +++ b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/0702010_union_and_anytype/Pos_0702010_union_and_anytype_001/Pos_0702010_union_and_anytype_001.json @@ -0,0 +1,5 @@ +{ + "Pos_0702010_union_and_anytype_001.MyUnionType": { + "cs" : "value of charstring" + } +} diff --git a/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/0702010_union_and_anytype/Pos_0702010_union_and_anytype_001/Pos_0702010_union_and_anytype_001.ttcn b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/0702010_union_and_anytype/Pos_0702010_union_and_anytype_001/Pos_0702010_union_and_anytype_001.ttcn new file mode 100644 index 0000000..3579919 --- /dev/null +++ b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/0702010_union_and_anytype/Pos_0702010_union_and_anytype_001/Pos_0702010_union_and_anytype_001.ttcn @@ -0,0 +1,93 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:7.2.10, Ensure that union and anytype values shall be encoded as JSON objects + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + * By default TTCN-3 unions and anytype fields shall be encoded as JSON objects. + * The object shall contain one object member, the name of which shall be the name of + * the selected TTCN-3 alternative (name of the field for unions and name of the type for anytypes) and its value shall be the value of the selected TTCN-3 field.. + * */ + +module Pos_0702010_union_and_anytype_001 { + + import from JSON all; + + type union MyUnionType{ // proposed order of fields + integer i, + float f, + octetstring os, + charstring cs}; + + template MyUnionType m_msg := { cs:= "value of charstring" } with { encode "JSON" }; // encoding union type as JSON object + + /* { "Pos_0702010_union_and_anytype_001.MyUnionType": { "cs" : "value of charstring" } } */ + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw with { encode "Text" }; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference JSON file and returns true if they represent the same JSON structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the JSON data + * @param p_referenceJsonFile the JSON data + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference JSON file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceJsonFile represent the same JSON data + */ + external function matchFile(Raw p_textToMatch, File p_referenceJsonFile, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_0702010_union_and_anytype_001() runs on C system C { + + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference JSON file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("JSON message: ", v_rcv); + if (matchFile(v_rcv, "Pos_0702010_union_and_anytype_001.json", v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference JSON"); + } + [] p.receive { + setverdict(fail, "JSON decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_0702010_union_and_anytype_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} \ No newline at end of file diff --git a/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/0702010_union_and_anytype/Pos_0702010_union_and_anytype_002/Pos_0702010_union_and_anytype_002.json b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/0702010_union_and_anytype/Pos_0702010_union_and_anytype_002/Pos_0702010_union_and_anytype_002.json new file mode 100644 index 0000000..ee9199e --- /dev/null +++ b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/0702010_union_and_anytype/Pos_0702010_union_and_anytype_002/Pos_0702010_union_and_anytype_002.json @@ -0,0 +1,5 @@ +{ + "Pos_0702010_union_and_anytype_002.MyAnyType": { + "integer" : 10 + } +} diff --git a/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/0702010_union_and_anytype/Pos_0702010_union_and_anytype_002/Pos_0702010_union_and_anytype_002.ttcn b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/0702010_union_and_anytype/Pos_0702010_union_and_anytype_002/Pos_0702010_union_and_anytype_002.ttcn new file mode 100644 index 0000000..a7b8f6a --- /dev/null +++ b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/0702010_union_and_anytype/Pos_0702010_union_and_anytype_002/Pos_0702010_union_and_anytype_002.ttcn @@ -0,0 +1,89 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:7.2.10, Ensure that union and anytype values shall be encoded as JSON objects + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + * By default TTCN-3 unions and anytype fields shall be encoded as JSON objects. + * The object shall contain one object member, the name of which shall be the name of + * the selected TTCN-3 alternative (name of the field for unions and name of the type for anytypes) and its value shall be the value of the selected TTCN-3 field.. + * */ + +module Pos_0702010_union_and_anytype_002 { + + import from JSON all; + + type anytype MyAnyType with { encode "JSON" }; + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw with { encode "Text" }; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference JSON file and returns true if they represent the same JSON structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the JSON data + * @param p_referenceJsonFile the JSON data + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference JSON file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceJsonFile represent the same JSON data + */ + external function matchFile(Raw p_textToMatch, File p_referenceJsonFile, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_0702010_union_and_anytype_002() runs on C system C { + var MyAnyType m_msg; + m_msg.integer := 10; + + /* { "Pos_0702010_union_and_anytype_002.MyAnyType": { "integer" : 10 } } */ + + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference JSON file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("JSON message: ", v_rcv); + if (matchFile(v_rcv, "Pos_0702010_union_and_anytype_002.json", v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference JSON"); + } + [] p.receive { + setverdict(fail, "JSON decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_0702010_union_and_anytype_002(), PX_TC_EXECUTION_TIMEOUT); + } + +} with { encode "JSON" } diff --git a/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/0702011_object_identifiers/Pos_0702011_object_identifiers_001/Pos_0702011_object_identifiers_001.json b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/0702011_object_identifiers/Pos_0702011_object_identifiers_001/Pos_0702011_object_identifiers_001.json new file mode 100644 index 0000000..3c74b54 --- /dev/null +++ b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/0702011_object_identifiers/Pos_0702011_object_identifiers_001/Pos_0702011_object_identifiers_001.json @@ -0,0 +1,3 @@ +{ + "Pos_0702011_object_identifiers_001.MyObjId":"2.4.5.0" +} diff --git a/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/0702011_object_identifiers/Pos_0702011_object_identifiers_001/Pos_0702011_object_identifiers_001.ttcn b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/0702011_object_identifiers/Pos_0702011_object_identifiers_001/Pos_0702011_object_identifiers_001.ttcn new file mode 100644 index 0000000..6083b0e --- /dev/null +++ b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/0702011_object_identifiers/Pos_0702011_object_identifiers_001/Pos_0702011_object_identifiers_001.ttcn @@ -0,0 +1,89 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:7.2.11, Ensure that object identifiers values shall be encoded as JSON strings + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + * TTCN-3 objid values shall be encoded in JSON as JSON.String-s (see clause 6.4.2) + * containing the number forms of the object identifier components, separated by dot (char(U2E)) + * characters without whitespace character between the digits and the dots. + * */ + +module Pos_0702011_object_identifiers_001 { + + import from JSON all; + + type objid MyObjId with { encode "JSON" }; + + template MyObjId m_msg := objid{ joint_iso_itu_t remote_operations(4) informationObjects(5) + version1(0) }; // encoding object id type as JSON string + /* { "Pos_0702011_object_identifiers_001.MyObjId" : {"objid" : "2.4.5.0" } } */ + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw with { encode "Text" }; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference JSON file and returns true if they represent the same JSON structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the JSON data + * @param p_referenceJsonFile the JSON data + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference JSON file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceJsonFile represent the same JSON data + */ + external function matchFile(Raw p_textToMatch, File p_referenceJsonFile, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_0702011_object_identifiers_001() runs on C system C { + + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference JSON file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("JSON message: ", v_rcv); + if (matchFile(v_rcv, "Pos_0702011_object_identifiers_001.json", v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference JSON"); + } + [] p.receive { + setverdict(fail, "JSON decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_0702011_object_identifiers_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} \ No newline at end of file diff --git a/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070201_character_strings/Pos_070201_character_strings_001/Pos_070201_character_strings_001.json b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070201_character_strings/Pos_070201_character_strings_001/Pos_070201_character_strings_001.json new file mode 100644 index 0000000..604c99a --- /dev/null +++ b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070201_character_strings/Pos_070201_character_strings_001/Pos_070201_character_strings_001.json @@ -0,0 +1,3 @@ +{ + "Pos_070201_character_strings_001.MyChar":"my Universal charstring value" +} diff --git a/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070201_character_strings/Pos_070201_character_strings_001/Pos_070201_character_strings_001.ttcn b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070201_character_strings/Pos_070201_character_strings_001/Pos_070201_character_strings_001.ttcn new file mode 100644 index 0000000..c6416a1 --- /dev/null +++ b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070201_character_strings/Pos_070201_character_strings_001/Pos_070201_character_strings_001.ttcn @@ -0,0 +1,84 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:7.2.1, Ensure that charstring, universal charstring values shall be encoded as JSON.Strings + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + TTCN-3 charstring, universal charstring values shall be encoded as JSON.Strings + */ + +module Pos_070201_character_strings_001 { + + import from JSON all; + + type charstring MyChar with { encode "JSON" }; + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw with { encode "Text" }; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference JSON file and returns true if they represent the same JSON structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the JSON data + * @param p_referenceJsonFile the JSON data + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference JSON file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceJsonFile represent the same JSON data + */ + external function matchFile(Raw p_textToMatch, File p_referenceJsonFile, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070201_character_strings_001() runs on C system C { + + var MyChar m_msg := "my Universal charstring value"; // JSON should be: { "Pos_070201_character_strings_003.MyChar" : "my Universal charstring value"} + + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference JSON file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("JSON message: ", v_rcv); + if (matchFile(v_rcv, "Pos_070201_character_strings_001.json", v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference JSON"); + } + [] p.receive { + setverdict(fail, "JSON decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070201_character_strings_001(), PX_TC_EXECUTION_TIMEOUT); + } +} \ No newline at end of file diff --git a/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070201_character_strings/Pos_070201_character_strings_002/Pos_070201_character_strings_002.json b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070201_character_strings/Pos_070201_character_strings_002/Pos_070201_character_strings_002.json new file mode 100644 index 0000000..eceba84 --- /dev/null +++ b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070201_character_strings/Pos_070201_character_strings_002/Pos_070201_character_strings_002.json @@ -0,0 +1,3 @@ +{ + "Pos_070201_character_strings_002.MyChar" : "my Universal charstring value\u0009" +} diff --git a/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070201_character_strings/Pos_070201_character_strings_002/Pos_070201_character_strings_002.ttcn b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070201_character_strings/Pos_070201_character_strings_002/Pos_070201_character_strings_002.ttcn new file mode 100644 index 0000000..779ff1b --- /dev/null +++ b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070201_character_strings/Pos_070201_character_strings_002/Pos_070201_character_strings_002.ttcn @@ -0,0 +1,85 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:7.2.1, Ensure that charstring, universal charstring values shall be encoded as JSON.Strings + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + TTCN-3 charstring, universal charstring values shall be encoded as JSON.Strings + */ + +module Pos_070201_character_strings_002 { + + import from JSON all; + + type charstring MyChar with { encode "JSON" }; + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw with { encode "Text" }; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference JSON file and returns true if they represent the same JSON structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the JSON data + * @param p_referenceJsonFile the JSON data + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference JSON file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceJsonFile represent the same JSON data + */ + external function matchFile(Raw p_textToMatch, File p_referenceJsonFile, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070201_character_strings_002() runs on C system C { + + var MyChar m_msg := "my Universal charstring value" & char(U9); // JSON should be: { "Pos_070201_character_strings_002.MyChar" : "my Universal charstring value\u0009"} + + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference JSON file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("JSON message: ", v_rcv); + if (matchFile(v_rcv, "Pos_070201_character_strings_002.json", v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference JSON"); + } + [] p.receive { + setverdict(fail, "JSON decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070201_character_strings_002(), PX_TC_EXECUTION_TIMEOUT); + } + +} \ No newline at end of file diff --git a/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070201_character_strings/Pos_070201_character_strings_003/Pos_070201_character_strings_003.json b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070201_character_strings/Pos_070201_character_strings_003/Pos_070201_character_strings_003.json new file mode 100644 index 0000000..f207239 --- /dev/null +++ b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070201_character_strings/Pos_070201_character_strings_003/Pos_070201_character_strings_003.json @@ -0,0 +1,3 @@ +{ + "Pos_070201_character_strings_003.MyChar" : "\u0009" +} diff --git a/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070201_character_strings/Pos_070201_character_strings_003/Pos_070201_character_strings_003.ttcn b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070201_character_strings/Pos_070201_character_strings_003/Pos_070201_character_strings_003.ttcn new file mode 100644 index 0000000..8696255 --- /dev/null +++ b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070201_character_strings/Pos_070201_character_strings_003/Pos_070201_character_strings_003.ttcn @@ -0,0 +1,85 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:7.2.1, Ensure that charstring, universal charstring values shall be encoded as JSON.Strings + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + TTCN-3 charstring, universal charstring values shall be encoded as JSON.Strings + */ + +module Pos_070201_character_strings_003 { + + import from JSON all; + + type charstring MyChar with { encode "JSON" } + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw with { encode "Text" }; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference JSON file and returns true if they represent the same JSON structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the JSON data + * @param p_referenceJsonFile the JSON data + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference JSON file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceJsonFile represent the same JSON data + */ + external function matchFile(Raw p_textToMatch, File p_referenceJsonFile, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070201_character_strings_003() runs on C system C { + + var MyChar m_msg := char(U9); // JSON should be: { "Pos_070201_character_strings_003.MyChar" : "\u0009"} + + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference JSON file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("JSON message: ", v_rcv); + if (matchFile(v_rcv, "Pos_070201_character_strings_003.json", v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference JSON"); + } + [] p.receive { + setverdict(fail, "JSON decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070201_character_strings_003(), PX_TC_EXECUTION_TIMEOUT); + } + +} \ No newline at end of file diff --git a/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070201_character_strings/Pos_070201_character_strings_004/Pos_070201_character_strings_004.json b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070201_character_strings/Pos_070201_character_strings_004/Pos_070201_character_strings_004.json new file mode 100644 index 0000000..6396ad0 --- /dev/null +++ b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070201_character_strings/Pos_070201_character_strings_004/Pos_070201_character_strings_004.json @@ -0,0 +1,3 @@ +{ + "universal charstring" : "my Universal charstring value" +} diff --git a/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070201_character_strings/Pos_070201_character_strings_004/Pos_070201_character_strings_004.ttcn b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070201_character_strings/Pos_070201_character_strings_004/Pos_070201_character_strings_004.ttcn new file mode 100644 index 0000000..df0d21c --- /dev/null +++ b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070201_character_strings/Pos_070201_character_strings_004/Pos_070201_character_strings_004.ttcn @@ -0,0 +1,83 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:7.2.1, Ensure that charstring, universal charstring values shall be encoded as JSON.Strings + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + TTCN-3 charstring, universal charstring values shall be encoded as JSON.Strings + */ + +module Pos_070201_character_strings_004 { + + import from JSON all; + + const universal charstring m_msg := "my Universal charstring value" with { encode "JSON" }; // JSON should be: { "universal charstring" : "my Universal charstring value"} + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw with { encode "Text" }; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference JSON file and returns true if they represent the same JSON structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the JSON data + * @param p_referenceJsonFile the JSON data + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference JSON file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceJsonFile represent the same JSON data + */ + external function matchFile(Raw p_textToMatch, File p_referenceJsonFile, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070201_character_strings_004() runs on C system C { + + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference JSON file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("JSON message: ", v_rcv); + if (matchFile(v_rcv, "Pos_070201_character_strings_004.json", v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference JSON"); + } + [] p.receive { + setverdict(fail, "JSON decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070201_character_strings_004(), PX_TC_EXECUTION_TIMEOUT); + } + +} \ No newline at end of file diff --git a/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070201_character_strings/Pos_070201_character_strings_005/Pos_070201_character_strings_005.json b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070201_character_strings/Pos_070201_character_strings_005/Pos_070201_character_strings_005.json new file mode 100644 index 0000000..0bf6570 --- /dev/null +++ b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070201_character_strings/Pos_070201_character_strings_005/Pos_070201_character_strings_005.json @@ -0,0 +1,3 @@ +{ + "charstring" : "\u0009" +} diff --git a/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070201_character_strings/Pos_070201_character_strings_005/Pos_070201_character_strings_005.ttcn b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070201_character_strings/Pos_070201_character_strings_005/Pos_070201_character_strings_005.ttcn new file mode 100644 index 0000000..b6fdb20 --- /dev/null +++ b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070201_character_strings/Pos_070201_character_strings_005/Pos_070201_character_strings_005.ttcn @@ -0,0 +1,83 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:7.2.1, Ensure that charstring, universal charstring values shall be encoded as JSON.Strings + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + TTCN-3 charstring, universal charstring values shall be encoded as JSON.Strings + */ + +module Pos_070201_character_strings_005 { + + import from JSON all; + + const charstring m_msg := char(U9) with { encode "JSON" }; // JSON should be: { "charstring" : "\u0009"} + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw with { encode "Text" }; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference JSON file and returns true if they represent the same JSON structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the JSON data + * @param p_referenceJsonFile the JSON data + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference JSON file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceJsonFile represent the same JSON data + */ + external function matchFile(Raw p_textToMatch, File p_referenceJsonFile, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070201_character_strings_005() runs on C system C { + + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference JSON file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("JSON message: ", v_rcv); + if (matchFile(v_rcv, "Pos_070201_character_strings_005.json", v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference JSON"); + } + [] p.receive { + setverdict(fail, "JSON decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070201_character_strings_005(), PX_TC_EXECUTION_TIMEOUT); + } + +} with { encode "JSON" } diff --git a/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070202_binary_strings/Pos_070202_binary_strings_001/Pos_070202_binary_strings_001.json b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070202_binary_strings/Pos_070202_binary_strings_001/Pos_070202_binary_strings_001.json new file mode 100644 index 0000000..84a5b06 --- /dev/null +++ b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070202_binary_strings/Pos_070202_binary_strings_001/Pos_070202_binary_strings_001.json @@ -0,0 +1,3 @@ +{ + "bitstring" : "01011010" +} diff --git a/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070202_binary_strings/Pos_070202_binary_strings_001/Pos_070202_binary_strings_001.ttcn b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070202_binary_strings/Pos_070202_binary_strings_001/Pos_070202_binary_strings_001.ttcn new file mode 100644 index 0000000..5e6dec7 --- /dev/null +++ b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070202_binary_strings/Pos_070202_binary_strings_001/Pos_070202_binary_strings_001.ttcn @@ -0,0 +1,83 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:7.2.2, Ensure that bitrstring, hexstring and octetstring values shall be encoded as JSON.Strings + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + TTCN-3 bitstring, hexstring and octetstring values shall be encoded in JSON as JSON.String-s + */ + +module Pos_070202_binary_strings_001 { + + import from JSON all; + + const bitstring m_msg := '01011010'B with { encode "JSON" }; // encoding bitstring as JSON.String + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw with { encode "Text" }; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference JSON file and returns true if they represent the same JSON structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the JSON data + * @param p_referenceJsonFile the JSON data + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference JSON file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceJsonFile represent the same JSON data + */ + external function matchFile(Raw p_textToMatch, File p_referenceJsonFile, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070202_binary_strings_001() runs on C system C { + + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference JSON file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("JSON message: ", v_rcv); + if (matchFile(v_rcv, "Pos_070202_binary_strings_001.json", v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference JSON"); + } + [] p.receive { + setverdict(fail, "JSON decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070202_binary_strings_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} \ No newline at end of file diff --git a/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070202_binary_strings/Pos_070202_binary_strings_002/Pos_070202_binary_strings_002.json b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070202_binary_strings/Pos_070202_binary_strings_002/Pos_070202_binary_strings_002.json new file mode 100644 index 0000000..45d7d55 --- /dev/null +++ b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070202_binary_strings/Pos_070202_binary_strings_002/Pos_070202_binary_strings_002.json @@ -0,0 +1,3 @@ +{ + "octetstring" : "57060516" +} diff --git a/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070202_binary_strings/Pos_070202_binary_strings_002/Pos_070202_binary_strings_002.ttcn b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070202_binary_strings/Pos_070202_binary_strings_002/Pos_070202_binary_strings_002.ttcn new file mode 100644 index 0000000..ce7c674 --- /dev/null +++ b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070202_binary_strings/Pos_070202_binary_strings_002/Pos_070202_binary_strings_002.ttcn @@ -0,0 +1,83 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:7.2.2, Ensure that bitrstring, hexstring and octetstring values shall be encoded as JSON.Strings + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + TTCN-3 bitstring, hexstring and octetstring values shall be encoded in JSON as JSON.String-s + */ + +module Pos_070202_binary_strings_002 { + + import from JSON all; + + const octetstring m_msg := '57060516'O with { encode "JSON" }; // encoding octetstring as JSON.String + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw with { encode "Text" }; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference JSON file and returns true if they represent the same JSON structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the JSON data + * @param p_referenceJsonFile the JSON data + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference JSON file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceJsonFile represent the same JSON data + */ + external function matchFile(Raw p_textToMatch, File p_referenceJsonFile, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070202_binary_strings_002() runs on C system C { + + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference JSON file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("JSON message: ", v_rcv); + if (matchFile(v_rcv, "Pos_070202_binary_strings_002.json", v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference JSON"); + } + [] p.receive { + setverdict(fail, "JSON decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070202_binary_strings_002(), PX_TC_EXECUTION_TIMEOUT); + } + +} \ No newline at end of file diff --git a/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070202_binary_strings/Pos_070202_binary_strings_003/Pos_070202_binary_strings_003.json b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070202_binary_strings/Pos_070202_binary_strings_003/Pos_070202_binary_strings_003.json new file mode 100644 index 0000000..5bf395f --- /dev/null +++ b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070202_binary_strings/Pos_070202_binary_strings_003/Pos_070202_binary_strings_003.json @@ -0,0 +1,3 @@ +{ + "hexstring" : "FFFF" +} diff --git a/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070202_binary_strings/Pos_070202_binary_strings_003/Pos_070202_binary_strings_003.ttcn b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070202_binary_strings/Pos_070202_binary_strings_003/Pos_070202_binary_strings_003.ttcn new file mode 100644 index 0000000..dab2590 --- /dev/null +++ b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070202_binary_strings/Pos_070202_binary_strings_003/Pos_070202_binary_strings_003.ttcn @@ -0,0 +1,83 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:7.2.2, Ensure that bitrstring, hexstring and octetstring values shall be encoded as JSON.Strings + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + TTCN-3 bitstring, hexstring and octetstring values shall be encoded in JSON as JSON.String-s + */ + +module Pos_070202_binary_strings_003 { + + import from JSON all; + + const hexstring m_msg := 'FFFF'H with { encode "JSON" }; // encoding hexstring as JSON.String + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw with { encode "Text" }; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference JSON file and returns true if they represent the same JSON structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the JSON data + * @param p_referenceJsonFile the JSON data + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference JSON file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceJsonFile represent the same JSON data + */ + external function matchFile(Raw p_textToMatch, File p_referenceJsonFile, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070202_binary_strings_003() runs on C system C { + + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference JSON file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("JSON message: ", v_rcv); + if (matchFile(v_rcv, "Pos_070202_binary_strings_003.json", v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference JSON"); + } + [] p.receive { + setverdict(fail, "JSON decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070202_binary_strings_003(), PX_TC_EXECUTION_TIMEOUT); + } + +} \ No newline at end of file diff --git a/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070202_binary_strings/Pos_070202_binary_strings_004/Pos_070202_binary_strings_004.json b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070202_binary_strings/Pos_070202_binary_strings_004/Pos_070202_binary_strings_004.json new file mode 100644 index 0000000..4fd3d59 --- /dev/null +++ b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070202_binary_strings/Pos_070202_binary_strings_004/Pos_070202_binary_strings_004.json @@ -0,0 +1,3 @@ +{ + "Pos_070202_binary_strings_004.MyBitstring" : "01011010" +} diff --git a/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070202_binary_strings/Pos_070202_binary_strings_004/Pos_070202_binary_strings_004.ttcn b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070202_binary_strings/Pos_070202_binary_strings_004/Pos_070202_binary_strings_004.ttcn new file mode 100644 index 0000000..e5afbc2 --- /dev/null +++ b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070202_binary_strings/Pos_070202_binary_strings_004/Pos_070202_binary_strings_004.ttcn @@ -0,0 +1,87 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:7.2.2, Ensure that bitrstring, hexstring and octetstring values shall be encoded as JSON.Strings + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + TTCN-3 bitstring, hexstring and octetstring values shall be encoded in JSON as JSON.String-s + */ + +module Pos_070202_binary_strings_004 { + + import from JSON all; + + type bitstring MyBitstring; + const MyBitstring m_msg := '01011010'B with { encode "JSON" }; // encoding bitstring as JSON.String + /* + * { "Pos_070202_binary_strings_004.MyBitstring" : "01011010"} + */ + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw with { encode "Text" }; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference JSON file and returns true if they represent the same JSON structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the JSON data + * @param p_referenceJsonFile the JSON data + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference JSON file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceJsonFile represent the same JSON data + */ + external function matchFile(Raw p_textToMatch, File p_referenceJsonFile, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070202_binary_strings_004() runs on C system C { + + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference JSON file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("JSON message: ", v_rcv); + if (matchFile(v_rcv, "Pos_070202_binary_strings_004.json", v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference JSON"); + } + [] p.receive { + setverdict(fail, "JSON decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070202_binary_strings_004(), PX_TC_EXECUTION_TIMEOUT); + } + +} \ No newline at end of file diff --git a/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070202_binary_strings/Pos_070202_binary_strings_005/Pos_070202_binary_strings_005.json b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070202_binary_strings/Pos_070202_binary_strings_005/Pos_070202_binary_strings_005.json new file mode 100644 index 0000000..41d68b0 --- /dev/null +++ b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070202_binary_strings/Pos_070202_binary_strings_005/Pos_070202_binary_strings_005.json @@ -0,0 +1,3 @@ +{ + "Pos_070202_binary_strings_005.MyOctetstring" : "57060516" +} diff --git a/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070202_binary_strings/Pos_070202_binary_strings_005/Pos_070202_binary_strings_005.ttcn b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070202_binary_strings/Pos_070202_binary_strings_005/Pos_070202_binary_strings_005.ttcn new file mode 100644 index 0000000..98e1eea --- /dev/null +++ b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070202_binary_strings/Pos_070202_binary_strings_005/Pos_070202_binary_strings_005.ttcn @@ -0,0 +1,87 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:7.2.2, Ensure that bitrstring, hexstring and octetstring values shall be encoded as JSON.Strings + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + TTCN-3 bitstring, hexstring and octetstring values shall be encoded in JSON as JSON.String-s + */ + +module Pos_070202_binary_strings_005 { + + import from JSON all; + + type octetstring MyOctetstring; + const MyOctetstring m_msg := '57060516'O with { encode "JSON" }; // encoding octetstring as JSON.String + /* + * { "Pos_070202_binary_strings_005.MyOctetstring" : "57060516"} + */ + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw with { encode "Text" }; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference JSON file and returns true if they represent the same JSON structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the JSON data + * @param p_referenceJsonFile the JSON data + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference JSON file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceJsonFile represent the same JSON data + */ + external function matchFile(Raw p_textToMatch, File p_referenceJsonFile, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070202_binary_strings_005() runs on C system C { + + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference JSON file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("JSON message: ", v_rcv); + if (matchFile(v_rcv, "Pos_070202_binary_strings_005.json", v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference JSON"); + } + [] p.receive { + setverdict(fail, "JSON decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070202_binary_strings_005(), PX_TC_EXECUTION_TIMEOUT); + } + +} \ No newline at end of file diff --git a/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070202_binary_strings/Pos_070202_binary_strings_006/Pos_070202_binary_strings_006.json b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070202_binary_strings/Pos_070202_binary_strings_006/Pos_070202_binary_strings_006.json new file mode 100644 index 0000000..f112c5f --- /dev/null +++ b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070202_binary_strings/Pos_070202_binary_strings_006/Pos_070202_binary_strings_006.json @@ -0,0 +1,3 @@ +{ + "Pos_070202_binary_strings_006.MyHexstring" : "FFFF" +} diff --git a/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070202_binary_strings/Pos_070202_binary_strings_006/Pos_070202_binary_strings_006.ttcn b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070202_binary_strings/Pos_070202_binary_strings_006/Pos_070202_binary_strings_006.ttcn new file mode 100644 index 0000000..b02de5b --- /dev/null +++ b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070202_binary_strings/Pos_070202_binary_strings_006/Pos_070202_binary_strings_006.ttcn @@ -0,0 +1,84 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:7.2.2, Ensure that bitrstring, hexstring and octetstring values shall be encoded as JSON.Strings + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + TTCN-3 bitstring, hexstring and octetstring values shall be encoded in JSON as JSON.String-s + */ + +module Pos_070202_binary_strings_006 { + + import from JSON all; + + type hexstring MyHexstring; + const MyHexstring m_msg := 'FFFF'H with { encode "JSON" }; // encoding hexstring as JSON.String + /* {"Pos_070202_binary_strings_006.MyHexstring" : "FFFF"} */ + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw with { encode "Text" }; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference JSON file and returns true if they represent the same JSON structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the JSON data + * @param p_referenceJsonFile the JSON data + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference JSON file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceJsonFile represent the same JSON data + */ + external function matchFile(Raw p_textToMatch, File p_referenceJsonFile, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070202_binary_strings_006() runs on C system C { + + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference JSON file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("JSON message: ", v_rcv); + if (matchFile(v_rcv, "Pos_070202_binary_strings_006.json", v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference JSON"); + } + [] p.receive { + setverdict(fail, "JSON decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070202_binary_strings_006(), PX_TC_EXECUTION_TIMEOUT); + } +} \ No newline at end of file diff --git a/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070203_integer/Pos_070203_integer_001/Pos_070203_integer_001.json b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070203_integer/Pos_070203_integer_001/Pos_070203_integer_001.json new file mode 100644 index 0000000..931d584 --- /dev/null +++ b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070203_integer/Pos_070203_integer_001/Pos_070203_integer_001.json @@ -0,0 +1,3 @@ +{ + "integer" : 10 +} diff --git a/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070203_integer/Pos_070203_integer_001/Pos_070203_integer_001.ttcn b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070203_integer/Pos_070203_integer_001/Pos_070203_integer_001.ttcn new file mode 100644 index 0000000..131dc3e --- /dev/null +++ b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070203_integer/Pos_070203_integer_001/Pos_070203_integer_001.ttcn @@ -0,0 +1,84 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:7.2.3, Ensure that integer value shall be encoded as JSON.Numbers + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + All TTCN-3 integer values shall be encoded as the JSON numbers (see clause 6.4.1), without the optional fraction and exponent parts. + */ + +module Pos_070203_integer_001 { + + import from JSON all; + + const integer m_msg := 10 with { encode "JSON" }; // encoding bitstring as JSON.Number + /* { "integer" : 10 } */ + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw with { encode "Text" }; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference JSON file and returns true if they represent the same JSON structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the JSON data + * @param p_referenceJsonFile the JSON data + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference JSON file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceJsonFile represent the same JSON data + */ + external function matchFile(Raw p_textToMatch, File p_referenceJsonFile, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070203_integer_001() runs on C system C { + + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference JSON file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("JSON message: ", v_rcv); + if (matchFile(v_rcv, "Pos_070203_integer_001.json", v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference JSON"); + } + [] p.receive { + setverdict(fail, "JSON decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070203_integer_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} \ No newline at end of file diff --git a/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070203_integer/Pos_070203_integer_002/Pos_070203_integer_002.json b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070203_integer/Pos_070203_integer_002/Pos_070203_integer_002.json new file mode 100644 index 0000000..d7c0e87 --- /dev/null +++ b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070203_integer/Pos_070203_integer_002/Pos_070203_integer_002.json @@ -0,0 +1,3 @@ +{ + "integer" : -0 +} diff --git a/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070203_integer/Pos_070203_integer_002/Pos_070203_integer_002.ttcn b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070203_integer/Pos_070203_integer_002/Pos_070203_integer_002.ttcn new file mode 100644 index 0000000..b6c195a --- /dev/null +++ b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070203_integer/Pos_070203_integer_002/Pos_070203_integer_002.ttcn @@ -0,0 +1,84 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:7.2.3, Ensure that integer value shall be encoded as JSON.Numbers + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + * At decoding the JSON -0 value, by default shall be converted to the TTCN-3 value 0. + */ + +module Pos_070203_integer_002 { + + import from JSON all; + + const integer m_msg := -0 with { encode "JSON" }; // encoding bitstring as JSON.Number + /* Note: the reference JSON contains: { "integer" : -0 } */ + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw with { encode "Text" }; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference JSON file and returns true if they represent the same JSON structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the JSON data + * @param p_referenceJsonFile the JSON data + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference JSON file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceJsonFile represent the same JSON data + */ + external function matchFile(Raw p_textToMatch, File p_referenceJsonFile, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070203_integer_002() runs on C system C { + + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference JSON file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("JSON message: ", v_rcv); + if (matchFile(v_rcv, "Pos_070203_integer_002.json", v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference JSON"); + } + [] p.receive { + setverdict(fail, "JSON decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070203_integer_002(), PX_TC_EXECUTION_TIMEOUT); + } + +} \ No newline at end of file diff --git a/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070204_float/Pos_070204_float_001/Pos_070204_float_001.json b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070204_float/Pos_070204_float_001/Pos_070204_float_001.json new file mode 100644 index 0000000..11a2af5 --- /dev/null +++ b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070204_float/Pos_070204_float_001/Pos_070204_float_001.json @@ -0,0 +1,3 @@ +{ + "float" : -10.1 +} diff --git a/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070204_float/Pos_070204_float_001/Pos_070204_float_001.ttcn b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070204_float/Pos_070204_float_001/Pos_070204_float_001.ttcn new file mode 100644 index 0000000..1b2068f --- /dev/null +++ b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070204_float/Pos_070204_float_001/Pos_070204_float_001.ttcn @@ -0,0 +1,84 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:7.2.4, Ensure that float value shall be encoded as JSON.Numbers + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + All TTCN-3 integer values shall be encoded as the JSON numbers (see clause 6.4.1), without the optional fraction and exponent parts. + */ + +module Pos_070204_float_001 { + + import from JSON all; + + const float m_msg := -10.1 with { encode "JSON" }; // encoding float as JSON.Number + /* { "float" : -10.1 } */ + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw with { encode "Text" }; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference JSON file and returns true if they represent the same JSON structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the JSON data + * @param p_referenceJsonFile the JSON data + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference JSON file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceJsonFile represent the same JSON data + */ + external function matchFile(Raw p_textToMatch, File p_referenceJsonFile, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070204_float_001() runs on C system C { + + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference JSON file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("JSON message: ", v_rcv); + if (matchFile(v_rcv, "Pos_070204_float_001.json", v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference JSON"); + } + [] p.receive { + setverdict(fail, "JSON decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070204_float_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} \ No newline at end of file diff --git a/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070204_float/Pos_070204_float_002/Pos_070204_float_002.json b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070204_float/Pos_070204_float_002/Pos_070204_float_002.json new file mode 100644 index 0000000..1f58b42 --- /dev/null +++ b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070204_float/Pos_070204_float_002/Pos_070204_float_002.json @@ -0,0 +1,3 @@ +{ + "float" : "infinity" +} diff --git a/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070204_float/Pos_070204_float_002/Pos_070204_float_002.ttcn b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070204_float/Pos_070204_float_002/Pos_070204_float_002.ttcn new file mode 100644 index 0000000..a484e26 --- /dev/null +++ b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070204_float/Pos_070204_float_002/Pos_070204_float_002.ttcn @@ -0,0 +1,84 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:7.2.4, Ensure that float value shall be encoded as JSON.Numbers + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + The special float values "infinity", "-infinity" and "not_a_number" are encoded as JSON strings. + * */ + +module Pos_070204_float_002 { + + import from JSON all; + + const float m_msg := infinity with { encode "JSON" }; // encoding float as JSON.Number + /* { "float" : "infinity" } */ + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw with { encode "Text" }; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference JSON file and returns true if they represent the same JSON structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the JSON data + * @param p_referenceJsonFile the JSON data + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference JSON file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceJsonFile represent the same JSON data + */ + external function matchFile(Raw p_textToMatch, File p_referenceJsonFile, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070204_float_002() runs on C system C { + + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference JSON file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("JSON message: ", v_rcv); + if (matchFile(v_rcv, "Pos_070204_float_002.json", v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference JSON"); + } + [] p.receive { + setverdict(fail, "JSON decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070204_float_002(), PX_TC_EXECUTION_TIMEOUT); + } + +} \ No newline at end of file diff --git a/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070204_float/Pos_070204_float_003/Pos_070204_float_003.json b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070204_float/Pos_070204_float_003/Pos_070204_float_003.json new file mode 100644 index 0000000..9f73642 --- /dev/null +++ b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070204_float/Pos_070204_float_003/Pos_070204_float_003.json @@ -0,0 +1,3 @@ +{ + "float" : "-infinity" +} diff --git a/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070204_float/Pos_070204_float_003/Pos_070204_float_003.ttcn b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070204_float/Pos_070204_float_003/Pos_070204_float_003.ttcn new file mode 100644 index 0000000..3003c16 --- /dev/null +++ b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070204_float/Pos_070204_float_003/Pos_070204_float_003.ttcn @@ -0,0 +1,84 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:7.2.4, Ensure that float value shall be encoded as JSON.Numbers + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + The special float values "infinity", "-infinity" and "not_a_number" are encoded as JSON strings. + * */ + +module Pos_070204_float_003 { + + import from JSON all; + + const float m_msg := -infinity with { encode "JSON" }; // encoding float as JSON.Number + /* { "float" : "-infinity" } */ + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw with { encode "Text" }; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference JSON file and returns true if they represent the same JSON structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the JSON data + * @param p_referenceJsonFile the JSON data + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference JSON file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceJsonFile represent the same JSON data + */ + external function matchFile(Raw p_textToMatch, File p_referenceJsonFile, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070204_float_003() runs on C system C { + + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference JSON file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("JSON message: ", v_rcv); + if (matchFile(v_rcv, "Pos_070204_float_003.json", v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference JSON"); + } + [] p.receive { + setverdict(fail, "JSON decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070204_float_003(), PX_TC_EXECUTION_TIMEOUT); + } + +} \ No newline at end of file diff --git a/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070204_float/Pos_070204_float_004/Pos_070204_float_004.json b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070204_float/Pos_070204_float_004/Pos_070204_float_004.json new file mode 100644 index 0000000..21aae0f --- /dev/null +++ b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070204_float/Pos_070204_float_004/Pos_070204_float_004.json @@ -0,0 +1,3 @@ +{ + "float" : "not_a_number" +} diff --git a/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070204_float/Pos_070204_float_004/Pos_070204_float_004.ttcn b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070204_float/Pos_070204_float_004/Pos_070204_float_004.ttcn new file mode 100644 index 0000000..600438b --- /dev/null +++ b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070204_float/Pos_070204_float_004/Pos_070204_float_004.ttcn @@ -0,0 +1,84 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:7.2.4, Ensure that float value shall be encoded as JSON.Numbers + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + The special float values "infinity", "-infinity" and "not_a_number" are encoded as JSON strings. + * */ + +module Pos_070204_float_004 { + + import from JSON all; + + const float m_msg := not_a_number with { encode "JSON" }; // encoding float as JSON.Number + /* { "float" : "not_a_number" } */ + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw with { encode "Text" }; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference JSON file and returns true if they represent the same JSON structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the JSON data + * @param p_referenceJsonFile the JSON data + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference JSON file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceJsonFile represent the same JSON data + */ + external function matchFile(Raw p_textToMatch, File p_referenceJsonFile, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070204_float_004() runs on C system C { + + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference JSON file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("JSON message: ", v_rcv); + if (matchFile(v_rcv, "Pos_070204_float_004.json", v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference JSON"); + } + [] p.receive { + setverdict(fail, "JSON decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070204_float_004(), PX_TC_EXECUTION_TIMEOUT); + } + +} \ No newline at end of file diff --git a/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070205_boolean/Pos_070205_boolean_001/Pos_070205_boolean_001.json b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070205_boolean/Pos_070205_boolean_001/Pos_070205_boolean_001.json new file mode 100644 index 0000000..87c3a47 --- /dev/null +++ b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070205_boolean/Pos_070205_boolean_001/Pos_070205_boolean_001.json @@ -0,0 +1,3 @@ +{ + "boolean" : true +} diff --git a/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070205_boolean/Pos_070205_boolean_001/Pos_070205_boolean_001.ttcn b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070205_boolean/Pos_070205_boolean_001/Pos_070205_boolean_001.ttcn new file mode 100644 index 0000000..f75efb8 --- /dev/null +++ b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070205_boolean/Pos_070205_boolean_001/Pos_070205_boolean_001.ttcn @@ -0,0 +1,84 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:7.2.5, Ensure that boolean value shall be encoded as JSON.Literals + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + TTCN-3 boolean values shall be encoded in JSON as the literals true and false. + * */ + +module Pos_070205_boolean_001 { + + import from JSON all; + + const boolean m_msg := true with { encode "JSON" }; // encoding bitstring as JSON.Literal + /* { "boolean" : true } */ + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw with { encode "Text" }; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference JSON file and returns true if they represent the same JSON structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the JSON data + * @param p_referenceJsonFile the JSON data + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference JSON file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceJsonFile represent the same JSON data + */ + external function matchFile(Raw p_textToMatch, File p_referenceJsonFile, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070205_boolean_001() runs on C system C { + + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference JSON file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("JSON message: ", v_rcv); + if (matchFile(v_rcv, "Pos_070205_boolean_001.json", v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference JSON"); + } + [] p.receive { + setverdict(fail, "JSON decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070205_boolean_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} \ No newline at end of file diff --git a/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070205_boolean/Pos_070205_boolean_002/Pos_070205_boolean_002.json b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070205_boolean/Pos_070205_boolean_002/Pos_070205_boolean_002.json new file mode 100644 index 0000000..98a7f15 --- /dev/null +++ b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070205_boolean/Pos_070205_boolean_002/Pos_070205_boolean_002.json @@ -0,0 +1,3 @@ +{ + "boolean" : false +} diff --git a/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070205_boolean/Pos_070205_boolean_002/Pos_070205_boolean_002.ttcn b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070205_boolean/Pos_070205_boolean_002/Pos_070205_boolean_002.ttcn new file mode 100644 index 0000000..3145aba --- /dev/null +++ b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070205_boolean/Pos_070205_boolean_002/Pos_070205_boolean_002.ttcn @@ -0,0 +1,84 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:7.2.5, Ensure that boolean value shall be encoded as JSON.Literals + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + TTCN-3 boolean values shall be encoded in JSON as the literals true and false. + * */ + +module Pos_070205_boolean_002 { + + import from JSON all; + + const boolean m_msg := false with { encode "JSON" }; // encoding bitstring as JSON.Literal + /* { "boolean" : false } */ + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw with { encode "Text" }; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference JSON file and returns true if they represent the same JSON structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the JSON data + * @param p_referenceJsonFile the JSON data + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference JSON file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceJsonFile represent the same JSON data + */ + external function matchFile(Raw p_textToMatch, File p_referenceJsonFile, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070205_boolean_002() runs on C system C { + + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference JSON file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("JSON message: ", v_rcv); + if (matchFile(v_rcv, "Pos_070205_boolean_002.json", v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference JSON"); + } + [] p.receive { + setverdict(fail, "JSON decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070205_boolean_002(), PX_TC_EXECUTION_TIMEOUT); + } + +} \ No newline at end of file diff --git a/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070206_enumerated/Pos_070206_enumerated_001/Pos_070206_enumerated_001.json b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070206_enumerated/Pos_070206_enumerated_001/Pos_070206_enumerated_001.json new file mode 100644 index 0000000..9a16b84 --- /dev/null +++ b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070206_enumerated/Pos_070206_enumerated_001/Pos_070206_enumerated_001.json @@ -0,0 +1,3 @@ +{ + "Pos_070206_enumerated_001.MyEnumType": "firstItem" +} diff --git a/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070206_enumerated/Pos_070206_enumerated_001/Pos_070206_enumerated_001.ttcn b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070206_enumerated/Pos_070206_enumerated_001/Pos_070206_enumerated_001.ttcn new file mode 100644 index 0000000..6bd0fa3 --- /dev/null +++ b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070206_enumerated/Pos_070206_enumerated_001/Pos_070206_enumerated_001.ttcn @@ -0,0 +1,91 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:7.2.6, Ensure that enum value shall be encoded as JSON.String + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + TTCN-3 enumerated values shall be encoded as JSON.String-s. + * */ + +module Pos_070206_enumerated_001 { + + import from JSON all; + + type enumerated MyEnumType { + firstItem(0), + secondItem(1), + thirdItem(3), + etc(2, 4..255) + } with { encode "JSON" }; + + const MyEnumType m_msg := firstItem; // encoding enum as JSON.String + /* { "Pos_070206_enumerated_001.MyEnumType": "firstItem" } */ + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw with { encode "Text" }; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference JSON file and returns true if they represent the same JSON structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the JSON data + * @param p_referenceJsonFile the JSON data + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference JSON file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceJsonFile represent the same JSON data + */ + external function matchFile(Raw p_textToMatch, File p_referenceJsonFile, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070206_enumerated_001() runs on C system C { + + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference JSON file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("JSON message: ", v_rcv); + if (matchFile(v_rcv, "Pos_070206_enumerated_001.json", v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference JSON"); + } + [] p.receive { + setverdict(fail, "JSON decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070206_enumerated_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} \ No newline at end of file diff --git a/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070207_verdicttype/Pos_070207_verdicttype_001/Pos_070207_verdicttype_001.json b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070207_verdicttype/Pos_070207_verdicttype_001/Pos_070207_verdicttype_001.json new file mode 100644 index 0000000..955b16b --- /dev/null +++ b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070207_verdicttype/Pos_070207_verdicttype_001/Pos_070207_verdicttype_001.json @@ -0,0 +1,3 @@ +{ + "Pos_070207_verdicttype_001.MyVerdictType" : "pass" +} diff --git a/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070207_verdicttype/Pos_070207_verdicttype_001/Pos_070207_verdicttype_001.ttcn b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070207_verdicttype/Pos_070207_verdicttype_001/Pos_070207_verdicttype_001.ttcn new file mode 100644 index 0000000..86c07dd --- /dev/null +++ b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070207_verdicttype/Pos_070207_verdicttype_001/Pos_070207_verdicttype_001.ttcn @@ -0,0 +1,86 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:7.2.7, Ensure that verdicttype value shall be encoded as JSON.String + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + TTCN-3 verdicttype values shall be encoded in JSON as JSON.String-s. + * */ + +module Pos_070207_verdicttype_001 { + + import from JSON all; + + type verdicttype MyVerdictType with { encode "JSON" }; + + const MyVerdictType m_msg := pass; // encoding verdicttype as JSON.String + /* { "Pos_070207_verdicttype_001.MyVerdictType": "pass" } */ + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw with { encode "Text" }; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference JSON file and returns true if they represent the same JSON structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the JSON data + * @param p_referenceJsonFile the JSON data + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference JSON file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceJsonFile represent the same JSON data + */ + external function matchFile(Raw p_textToMatch, File p_referenceJsonFile, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070207_verdicttype_001() runs on C system C { + + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference JSON file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("JSON message: ", v_rcv); + if (matchFile(v_rcv, "Pos_070207_verdicttype_001.json", v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference JSON"); + } + [] p.receive { + setverdict(fail, "JSON decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070207_verdicttype_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} \ No newline at end of file diff --git a/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070207_verdicttype/Pos_070207_verdicttype_002/Pos_070207_verdicttype_002.json b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070207_verdicttype/Pos_070207_verdicttype_002/Pos_070207_verdicttype_002.json new file mode 100644 index 0000000..7a15654 --- /dev/null +++ b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070207_verdicttype/Pos_070207_verdicttype_002/Pos_070207_verdicttype_002.json @@ -0,0 +1,3 @@ +{ + "Pos_070207_verdicttype_002.MyVerdictType": "fail" +} diff --git a/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070207_verdicttype/Pos_070207_verdicttype_002/Pos_070207_verdicttype_002.ttcn b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070207_verdicttype/Pos_070207_verdicttype_002/Pos_070207_verdicttype_002.ttcn new file mode 100644 index 0000000..6b69741 --- /dev/null +++ b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070207_verdicttype/Pos_070207_verdicttype_002/Pos_070207_verdicttype_002.ttcn @@ -0,0 +1,86 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:7.2.7, Ensure that verdicttype value shall be encoded as JSON.String + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + TTCN-3 verdicttype values shall be encoded in JSON as JSON.String-s. + * */ + +module Pos_070207_verdicttype_002 { + + import from JSON all; + + type verdicttype MyVerdictType with { encode "JSON" }; + + const MyVerdictType m_msg := fail; // encoding verdicttype as JSON.String + /* { "Pos_070207_verdicttype_002.MyVerdictType": "fail" } */ + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw with { encode "Text" }; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference JSON file and returns true if they represent the same JSON structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the JSON data + * @param p_referenceJsonFile the JSON data + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference JSON file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceJsonFile represent the same JSON data + */ + external function matchFile(Raw p_textToMatch, File p_referenceJsonFile, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070207_verdicttype_002() runs on C system C { + + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference JSON file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("JSON message: ", v_rcv); + if (matchFile(v_rcv, "Pos_070207_verdicttype_002.json", v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference JSON"); + } + [] p.receive { + setverdict(fail, "JSON decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070207_verdicttype_002(), PX_TC_EXECUTION_TIMEOUT); + } + +} \ No newline at end of file diff --git a/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070207_verdicttype/Pos_070207_verdicttype_003/Pos_070207_verdicttype_003.json b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070207_verdicttype/Pos_070207_verdicttype_003/Pos_070207_verdicttype_003.json new file mode 100644 index 0000000..5f49c23 --- /dev/null +++ b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070207_verdicttype/Pos_070207_verdicttype_003/Pos_070207_verdicttype_003.json @@ -0,0 +1,3 @@ +{ + "Pos_070207_verdicttype_003.MyVerdictType": "inconc" +} diff --git a/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070207_verdicttype/Pos_070207_verdicttype_003/Pos_070207_verdicttype_003.ttcn b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070207_verdicttype/Pos_070207_verdicttype_003/Pos_070207_verdicttype_003.ttcn new file mode 100644 index 0000000..a4ea56f --- /dev/null +++ b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070207_verdicttype/Pos_070207_verdicttype_003/Pos_070207_verdicttype_003.ttcn @@ -0,0 +1,86 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:7.2.7, Ensure that verdicttype value shall be encoded as JSON.String + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + TTCN-3 verdicttype values shall be encoded in JSON as JSON.String-s. + * */ + +module Pos_070207_verdicttype_003 { + + import from JSON all; + + type verdicttype MyVerdictType with { encode "JSON" }; + + const MyVerdictType m_msg := inconc; // encoding verdicttype as JSON.String + /* { "Pos_070207_verdicttype_003.MyVerdictType": "inconc" } */ + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw with { encode "Text" }; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference JSON file and returns true if they represent the same JSON structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the JSON data + * @param p_referenceJsonFile the JSON data + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference JSON file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceJsonFile represent the same JSON data + */ + external function matchFile(Raw p_textToMatch, File p_referenceJsonFile, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070207_verdicttype_003() runs on C system C { + + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference JSON file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("JSON message: ", v_rcv); + if (matchFile(v_rcv, "Pos_070207_verdicttype_003.json", v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference JSON"); + } + [] p.receive { + setverdict(fail, "JSON decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070207_verdicttype_003(), PX_TC_EXECUTION_TIMEOUT); + } + +} \ No newline at end of file diff --git a/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070207_verdicttype/Pos_070207_verdicttype_004/Pos_070207_verdicttype_004.json b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070207_verdicttype/Pos_070207_verdicttype_004/Pos_070207_verdicttype_004.json new file mode 100644 index 0000000..64c948d --- /dev/null +++ b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070207_verdicttype/Pos_070207_verdicttype_004/Pos_070207_verdicttype_004.json @@ -0,0 +1,3 @@ +{ + "Pos_070207_verdicttype_004.MyVerdictType": "none" +} diff --git a/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070207_verdicttype/Pos_070207_verdicttype_004/Pos_070207_verdicttype_004.ttcn b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070207_verdicttype/Pos_070207_verdicttype_004/Pos_070207_verdicttype_004.ttcn new file mode 100644 index 0000000..6a26ffa --- /dev/null +++ b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070207_verdicttype/Pos_070207_verdicttype_004/Pos_070207_verdicttype_004.ttcn @@ -0,0 +1,86 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:7.2.7, Ensure that verdicttype value shall be encoded as JSON.String + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + TTCN-3 verdicttype values shall be encoded in JSON as JSON.String-s. + * */ + +module Pos_070207_verdicttype_004 { + + import from JSON all; + + type verdicttype MyVerdictType with { encode "JSON" }; + + const MyVerdictType m_msg := none; // encoding verdicttype as JSON.String + /* { "Pos_070207_verdicttype_004.MyVerdictType": "none" } */ + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw with { encode "Text" }; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference JSON file and returns true if they represent the same JSON structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the JSON data + * @param p_referenceJsonFile the JSON data + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference JSON file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceJsonFile represent the same JSON data + */ + external function matchFile(Raw p_textToMatch, File p_referenceJsonFile, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070207_verdicttype_004() runs on C system C { + + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference JSON file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("JSON message: ", v_rcv); + if (matchFile(v_rcv, "Pos_070207_verdicttype_004.json", v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference JSON"); + } + [] p.receive { + setverdict(fail, "JSON decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070207_verdicttype_004(), PX_TC_EXECUTION_TIMEOUT); + } + +} \ No newline at end of file diff --git a/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070208_record_and_set/Pos_070208_record_and_set_001/Pos_070208_record_and_set_001.json b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070208_record_and_set/Pos_070208_record_and_set_001/Pos_070208_record_and_set_001.json new file mode 100644 index 0000000..c63b2e4 --- /dev/null +++ b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070208_record_and_set/Pos_070208_record_and_set_001/Pos_070208_record_and_set_001.json @@ -0,0 +1,6 @@ +{ + "Pos_070208_record_and_set_001.MyRecordType":{ + "int":5, + "MyCharString":"abcdef" + } +} diff --git a/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070208_record_and_set/Pos_070208_record_and_set_001/Pos_070208_record_and_set_001.ttcn b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070208_record_and_set/Pos_070208_record_and_set_001/Pos_070208_record_and_set_001.ttcn new file mode 100644 index 0000000..6969078 --- /dev/null +++ b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070208_record_and_set/Pos_070208_record_and_set_001/Pos_070208_record_and_set_001.ttcn @@ -0,0 +1,97 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:7.2.8, Ensure that record and set values shall be encoded as JSON.Objects + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + The body of TTCN-3 record and set values shall be encoded to JSON objects. + * At TTCN-3 to JSON conversion the order of the object members shall be the same as the order of the fields in the TTCN-3 value, for both records and sets. + * */ + +module Pos_070208_record_and_set_001 { + + import from JSON all; + + + type record MyRecordType{ + integer int, + charstring MyCharString + } with { encode "JSON" }; + + template MyRecordType m_msg := {5, "abcdef"}; // encoding record as JSON.Object + /* { "Pos_070208_record_and_set_002.MyRecordType": + { + "int":5, + "MyCharString" : "abcdef" + } + * } + */ + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw with { encode "Text" }; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference JSON file and returns true if they represent the same JSON structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the JSON data + * @param p_referenceJsonFile the JSON data + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference JSON file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceJsonFile represent the same JSON data + */ + external function matchFile(Raw p_textToMatch, File p_referenceJsonFile, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070208_record_and_set_001() runs on C system C { + + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference JSON file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("JSON message: ", v_rcv); + if (matchFile(v_rcv, "Pos_070208_record_and_set_001.json", v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference JSON"); + } + [] p.receive { + setverdict(fail, "JSON decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070208_record_and_set_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} \ No newline at end of file diff --git a/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070208_record_and_set/Pos_070208_record_and_set_002/Pos_070208_record_and_set_002.json b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070208_record_and_set/Pos_070208_record_and_set_002/Pos_070208_record_and_set_002.json new file mode 100644 index 0000000..8db9dc7 --- /dev/null +++ b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070208_record_and_set/Pos_070208_record_and_set_002/Pos_070208_record_and_set_002.json @@ -0,0 +1,6 @@ +{ + "Pos_070208_record_and_set_002.MyRecordType": + { + "int":5 + } +} diff --git a/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070208_record_and_set/Pos_070208_record_and_set_002/Pos_070208_record_and_set_002.ttcn b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070208_record_and_set/Pos_070208_record_and_set_002/Pos_070208_record_and_set_002.ttcn new file mode 100644 index 0000000..742267c --- /dev/null +++ b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070208_record_and_set/Pos_070208_record_and_set_002/Pos_070208_record_and_set_002.ttcn @@ -0,0 +1,98 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:7.2.8, Ensure that record and set values shall be encoded as JSON.Objects + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + The body of TTCN-3 record and set values shall be encoded to JSON objects. + * By default (i.e. when none of the below encoding instruction is applied to the field in its corresponding type + * definition), it shall be omitted at TTCN-3 to JSON conversion, i.e. no object member is generated for the field. + * At JSON to TTCN-3 conversion, omit shall be assigned to optional fields that do not appear in the JSON value. + * */ + +module Pos_070208_record_and_set_002 { + + import from JSON all; + + + type record MyRecordType{ + integer int, + charstring MyCharString optional + } with { encode "JSON" }; + + template MyRecordType m_msg := {5, omit}; // encoding record as JSON.Object (optional fields that do not appear in the JSON value) + /* { "Pos_070208_record_and_set_002.MyRecordType": + { + "int":5 + } + * } + */ + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw with { encode "Text" }; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference JSON file and returns true if they represent the same JSON structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the JSON data + * @param p_referenceJsonFile the JSON data + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference JSON file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceJsonFile represent the same JSON data + */ + external function matchFile(Raw p_textToMatch, File p_referenceJsonFile, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070208_record_and_set_002() runs on C system C { + + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference JSON file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("JSON message: ", v_rcv); + if (matchFile(v_rcv, "Pos_070208_record_and_set_002.json", v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference JSON"); + } + [] p.receive { + setverdict(fail, "JSON decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070208_record_and_set_002(), PX_TC_EXECUTION_TIMEOUT); + } + +} \ No newline at end of file diff --git a/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070208_record_and_set/Pos_070208_record_and_set_003/Pos_070208_record_and_set_003.json b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070208_record_and_set/Pos_070208_record_and_set_003/Pos_070208_record_and_set_003.json new file mode 100644 index 0000000..df1d95f --- /dev/null +++ b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070208_record_and_set/Pos_070208_record_and_set_003/Pos_070208_record_and_set_003.json @@ -0,0 +1,7 @@ +{ + "Pos_070208_record_and_set_003.MySetType": + { + "int":5, + "MyCharString" : "abcdef" + } +} diff --git a/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070208_record_and_set/Pos_070208_record_and_set_003/Pos_070208_record_and_set_003.ttcn b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070208_record_and_set/Pos_070208_record_and_set_003/Pos_070208_record_and_set_003.ttcn new file mode 100644 index 0000000..43c939a --- /dev/null +++ b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070208_record_and_set/Pos_070208_record_and_set_003/Pos_070208_record_and_set_003.ttcn @@ -0,0 +1,97 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:7.2.8, Ensure that record and set values shall be encoded as JSON.Objects + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + The body of TTCN-3 record and set values shall be encoded to JSON objects. + * At TTCN-3 to JSON conversion the order of the object members shall be the same as the order of the fields in the TTCN-3 value, for both records and sets. + * */ + +module Pos_070208_record_and_set_003 { + + import from JSON all; + + + type record MySetType{ + integer int, + charstring MyCharString + } with { encode "JSON" }; + + template MySetType m_msg := {5, "abcdef"}; // encoding set as JSON.Object + /* { "Pos_070208_record_and_set_001.MySetType": + { + "int":5, + "MyCharString" : "abcdef" + } + * } + */ + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw with { encode "Text" }; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference JSON file and returns true if they represent the same JSON structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the JSON data + * @param p_referenceJsonFile the JSON data + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference JSON file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceJsonFile represent the same JSON data + */ + external function matchFile(Raw p_textToMatch, File p_referenceJsonFile, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070208_record_and_set_003() runs on C system C { + + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference JSON file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("JSON message: ", v_rcv); + if (matchFile(v_rcv, "Pos_070208_record_and_set_003.json", v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference JSON"); + } + [] p.receive { + setverdict(fail, "JSON decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070208_record_and_set_003(), PX_TC_EXECUTION_TIMEOUT); + } + +} \ No newline at end of file diff --git a/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070208_record_and_set/Pos_070208_record_and_set_004/Pos_070208_record_and_set_004.json b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070208_record_and_set/Pos_070208_record_and_set_004/Pos_070208_record_and_set_004.json new file mode 100644 index 0000000..8cb20a4 --- /dev/null +++ b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070208_record_and_set/Pos_070208_record_and_set_004/Pos_070208_record_and_set_004.json @@ -0,0 +1,6 @@ +{ + "Pos_070208_record_and_set_004.MySetType": + { + "MyCharString" : "abcdef" + } +} diff --git a/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070208_record_and_set/Pos_070208_record_and_set_004/Pos_070208_record_and_set_004.ttcn b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070208_record_and_set/Pos_070208_record_and_set_004/Pos_070208_record_and_set_004.ttcn new file mode 100644 index 0000000..30eb4df --- /dev/null +++ b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070208_record_and_set/Pos_070208_record_and_set_004/Pos_070208_record_and_set_004.ttcn @@ -0,0 +1,98 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:7.2.8, Ensure that record and set values shall be encoded as JSON.Objects + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + The body of TTCN-3 record and set values shall be encoded to JSON objects. + * By default (i.e. when none of the below encoding instruction is applied to the field in its corresponding type + * definition), it shall be omitted at TTCN-3 to JSON conversion, i.e. no object member is generated for the field. + * At JSON to TTCN-3 conversion, omit shall be assigned to optional fields that do not appear in the JSON value. + * */ + +module Pos_070208_record_and_set_004 { + + import from JSON all; + + + type record MySetType{ + integer int optional, + charstring MyCharString + } with { encode "JSON" }; + + template MySetType m_msg := {omit, "abcdef"}; // encoding set as JSON.Object,optional fields that do not appear in the JSON value. + /* { "Pos_070208_record_and_set_004.MySetType": + { + "MyCharString" : "abcdef" + } + * } + */ + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw with { encode "Text" }; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference JSON file and returns true if they represent the same JSON structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the JSON data + * @param p_referenceJsonFile the JSON data + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference JSON file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceJsonFile represent the same JSON data + */ + external function matchFile(Raw p_textToMatch, File p_referenceJsonFile, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070208_record_and_set_004() runs on C system C { + + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference JSON file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("JSON message: ", v_rcv); + if (matchFile(v_rcv, "Pos_070208_record_and_set_004.json", v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference JSON"); + } + [] p.receive { + setverdict(fail, "JSON decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070208_record_and_set_004(), PX_TC_EXECUTION_TIMEOUT); + } + +} \ No newline at end of file diff --git a/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070209_record_of_set_of_and_arrays/Pos_070209_record_of_set_of_and_arrays_001/Pos_070209_record_of_set_of_and_arrays_001.json b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070209_record_of_set_of_and_arrays/Pos_070209_record_of_set_of_and_arrays_001/Pos_070209_record_of_set_of_and_arrays_001.json new file mode 100644 index 0000000..8edda55 --- /dev/null +++ b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070209_record_of_set_of_and_arrays/Pos_070209_record_of_set_of_and_arrays_001/Pos_070209_record_of_set_of_and_arrays_001.json @@ -0,0 +1,3 @@ +{ + "Pos_070209_record_of_set_of_and_arrays_001.MyRecordofIntType": [1,2,3,4,5,6,7,8,9] +} diff --git a/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070209_record_of_set_of_and_arrays/Pos_070209_record_of_set_of_and_arrays_001/Pos_070209_record_of_set_of_and_arrays_001.ttcn b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070209_record_of_set_of_and_arrays/Pos_070209_record_of_set_of_and_arrays_001/Pos_070209_record_of_set_of_and_arrays_001.ttcn new file mode 100644 index 0000000..d4a179f --- /dev/null +++ b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070209_record_of_set_of_and_arrays/Pos_070209_record_of_set_of_and_arrays_001/Pos_070209_record_of_set_of_and_arrays_001.ttcn @@ -0,0 +1,91 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:7.2.9, Ensure that record of and set of and array values shall be encoded as JSON.Arrays + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + TTCN-3 record of, set of and array values shall be encoded in JSON as arrays. The elements of the array shall be the JSON representations of the corresponding TTCN-3 elements. + JSON array elements shall appear in the same order as in the TTCN-3 value. + * */ + +module Pos_070209_record_of_set_of_and_arrays_001 { + + import from JSON all; + + + type record of integer MyRecordofIntType with { encode "JSON" }; + + template MyRecordofIntType m_msg := {1,2,3,4,5,6,7,8,9}; // encoding record as JSON array + /* { + * "Pos_070209_record_of_set_of_and_arrays_001.MyRecordofIntType": [1,2,3,4,5,6,7,8,9] + * } + */ + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw with { encode "Text" }; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference JSON file and returns true if they represent the same JSON structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the JSON data + * @param p_referenceJsonFile the JSON data + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference JSON file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceJsonFile represent the same JSON data + */ + external function matchFile(Raw p_textToMatch, File p_referenceJsonFile, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070209_record_of_set_of_and_arrays_001() runs on C system C { + + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference JSON file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("JSON message: ", v_rcv); + if (matchFile(v_rcv, "Pos_070209_record_of_set_of_and_arrays_001.json", v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference JSON"); + } + [] p.receive { + setverdict(fail, "JSON decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070209_record_of_set_of_and_arrays_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} \ No newline at end of file diff --git a/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070209_record_of_set_of_and_arrays/Pos_070209_record_of_set_of_and_arrays_002/Pos_070209_record_of_set_of_and_arrays_002.json b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070209_record_of_set_of_and_arrays/Pos_070209_record_of_set_of_and_arrays_002/Pos_070209_record_of_set_of_and_arrays_002.json new file mode 100644 index 0000000..440ec54 --- /dev/null +++ b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070209_record_of_set_of_and_arrays/Pos_070209_record_of_set_of_and_arrays_002/Pos_070209_record_of_set_of_and_arrays_002.json @@ -0,0 +1,3 @@ +{ + "Pos_070209_record_of_set_of_and_arrays_002.MySetofIntType": [1,2,3,4,5,6,7,8,9] +} diff --git a/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070209_record_of_set_of_and_arrays/Pos_070209_record_of_set_of_and_arrays_002/Pos_070209_record_of_set_of_and_arrays_002.ttcn b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070209_record_of_set_of_and_arrays/Pos_070209_record_of_set_of_and_arrays_002/Pos_070209_record_of_set_of_and_arrays_002.ttcn new file mode 100644 index 0000000..13a2558 --- /dev/null +++ b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070209_record_of_set_of_and_arrays/Pos_070209_record_of_set_of_and_arrays_002/Pos_070209_record_of_set_of_and_arrays_002.ttcn @@ -0,0 +1,91 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:7.2.9, Ensure that record of and set of and array values shall be encoded as JSON.Arrays + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + TTCN-3 record of, set of and array values shall be encoded in JSON as arrays. The elements of the array shall be the JSON representations of the corresponding TTCN-3 elements. + JSON array elements shall appear in the same order as in the TTCN-3 value. + * */ + +module Pos_070209_record_of_set_of_and_arrays_002 { + + import from JSON all; + + + type set of integer MySetofIntType with { encode "JSON" }; + + template MySetofIntType m_msg := {1,2,3,4,5,6,7,8,9}; // encoding set as JSON array + /* { + * "Pos_070209_record_of_set_of_and_arrays_001.MySetofIntType": [1,2,3,4,5,6,7,8,9] + * } + */ + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw with { encode "Text" }; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference JSON file and returns true if they represent the same JSON structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the JSON data + * @param p_referenceJsonFile the JSON data + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference JSON file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceJsonFile represent the same JSON data + */ + external function matchFile(Raw p_textToMatch, File p_referenceJsonFile, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070209_record_of_set_of_and_arrays_002() runs on C system C { + + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference JSON file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("JSON message: ", v_rcv); + if (matchFile(v_rcv, "Pos_070209_record_of_set_of_and_arrays_002.json", v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference JSON"); + } + [] p.receive { + setverdict(fail, "JSON decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070209_record_of_set_of_and_arrays_002(), PX_TC_EXECUTION_TIMEOUT); + } + +} \ No newline at end of file diff --git a/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070209_record_of_set_of_and_arrays/Pos_070209_record_of_set_of_and_arrays_003/Pos_070209_record_of_set_of_and_arrays_003.json b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070209_record_of_set_of_and_arrays/Pos_070209_record_of_set_of_and_arrays_003/Pos_070209_record_of_set_of_and_arrays_003.json new file mode 100644 index 0000000..77806de --- /dev/null +++ b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070209_record_of_set_of_and_arrays/Pos_070209_record_of_set_of_and_arrays_003/Pos_070209_record_of_set_of_and_arrays_003.json @@ -0,0 +1,3 @@ +{ + "Pos_070209_record_of_set_of_and_arrays_003.MyIntArray": [1,2,3,4,5,6,7,8,9] +} diff --git a/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070209_record_of_set_of_and_arrays/Pos_070209_record_of_set_of_and_arrays_003/Pos_070209_record_of_set_of_and_arrays_003.ttcn b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070209_record_of_set_of_and_arrays/Pos_070209_record_of_set_of_and_arrays_003/Pos_070209_record_of_set_of_and_arrays_003.ttcn new file mode 100644 index 0000000..9d2f84b --- /dev/null +++ b/json/07_using_json_to_exchange_data/0702_json_representations_of_ttcn-3_values/070209_record_of_set_of_and_arrays/Pos_070209_record_of_set_of_and_arrays_003/Pos_070209_record_of_set_of_and_arrays_003.ttcn @@ -0,0 +1,91 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:7.2.9, Ensure that record of and set of and array values shall be encoded as JSON.Arrays + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + TTCN-3 record of, set of and array values shall be encoded in JSON as arrays. The elements of the array shall be the JSON representations of the corresponding TTCN-3 elements. + JSON array elements shall appear in the same order as in the TTCN-3 value. + * */ + +module Pos_070209_record_of_set_of_and_arrays_003 { + + import from JSON all; + + + type integer MyIntArray[9] with { encode "JSON" }; + + template MyIntArray m_msg := {1,2,3,4,5,6,7,8,9}; // encoding record as JSON array + /* { + * "Pos_070209_record_of_set_of_and_arrays_003.MyIntArray": [1,2,3,4,5,6,7,8,9] + * } + */ + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw with { encode "Text" }; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference JSON file and returns true if they represent the same JSON structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the JSON data + * @param p_referenceJsonFile the JSON data + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference JSON file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceJsonFile represent the same JSON data + */ + external function matchFile(Raw p_textToMatch, File p_referenceJsonFile, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070209_record_of_set_of_and_arrays_003() runs on C system C { + + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference JSON file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("JSON message: ", v_rcv); + if (matchFile(v_rcv, "Pos_070209_record_of_set_of_and_arrays_003.json", v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference JSON"); + } + [] p.receive { + setverdict(fail, "JSON decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070209_record_of_set_of_and_arrays_003(), PX_TC_EXECUTION_TIMEOUT); + } + +} \ No newline at end of file diff --git a/json/A_ttcn3_module_json/Note.txt b/json/A_ttcn3_module_json/Note.txt new file mode 100644 index 0000000..ccecfc2 --- /dev/null +++ b/json/A_ttcn3_module_json/Note.txt @@ -0,0 +1 @@ +No test cases needed here. diff --git a/json/B_encoding_instructions/B1_toplevel/Note.txt b/json/B_encoding_instructions/B1_toplevel/Note.txt new file mode 100644 index 0000000..3272254 --- /dev/null +++ b/json/B_encoding_instructions/B1_toplevel/Note.txt @@ -0,0 +1 @@ +General part, no test case required. diff --git a/json/B_encoding_instructions/B2_the_json_encode_attribute/Pos_B2_the_json_encode_attribute_001/Pos_B2_the_json_encode_attribute_001.json b/json/B_encoding_instructions/B2_the_json_encode_attribute/Pos_B2_the_json_encode_attribute_001/Pos_B2_the_json_encode_attribute_001.json new file mode 100644 index 0000000..e845d89 --- /dev/null +++ b/json/B_encoding_instructions/B2_the_json_encode_attribute/Pos_B2_the_json_encode_attribute_001/Pos_B2_the_json_encode_attribute_001.json @@ -0,0 +1,3 @@ +{ + "charstring":"abcd" +} diff --git a/json/B_encoding_instructions/B2_the_json_encode_attribute/Pos_B2_the_json_encode_attribute_001/Pos_B2_the_json_encode_attribute_001.ttcn b/json/B_encoding_instructions/B2_the_json_encode_attribute/Pos_B2_the_json_encode_attribute_001/Pos_B2_the_json_encode_attribute_001.ttcn new file mode 100644 index 0000000..b7bdc1a --- /dev/null +++ b/json/B_encoding_instructions/B2_the_json_encode_attribute/Pos_B2_the_json_encode_attribute_001/Pos_B2_the_json_encode_attribute_001.ttcn @@ -0,0 +1,85 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:B.2, Verify that JSON encode attribute work propely. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + * The TTCN-3 encode attribute shall be used to identify that the definitions in the scope unit to which this + * attribute is attached shall be encoded in the following formats "JSON" or "JSON RFC7159" + * Applicable to (TTCN-3): Module, group, definition. + */ + +module Pos_B2_the_json_encode_attribute_001{ + + import from JSON all; + + template charstring m_msg := "abcd" with { encode "JSON" }; + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw with { encode "Text"}; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference JSON file and returns true if they represent the same JSON structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the JSON data + * @param p_referenceJsonFile the JSON data + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference JSON file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceJsonFile represent the same JSON data + */ + external function matchFile(Raw p_textToMatch, File p_referenceJsonFile, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_B2_the_json_encode_attribute_001() runs on C system C { + + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference JSON file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("JSON message: ", v_rcv); + if (matchFile(v_rcv, "Pos_B2_the_json_encode_attribute_001.json", v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference JSON"); + } + [] p.receive { + setverdict(fail, "JSON decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_B2_the_json_encode_attribute_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} \ No newline at end of file diff --git a/json/B_encoding_instructions/B2_the_json_encode_attribute/Pos_B2_the_json_encode_attribute_002/Pos_B2_the_json_encode_attribute_002.json b/json/B_encoding_instructions/B2_the_json_encode_attribute/Pos_B2_the_json_encode_attribute_002/Pos_B2_the_json_encode_attribute_002.json new file mode 100644 index 0000000..85df507 --- /dev/null +++ b/json/B_encoding_instructions/B2_the_json_encode_attribute/Pos_B2_the_json_encode_attribute_002/Pos_B2_the_json_encode_attribute_002.json @@ -0,0 +1 @@ +abcd \ No newline at end of file diff --git a/json/B_encoding_instructions/B2_the_json_encode_attribute/Pos_B2_the_json_encode_attribute_002/Pos_B2_the_json_encode_attribute_002.ttcn b/json/B_encoding_instructions/B2_the_json_encode_attribute/Pos_B2_the_json_encode_attribute_002/Pos_B2_the_json_encode_attribute_002.ttcn new file mode 100644 index 0000000..ce7be5b --- /dev/null +++ b/json/B_encoding_instructions/B2_the_json_encode_attribute/Pos_B2_the_json_encode_attribute_002/Pos_B2_the_json_encode_attribute_002.ttcn @@ -0,0 +1,85 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:B.2, Verify that JSON encode attribute work propely. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + * The TTCN-3 encode attribute shall be used to identify that the definitions in the scope unit to which this + * attribute is attached shall be encoded in the following formats "JSON" or "JSON RFC7159". + * Applicable to (TTCN-3): Module, group, definition. + */ + +module Pos_B2_the_json_encode_attribute_002{ + + import from JSON all; + + template charstring m_msg := "abcd" with { encode "JSON RFC7159" }; + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw with { encode "Text"}; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference JSON file and returns true if they represent the same JSON structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the JSON data + * @param p_referenceJsonFile the JSON data + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference JSON file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceJsonFile represent the same JSON data + */ + external function matchFile(Raw p_textToMatch, File p_referenceJsonFile, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_B2_the_json_encode_attribute_002() runs on C system C { + + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference JSON file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("JSON message: ", v_rcv); + if (matchFile(v_rcv, "Pos_B2_the_json_encode_attribute_002.json", v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference JSON"); + } + [] p.receive { + setverdict(fail, "JSON decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_B2_the_json_encode_attribute_002(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/json/B_encoding_instructions/B2_the_json_encode_attribute/Pos_B2_the_json_encode_attribute_003/Pos_B2_the_json_encode_attribute_003.json b/json/B_encoding_instructions/B2_the_json_encode_attribute/Pos_B2_the_json_encode_attribute_003/Pos_B2_the_json_encode_attribute_003.json new file mode 100644 index 0000000..e845d89 --- /dev/null +++ b/json/B_encoding_instructions/B2_the_json_encode_attribute/Pos_B2_the_json_encode_attribute_003/Pos_B2_the_json_encode_attribute_003.json @@ -0,0 +1,3 @@ +{ + "charstring":"abcd" +} diff --git a/json/B_encoding_instructions/B2_the_json_encode_attribute/Pos_B2_the_json_encode_attribute_003/Pos_B2_the_json_encode_attribute_003.ttcn b/json/B_encoding_instructions/B2_the_json_encode_attribute/Pos_B2_the_json_encode_attribute_003/Pos_B2_the_json_encode_attribute_003.ttcn new file mode 100644 index 0000000..261e0d3 --- /dev/null +++ b/json/B_encoding_instructions/B2_the_json_encode_attribute/Pos_B2_the_json_encode_attribute_003/Pos_B2_the_json_encode_attribute_003.ttcn @@ -0,0 +1,88 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:B.2, Verify that JSON encode attribute work propely. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + * The TTCN-3 encode attribute shall be used to identify that the definitions in the scope unit to which this + * attribute is attached shall be encoded in the following formats "JSON" or "JSON RFC7159" + * Applicable to (TTCN-3): Module, group, definition. + */ + +module Pos_B2_the_json_encode_attribute_003{ + + import from JSON all; + + template charstring m_msg := "abcd"; + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw with { encode "Text"}; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference JSON file and returns true if they represent the same JSON structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the JSON data + * @param p_referenceJsonFile the JSON data + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference JSON file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceJsonFile represent the same JSON data + */ + external function matchFile(Raw p_textToMatch, File p_referenceJsonFile, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_B2_the_json_encode_attribute_003() runs on C system C { + + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference JSON file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("JSON message: ", v_rcv); + if (matchFile(v_rcv, "Pos_B2_the_json_encode_attribute_003.json", v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference JSON"); + } + [] p.receive { + setverdict(fail, "JSON decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + + control { + execute(TC_Pos_B2_the_json_encode_attribute_003(), PX_TC_EXECUTION_TIMEOUT); + } + +} with { encode "JSON" } + + diff --git a/json/B_encoding_instructions/B2_the_json_encode_attribute/Pos_B2_the_json_encode_attribute_004/Pos_B2_the_json_encode_attribute_004.json b/json/B_encoding_instructions/B2_the_json_encode_attribute/Pos_B2_the_json_encode_attribute_004/Pos_B2_the_json_encode_attribute_004.json new file mode 100644 index 0000000..e845d89 --- /dev/null +++ b/json/B_encoding_instructions/B2_the_json_encode_attribute/Pos_B2_the_json_encode_attribute_004/Pos_B2_the_json_encode_attribute_004.json @@ -0,0 +1,3 @@ +{ + "charstring":"abcd" +} diff --git a/json/B_encoding_instructions/B2_the_json_encode_attribute/Pos_B2_the_json_encode_attribute_004/Pos_B2_the_json_encode_attribute_004.ttcn b/json/B_encoding_instructions/B2_the_json_encode_attribute/Pos_B2_the_json_encode_attribute_004/Pos_B2_the_json_encode_attribute_004.ttcn new file mode 100644 index 0000000..a7e6adf --- /dev/null +++ b/json/B_encoding_instructions/B2_the_json_encode_attribute/Pos_B2_the_json_encode_attribute_004/Pos_B2_the_json_encode_attribute_004.ttcn @@ -0,0 +1,88 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:B.2, Verify that JSON encode attribute work propely. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + * The TTCN-3 encode attribute shall be used to identify that the definitions in the scope unit to which this + * attribute is attached shall be encoded in the following formats "JSON" or "JSON RFC7159" + * Applicable to (TTCN-3): Module, group, definition. + */ + +module Pos_B2_the_json_encode_attribute_004{ + + import from JSON all; + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw with { encode "Text"}; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference JSON file and returns true if they represent the same JSON structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the JSON data + * @param p_referenceJsonFile the JSON data + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference JSON file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceJsonFile represent the same JSON data + */ + external function matchFile(Raw p_textToMatch, File p_referenceJsonFile, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + + group TYPEDEF_GROUP { + testcase TC_Pos_B2_the_json_encode_attribute_004() runs on C system C { + + var Raw v_rcv; + var universal charstring v_matchError; + + template charstring m_msg := "abcd"; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference JSON file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("JSON message: ", v_rcv); + if (matchFile(v_rcv, "Pos_B2_the_json_encode_attribute_004.json", v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference JSON"); + } + [] p.receive { + setverdict(fail, "JSON decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + } with { encode "JSON" } + + control { + execute(TC_Pos_B2_the_json_encode_attribute_004(), PX_TC_EXECUTION_TIMEOUT); + } +} + diff --git a/json/B_encoding_instructions/B3_ecoding_instructions/B301_toplevel/Note.txt b/json/B_encoding_instructions/B3_ecoding_instructions/B301_toplevel/Note.txt new file mode 100644 index 0000000..3272254 --- /dev/null +++ b/json/B_encoding_instructions/B3_ecoding_instructions/B301_toplevel/Note.txt @@ -0,0 +1 @@ +General part, no test case required. diff --git a/json/B_encoding_instructions/B3_ecoding_instructions/B302_json_type_identification/Pos_B302_json_type_identification_001/Pos_B302_json_type_identification_001.json b/json/B_encoding_instructions/B3_ecoding_instructions/B302_json_type_identification/Pos_B302_json_type_identification_001/Pos_B302_json_type_identification_001.json new file mode 100644 index 0000000..28631bf --- /dev/null +++ b/json/B_encoding_instructions/B3_ecoding_instructions/B302_json_type_identification/Pos_B302_json_type_identification_001/Pos_B302_json_type_identification_001.json @@ -0,0 +1,3 @@ +{ + "Pos_B302_json_type_identification_001.MyString":"abcd" +} diff --git a/json/B_encoding_instructions/B3_ecoding_instructions/B302_json_type_identification/Pos_B302_json_type_identification_001/Pos_B302_json_type_identification_001.ttcn b/json/B_encoding_instructions/B3_ecoding_instructions/B302_json_type_identification/Pos_B302_json_type_identification_001/Pos_B302_json_type_identification_001.ttcn new file mode 100644 index 0000000..a1f50e9 --- /dev/null +++ b/json/B_encoding_instructions/B3_ecoding_instructions/B302_json_type_identification/Pos_B302_json_type_identification_001/Pos_B302_json_type_identification_001.ttcn @@ -0,0 +1,87 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:B.3.2, Verify that JSON type identification attribute work propely. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + * These encoding instructions are typically should not appear in TTCN-3 module describing a JSON Schema. + * They are attached to the TTCN‑3 type definitions of the module named JSON in Annex A + * of the present document, corresponding to JSON "types" and literal values, and normally + * should be imported from this module. + */ + +module Pos_B302_json_type_identification_001{ + + import from JSON all; + + type charstring MyString with { variant "JSON:string" }; + template MyString m_msg := "abcd"; + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw with { encode "Text"}; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference JSON file and returns true if they represent the same JSON structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the JSON data + * @param p_referenceJsonFile the JSON data + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference JSON file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceJsonFile represent the same JSON data + */ + external function matchFile(Raw p_textToMatch, File p_referenceJsonFile, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_B302_json_type_identification_001() runs on C system C { + + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference JSON file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("JSON message: ", v_rcv); + if (matchFile(v_rcv, "Pos_B302_json_type_identification_001.json", v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference JSON"); + } + [] p.receive { + setverdict(fail, "JSON decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_B302_json_type_identification_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} with { encode "JSON"} diff --git a/json/B_encoding_instructions/B3_ecoding_instructions/B303_normalizing_json_values/Pos_B303_normalizing_json_values_001/Pos_B303_normalizing_json_values_001.json b/json/B_encoding_instructions/B3_ecoding_instructions/B303_normalizing_json_values/Pos_B303_normalizing_json_values_001/Pos_B303_normalizing_json_values_001.json new file mode 100644 index 0000000..3ca8c53 --- /dev/null +++ b/json/B_encoding_instructions/B3_ecoding_instructions/B303_normalizing_json_values/Pos_B303_normalizing_json_values_001/Pos_B303_normalizing_json_values_001.json @@ -0,0 +1,2 @@ +{ "charstring" : "abcd efgh" +} diff --git a/json/B_encoding_instructions/B3_ecoding_instructions/B303_normalizing_json_values/Pos_B303_normalizing_json_values_001/Pos_B303_normalizing_json_values_001.ttcn b/json/B_encoding_instructions/B3_ecoding_instructions/B303_normalizing_json_values/Pos_B303_normalizing_json_values_001/Pos_B303_normalizing_json_values_001.ttcn new file mode 100644 index 0000000..74f1d7d --- /dev/null +++ b/json/B_encoding_instructions/B3_ecoding_instructions/B303_normalizing_json_values/Pos_B303_normalizing_json_values_001/Pos_B303_normalizing_json_values_001.ttcn @@ -0,0 +1,82 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:B.3.3, Verify that "normalize" variant work propely. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Pos_B303_normalizing_json_values_001{ + + import from JSON all; + + // charstring with horizontal tabulator, line feed and carriage return + template charstring m_msg := "abcd" & char(UA) & char(U20) & char(UD) & "efgh" with { encode "JSON"; variant "normalize" }; + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw with { encode "Text"}; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference JSON file and returns true if they represent the same JSON structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the JSON data + * @param p_referenceJsonFile the JSON data + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference JSON file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceJsonFile represent the same JSON data + */ + external function matchFile(Raw p_textToMatch, File p_referenceJsonFile, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_B303_normalizing_json_values_001() runs on C system C { + + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference JSON file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("JSON message: ", v_rcv); + if (matchFile(v_rcv, "Pos_B303_normalizing_json_values_001.json", v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference JSON"); + } + [] p.receive { + setverdict(fail, "JSON decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_B303_normalizing_json_values_001(), PX_TC_EXECUTION_TIMEOUT); + } + + +} \ No newline at end of file diff --git a/json/B_encoding_instructions/B3_ecoding_instructions/B304_name_as/Pos_B304_name_as_001/Pos_B304_name_as_001.json b/json/B_encoding_instructions/B3_ecoding_instructions/B304_name_as/Pos_B304_name_as_001/Pos_B304_name_as_001.json new file mode 100644 index 0000000..b3beaa2 --- /dev/null +++ b/json/B_encoding_instructions/B3_ecoding_instructions/B304_name_as/Pos_B304_name_as_001/Pos_B304_name_as_001.json @@ -0,0 +1,6 @@ +{ + "Pos_B304_name_as_001.MyRec": + { "IntegerValue": 5, + "CharStringValue": "abcdef" + } +} diff --git a/json/B_encoding_instructions/B3_ecoding_instructions/B304_name_as/Pos_B304_name_as_001/Pos_B304_name_as_001.ttcn b/json/B_encoding_instructions/B3_ecoding_instructions/B304_name_as/Pos_B304_name_as_001/Pos_B304_name_as_001.ttcn new file mode 100644 index 0000000..a34ca45 --- /dev/null +++ b/json/B_encoding_instructions/B3_ecoding_instructions/B304_name_as/Pos_B304_name_as_001/Pos_B304_name_as_001.ttcn @@ -0,0 +1,93 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:B.3.4, Verify that "name as" variant work propely. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + * Gives the specified field a different name in the JSON representation. + */ + +module Pos_B304_name_as_001{ + + import from JSON all; + + type record MyRec { + integer int, + charstring charString + }with { encode "JSON"; + variant(int) "name as 'IntegerValue'"; + variant(charString) "name as 'CharStringValue'" + }; + + + template MyRec m_msg := {int := 5, charString := "abcdef"} + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw with { encode "Text"}; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference JSON file and returns true if they represent the same JSON structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the JSON data + * @param p_referenceJsonFile the JSON data + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference JSON file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceJsonFile represent the same JSON data + */ + external function matchFile(Raw p_textToMatch, File p_referenceJsonFile, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_B304_name_as_001() runs on C system C { + + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference JSON file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("JSON message: ", v_rcv); + if (matchFile(v_rcv, "Pos_B304_name_as_001.json", v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference JSON"); + } + [] p.receive { + setverdict(fail, "JSON decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_B304_name_as_001(), PX_TC_EXECUTION_TIMEOUT); + } + + +} \ No newline at end of file diff --git a/json/B_encoding_instructions/B3_ecoding_instructions/B305_number_of_fraction_digits/Pos_B305_number_of_fraction_digits_001/Pos_B305_number_of_fraction_digits_001.json b/json/B_encoding_instructions/B3_ecoding_instructions/B305_number_of_fraction_digits/Pos_B305_number_of_fraction_digits_001/Pos_B305_number_of_fraction_digits_001.json new file mode 100644 index 0000000..7125f54 --- /dev/null +++ b/json/B_encoding_instructions/B3_ecoding_instructions/B305_number_of_fraction_digits/Pos_B305_number_of_fraction_digits_001/Pos_B305_number_of_fraction_digits_001.json @@ -0,0 +1,3 @@ +{ + "JSON.Number":31.415E-1 +} diff --git a/json/B_encoding_instructions/B3_ecoding_instructions/B305_number_of_fraction_digits/Pos_B305_number_of_fraction_digits_001/Pos_B305_number_of_fraction_digits_001.ttcn b/json/B_encoding_instructions/B3_ecoding_instructions/B305_number_of_fraction_digits/Pos_B305_number_of_fraction_digits_001/Pos_B305_number_of_fraction_digits_001.ttcn new file mode 100644 index 0000000..885d7e0 --- /dev/null +++ b/json/B_encoding_instructions/B3_ecoding_instructions/B305_number_of_fraction_digits/Pos_B305_number_of_fraction_digits_001/Pos_B305_number_of_fraction_digits_001.ttcn @@ -0,0 +1,81 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:B.3.5, Verify that fractionDigits for float numbers are correctly used. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + The "fractionDigits" encoding instruction, at encoding constraints the maximum number of fractional digits following the decimal point in the encoded JSON value. + */ + +module Pos_B305_number_of_fraction_digits_001 { + + import from JSON all; + + template Number m_msg := 3.1415 with {encode "JSON"; variant "fractionDigits 3"}; + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw with {encode "Text"}; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference JSON file and returns true if they represent the same JSON structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the JSON data + * @param p_referenceJsonFile the JSON data + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference JSON file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceJsonFile represent the same JSON data + */ + external function matchFile(Raw p_textToMatch, File p_referenceJsonFile, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_B305_number_of_fraction_digits_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference JSON file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("JSON message: ", v_rcv); + if (matchFile(v_rcv, "Pos_B305_number_of_fraction_digits_001.json", v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference JSON"); + } + [] p.receive { + setverdict(fail, "JSON decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_B305_number_of_fraction_digits_001(), PX_TC_EXECUTION_TIMEOUT); + } +} \ No newline at end of file diff --git a/json/B_encoding_instructions/B3_ecoding_instructions/B305_number_of_fraction_digits/Pos_B305_number_of_fraction_digits_002/Pos_B305_number_of_fraction_digits_002.json b/json/B_encoding_instructions/B3_ecoding_instructions/B305_number_of_fraction_digits/Pos_B305_number_of_fraction_digits_002/Pos_B305_number_of_fraction_digits_002.json new file mode 100644 index 0000000..f4c0987 --- /dev/null +++ b/json/B_encoding_instructions/B3_ecoding_instructions/B305_number_of_fraction_digits/Pos_B305_number_of_fraction_digits_002/Pos_B305_number_of_fraction_digits_002.json @@ -0,0 +1,3 @@ +{ + "JSON.Number":31415E-4 +} diff --git a/json/B_encoding_instructions/B3_ecoding_instructions/B305_number_of_fraction_digits/Pos_B305_number_of_fraction_digits_002/Pos_B305_number_of_fraction_digits_002.ttcn b/json/B_encoding_instructions/B3_ecoding_instructions/B305_number_of_fraction_digits/Pos_B305_number_of_fraction_digits_002/Pos_B305_number_of_fraction_digits_002.ttcn new file mode 100644 index 0000000..2a4c6ee --- /dev/null +++ b/json/B_encoding_instructions/B3_ecoding_instructions/B305_number_of_fraction_digits/Pos_B305_number_of_fraction_digits_002/Pos_B305_number_of_fraction_digits_002.ttcn @@ -0,0 +1,81 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:B.3.5, Verify that fractionDigits for float numbers are correctly used. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + The "fractionDigits" encoding instruction, at encoding constraints the maximum number of fractional digits following the decimal point in the encoded JSON value. + */ + +module Pos_B305_number_of_fraction_digits_002 { + + import from JSON all; + + template Number m_msg := 3.1415 with {encode "JSON"; variant "fractionDigits 0"}; + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw with {encode "Text"}; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference JSON file and returns true if they represent the same JSON structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the JSON data + * @param p_referenceJsonFile the JSON data + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference JSON file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceJsonFile represent the same JSON data + */ + external function matchFile(Raw p_textToMatch, File p_referenceJsonFile, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_B305_number_of_fraction_digits_002() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference JSON file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("JSON message: ", v_rcv); + if (matchFile(v_rcv, "Pos_B305_number_of_fraction_digits_002.json", v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference JSON"); + } + [] p.receive { + setverdict(fail, "JSON decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_B305_number_of_fraction_digits_002(), PX_TC_EXECUTION_TIMEOUT); + } +} \ No newline at end of file diff --git a/json/B_encoding_instructions/B3_ecoding_instructions/B306_use_the_minus_sign/Pos_B306_use_the_minus_sign_001/Pos_B306_use_the_minus_sign_001.json b/json/B_encoding_instructions/B3_ecoding_instructions/B306_use_the_minus_sign/Pos_B306_use_the_minus_sign_001/Pos_B306_use_the_minus_sign_001.json new file mode 100644 index 0000000..7430a73 --- /dev/null +++ b/json/B_encoding_instructions/B3_ecoding_instructions/B306_use_the_minus_sign/Pos_B306_use_the_minus_sign_001/Pos_B306_use_the_minus_sign_001.json @@ -0,0 +1,3 @@ +{ + "JSON.Number": -3.1415 +} diff --git a/json/B_encoding_instructions/B3_ecoding_instructions/B306_use_the_minus_sign/Pos_B306_use_the_minus_sign_001/Pos_B306_use_the_minus_sign_001.ttcn b/json/B_encoding_instructions/B3_ecoding_instructions/B306_use_the_minus_sign/Pos_B306_use_the_minus_sign_001/Pos_B306_use_the_minus_sign_001.ttcn new file mode 100644 index 0000000..2df98e1 --- /dev/null +++ b/json/B_encoding_instructions/B3_ecoding_instructions/B306_use_the_minus_sign/Pos_B306_use_the_minus_sign_001/Pos_B306_use_the_minus_sign_001.ttcn @@ -0,0 +1,86 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:B.3.6, Verify that useMinus for float numbers is correctly used. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + * By default, without the "useMinus" instruction, JSON numbers are decoded to TTCN-3 JSON.Number + * and IEEE 754 float useful types by their values; i.e. all the -0.0, 0.0, -0e, 0e, + * -0E, 0E, -0 and 0 JSON values are decoded in TTCN-3 as 0.0 for JSON.Number types + * and as 0 for JSON.Integer types (i.e. without the minus sign), where is any positive or + * negative integer number. + * */ + +module Pos_B306_use_the_minus_sign_001 { + + import from JSON all; + + template Number m_msg := -3.1415 with {encode "JSON"; variant "useMinus"}; + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw with {encode "Text"}; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference JSON file and returns true if they represent the same JSON structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the JSON data + * @param p_referenceJsonFile the JSON data + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference JSON file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceJsonFile represent the same JSON data + */ + external function matchFile(Raw p_textToMatch, File p_referenceJsonFile, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_B306_use_the_minus_sign_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference JSON file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("JSON message: ", v_rcv); + if (matchFile(v_rcv, "Pos_B306_use_the_minus_sign_001.json", v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference JSON"); + } + [] p.receive { + setverdict(fail, "JSON decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_B306_use_the_minus_sign_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} \ No newline at end of file diff --git a/json/B_encoding_instructions/B3_ecoding_instructions/B306_use_the_minus_sign/Pos_B306_use_the_minus_sign_002/Pos_B306_use_the_minus_sign_002.json b/json/B_encoding_instructions/B3_ecoding_instructions/B306_use_the_minus_sign/Pos_B306_use_the_minus_sign_002/Pos_B306_use_the_minus_sign_002.json new file mode 100644 index 0000000..aa249f8 --- /dev/null +++ b/json/B_encoding_instructions/B3_ecoding_instructions/B306_use_the_minus_sign/Pos_B306_use_the_minus_sign_002/Pos_B306_use_the_minus_sign_002.json @@ -0,0 +1,3 @@ +{ +"JSON.Integer": 31 +} diff --git a/json/B_encoding_instructions/B3_ecoding_instructions/B306_use_the_minus_sign/Pos_B306_use_the_minus_sign_002/Pos_B306_use_the_minus_sign_002.ttcn b/json/B_encoding_instructions/B3_ecoding_instructions/B306_use_the_minus_sign/Pos_B306_use_the_minus_sign_002/Pos_B306_use_the_minus_sign_002.ttcn new file mode 100644 index 0000000..bc28c3b --- /dev/null +++ b/json/B_encoding_instructions/B3_ecoding_instructions/B306_use_the_minus_sign/Pos_B306_use_the_minus_sign_002/Pos_B306_use_the_minus_sign_002.ttcn @@ -0,0 +1,83 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:B.3.6, Verify that useMinus has no effect on integers. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + The "useMinus" encoding instruction, when applied to a JSON.Number type, + * instructs the decoder to decode the JSON values -0.0, -0e, -0E and -0 in TTCN-3 as negative float numbers, i.e. together with their minus sign. The instruction has no effect on JSON.Integer types. + * */ + +module Pos_B306_use_the_minus_sign_002 { + + import from JSON all; + + template Integer m_msg := 31 with {encode "JSON"; variant "useMinus"}; // ensure that useMinus does not has effect on JSON.Integer + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw with {encode "Text"}; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference JSON file and returns true if they represent the same JSON structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the JSON data + * @param p_referenceJsonFile the JSON data + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference JSON file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceJsonFile represent the same JSON data + */ + external function matchFile(Raw p_textToMatch, File p_referenceJsonFile, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_B306_use_the_minus_sign_002() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference JSON file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("JSON message: ", v_rcv); + if (matchFile(v_rcv, "Pos_B306_use_the_minus_sign_002.json", v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference JSON"); + } + [] p.receive { + setverdict(fail, "JSON decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_B306_use_the_minus_sign_002(), PX_TC_EXECUTION_TIMEOUT); + } + +} \ No newline at end of file diff --git a/json/B_encoding_instructions/B3_ecoding_instructions/B307_escape_as/Pos_B307_escape_as_001/Pos_B307_escape_as_001.json b/json/B_encoding_instructions/B3_ecoding_instructions/B307_escape_as/Pos_B307_escape_as_001/Pos_B307_escape_as_001.json new file mode 100644 index 0000000..9314182 --- /dev/null +++ b/json/B_encoding_instructions/B3_ecoding_instructions/B307_escape_as/Pos_B307_escape_as_001/Pos_B307_escape_as_001.json @@ -0,0 +1,3 @@ +{ + "JSON.String": "ab\u0007\tcd" +} diff --git a/json/B_encoding_instructions/B3_ecoding_instructions/B307_escape_as/Pos_B307_escape_as_001/Pos_B307_escape_as_001.ttcn b/json/B_encoding_instructions/B3_ecoding_instructions/B307_escape_as/Pos_B307_escape_as_001/Pos_B307_escape_as_001.ttcn new file mode 100644 index 0000000..f8f05c9 --- /dev/null +++ b/json/B_encoding_instructions/B3_ecoding_instructions/B307_escape_as/Pos_B307_escape_as_001/Pos_B307_escape_as_001.ttcn @@ -0,0 +1,85 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:B.3.7, Verify that "escape as short" for strings is correctly used. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + * The "escape as short" encoding instruction tells the encoder that all characters in the TTCN-3 value, + * which has short escape sequences defined (see IETF® RFC 7159 [0] and clause 6.4.2), shall be encoded + * using the short escape sequence. + * */ + +module Pos_B307_escape_as_001 { + + import from JSON all; + + template String m_msg := "ab" & char(U7) & cu_ht & "cd" with { encode "JSON"; variant "escape as short"}; + // the json should be: { "string": "ab\u0007\tcd" } + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw with { encode "Text"}; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference JSON file and returns true if they represent the same JSON structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the JSON data + * @param p_referenceJsonFile the JSON data + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference JSON file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceJsonFile represent the same JSON data + */ + external function matchFile(Raw p_textToMatch, File p_referenceJsonFile, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_B307_escape_as_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference JSON file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("JSON message: ", v_rcv); + if (matchFile(v_rcv, "Pos_B307_escape_as_001.json", v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference JSON"); + } + [] p.receive { + setverdict(fail, "JSON decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_B307_escape_as_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} \ No newline at end of file diff --git a/json/B_encoding_instructions/B3_ecoding_instructions/B307_escape_as/Pos_B307_escape_as_002/Pos_B307_escape_as_002.json b/json/B_encoding_instructions/B3_ecoding_instructions/B307_escape_as/Pos_B307_escape_as_002/Pos_B307_escape_as_002.json new file mode 100644 index 0000000..f82988d --- /dev/null +++ b/json/B_encoding_instructions/B3_ecoding_instructions/B307_escape_as/Pos_B307_escape_as_002/Pos_B307_escape_as_002.json @@ -0,0 +1,3 @@ +{ + "JSON.String": "ab\u0007\u0009cd" +} diff --git a/json/B_encoding_instructions/B3_ecoding_instructions/B307_escape_as/Pos_B307_escape_as_002/Pos_B307_escape_as_002.ttcn b/json/B_encoding_instructions/B3_ecoding_instructions/B307_escape_as/Pos_B307_escape_as_002/Pos_B307_escape_as_002.ttcn new file mode 100644 index 0000000..427e3d0 --- /dev/null +++ b/json/B_encoding_instructions/B3_ecoding_instructions/B307_escape_as/Pos_B307_escape_as_002/Pos_B307_escape_as_002.ttcn @@ -0,0 +1,84 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:B.3.7, Verify that "escape as usi" for strings is correctly used. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + * The "escape as usi" encoding instruction tells the encoder that all characters in the TTCN-3 + * value shall be encoded using the USI-like escape sequence "\u". + * */ + +module Pos_B307_escape_as_002 { + + import from JSON all; + + template String m_msg := "ab" & char(U7) & cu_ht & "cd" with { encode "JSON"; variant "escape as usi"}; + // the json should be: { "string": "ab\u0007\u0009cd" } + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw with { encode "Text"}; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference JSON file and returns true if they represent the same JSON structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the JSON data + * @param p_referenceJsonFile the JSON data + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference JSON file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceJsonFile represent the same JSON data + */ + external function matchFile(Raw p_textToMatch, File p_referenceJsonFile, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_B307_escape_as_002() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference JSON file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("JSON message: ", v_rcv); + if (matchFile(v_rcv, "Pos_B307_escape_as_002.json", v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference JSON"); + } + [] p.receive { + setverdict(fail, "JSON decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_B307_escape_as_002(), PX_TC_EXECUTION_TIMEOUT); + } + +} \ No newline at end of file diff --git a/json/B_encoding_instructions/B3_ecoding_instructions/B307_escape_as/Pos_B307_escape_as_003/Pos_B307_escape_as_003.json b/json/B_encoding_instructions/B3_ecoding_instructions/B307_escape_as/Pos_B307_escape_as_003/Pos_B307_escape_as_003.json new file mode 100644 index 0000000..9314182 --- /dev/null +++ b/json/B_encoding_instructions/B3_ecoding_instructions/B307_escape_as/Pos_B307_escape_as_003/Pos_B307_escape_as_003.json @@ -0,0 +1,3 @@ +{ + "JSON.String": "ab\u0007\tcd" +} diff --git a/json/B_encoding_instructions/B3_ecoding_instructions/B307_escape_as/Pos_B307_escape_as_003/Pos_B307_escape_as_003.ttcn b/json/B_encoding_instructions/B3_ecoding_instructions/B307_escape_as/Pos_B307_escape_as_003/Pos_B307_escape_as_003.ttcn new file mode 100644 index 0000000..0acf7d3 --- /dev/null +++ b/json/B_encoding_instructions/B3_ecoding_instructions/B307_escape_as/Pos_B307_escape_as_003/Pos_B307_escape_as_003.ttcn @@ -0,0 +1,84 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:B.3.7, Verify that "escape as transparent" for strings is correctly used. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + * The "escape as transparent" encoding instruction tells the encoder that characters in the TTCN-3 value shall not be escaped in their JSON + * representation, except the C0 control characters (present in the TTCN-3 value in the char(…) representation). + * */ + +module Pos_B307_escape_as_003 { + + import from JSON all; + + template String m_msg := "ab" & char(U7) & cu_ht & "cd" with { encode "JSON"; variant "escape as transparent"}; + // the json should be: { "string": "ab\u0007\tcd" } + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw with { encode "Text"}; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference JSON file and returns true if they represent the same JSON structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the JSON data + * @param p_referenceJsonFile the JSON data + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference JSON file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceJsonFile represent the same JSON data + */ + external function matchFile(Raw p_textToMatch, File p_referenceJsonFile, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_B307_escape_as_003() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference JSON file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("JSON message: ", v_rcv); + if (matchFile(v_rcv, "Pos_B307_escape_as_003.json", v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference JSON"); + } + [] p.receive { + setverdict(fail, "JSON decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_B307_escape_as_003(), PX_TC_EXECUTION_TIMEOUT); + } + +} \ No newline at end of file diff --git a/json/B_encoding_instructions/B3_ecoding_instructions/B308_omit_as_null/Pos_B308_omit_as_null_001/Pos_B308_omit_as_null_001.json b/json/B_encoding_instructions/B3_ecoding_instructions/B308_omit_as_null/Pos_B308_omit_as_null_001/Pos_B308_omit_as_null_001.json new file mode 100644 index 0000000..8aed153 --- /dev/null +++ b/json/B_encoding_instructions/B3_ecoding_instructions/B308_omit_as_null/Pos_B308_omit_as_null_001/Pos_B308_omit_as_null_001.json @@ -0,0 +1,7 @@ +{ + "Pos_B308_omit_as_null_001.MyRecord": + { + "int": null, + "MyCharString" : "abcdef" + } +} diff --git a/json/B_encoding_instructions/B3_ecoding_instructions/B308_omit_as_null/Pos_B308_omit_as_null_001/Pos_B308_omit_as_null_001.ttcn b/json/B_encoding_instructions/B3_ecoding_instructions/B308_omit_as_null/Pos_B308_omit_as_null_001/Pos_B308_omit_as_null_001.ttcn new file mode 100644 index 0000000..6b31494 --- /dev/null +++ b/json/B_encoding_instructions/B3_ecoding_instructions/B308_omit_as_null/Pos_B308_omit_as_null_001/Pos_B308_omit_as_null_001.ttcn @@ -0,0 +1,96 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:B.3.8, Verify that "omit as null" for record to object encode is correctly used. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + *If set, the value of the specified optional field will be encoded with the JSON literal 'null' + * if the value is omitted. By default omitted fields (both their name and value) are skipped + * entirely. The decoder ignores this attribute and accepts both versions. + * */ + +module Pos_B308_omit_as_null_001 { + + import from JSON all; + + type record MyRecord{ + integer int optional, + charstring MyCharString + } with { encode "JSON"; variant "omit as null" }; + + template MyRecord m_msg := {omit, "abcdef"}; // encoding record as JSON.Object + /* { "Pos_B308_omit_as_null_001.MyRecord": + { + "int": null, + "MyCharString" : "abcdef" + } + * } + */ + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw with {encode "Text"}; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference JSON file and returns true if they represent the same JSON structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the JSON data + * @param p_referenceJsonFile the JSON data + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference JSON file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceJsonFile represent the same JSON data + */ + external function matchFile(Raw p_textToMatch, File p_referenceJsonFile, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_B308_omit_as_null_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference JSON file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("JSON message: ", v_rcv); + if (matchFile(v_rcv, "Pos_B308_omit_as_null_001.json", v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference JSON"); + } + [] p.receive { + setverdict(fail, "JSON decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_B308_omit_as_null_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} \ No newline at end of file diff --git a/json/B_encoding_instructions/B3_ecoding_instructions/B308_omit_as_null/Pos_B308_omit_as_null_002/Pos_B308_omit_as_null_002.json b/json/B_encoding_instructions/B3_ecoding_instructions/B308_omit_as_null/Pos_B308_omit_as_null_002/Pos_B308_omit_as_null_002.json new file mode 100644 index 0000000..ae59046 --- /dev/null +++ b/json/B_encoding_instructions/B3_ecoding_instructions/B308_omit_as_null/Pos_B308_omit_as_null_002/Pos_B308_omit_as_null_002.json @@ -0,0 +1,7 @@ +{ + "Pos_B308_omit_as_null_002.MySet": + { + "int": null, + "MyCharString" : "abcdef" + } +} diff --git a/json/B_encoding_instructions/B3_ecoding_instructions/B308_omit_as_null/Pos_B308_omit_as_null_002/Pos_B308_omit_as_null_002.ttcn b/json/B_encoding_instructions/B3_ecoding_instructions/B308_omit_as_null/Pos_B308_omit_as_null_002/Pos_B308_omit_as_null_002.ttcn new file mode 100644 index 0000000..fa47a2c --- /dev/null +++ b/json/B_encoding_instructions/B3_ecoding_instructions/B308_omit_as_null/Pos_B308_omit_as_null_002/Pos_B308_omit_as_null_002.ttcn @@ -0,0 +1,96 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:B.3.8, Verify that "omit as null" for set to object encode is correctly used. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + *If set, the value of the specified optional field will be encoded with the JSON literal 'null' + * if the value is omitted. By default omitted fields (both their name and value) are skipped + * entirely. The decoder ignores this attribute and accepts both versions. + * */ + +module Pos_B308_omit_as_null_002 { + + import from JSON all; + + type set MySet{ + integer int optional, + charstring MyCharString + } with { encode "JSON"; variant "omit as null" }; + + template MySet m_msg := {omit, "abcdef"}; // encoding set as JSON.Object + /* { "Pos_B308_omit_as_null_002.MySet": + { + "int": null, + "MyCharString" : "abcdef" + } + * } + */ + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw with { encode "Text"}; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference JSON file and returns true if they represent the same JSON structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the JSON data + * @param p_referenceJsonFile the JSON data + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference JSON file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceJsonFile represent the same JSON data + */ + external function matchFile(Raw p_textToMatch, File p_referenceJsonFile, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_B308_omit_as_null_002() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference JSON file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("JSON message: ", v_rcv); + if (matchFile(v_rcv, "Pos_B308_omit_as_null_002.json", v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference JSON"); + } + [] p.receive { + setverdict(fail, "JSON decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_B308_omit_as_null_002(), PX_TC_EXECUTION_TIMEOUT); + } + +} \ No newline at end of file diff --git a/json/B_encoding_instructions/B3_ecoding_instructions/B309_default/Pos_B309_default_001/Pos_B309_default_001.json b/json/B_encoding_instructions/B3_ecoding_instructions/B309_default/Pos_B309_default_001/Pos_B309_default_001.json new file mode 100644 index 0000000..3b3234c --- /dev/null +++ b/json/B_encoding_instructions/B3_ecoding_instructions/B309_default/Pos_B309_default_001/Pos_B309_default_001.json @@ -0,0 +1,6 @@ +{ + "Pos_B309_default_001.MyRecord": + { + "MyCharString" : "abcdef" + } +} diff --git a/json/B_encoding_instructions/B3_ecoding_instructions/B309_default/Pos_B309_default_001/Pos_B309_default_001.ttcn b/json/B_encoding_instructions/B3_ecoding_instructions/B309_default/Pos_B309_default_001/Pos_B309_default_001.ttcn new file mode 100644 index 0000000..b43742d --- /dev/null +++ b/json/B_encoding_instructions/B3_ecoding_instructions/B309_default/Pos_B309_default_001/Pos_B309_default_001.ttcn @@ -0,0 +1,96 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:B.3.9, Verify that "default" for record to object encode is correctly used. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + *If set, the value of the specified optional field will be encoded with the JSON literal 'null' + * if the value is omitted. By default omitted fields (both their name and value) are skipped + * entirely. The decoder ignores this attribute and accepts both versions. + * */ + +module Pos_B309_default_001 { + + import from JSON all; + + type record MyRecord{ + integer int optional, + charstring MyCharString + } with { encode "JSON"; variant(int) "default (15)"}; + + template MyRecord m_msg := {omit, "abcdef"}; // encoding record as JSON.Object with omitted parameter + template MyRecord m_rec := {15, "abcdef"}; // encoding record as JSON.Object with default parameter + /* { "Pos_B309_default_001.MyRecord": + { + "MyCharString" : "abcdef" + } + * } + */ + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw with { encode "Text"}; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference JSON file and returns true if they represent the same JSON structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the JSON data + * @param p_referenceJsonFile the JSON data + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference JSON file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceJsonFile represent the same JSON data + */ + external function matchFile(Raw p_textToMatch, File p_referenceJsonFile, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_B309_default_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference JSON file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("JSON message: ", v_rcv); + if (matchFile(v_rcv, "Pos_B309_default_001.json", v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_rec) { + setverdict(pass, "Decoded value matches encoded template and reference JSON"); + } + [] p.receive { + setverdict(fail, "JSON decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_B309_default_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} \ No newline at end of file diff --git a/json/B_encoding_instructions/B3_ecoding_instructions/B309_default/Pos_B309_default_002/Pos_B309_default_002.json b/json/B_encoding_instructions/B3_ecoding_instructions/B309_default/Pos_B309_default_002/Pos_B309_default_002.json new file mode 100644 index 0000000..91d5218 --- /dev/null +++ b/json/B_encoding_instructions/B3_ecoding_instructions/B309_default/Pos_B309_default_002/Pos_B309_default_002.json @@ -0,0 +1,6 @@ +{ + "Pos_B309_default_002.MySet":{ + "MyCharString" : "abcdef", + "int" : 15 + } +} diff --git a/json/B_encoding_instructions/B3_ecoding_instructions/B309_default/Pos_B309_default_002/Pos_B309_default_002.ttcn b/json/B_encoding_instructions/B3_ecoding_instructions/B309_default/Pos_B309_default_002/Pos_B309_default_002.ttcn new file mode 100644 index 0000000..02ddf93 --- /dev/null +++ b/json/B_encoding_instructions/B3_ecoding_instructions/B309_default/Pos_B309_default_002/Pos_B309_default_002.ttcn @@ -0,0 +1,97 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:B.3.9, Verify that "default" for record to object encode is correctly used. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + *If set, the value of the specified optional field will be encoded with the JSON literal 'null' + * if the value is omitted. By default omitted fields (both their name and value) are skipped + * entirely. The decoder ignores this attribute and accepts both versions. + * */ + +module Pos_B309_default_002 { + + import from JSON all; + + type record MySet{ + integer int optional, + charstring MyCharString + } with { encode "JSON"; variant(int) "default (15)"}; + + template MySet m_msg := {omit, "abcdef"}; // encoding record as JSON.Object with omitted parameter + template MySet m_rec := {15, "abcdef"}; // encoding record as JSON.Object with default parameter + /* { "Pos_B309_default_002.MySet": + { + "MyCharString" : "abcdef" + "int" : 15, + } + * } + */ + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw with { encode "Text"}; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference JSON file and returns true if they represent the same JSON structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the JSON data + * @param p_referenceJsonFile the JSON data + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference JSON file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceJsonFile represent the same JSON data + */ + external function matchFile(Raw p_textToMatch, File p_referenceJsonFile, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_B309_default_002() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference JSON file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("JSON message: ", v_rcv); + if (matchFile(v_rcv, "Pos_B309_default_002.json", v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_rec) { + setverdict(pass, "Decoded value matches encoded template and reference JSON"); + } + [] p.receive { + setverdict(fail, "JSON decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_B309_default_002(), PX_TC_EXECUTION_TIMEOUT); + } + +} \ No newline at end of file diff --git a/json/B_encoding_instructions/B3_ecoding_instructions/B310_as_value/Pos_B310_as_value_001/Pos_B310_as_value_001.json b/json/B_encoding_instructions/B3_ecoding_instructions/B310_as_value/Pos_B310_as_value_001/Pos_B310_as_value_001.json new file mode 100644 index 0000000..9089766 --- /dev/null +++ b/json/B_encoding_instructions/B3_ecoding_instructions/B310_as_value/Pos_B310_as_value_001/Pos_B310_as_value_001.json @@ -0,0 +1,3 @@ +{ + "MyCharString" : "Hello World!" +} diff --git a/json/B_encoding_instructions/B3_ecoding_instructions/B310_as_value/Pos_B310_as_value_001/Pos_B310_as_value_001.ttcn b/json/B_encoding_instructions/B3_ecoding_instructions/B310_as_value/Pos_B310_as_value_001/Pos_B310_as_value_001.ttcn new file mode 100644 index 0000000..3ed4e1a --- /dev/null +++ b/json/B_encoding_instructions/B3_ecoding_instructions/B310_as_value/Pos_B310_as_value_001/Pos_B310_as_value_001.ttcn @@ -0,0 +1,91 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:B.3.10, Verify that "as value" for union to array encode is correctly used. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + *The TTCN-3 union value shall be encoded as a JSON value instead of as a JSON object with one object member + * */ + +module Pos_B310_as_value_001 { + + import from JSON all; + + type union MyUnion{ + integer int, + charstring MyCharString + } with { encode "JSON"; variant "as value"}; + + template MyUnion m_msg := { MyCharString := "Hello World!" } + /*{ + "MyCharString" : "Hello World!" + } + */ + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw with { encode "Text"}; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference JSON file and returns true if they represent the same JSON structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the JSON data + * @param p_referenceJsonFile the JSON data + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference JSON file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceJsonFile represent the same JSON data + */ + external function matchFile(Raw p_textToMatch, File p_referenceJsonFile, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_B310_as_value_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference JSON file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("JSON message: ", v_rcv); + if (matchFile(v_rcv, "Pos_B310_as_value_001.json", v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference JSON"); + } + [] p.receive { + setverdict(fail, "JSON decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_B310_as_value_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} \ No newline at end of file diff --git a/json/B_encoding_instructions/B3_ecoding_instructions/B310_as_value/Pos_B310_as_value_002/Pos_B310_as_value_002.json b/json/B_encoding_instructions/B3_ecoding_instructions/B310_as_value/Pos_B310_as_value_002/Pos_B310_as_value_002.json new file mode 100644 index 0000000..f1815bb --- /dev/null +++ b/json/B_encoding_instructions/B3_ecoding_instructions/B310_as_value/Pos_B310_as_value_002/Pos_B310_as_value_002.json @@ -0,0 +1,11 @@ +[ + { + "MyCharString" : "Hello World!" + }, + { + "int" : 42 + }, + { + "int" : 24 + } +] diff --git a/json/B_encoding_instructions/B3_ecoding_instructions/B310_as_value/Pos_B310_as_value_002/Pos_B310_as_value_002.ttcn b/json/B_encoding_instructions/B3_ecoding_instructions/B310_as_value/Pos_B310_as_value_002/Pos_B310_as_value_002.ttcn new file mode 100644 index 0000000..07d49be --- /dev/null +++ b/json/B_encoding_instructions/B3_ecoding_instructions/B310_as_value/Pos_B310_as_value_002/Pos_B310_as_value_002.ttcn @@ -0,0 +1,93 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:B.3.10, Verify that "as value" for union to array encode is correctly used. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + *The TTCN-3 union value shall be encoded as a JSON value instead of as a JSON object with one object member + * */ + +module Pos_B310_as_value_002 { + + import from JSON all; + + type union MyUnion{ + integer int, + charstring MyCharString + } + + type record of MyUnion RoU1; + + template RoU1 m_msg := {{ MyCharString := "Hello World!" }, {int := 42},{int := 24} } with { encode "JSON"; variant "as value"}; + + /** + * the json is: [{"MyCharString" : "Hello World!"},{"int" : 42},{"int" : 24}] + **/ + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw with { encode "Text"}; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference JSON file and returns true if they represent the same JSON structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the JSON data + * @param p_referenceJsonFile the JSON data + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference JSON file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceJsonFile represent the same JSON data + */ + external function matchFile(Raw p_textToMatch, File p_referenceJsonFile, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_B310_as_value_002() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference JSON file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("JSON message: ", v_rcv); + if (matchFile(v_rcv, "Pos_B310_as_value_002.json", v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference JSON"); + } + [] p.receive { + setverdict(fail, "JSON decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_B310_as_value_002(), PX_TC_EXECUTION_TIMEOUT); + } + +} \ No newline at end of file diff --git a/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_001/Pos_B311_no_type_001.json b/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_001/Pos_B311_no_type_001.json new file mode 100644 index 0000000..fc883c8 --- /dev/null +++ b/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_001/Pos_B311_no_type_001.json @@ -0,0 +1 @@ +"Hello World!" diff --git a/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_001/Pos_B311_no_type_001.ttcn b/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_001/Pos_B311_no_type_001.ttcn new file mode 100644 index 0000000..dd9ea3a --- /dev/null +++ b/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_001/Pos_B311_no_type_001.ttcn @@ -0,0 +1,85 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:B.3.11, Verify that "noType" variant is correctly used during encode. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + * The "noType" encoding instruction shall cause that the "type wrapper" of + * the top-level TTCN-3 type of the instance being encoded, is omitted in the + * JSON representation, and at decoding a JSON value, it is not expected to be present. + * */ + +module Pos_B311_no_type_001 { + + import from JSON all; + + template charstring m_msg := "Hello World!" with { encode "JSON"; variant "noType"}; + /*"Hello World!" */ + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw with {encode "Text"}; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference JSON file and returns true if they represent the same JSON structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the JSON data + * @param p_referenceJsonFile the JSON data + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference JSON file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceJsonFile represent the same JSON data + */ + external function matchFile(Raw p_textToMatch, File p_referenceJsonFile, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_B311_no_type_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference JSON file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("JSON message: ", v_rcv); + if (matchFile(v_rcv, "Pos_B311_no_type_001.json", v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference JSON"); + } + [] p.receive { + setverdict(fail, "JSON decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_B311_no_type_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} \ No newline at end of file diff --git a/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_002/Pos_B311_no_type_002.json b/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_002/Pos_B311_no_type_002.json new file mode 100644 index 0000000..ddb3fef --- /dev/null +++ b/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_002/Pos_B311_no_type_002.json @@ -0,0 +1 @@ +"\u0009Hello World!" diff --git a/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_002/Pos_B311_no_type_002.ttcn b/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_002/Pos_B311_no_type_002.ttcn new file mode 100644 index 0000000..5c677d1 --- /dev/null +++ b/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_002/Pos_B311_no_type_002.ttcn @@ -0,0 +1,86 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:B.3.11, Verify that "noType" variant is correctly used during encode. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + * The "noType" encoding instruction shall cause that the "type wrapper" of + * the top-level TTCN-3 type of the instance being encoded, is omitted in the + * JSON representation, and at decoding a JSON value, it is not expected to be present. + * */ + +module Pos_B311_no_type_002 { + + import from JSON all; + + template universal charstring m_msg := char(U9) & "Hello World!" with { encode "JSON"; variant "noType"}; + /*"Hello World!" + */ + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw with {encode "Text"}; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference JSON file and returns true if they represent the same JSON structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the JSON data + * @param p_referenceJsonFile the JSON data + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference JSON file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceJsonFile represent the same JSON data + */ + external function matchFile(Raw p_textToMatch, File p_referenceJsonFile, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_B311_no_type_002() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference JSON file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("JSON message: ", v_rcv); + if (matchFile(v_rcv, "Pos_B311_no_type_002.json", v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference JSON"); + } + [] p.receive { + setverdict(fail, "JSON decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_B311_no_type_002(), PX_TC_EXECUTION_TIMEOUT); + } + +} \ No newline at end of file diff --git a/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_003/Pos_B311_no_type_003.json b/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_003/Pos_B311_no_type_003.json new file mode 100644 index 0000000..71ab0a2 --- /dev/null +++ b/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_003/Pos_B311_no_type_003.json @@ -0,0 +1 @@ +"01011010" diff --git a/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_003/Pos_B311_no_type_003.ttcn b/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_003/Pos_B311_no_type_003.ttcn new file mode 100644 index 0000000..fbf5235 --- /dev/null +++ b/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_003/Pos_B311_no_type_003.ttcn @@ -0,0 +1,84 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:B.3.11, Verify that "noType" variant is correctly used during encode. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + * The "noType" encoding instruction shall cause that the "type wrapper" of + * the top-level TTCN-3 type of the instance being encoded, is omitted in the + * JSON representation, and at decoding a JSON value, it is not expected to be present. + * */ + +module Pos_B311_no_type_003 { + + import from JSON all; + + template bitstring m_msg := '01011010'B with { encode "JSON"; variant "noType"}; + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw with {encode "Text"}; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference JSON file and returns true if they represent the same JSON structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the JSON data + * @param p_referenceJsonFile the JSON data + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference JSON file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceJsonFile represent the same JSON data + */ + external function matchFile(Raw p_textToMatch, File p_referenceJsonFile, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_B311_no_type_003() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference JSON file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("JSON message: ", v_rcv); + if (matchFile(v_rcv, "Pos_B311_no_type_003.json", v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference JSON"); + } + [] p.receive { + setverdict(fail, "JSON decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_B311_no_type_003(), PX_TC_EXECUTION_TIMEOUT); + } + +} \ No newline at end of file diff --git a/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_004/Pos_B311_no_type_004.json b/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_004/Pos_B311_no_type_004.json new file mode 100644 index 0000000..1e46a33 --- /dev/null +++ b/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_004/Pos_B311_no_type_004.json @@ -0,0 +1 @@ +"1234" diff --git a/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_004/Pos_B311_no_type_004.ttcn b/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_004/Pos_B311_no_type_004.ttcn new file mode 100644 index 0000000..8aefebe --- /dev/null +++ b/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_004/Pos_B311_no_type_004.ttcn @@ -0,0 +1,84 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:B.3.11, Verify that "noType" variant is correctly used during encode. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + * The "noType" encoding instruction shall cause that the "type wrapper" of + * the top-level TTCN-3 type of the instance being encoded, is omitted in the + * JSON representation, and at decoding a JSON value, it is not expected to be present. + * */ + +module Pos_B311_no_type_004 { + + import from JSON all; + + template octetstring m_msg := '1234'O with { encode "JSON"; variant "noType"}; + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw with {encode "Text"}; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference JSON file and returns true if they represent the same JSON structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the JSON data + * @param p_referenceJsonFile the JSON data + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference JSON file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceJsonFile represent the same JSON data + */ + external function matchFile(Raw p_textToMatch, File p_referenceJsonFile, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_B311_no_type_004() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference JSON file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("JSON message: ", v_rcv); + if (matchFile(v_rcv, "Pos_B311_no_type_004.json", v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference JSON"); + } + [] p.receive { + setverdict(fail, "JSON decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_B311_no_type_004(), PX_TC_EXECUTION_TIMEOUT); + } + +} \ No newline at end of file diff --git a/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_005/Pos_B311_no_type_005.json b/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_005/Pos_B311_no_type_005.json new file mode 100644 index 0000000..ce2b193 --- /dev/null +++ b/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_005/Pos_B311_no_type_005.json @@ -0,0 +1 @@ +"FFFF" diff --git a/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_005/Pos_B311_no_type_005.ttcn b/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_005/Pos_B311_no_type_005.ttcn new file mode 100644 index 0000000..be35673 --- /dev/null +++ b/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_005/Pos_B311_no_type_005.ttcn @@ -0,0 +1,84 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:B.3.11, Verify that "noType" variant is correctly used during encode. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + * The "noType" encoding instruction shall cause that the "type wrapper" of + * the top-level TTCN-3 type of the instance being encoded, is omitted in the + * JSON representation, and at decoding a JSON value, it is not expected to be present. + * */ + +module Pos_B311_no_type_005 { + + import from JSON all; + + template hexstring m_msg := 'FFFF'H with { encode "JSON"; variant "noType"}; + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw with {encode "Text"}; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference JSON file and returns true if they represent the same JSON structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the JSON data + * @param p_referenceJsonFile the JSON data + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference JSON file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceJsonFile represent the same JSON data + */ + external function matchFile(Raw p_textToMatch, File p_referenceJsonFile, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_B311_no_type_005() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference JSON file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("JSON message: ", v_rcv); + if (matchFile(v_rcv, "Pos_B311_no_type_005.json", v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference JSON"); + } + [] p.receive { + setverdict(fail, "JSON decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_B311_no_type_005(), PX_TC_EXECUTION_TIMEOUT); + } + +} \ No newline at end of file diff --git a/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_006/Pos_B311_no_type_006.json b/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_006/Pos_B311_no_type_006.json new file mode 100644 index 0000000..2f562a1 --- /dev/null +++ b/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_006/Pos_B311_no_type_006.json @@ -0,0 +1 @@ +42 diff --git a/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_006/Pos_B311_no_type_006.ttcn b/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_006/Pos_B311_no_type_006.ttcn new file mode 100644 index 0000000..3842ff1 --- /dev/null +++ b/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_006/Pos_B311_no_type_006.ttcn @@ -0,0 +1,84 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:B.3.11, Verify that "noType" variant is correctly used during encode. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + * The "noType" encoding instruction shall cause that the "type wrapper" of + * the top-level TTCN-3 type of the instance being encoded, is omitted in the + * JSON representation, and at decoding a JSON value, it is not expected to be present. + * */ + +module Pos_B311_no_type_006 { + + import from JSON all; + + template integer m_msg := 42 with { encode "JSON"; variant "noType"}; + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw with {encode "Text"}; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference JSON file and returns true if they represent the same JSON structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the JSON data + * @param p_referenceJsonFile the JSON data + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference JSON file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceJsonFile represent the same JSON data + */ + external function matchFile(Raw p_textToMatch, File p_referenceJsonFile, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_B311_no_type_006() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference JSON file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("JSON message: ", v_rcv); + if (matchFile(v_rcv, "Pos_B311_no_type_006.json", v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference JSON"); + } + [] p.receive { + setverdict(fail, "JSON decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_B311_no_type_006(), PX_TC_EXECUTION_TIMEOUT); + } + +} \ No newline at end of file diff --git a/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_007/Pos_B311_no_type_007.json b/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_007/Pos_B311_no_type_007.json new file mode 100644 index 0000000..b03094c --- /dev/null +++ b/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_007/Pos_B311_no_type_007.json @@ -0,0 +1 @@ +4.25E1 diff --git a/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_007/Pos_B311_no_type_007.ttcn b/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_007/Pos_B311_no_type_007.ttcn new file mode 100644 index 0000000..477ce6b --- /dev/null +++ b/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_007/Pos_B311_no_type_007.ttcn @@ -0,0 +1,84 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:B.3.11, Verify that "noType" variant is correctly used during encode. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + * The "noType" encoding instruction shall cause that the "type wrapper" of + * the top-level TTCN-3 type of the instance being encoded, is omitted in the + * JSON representation, and at decoding a JSON value, it is not expected to be present. + * */ + +module Pos_B311_no_type_007 { + + import from JSON all; + + template float m_msg := 42.5 with { encode "JSON"; variant "noType"}; + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw with {encode "Text"}; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference JSON file and returns true if they represent the same JSON structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the JSON data + * @param p_referenceJsonFile the JSON data + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference JSON file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceJsonFile represent the same JSON data + */ + external function matchFile(Raw p_textToMatch, File p_referenceJsonFile, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_B311_no_type_007() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference JSON file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("JSON message: ", v_rcv); + if (matchFile(v_rcv, "Pos_B311_no_type_007.json", v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference JSON"); + } + [] p.receive { + setverdict(fail, "JSON decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_B311_no_type_007(), PX_TC_EXECUTION_TIMEOUT); + } + +} \ No newline at end of file diff --git a/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_008/Pos_B311_no_type_008.json b/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_008/Pos_B311_no_type_008.json new file mode 100644 index 0000000..ac1b522 --- /dev/null +++ b/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_008/Pos_B311_no_type_008.json @@ -0,0 +1 @@ +"infinity" diff --git a/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_008/Pos_B311_no_type_008.ttcn b/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_008/Pos_B311_no_type_008.ttcn new file mode 100644 index 0000000..92f9de0 --- /dev/null +++ b/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_008/Pos_B311_no_type_008.ttcn @@ -0,0 +1,84 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:B.3.11, Verify that "noType" variant is correctly used during encode. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + * The "noType" encoding instruction shall cause that the "type wrapper" of + * the top-level TTCN-3 type of the instance being encoded, is omitted in the + * JSON representation, and at decoding a JSON value, it is not expected to be present. + * */ + +module Pos_B311_no_type_008 { + + import from JSON all; + + template float m_msg := infinity with { encode "JSON"; variant "noType"}; + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw with {encode "Text"}; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference JSON file and returns true if they represent the same JSON structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the JSON data + * @param p_referenceJsonFile the JSON data + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference JSON file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceJsonFile represent the same JSON data + */ + external function matchFile(Raw p_textToMatch, File p_referenceJsonFile, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_B311_no_type_008() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference JSON file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("JSON message: ", v_rcv); + if (matchFile(v_rcv, "Pos_B311_no_type_008.json", v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference JSON"); + } + [] p.receive { + setverdict(fail, "JSON decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_B311_no_type_008(), PX_TC_EXECUTION_TIMEOUT); + } + +} \ No newline at end of file diff --git a/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_009/Pos_B311_no_type_009.json b/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_009/Pos_B311_no_type_009.json new file mode 100644 index 0000000..2087c06 --- /dev/null +++ b/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_009/Pos_B311_no_type_009.json @@ -0,0 +1 @@ +"-infinity" diff --git a/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_009/Pos_B311_no_type_009.ttcn b/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_009/Pos_B311_no_type_009.ttcn new file mode 100644 index 0000000..874c623 --- /dev/null +++ b/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_009/Pos_B311_no_type_009.ttcn @@ -0,0 +1,84 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:B.3.11, Verify that "noType" variant is correctly used during encode. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + * The "noType" encoding instruction shall cause that the "type wrapper" of + * the top-level TTCN-3 type of the instance being encoded, is omitted in the + * JSON representation, and at decoding a JSON value, it is not expected to be present. + * */ + +module Pos_B311_no_type_009 { + + import from JSON all; + + template float m_msg := -infinity with { encode "JSON"; variant "noType"}; + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw with {encode "Text"}; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference JSON file and returns true if they represent the same JSON structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the JSON data + * @param p_referenceJsonFile the JSON data + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference JSON file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceJsonFile represent the same JSON data + */ + external function matchFile(Raw p_textToMatch, File p_referenceJsonFile, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_B311_no_type_009() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference JSON file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("JSON message: ", v_rcv); + if (matchFile(v_rcv, "Pos_B311_no_type_009.json", v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference JSON"); + } + [] p.receive { + setverdict(fail, "JSON decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_B311_no_type_009(), PX_TC_EXECUTION_TIMEOUT); + } + +} \ No newline at end of file diff --git a/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_010/Pos_B311_no_type_010.json b/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_010/Pos_B311_no_type_010.json new file mode 100644 index 0000000..560dae0 --- /dev/null +++ b/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_010/Pos_B311_no_type_010.json @@ -0,0 +1 @@ +"not_a_number" diff --git a/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_010/Pos_B311_no_type_010.ttcn b/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_010/Pos_B311_no_type_010.ttcn new file mode 100644 index 0000000..1048327 --- /dev/null +++ b/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_010/Pos_B311_no_type_010.ttcn @@ -0,0 +1,83 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:B.3.11, Verify that "noType" variant is correctly used during encode. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + * The "noType" encoding instruction shall cause that the "type wrapper" of + * the top-level TTCN-3 type of the instance being encoded, is omitted in the + * JSON representation, and at decoding a JSON value, it is not expected to be present. + * */ + +module Pos_B311_no_type_010 { + + import from JSON all; + + template float m_msg := not_a_number with { encode "JSON"; variant "noType"}; + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw with {encode "Text"}; + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference JSON file and returns true if they represent the same JSON structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the JSON data + * @param p_referenceJsonFile the JSON data + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference JSON file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceJsonFile represent the same JSON data + */ + external function matchFile(Raw p_textToMatch, File p_referenceJsonFile, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_B311_no_type_010() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference JSON file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("JSON message: ", v_rcv); + if (matchFile(v_rcv, "Pos_B311_no_type_010.json", v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference JSON"); + } + [] p.receive { + setverdict(fail, "JSON decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_B311_no_type_010(), PX_TC_EXECUTION_TIMEOUT); + } + +} \ No newline at end of file diff --git a/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_011/Pos_B311_no_type_011.json b/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_011/Pos_B311_no_type_011.json new file mode 100644 index 0000000..fe75c80 --- /dev/null +++ b/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_011/Pos_B311_no_type_011.json @@ -0,0 +1 @@ +true diff --git a/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_011/Pos_B311_no_type_011.ttcn b/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_011/Pos_B311_no_type_011.ttcn new file mode 100644 index 0000000..c877176 --- /dev/null +++ b/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_011/Pos_B311_no_type_011.ttcn @@ -0,0 +1,83 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:B.3.11, Verify that "noType" variant is correctly used during encode. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + * The "noType" encoding instruction shall cause that the "type wrapper" of + * the top-level TTCN-3 type of the instance being encoded, is omitted in the + * JSON representation, and at decoding a JSON value, it is not expected to be present. + * */ + +module Pos_B311_no_type_011 { + + import from JSON all; + + template boolean m_msg := true with { encode "JSON"; variant "noType"}; + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw with {encode "Text"}; + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference JSON file and returns true if they represent the same JSON structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the JSON data + * @param p_referenceJsonFile the JSON data + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference JSON file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceJsonFile represent the same JSON data + */ + external function matchFile(Raw p_textToMatch, File p_referenceJsonFile, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_B311_no_type_011() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference JSON file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("JSON message: ", v_rcv); + if (matchFile(v_rcv, "Pos_B311_no_type_011.json", v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference JSON"); + } + [] p.receive { + setverdict(fail, "JSON decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_B311_no_type_011(), PX_TC_EXECUTION_TIMEOUT); + } + +} \ No newline at end of file diff --git a/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_012/Pos_B311_no_type_012.json b/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_012/Pos_B311_no_type_012.json new file mode 100644 index 0000000..5dda550 --- /dev/null +++ b/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_012/Pos_B311_no_type_012.json @@ -0,0 +1 @@ +"firstItem" diff --git a/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_012/Pos_B311_no_type_012.ttcn b/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_012/Pos_B311_no_type_012.ttcn new file mode 100644 index 0000000..79a516a --- /dev/null +++ b/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_012/Pos_B311_no_type_012.ttcn @@ -0,0 +1,92 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:B.3.11, Verify that "noType" variant is correctly used during encode. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + * The "noType" encoding instruction shall cause that the "type wrapper" of + * the top-level TTCN-3 type of the instance being encoded, is omitted in the + * JSON representation, and at decoding a JSON value, it is not expected to be present. + * */ + +module Pos_B311_no_type_012 { + + import from JSON all; + + type enumerated MyEnumType { + firstItem(0), + secondItem(1), + thirdItem(3), + etc(2, 4..255) + }; + + template MyEnumType m_msg := firstItem with { encode "JSON"; variant "noType"}; + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + + type universal charstring Raw with {encode "Text"}; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference JSON file and returns true if they represent the same JSON structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the JSON data + * @param p_referenceJsonFile the JSON data + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference JSON file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceJsonFile represent the same JSON data + */ + external function matchFile(Raw p_textToMatch, File p_referenceJsonFile, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_B311_no_type_012() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference JSON file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("JSON message: ", v_rcv); + if (matchFile(v_rcv, "Pos_B311_no_type_012.json", v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference JSON"); + } + [] p.receive { + setverdict(fail, "JSON decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_B311_no_type_012(), PX_TC_EXECUTION_TIMEOUT); + } + +} \ No newline at end of file diff --git a/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_013/Pos_B311_no_type_013.json b/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_013/Pos_B311_no_type_013.json new file mode 100644 index 0000000..3751665 --- /dev/null +++ b/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_013/Pos_B311_no_type_013.json @@ -0,0 +1 @@ +"pass" diff --git a/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_013/Pos_B311_no_type_013.ttcn b/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_013/Pos_B311_no_type_013.ttcn new file mode 100644 index 0000000..d7326a3 --- /dev/null +++ b/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_013/Pos_B311_no_type_013.ttcn @@ -0,0 +1,84 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:B.3.11, Verify that "noType" variant is correctly used during encode. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + * The "noType" encoding instruction shall cause that the "type wrapper" of + * the top-level TTCN-3 type of the instance being encoded, is omitted in the + * JSON representation, and at decoding a JSON value, it is not expected to be present. + * */ + +module Pos_B311_no_type_013 { + + import from JSON all; + + template verdicttype m_msg := pass with { encode "JSON"; variant "noType"}; + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw with {encode "Text"}; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference JSON file and returns true if they represent the same JSON structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the JSON data + * @param p_referenceJsonFile the JSON data + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference JSON file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceJsonFile represent the same JSON data + */ + external function matchFile(Raw p_textToMatch, File p_referenceJsonFile, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_B311_no_type_013() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference JSON file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("JSON message: ", v_rcv); + if (matchFile(v_rcv, "Pos_B311_no_type_013.json", v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference JSON"); + } + [] p.receive { + setverdict(fail, "JSON decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_B311_no_type_013(), PX_TC_EXECUTION_TIMEOUT); + } + +} \ No newline at end of file diff --git a/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_014/Pos_B311_no_type_014.json b/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_014/Pos_B311_no_type_014.json new file mode 100644 index 0000000..fc19e5d --- /dev/null +++ b/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_014/Pos_B311_no_type_014.json @@ -0,0 +1,4 @@ +{ + "int":5, + "MyCharString" : "abcdef" +} diff --git a/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_014/Pos_B311_no_type_014.ttcn b/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_014/Pos_B311_no_type_014.ttcn new file mode 100644 index 0000000..d4e6c9c --- /dev/null +++ b/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_014/Pos_B311_no_type_014.ttcn @@ -0,0 +1,89 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:B.3.11, Verify that "noType" variant is correctly used during encode. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + * The "noType" encoding instruction shall cause that the "type wrapper" of + * the top-level TTCN-3 type of the instance being encoded, is omitted in the + * JSON representation, and at decoding a JSON value, it is not expected to be present. + * */ + +module Pos_B311_no_type_014 { + + import from JSON all; + + type record MyRecordType{ + integer int, + charstring MyCharString + }; + + template MyRecordType m_msg := {5, "abcdef"} with { encode "JSON"; variant "noType"}; + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw with {encode "Text"}; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference JSON file and returns true if they represent the same JSON structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the JSON data + * @param p_referenceJsonFile the JSON data + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference JSON file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceJsonFile represent the same JSON data + */ + external function matchFile(Raw p_textToMatch, File p_referenceJsonFile, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_B311_no_type_014() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference JSON file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("JSON message: ", v_rcv); + if (matchFile(v_rcv, "Pos_B311_no_type_014.json", v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference JSON"); + } + [] p.receive { + setverdict(fail, "JSON decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_B311_no_type_014(), PX_TC_EXECUTION_TIMEOUT); + } + +} \ No newline at end of file diff --git a/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_015/Pos_B311_no_type_015.json b/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_015/Pos_B311_no_type_015.json new file mode 100644 index 0000000..fc19e5d --- /dev/null +++ b/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_015/Pos_B311_no_type_015.json @@ -0,0 +1,4 @@ +{ + "int":5, + "MyCharString" : "abcdef" +} diff --git a/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_015/Pos_B311_no_type_015.ttcn b/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_015/Pos_B311_no_type_015.ttcn new file mode 100644 index 0000000..8afe519 --- /dev/null +++ b/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_015/Pos_B311_no_type_015.ttcn @@ -0,0 +1,89 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:B.3.11, Verify that "noType" variant is correctly used during encode. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + * The "noType" encoding instruction shall cause that the "type wrapper" of + * the top-level TTCN-3 type of the instance being encoded, is omitted in the + * JSON representation, and at decoding a JSON value, it is not expected to be present. + * */ + +module Pos_B311_no_type_015 { + + import from JSON all; + + type set MySetType{ + integer int, + charstring MyCharString + }; + + template MySetType m_msg := {5, "abcdef"} with { encode "JSON";variant "noType"}; + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw with {encode "Text"}; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference JSON file and returns true if they represent the same JSON structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the JSON data + * @param p_referenceJsonFile the JSON data + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference JSON file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceJsonFile represent the same JSON data + */ + external function matchFile(Raw p_textToMatch, File p_referenceJsonFile, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_B311_no_type_015() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference JSON file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("JSON message: ", v_rcv); + if (matchFile(v_rcv, "Pos_B311_no_type_015.json", v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference JSON"); + } + [] p.receive { + setverdict(fail, "JSON decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_B311_no_type_015(), PX_TC_EXECUTION_TIMEOUT); + } + +} \ No newline at end of file diff --git a/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_016/Pos_B311_no_type_016.json b/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_016/Pos_B311_no_type_016.json new file mode 100644 index 0000000..b037775 --- /dev/null +++ b/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_016/Pos_B311_no_type_016.json @@ -0,0 +1 @@ +[1,2,3,4,5,6,7,8,9] diff --git a/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_016/Pos_B311_no_type_016.ttcn b/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_016/Pos_B311_no_type_016.ttcn new file mode 100644 index 0000000..febc23d --- /dev/null +++ b/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_016/Pos_B311_no_type_016.ttcn @@ -0,0 +1,86 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:B.3.11, Verify that "noType" variant is correctly used during encode. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + * The "noType" encoding instruction shall cause that the "type wrapper" of + * the top-level TTCN-3 type of the instance being encoded, is omitted in the + * JSON representation, and at decoding a JSON value, it is not expected to be present. + * */ + +module Pos_B311_no_type_016 { + + import from JSON all; + + type record of integer MyRecordofIntType; + + template MyRecordofIntType m_msg := {1,2,3,4,5,6,7,8,9} with { encode "JSON"; variant "noType"}; + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw with {encode "Text"}; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference JSON file and returns true if they represent the same JSON structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the JSON data + * @param p_referenceJsonFile the JSON data + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference JSON file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceJsonFile represent the same JSON data + */ + external function matchFile(Raw p_textToMatch, File p_referenceJsonFile, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_B311_no_type_016() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference JSON file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("JSON message: ", v_rcv); + if (matchFile(v_rcv, "Pos_B311_no_type_016.json", v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference JSON"); + } + [] p.receive { + setverdict(fail, "JSON decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_B311_no_type_016(), PX_TC_EXECUTION_TIMEOUT); + } + +} \ No newline at end of file diff --git a/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_017/Pos_B311_no_type_017.json b/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_017/Pos_B311_no_type_017.json new file mode 100644 index 0000000..b037775 --- /dev/null +++ b/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_017/Pos_B311_no_type_017.json @@ -0,0 +1 @@ +[1,2,3,4,5,6,7,8,9] diff --git a/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_017/Pos_B311_no_type_017.ttcn b/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_017/Pos_B311_no_type_017.ttcn new file mode 100644 index 0000000..cef4631 --- /dev/null +++ b/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_017/Pos_B311_no_type_017.ttcn @@ -0,0 +1,86 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:B.3.11, Verify that "noType" variant is correctly used during encode. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + * The "noType" encoding instruction shall cause that the "type wrapper" of + * the top-level TTCN-3 type of the instance being encoded, is omitted in the + * JSON representation, and at decoding a JSON value, it is not expected to be present. + * */ + +module Pos_B311_no_type_017 { + + import from JSON all; + + type set of integer MySetofIntType; + + template MySetofIntType m_msg := {1,2,3,4,5,6,7,8,9} with { encode "JSON"; variant "noType"}; + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw with {encode "Text"}; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference JSON file and returns true if they represent the same JSON structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the JSON data + * @param p_referenceJsonFile the JSON data + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference JSON file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceJsonFile represent the same JSON data + */ + external function matchFile(Raw p_textToMatch, File p_referenceJsonFile, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_B311_no_type_017() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference JSON file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("JSON message: ", v_rcv); + if (matchFile(v_rcv, "Pos_B311_no_type_017.json", v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference JSON"); + } + [] p.receive { + setverdict(fail, "JSON decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_B311_no_type_017(), PX_TC_EXECUTION_TIMEOUT); + } + +} \ No newline at end of file diff --git a/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_018/Pos_B311_no_type_018.json b/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_018/Pos_B311_no_type_018.json new file mode 100644 index 0000000..b037775 --- /dev/null +++ b/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_018/Pos_B311_no_type_018.json @@ -0,0 +1 @@ +[1,2,3,4,5,6,7,8,9] diff --git a/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_018/Pos_B311_no_type_018.ttcn b/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_018/Pos_B311_no_type_018.ttcn new file mode 100644 index 0000000..4252955 --- /dev/null +++ b/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_018/Pos_B311_no_type_018.ttcn @@ -0,0 +1,85 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:B.3.11, Verify that "noType" variant is correctly used during encode. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + * The "noType" encoding instruction shall cause that the "type wrapper" of + * the top-level TTCN-3 type of the instance being encoded, is omitted in the + * JSON representation, and at decoding a JSON value, it is not expected to be present. + * */ + +module Pos_B311_no_type_018 { + + import from JSON all; + + type integer MyIntArray[9]; + + template MyIntArray m_msg := {1,2,3,4,5,6,7,8,9} with { encode "JSON"; variant "noType"}; + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + type universal charstring Raw with {encode "Text"}; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference JSON file and returns true if they represent the same JSON structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the JSON data + * @param p_referenceJsonFile the JSON data + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference JSON file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceJsonFile represent the same JSON data + */ + external function matchFile(Raw p_textToMatch, File p_referenceJsonFile, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_B311_no_type_018() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference JSON file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("JSON message: ", v_rcv); + if (matchFile(v_rcv, "Pos_B311_no_type_018.json", v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference JSON"); + } + [] p.receive { + setverdict(fail, "JSON decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_B311_no_type_018(), PX_TC_EXECUTION_TIMEOUT); + } + +} \ No newline at end of file diff --git a/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_019/Pos_B311_no_type_019.json b/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_019/Pos_B311_no_type_019.json new file mode 100644 index 0000000..099f936 --- /dev/null +++ b/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_019/Pos_B311_no_type_019.json @@ -0,0 +1,3 @@ +{ + "cs" : "value of charstring" +} diff --git a/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_019/Pos_B311_no_type_019.ttcn b/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_019/Pos_B311_no_type_019.ttcn new file mode 100644 index 0000000..f4d6200 --- /dev/null +++ b/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_019/Pos_B311_no_type_019.ttcn @@ -0,0 +1,90 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:B.3.11, Verify that "noType" variant is correctly used during encode. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + * The "noType" encoding instruction shall cause that the "type wrapper" of + * the top-level TTCN-3 type of the instance being encoded, is omitted in the + * JSON representation, and at decoding a JSON value, it is not expected to be present. + * */ + +module Pos_B311_no_type_019 { + + import from JSON all; + + type union MyUnionType{ // proposed order of fields + integer i, + float f, + octetstring os, + charstring cs}; + + template MyUnionType m_msg := { cs:= "value of charstring" } with { encode "JSON"; variant "noType"}; + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw with {encode "Text"}; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference JSON file and returns true if they represent the same JSON structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the JSON data + * @param p_referenceJsonFile the JSON data + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference JSON file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceJsonFile represent the same JSON data + */ + external function matchFile(Raw p_textToMatch, File p_referenceJsonFile, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_B311_no_type_019() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference JSON file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("JSON message: ", v_rcv); + if (matchFile(v_rcv, "Pos_B311_no_type_019.json", v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference JSON"); + } + [] p.receive { + setverdict(fail, "JSON decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_B311_no_type_019(), PX_TC_EXECUTION_TIMEOUT); + } + +} \ No newline at end of file diff --git a/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_020/Pos_B311_no_type_020.json b/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_020/Pos_B311_no_type_020.json new file mode 100644 index 0000000..f7248b1 --- /dev/null +++ b/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_020/Pos_B311_no_type_020.json @@ -0,0 +1,3 @@ +{ + "integer" : 10 +} diff --git a/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_020/Pos_B311_no_type_020.ttcn b/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_020/Pos_B311_no_type_020.ttcn new file mode 100644 index 0000000..477fcbc --- /dev/null +++ b/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_020/Pos_B311_no_type_020.ttcn @@ -0,0 +1,86 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:B.3.11, Verify that "noType" variant is correctly used during encode. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + * The "noType" encoding instruction shall cause that the "type wrapper" of + * the top-level TTCN-3 type of the instance being encoded, is omitted in the + * JSON representation, and at decoding a JSON value, it is not expected to be present. + * */ + +module Pos_B311_no_type_020 { + + import from JSON all; + + type anytype MyAnyType with { encode "JSON" }; + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw with {encode "Text"}; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference JSON file and returns true if they represent the same JSON structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the JSON data + * @param p_referenceJsonFile the JSON data + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference JSON file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceJsonFile represent the same JSON data + */ + external function matchFile(Raw p_textToMatch, File p_referenceJsonFile, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_B311_no_type_020() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + var MyAnyType m_msg with { encode "JSON"; variant "noType"}; + m_msg.integer := 10; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference JSON file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("JSON message: ", v_rcv); + if (matchFile(v_rcv, "Pos_B311_no_type_020.json", v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference JSON"); + } + [] p.receive { + setverdict(fail, "JSON decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_B311_no_type_020(), PX_TC_EXECUTION_TIMEOUT); + } + +} \ No newline at end of file diff --git a/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_021/Pos_B311_no_type_021.json b/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_021/Pos_B311_no_type_021.json new file mode 100644 index 0000000..8d85ab8 --- /dev/null +++ b/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_021/Pos_B311_no_type_021.json @@ -0,0 +1 @@ +"2.4.5.0" diff --git a/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_021/Pos_B311_no_type_021.ttcn b/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_021/Pos_B311_no_type_021.ttcn new file mode 100644 index 0000000..c55724b --- /dev/null +++ b/json/B_encoding_instructions/B3_ecoding_instructions/B311_no_type/Pos_B311_no_type_021/Pos_B311_no_type_021.ttcn @@ -0,0 +1,86 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:B.3.11, Verify that "noType" variant is correctly used during encode. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + * The "noType" encoding instruction shall cause that the "type wrapper" of + * the top-level TTCN-3 type of the instance being encoded, is omitted in the + * JSON representation, and at decoding a JSON value, it is not expected to be present. + * */ + +module Pos_B311_no_type_021 { + + import from JSON all; + + type objid MyObjId; + + template MyObjId m_msg := objid{ joint_iso_itu_t remote_operations(4) informationObjects(5) version1(0) } with { encode "JSON"; variant "noType"}; + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw with {encode "Text"}; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference JSON file and returns true if they represent the same JSON structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the JSON data + * @param p_referenceJsonFile the JSON data + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference JSON file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceJsonFile represent the same JSON data + */ + external function matchFile(Raw p_textToMatch, File p_referenceJsonFile, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_B311_no_type_021() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference JSON file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("JSON message: ", v_rcv); + if (matchFile(v_rcv, "Pos_B311_no_type_021.json", v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference JSON"); + } + [] p.receive { + setverdict(fail, "JSON decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_B311_no_type_021(), PX_TC_EXECUTION_TIMEOUT); + } + +} \ No newline at end of file diff --git a/json/B_encoding_instructions/B3_ecoding_instructions/B312_use _order/Pos_B312_use _order_001/Pos_B312_use_order_001.json b/json/B_encoding_instructions/B3_ecoding_instructions/B312_use _order/Pos_B312_use _order_001/Pos_B312_use_order_001.json new file mode 100644 index 0000000..35c4776 --- /dev/null +++ b/json/B_encoding_instructions/B3_ecoding_instructions/B312_use _order/Pos_B312_use _order_001/Pos_B312_use_order_001.json @@ -0,0 +1,7 @@ +{ + "Pos_B312_use_order_001.MyRecordType":{ + "zeroint":5, + "firstint":6, + "MyCharString":"abcdef" + } +} diff --git a/json/B_encoding_instructions/B3_ecoding_instructions/B312_use _order/Pos_B312_use _order_001/Pos_B312_use_order_001.ttcn b/json/B_encoding_instructions/B3_ecoding_instructions/B312_use _order/Pos_B312_use _order_001/Pos_B312_use_order_001.ttcn new file mode 100644 index 0000000..897f686 --- /dev/null +++ b/json/B_encoding_instructions/B3_ecoding_instructions/B312_use _order/Pos_B312_use _order_001/Pos_B312_use_order_001.ttcn @@ -0,0 +1,86 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:B.3.12, Verify that "useOrder" variant is correctly used during encode. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + * The encoding instruction designates that the encoder shall encode the JSON object members according to the strings' order in the order field. + * */ + +module Pos_B312_use_order_001 { + + import from JSON all; + + type record MyRecordType{ + record of JSON.String order, + charstring MyCharString, + integer firstint, + integer zeroint + } with { encode "JSON"; variant "useOrder"}; + + template MyRecordType m_msg := { + order := {"zeroint", "firstint", "MyCharString"}, + MyCharString:= "abcdef", + zeroint:= 5, + firstint:=6 + } + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw with {encode "Text"}; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference JSON file and returns true if they represent the same JSON structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the JSON data + * @param p_referenceJsonFile the JSON data + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference JSON file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceJsonFile represent the same JSON data + */ + external function matchFile(Raw p_textToMatch, File p_referenceJsonFile, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_B312_use_order_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference JSON file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("JSON message: ", v_rcv); + if (matchFile(v_rcv, "Pos_B312_use_order_001.json", v_matchError)) { + setverdict(pass, "Decoded value matches encoded template and reference JSON"); + } else { + setverdict(fail, v_matchError); + } + + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_B312_use_order_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} \ No newline at end of file diff --git a/json/B_encoding_instructions/B3_ecoding_instructions/B313_error_behaviour/Pos_B313_error_behaviour_001/Pos_B313_error_behaviour_001.ttcn b/json/B_encoding_instructions/B3_ecoding_instructions/B313_error_behaviour/Pos_B313_error_behaviour_001/Pos_B313_error_behaviour_001.ttcn new file mode 100644 index 0000000..dd0cd0a --- /dev/null +++ b/json/B_encoding_instructions/B3_ecoding_instructions/B313_error_behaviour/Pos_B313_error_behaviour_001/Pos_B313_error_behaviour_001.ttcn @@ -0,0 +1,56 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:B.3.13, Verify that "errorbehavior" variant is correctly used during decode. + ** @verdict pass accept, noexecution + ***************************************************/ +/* + * TTCN-3 predefined decoding functions ensure that the decoding trial of the inout + * parameter encoded_value will not cause a test case error, when the decoding fails + * or is incomplete. - ET_UNDEF:EB_IGNORE + * */ + +// NOTE: the test is not executed as it would require dedicated errorbehavior support + +module Pos_B313_error_behaviour_001 { + + import from JSON all; + + type charstring MyChar with { encode "JSON"; variant "errorbehavior(ET_UNDEF:EB_IGNORE)"}; + template MyChar myChar := "abc"; + + + type component C { + + } + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + testcase TC_Pos_B313_error_behaviour_001() runs on C system C { + + var MyChar v_dec := ""; + // var octetstring v_enc := encvalue_o(myChar, - , "JSON"); // '7B22506F735F423331335F6572726F725F6265686176696F75725F3030312E4D7943686172223A22616263227D'O + var octetstring v_enc := '7B'O; // incomplete encoded JSON: '{' + log(v_enc); + + // Note: since v_enc contains an incomplete JSON the decvalue_o() should fail, however due to error behavior: it returns the undecoded JSON value to TTCN-3 as a universal charstring value. + var integer v_decresult := decvalue_o(v_enc, v_dec, "errorbehavior(ET_UNDEF:EB_IGNORE)" , "JSON"); + log(v_dec); + + if(match(v_dec,"{")){ + setverdict(pass, v_dec); + } + else{ + setverdict(fail, v_dec, v_decresult); + } + } + + + control { + // execute(TC_Pos_B313_error_behaviour_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} \ No newline at end of file diff --git a/json/B_encoding_instructions/B3_ecoding_instructions/B313_error_behaviour/Pos_B313_error_behaviour_002/Pos_B313_error_behaviour_002.ttcn b/json/B_encoding_instructions/B3_ecoding_instructions/B313_error_behaviour/Pos_B313_error_behaviour_002/Pos_B313_error_behaviour_002.ttcn new file mode 100644 index 0000000..f681fb6 --- /dev/null +++ b/json/B_encoding_instructions/B3_ecoding_instructions/B313_error_behaviour/Pos_B313_error_behaviour_002/Pos_B313_error_behaviour_002.ttcn @@ -0,0 +1,64 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:B.3.13, Verify that "errorbehavior" variant is correctly used during decode. + ** @verdict pass accept, noexecution + ***************************************************/ +/* + * TTCN-3 predefined decoding functions ensure that the decoding trial of the inout + * parameter encoded_value will not cause a test case error, when the decoding fails + * or is incomplete. - ET_DEC_ENUM:EB_IGNORE + * */ + +// NOTE: the test is not executed as it would require dedicated errorbehavior support + +module Pos_B313_error_behaviour_002 { + + import from JSON all; + + type enumerated MyEnumType { + firstItem(0), + secondItem(1), + thirdItem(3), + etc(2, 4..255) + } with { encode "JSON"; variant "errorbehavior(ET_DEC_ENUM:EB_ERROR)"}; + + template MyEnumType myEnum := secondItem; + + type component C { + + } + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + testcase TC_Pos_B313_error_behaviour_002() runs on C system C { + + var MyEnumType v_dec := firstItem; + + //var octetstring v_enc := encvalue_o(myEnum, - , "JSON"); // result: '7B22506F735F423331335F6572726F725F6265686176696F75725F3030322E4D79456E756D54797065223A227365636F6E644974656D227D'O + + // note: since the octetstring is incomplete, the decoding should fail, due to an unknown enumerated value. + var octetstring v_enc := '7B22506F735F423331335F6572726F725F6265686176696F75725F3030322E4D79456E756D54797065223A227365636F6E64497465227D'O; + log(v_enc); + + // Decoding of an unknown enumerated value. + var integer v_decresult := decvalue_o(v_enc, v_dec, "errorbehavior(ET_DEC_ENUM:EB_IGNORE)" , "JSON"); + + // encode the message + if (v_decresult == 0) { + setverdict(pass,v_decresult, v_dec ); + + } else { + setverdict(fail, v_dec); + + } + } + + control { + // execute(TC_Pos_B313_error_behaviour_002(), PX_TC_EXECUTION_TIMEOUT); + } + +} \ No newline at end of file diff --git a/json/B_encoding_instructions/B3_ecoding_instructions/B313_error_behaviour/Pos_B313_error_behaviour_003/Pos_B313_error_behaviour_003.ttcn b/json/B_encoding_instructions/B3_ecoding_instructions/B313_error_behaviour/Pos_B313_error_behaviour_003/Pos_B313_error_behaviour_003.ttcn new file mode 100644 index 0000000..8f598cd --- /dev/null +++ b/json/B_encoding_instructions/B3_ecoding_instructions/B313_error_behaviour/Pos_B313_error_behaviour_003/Pos_B313_error_behaviour_003.ttcn @@ -0,0 +1,52 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:B.3.13, Verify that "errorbehavior" variant is correctly used during decode. + ** @verdict pass accept, noexecution + ***************************************************/ +/* + * TTCN-3 predefined decoding functions ensure that the decoding trial of the inout + * parameter encoded_value will not cause a test case error, when the decoding fails + * or is incomplete. - ET_INCOMPL_MSG:EB_IGNORE + * */ + +// NOTE: the test is not executed as it would require dedicated errorbehavior support + +module Pos_B313_error_behaviour_003 { + + import from JSON all; + + type component C { + + } + + template charstring m_msg := "firstItem" with { encode "JSON"; variant "errorbehavior(ET_INCOMPL_MSG:EB_IGNORE)"}; + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + testcase TC_Pos_B313_error_behaviour_003() runs on C system C { + + // var octetstring v_enc := encvalue_o(m_msg, "errorbehavior(ET_INCOMPL_MSG:EB_ERROR)" , "JSON"); + var octetstring v_enc := '7B2263686172737472696E6722'O; // incomplete encoded JSON + + // Decoding. + var charstring v_dec; + var integer v_decresult := decvalue_o(v_enc, v_dec, "errorbehavior(ET_INCOMPL_MSG:EB_IGNORE)" , "JSON"); + + if(match(v_dec, "{" & char(U022)& "charstring" & char(U022))){ + setverdict(pass); + } + else { + setverdict(fail); + } + + } + + control { + // execute(TC_Pos_B313_error_behaviour_003(), PX_TC_EXECUTION_TIMEOUT); + } + +} \ No newline at end of file diff --git a/json/B_encoding_instructions/B3_ecoding_instructions/B313_error_behaviour/Pos_B313_error_behaviour_004/Pos_B313_error_behaviour_004.ttcn b/json/B_encoding_instructions/B3_ecoding_instructions/B313_error_behaviour/Pos_B313_error_behaviour_004/Pos_B313_error_behaviour_004.ttcn new file mode 100644 index 0000000..afa447d --- /dev/null +++ b/json/B_encoding_instructions/B3_ecoding_instructions/B313_error_behaviour/Pos_B313_error_behaviour_004/Pos_B313_error_behaviour_004.ttcn @@ -0,0 +1,52 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:B.3.13, Verify that "errorbehavior" variant is correctly used during decode. + ** @verdict pass accept, noexecution + ***************************************************/ +/* + * TTCN-3 predefined decoding functions ensure that the decoding trial of the inout + * parameter encoded_value will not cause a test case error, when the decoding fails + * or is incomplete. - ET_INVAL MSG:EB_IGNORE + * */ + +// NOTE: the test is not executed as it would require dedicated errorbehavior support + +module Pos_B313_error_behaviour_004{ + + import from JSON all; + + type component C { + + } + + template charstring m_msg := "abc" with { encode "JSON"; variant "errorbehavior(ET_INVAL MSG:EB_IGNORE)"}; + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + testcase TC_Pos_B313_error_behaviour_004() runs on C system C { + + // var octetstring v_enc := encvalue_o(m_msg, "errorbehavior(ET_INVAL MSG:EB_IGNORE)" , "JSON"); + var octetstring v_enc := '7B22696E7465676572223A317D'O; // invalid message {"integer":1} +log(v_enc); + // Decoding. + var charstring v_dec; + var integer v_decresult := decvalue_o(v_enc, v_dec, "errorbehavior(ET_INVAL MSG:EB_IGNORE)" , "JSON"); + + if(match(v_dec, "{" & char(U022) & "integer" & char(U022) & ":1}")){ + setverdict(pass); + } + else { + setverdict(fail, v_dec); + } + + } + + control { + // execute(TC_Pos_B313_error_behaviour_004(), PX_TC_EXECUTION_TIMEOUT); + } + +} \ No newline at end of file diff --git a/json/B_encoding_instructions/B3_ecoding_instructions/B313_error_behaviour/Pos_B313_error_behaviour_005/Pos_B313_error_behaviour_005.ttcn b/json/B_encoding_instructions/B3_ecoding_instructions/B313_error_behaviour/Pos_B313_error_behaviour_005/Pos_B313_error_behaviour_005.ttcn new file mode 100644 index 0000000..955e8d3 --- /dev/null +++ b/json/B_encoding_instructions/B3_ecoding_instructions/B313_error_behaviour/Pos_B313_error_behaviour_005/Pos_B313_error_behaviour_005.ttcn @@ -0,0 +1,58 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:B.3.13, Verify that "errorbehavior" variant is correctly used during decode. + ** @verdict pass accept, noexecution + ***************************************************/ +/* + * TTCN-3 predefined decoding functions ensure that the decoding trial of the inout + * parameter encoded_value will not cause a test case error, when the decoding fails + * or is incomplete. - ET_CONSTRAINT:EB_IGNORE + * */ + +// NOTE: the test is not executed as it would require dedicated errorbehavior support + +module Pos_B313_error_behaviour_005{ + + import from JSON all; + + type component C { + + } + + type integer MyInt (3..10) with { encode "JSON"; variant "errorbehavior(ET_CONSTRAINT:EB_IGNORE)"}; + template MyInt m_msg := 3; + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + testcase TC_Pos_B313_error_behaviour_005() runs on C system C { + + // encoded JSON + var octetstring v_enc := '7B22506F735F423331335F6572726F725F6265686176696F75725F3030352E4D79496E74223A327D'O; + + /** + * {"Pos_B313_error_behaviour_005.MyInt":2} + */ + + log(v_enc); + // Decoding: MyInt: 2 casuses CONSTRAINT error + var MyInt v_dec; + var integer v_decresult := decvalue_o(v_enc, v_dec, "errorbehavior(ET_CONSTRAINT:EB_IGNORE)" , "JSON"); + + if(match(v_decresult, 0)){ + setverdict(pass, v_dec); + } + else { + setverdict(fail, v_dec); + } + + } + + control { + // execute(TC_Pos_B313_error_behaviour_005(), PX_TC_EXECUTION_TIMEOUT); + } + +} \ No newline at end of file diff --git a/json/B_encoding_instructions/B3_ecoding_instructions/B313_error_behaviour/Pos_B313_error_behaviour_006/Pos_B313_error_behaviour_006.ttcn b/json/B_encoding_instructions/B3_ecoding_instructions/B313_error_behaviour/Pos_B313_error_behaviour_006/Pos_B313_error_behaviour_006.ttcn new file mode 100644 index 0000000..cca917b --- /dev/null +++ b/json/B_encoding_instructions/B3_ecoding_instructions/B313_error_behaviour/Pos_B313_error_behaviour_006/Pos_B313_error_behaviour_006.ttcn @@ -0,0 +1,58 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 11:B.3.13, Verify that "errorbehavior" variant is correctly used during decode. + ** @verdict pass accept, noexecution + ***************************************************/ +/* + * TTCN-3 predefined decoding functions ensure that the decoding trial of the inout + * parameter encoded_value will not cause a test case error, when the decoding fails + * or is incomplete. - ET_ALL:EB_IGNORE + * */ + +// NOTE: the test is not executed as it would require dedicated errorbehavior support + +module Pos_B313_error_behaviour_006{ + + import from JSON all; + + type component C { + + } + + type integer MyInt (3..10) with { encode "JSON"; variant "errorbehavior(ET_ALL:EB_IGNORE)"}; + template MyInt m_msg := 3; + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + testcase TC_Pos_B313_error_behaviour_006() runs on C system C { + + // encoded JSON + var octetstring v_enc := '7B22506F735F423331335F6572726F725F6265686176696F75725F3030352E4D79496E74223A327D'O; + + /** + * {"Pos_B313_error_behaviour_005.MyInt":2} + */ + + log(v_enc); + // Decoding: MyInt: 2 casuses CONSTRAINT error + var MyInt v_dec; + var integer v_decresult := decvalue_o(v_enc, v_dec, "errorbehavior(ET_ALL:EB_IGNORE)" , "JSON"); + + if(match(v_decresult, 0)){ + setverdict(pass, v_dec); + } + else { + setverdict(fail, v_dec); + } + + } + + control { + // execute(TC_Pos_B313_error_behaviour_006(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/oo/501_classes_and_objects/50101_classes/5010101_scope_rules/NegSem_5010101_scopeRules_001.ttcn b/oo/501_classes_and_objects/50101_classes/5010101_scope_rules/NegSem_5010101_scopeRules_001.ttcn new file mode 100755 index 0000000..9c9f30f --- /dev/null +++ b/oo/501_classes_and_objects/50101_classes/5010101_scope_rules/NegSem_5010101_scopeRules_001.ttcn @@ -0,0 +1,33 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 5.1.1.1, Ensure that reusing identifiers of members of the component type specified in the runs on clause of the class for members and inside methods for formal parameters and local declarations is not allowed + ** @verdict pass reject +*****************************************************************/ +module NegSem_5010101_scopeRules_001 "TTCN-3:2018 Object-Oriented" { + + type component GeneralComp { + const integer c_i := 5; + } + + public type class MyClass runs on GeneralComp { + const integer c_i := 8; //not allowed + + function DoNothing(integer c_i := 11) { //not allowed + log("Not allowed this type of reusing IDs."); + } + } + + testcase TC_NegSem_5010101_scopeRules_001() runs on GeneralComp { + var MyClass v_a := MyClass.create(); + if (v_a.c_i != c_i) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_NegSem_5010101_scopeRules_001()); + } +} \ No newline at end of file diff --git a/oo/501_classes_and_objects/50101_classes/5010101_scope_rules/Sem_5010101_scopeRules_001.ttcn b/oo/501_classes_and_objects/50101_classes/5010101_scope_rules/Sem_5010101_scopeRules_001.ttcn new file mode 100755 index 0000000..dc0318f --- /dev/null +++ b/oo/501_classes_and_objects/50101_classes/5010101_scope_rules/Sem_5010101_scopeRules_001.ttcn @@ -0,0 +1,39 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 5.1.1.1, Ensure that the reuse identifiers from the higher(module) scope. + ** @verdict pass accept +*****************************************************************/ +module Sem_5010101_scopeRules_001 "TTCN-3:2018 Object-Oriented" { + + const float c_f := 5.551; + + type component GeneralComp { + } + + public type class t_class_scope { + const float c_f := 2.5; + + public function get_cf() return float { + return this.c_f; + } + } + + testcase TC_Sem_5010101_scopeRules_001() runs on GeneralComp { + var t_class_scope v_a := t_class_scope.create(); + if (v_a.get_cf() == 2.5 and Sem_5010101_scopeRules_001.c_f == 5.551) { + setverdict(pass); + } else { + setverdict(fail); + } + if (v_a.get_cf()!= Sem_5010101_scopeRules_001.c_f) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_5010101_scopeRules_001()); + } +} \ No newline at end of file diff --git a/oo/501_classes_and_objects/50101_classes/5010101_scope_rules/Sem_5010101_scopeRules_002.ttcn b/oo/501_classes_and_objects/50101_classes/5010101_scope_rules/Sem_5010101_scopeRules_002.ttcn new file mode 100755 index 0000000..165ceaf --- /dev/null +++ b/oo/501_classes_and_objects/50101_classes/5010101_scope_rules/Sem_5010101_scopeRules_002.ttcn @@ -0,0 +1,32 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 5.1.1.1, Ensure that identifiers of member declarations can be reused inside methods for formal parameter and local declarations. + ** @verdict pass accept +*****************************************************************/ +module Sem_5010101_scopeRules_002 "TTCN-3:2018 Object-Oriented" { + + type component GeneralComp { + } + + public type class t_class_scope { + const integer a := 88; + + public function formalParameterScope(integer a := 87) return boolean { + return this.a != a; + } + } + + testcase TC_Sem_5010101_scopeRules_002() runs on GeneralComp { + var t_class_scope v_a := t_class_scope.create(); + if (v_a.formalParameterScope()) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_5010101_scopeRules_002()); + } +} \ No newline at end of file diff --git a/oo/501_classes_and_objects/50101_classes/5010102_abstract_classes/NegSem_5010102_abstractClasses_001.ttcn b/oo/501_classes_and_objects/50101_classes/5010102_abstract_classes/NegSem_5010102_abstractClasses_001.ttcn new file mode 100755 index 0000000..e172e15 --- /dev/null +++ b/oo/501_classes_and_objects/50101_classes/5010102_abstract_classes/NegSem_5010102_abstractClasses_001.ttcn @@ -0,0 +1,32 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 5.1.1.2, Ensure that abstract classes cannot be explicitly instantiated. + ** @verdict pass reject +*****************************************************************/ +module NegSem_5010102_abstractClasses_001 "TTCN-3:2018 Object-Oriented" { + + type component GeneralComp { + } + + public type class @abstract t_class_abstract { + + public function log_sending(); + } + + public type class t_class_subclass extends t_class_abstract { + + public function log_sending() { + log("Sending messages!!!"); + } + } + + testcase TC_NegSem_5010102_abstractClasses_001() runs on GeneralComp { + var t_class_abstract v_a := t_class_abstract.create(); //not allowed + setverdict(pass); + } + + control { + execute(TC_NegSem_5010102_abstractClasses_001()); + } +} \ No newline at end of file diff --git a/oo/501_classes_and_objects/50101_classes/5010102_abstract_classes/Sem_5010102_abstractClasses_001.ttcn b/oo/501_classes_and_objects/50101_classes/5010102_abstract_classes/Sem_5010102_abstractClasses_001.ttcn new file mode 100755 index 0000000..29c9644 --- /dev/null +++ b/oo/501_classes_and_objects/50101_classes/5010102_abstract_classes/Sem_5010102_abstractClasses_001.ttcn @@ -0,0 +1,36 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 5.1.1.2, Ensure that use abstract classes correctly. + ** @verdict pass accept +*****************************************************************/ +module Sem_5010102_abstractClasses_001 "TTCN-3:2018 Object-Oriented" { + + type component GeneralComp { + } + + public type class @abstract t_class_abstract { + + public function doSomethingSpecial(integer v_arg) return integer; + } + + public type class t_class_subclass extends t_class_abstract { + + public function doSomethingSpecial(integer v_arg) return integer { + return v_arg + 1; + } + } + + testcase TC_Sem_5010102_abstractClasses_001() runs on GeneralComp { + var t_class_subclass v_a := t_class_subclass.create(); + if (v_a.doSomethingSpecial(64) == 65) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_5010102_abstractClasses_001()); + } +} \ No newline at end of file diff --git a/oo/501_classes_and_objects/50101_classes/5010103_external_classes/Java_Int_List.jar b/oo/501_classes_and_objects/50101_classes/5010103_external_classes/Java_Int_List.jar new file mode 100755 index 0000000000000000000000000000000000000000..7b79dad5504ad10a3b1fc03a4d0650ccf8df7db4 GIT binary patch literal 1183 zcmWIWW@Zs#;Nak35G_#;U_b(#3@i-3t|5-Po_=on|4uP5Ff#;rvvYt{FhP|C;M6Pv zQ~}rQ>*(j{<{BKL=j-;__snS@Z(Y5MyxzK6=gyqp9At3C_`%a6JuhD!Pv48Bt5`TA zUPvC1j*`&I_#v*U_I!z!#dC4dC*rEp7_Mf2D*9N&2zG_UM;lugpdGG2jBv$_98@m| z0cE`s%M#-~^Gf1tIk-fPJi$Ep>k2!^^;xyPW#VWGwa=(6)l$%Zyzdr(aoGK zm{rlccY^y?fk|frZk{^D7ve29Q+LDO!=JJgFX?RiUvW9d=)2&9Y@>!_OT?2(9M(K= z=V_Zg|0&}KM;U+S=*Zq_M~>M|+ZyqVjjbc;} z3S)RMIVZ8WICtXhY~etGWA*9gX_MbRyXJl6TJ&38&!aycM0+{1C&1my<;(3|Va@ux$r(J8_ z{Set*~<;?~G_9<#NVum14e|8mNLco(zWe@ja&C$YJ2dzpOOc!8JiMuV%LbvzG!H{`=7!nLd%M;o`Ez>lX)2$L7CXPNNxOb#{F^-r{zmev z)^dluwmvtT`_B0%c4>E5H>RF+@SCTspA&zn@u0m_O9U<+izwIXFqWD`Ky2s!5} literal 0 HcmV?d00001 diff --git a/oo/501_classes_and_objects/50101_classes/5010103_external_classes/NegSem_5010103_externalClasses_001.ttcn b/oo/501_classes_and_objects/50101_classes/5010103_external_classes/NegSem_5010103_externalClasses_001.ttcn new file mode 100644 index 0000000..a18d843 --- /dev/null +++ b/oo/501_classes_and_objects/50101_classes/5010103_external_classes/NegSem_5010103_externalClasses_001.ttcn @@ -0,0 +1,25 @@ +/***************************************************************** + ** @author STF T003 + ** @version 0.0.1 + ** @purpose 5.1.1.3, Ensure that an internal class shall not extend an external class (Restriction d) + ** @verdict pass reject +*****************************************************************/ +module NegSem_5010103_externalClasses_001 language "TTCN-3:2018 Object-Oriented" { + type component GeneralComp { + } + + type external class Java_Int_List { + } + + type class Internal_Java_Int_List extends Java_Int_List { //not allowed + } + + testcase TC_NegSem_5010103_externalClasses_001() runs on GeneralComp { + //empty testcase + setverdict(pass); + } + + control { + execute(TC_NegSem_5010103_externalClasses_001()); + } +} \ No newline at end of file diff --git a/oo/501_classes_and_objects/50101_classes/5010103_external_classes/Sem_5010103_externalClasses_001.ttcn b/oo/501_classes_and_objects/50101_classes/5010103_external_classes/Sem_5010103_externalClasses_001.ttcn new file mode 100755 index 0000000..b305b3b --- /dev/null +++ b/oo/501_classes_and_objects/50101_classes/5010103_external_classes/Sem_5010103_externalClasses_001.ttcn @@ -0,0 +1,37 @@ +/***************************************************************** + ** @author STF T003 + ** @version 0.0.1 + ** @purpose 5.1.1.3, Ensure that an internal class shall not extend an external class (Restriction d) + ** @verdict pass reject +*****************************************************************/ +module NegSem_5010103_externalClasses_001 language "TTCN-3:2018 Object-Oriented" { + + type component GeneralComp { + } + + type external class Java_Int_List { + + /* + function add(integer v) { + log("Add v to integer list"); //not alloed + } + function get(integer index) return integer; + const charstring c_a := "ret"; //not allowed + */ + } + + type class Internal_Java_Int_List extends Java_Int_List { //not allowed + + } + + + + testcase TC_NegSem_5010103_externalClasses_001() runs on GeneralComp { + //empty testcase + setverdict(pass); + } + + control { + execute(TC_NegSem_5010103_externalClasses_001()); + } +} \ No newline at end of file diff --git a/oo/501_classes_and_objects/50101_classes/5010103_external_classes/Sem_5010103_externalClasses_002.ttcn b/oo/501_classes_and_objects/50101_classes/5010103_external_classes/Sem_5010103_externalClasses_002.ttcn new file mode 100644 index 0000000..297ca98 --- /dev/null +++ b/oo/501_classes_and_objects/50101_classes/5010103_external_classes/Sem_5010103_externalClasses_002.ttcn @@ -0,0 +1,30 @@ +/***************************************************************** + ** @author STF T003 + ** @version 0.0.1 + ** @purpose 5.1.1.3, Ensure that external classes can extend non‑external classes + ** @verdict pass accept +*****************************************************************/ +module Sem_5010103_externalClasses_002 language "TTCN-3:2018 Object-Oriented" { + + type component GeneralComp { + } + + type class t_internal_class { + function add(integer v) {} + } + + type external class Java_Int_List extends t_internal_class { + function get(integer index) return integer; + } + + + + testcase TC_Sem_5010103_externalClasses_002() runs on GeneralComp { + //empty testcase + setverdict(pass); + } + + control { + execute(TC_Sem_5010103_externalClasses_002()); + } +} \ No newline at end of file diff --git a/oo/501_classes_and_objects/50101_classes/5010104_final_classes/NegSem_5010104_finalClasses_002.ttcn b/oo/501_classes_and_objects/50101_classes/5010104_final_classes/NegSem_5010104_finalClasses_002.ttcn new file mode 100644 index 0000000..bc29881 --- /dev/null +++ b/oo/501_classes_and_objects/50101_classes/5010104_final_classes/NegSem_5010104_finalClasses_002.ttcn @@ -0,0 +1,30 @@ +/***************************************************************** + ** @author STF T003 + ** @version 0.0.1 + ** @purpose 5.1.1.4, Ensure that final classes cannot be subclassed. + ** @verdict pass reject +*****************************************************************/ +module NegSem_5010104_finalClasses_002 language "TTCN-3:2018 Object-Oriented" { + + type component GeneralComp { + } + + type class @final FinalClass { + function doSomething() return charstring { + return "something"; + } + } + + type class Subclass extends FinalClass { //not allowed + var integer i; + } + + testcase TC_NegSem_5010104_finalClasses_002() runs on GeneralComp { + var Subclass o_subclass := Subclass.create(1); + setverdict(pass); + } + + control { + execute(TC_NegSem_5010104_finalClasses_002()); + } +} \ No newline at end of file diff --git a/oo/501_classes_and_objects/50101_classes/5010104_final_classes/Sem_5010104_finalClasses_001.ttcn b/oo/501_classes_and_objects/50101_classes/5010104_final_classes/Sem_5010104_finalClasses_001.ttcn new file mode 100755 index 0000000..58e9489 --- /dev/null +++ b/oo/501_classes_and_objects/50101_classes/5010104_final_classes/Sem_5010104_finalClasses_001.ttcn @@ -0,0 +1,30 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 5.1.1.4, Ensure that use final classes correctly. + ** @verdict pass accept +*****************************************************************/ +module Sem_5010104_finalClasses_001 "TTCN-3:2018 Object-Oriented" { + + type component GeneralComp { + } + + type class @final FinalClass { + function doSomething() return charstring { + return "something"; + } + } + + testcase TC_Sem_5010104_finalClasses_001() runs on GeneralComp { + var FinalClass v_a := FinalClass.create(); + if (v_a.doSomething() == "something") { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_5010104_finalClasses_001()); + } +} \ No newline at end of file diff --git a/oo/501_classes_and_objects/50101_classes/5010105_constructors/NegSem_5010105_Constructors_001.ttcn b/oo/501_classes_and_objects/50101_classes/5010105_constructors/NegSem_5010105_Constructors_001.ttcn new file mode 100644 index 0000000..2d8ae75 --- /dev/null +++ b/oo/501_classes_and_objects/50101_classes/5010105_constructors/NegSem_5010105_Constructors_001.ttcn @@ -0,0 +1,27 @@ +/***************************************************************** + ** @author STF T003 + ** @version 0.0.1 + ** @purpose 5.1.1.5, Ensure that no out formal parameter is allowed in constructor + ** @verdict pass reject +*****************************************************************/ +module NegSem_5010105_Constructors_001 language "TTCN-3:2018 Object-Oriented" { + + type component GeneralComp { + } + + type class MyClass { + var integer v_i; + + create(out integer v_i) { + this.v_i := v_i; + } + } + + testcase TC_NegSem_5010105_Constructors_001() runs on GeneralComp { + setverdict(pass); + } + + control { + execute(TC_NegSem_5010105_Constructors_001()); + } +} \ No newline at end of file diff --git a/oo/501_classes_and_objects/50101_classes/5010105_constructors/NegSem_5010105_Constructors_002.ttcn b/oo/501_classes_and_objects/50101_classes/5010105_constructors/NegSem_5010105_Constructors_002.ttcn new file mode 100644 index 0000000..b4470d2 --- /dev/null +++ b/oo/501_classes_and_objects/50101_classes/5010105_constructors/NegSem_5010105_Constructors_002.ttcn @@ -0,0 +1,27 @@ +/***************************************************************** + ** @author STF T003 + ** @version 0.0.1 + ** @purpose 5.1.1.5, Ensure that no inout formal parameter is allowed in constructor + ** @verdict pass reject +*****************************************************************/ +module NegSem_5010105_Constructors_002 language "TTCN-3:2018 Object-Oriented" { + + type component GeneralComp { + } + + type class MyClass { + var integer v_i; + + create(inout integer v_i) { + this.v_i := v_i; + } + } + + testcase TC_NegSem_5010105_Constructors_002() runs on GeneralComp { + setverdict(pass); + } + + control { + execute(TC_NegSem_5010105_Constructors_002()); + } +} \ No newline at end of file diff --git a/oo/501_classes_and_objects/50101_classes/5010105_constructors/NegSem_5010105_Constructors_003.ttcn b/oo/501_classes_and_objects/50101_classes/5010105_constructors/NegSem_5010105_Constructors_003.ttcn new file mode 100644 index 0000000..aee10b9 --- /dev/null +++ b/oo/501_classes_and_objects/50101_classes/5010105_constructors/NegSem_5010105_Constructors_003.ttcn @@ -0,0 +1,25 @@ +/***************************************************************** + ** @author STF T003 + ** @version 0.0.1 + ** @purpose 5.1.1.5, Ensure that initialized formal parameters are not included in implicit constructor + ** @verdict pass reject +*****************************************************************/ +module NegSem_5010105_Constructors_003 language "TTCN-3:2018 Object-Oriented" { + + type component GeneralComp { + } + + type class MyClass { + var integer v_i; + template integer t_myTemplate := 5; //integer template initialized + } + + testcase TC_NegSem_5010105_Constructors_003() runs on GeneralComp { + var MyClass o_myClass := MyClass.create(1, 5); //not allowed, implicit constructor should have only one formal param + setverdict(pass); + } + + control { + execute(TC_NegSem_5010105_Constructors_003()); + } +} diff --git a/oo/501_classes_and_objects/50101_classes/5010105_constructors/NegSem_5010105_Constructors_004.ttcn b/oo/501_classes_and_objects/50101_classes/5010105_constructors/NegSem_5010105_Constructors_004.ttcn new file mode 100644 index 0000000..47aa593 --- /dev/null +++ b/oo/501_classes_and_objects/50101_classes/5010105_constructors/NegSem_5010105_Constructors_004.ttcn @@ -0,0 +1,32 @@ +/***************************************************************** + ** @author STF T003 + ** @version 0.0.1 + ** @purpose 5.1.1.5, Ensure that constructors do not assign anything to variables that are not local to the constructor body or accessible fields of the class the constructor belongs to + ** @verdict pass reject +*****************************************************************/ +module NegSem_5010105_Constructors_004 language "TTCN-3:2018 Object-Oriented" { + + type component GeneralComp { + var integer v_myVar; + } + + + type class MyClass runs on GeneralComp { + var integer v_i; + + create(integer v_i) { + this.v_i := v_i; + v_myVar := 4; //not allowed, v_myVar is not constructor local or field of MyClass + } + + } + + testcase TC_NegSem_5010105_Constructors_004() runs on GeneralComp { + var MyClass o_myClass := MyClass.create(1); + setverdict(pass); + } + + control { + execute(TC_NegSem_5010105_Constructors_004()); + } +} \ No newline at end of file diff --git a/oo/501_classes_and_objects/50101_classes/5010105_constructors/NegSem_5010105_Constructors_005.ttcn b/oo/501_classes_and_objects/50101_classes/5010105_constructors/NegSem_5010105_Constructors_005.ttcn new file mode 100644 index 0000000..5eed5cb --- /dev/null +++ b/oo/501_classes_and_objects/50101_classes/5010105_constructors/NegSem_5010105_Constructors_005.ttcn @@ -0,0 +1,32 @@ +/***************************************************************** + ** @author STF T003 + ** @version 0.0.1 + ** @purpose 5.1.1.5, Ensure that constructor body shall not use blocking operations + ** @verdict pass reject +*****************************************************************/ +module NegSem_5010105_Constructors_005 language "TTCN-3:2018 Object-Oriented" { + + type component GeneralComp { + } + + type class MyClass { + var integer v_i; + timer t1 := 4.0; + + create(integer v_i) { + this.v_i := v_i; + t1.start; + t1.timeout; //not allowed, timeout is blocking operation + } + + } + + testcase TC_NegSem_5010105_Constructors_005() runs on GeneralComp { + var MyClass o_myClass := MyClass.create(1); + setverdict(pass); + } + + control { + execute(TC_NegSem_5010105_Constructors_005()); + } +} \ No newline at end of file diff --git a/oo/501_classes_and_objects/50101_classes/5010105_constructors/NegSem_5010105_Constructors_006.ttcn b/oo/501_classes_and_objects/50101_classes/5010105_constructors/NegSem_5010105_Constructors_006.ttcn new file mode 100644 index 0000000..db0d6dd --- /dev/null +++ b/oo/501_classes_and_objects/50101_classes/5010105_constructors/NegSem_5010105_Constructors_006.ttcn @@ -0,0 +1,32 @@ +/***************************************************************** + ** @author STF T003 + ** @version 0.0.1 + ** @purpose 5.1.1.5, Ensure that initialization of a member field shall not invoke any member function in the object being initialized + ** @verdict pass reject +*****************************************************************/ +module NegSem_5010105_Constructors_006 language "TTCN-3:2018 Object-Oriented" { + + type component GeneralComp { + } + + type class MyClass { + var integer v_i := set_vi(3); //not allowed, calling a member function to initialize a member field + + public function set_vi(integer v_i) return integer { + return v_i; + } + + public function get_vi() return integer { + return this.v_i; + } + } + + testcase TC_NegSem_5010105_Constructors_006() runs on GeneralComp { + var MyClass o_myClass := MyClass.create(); + setverdict(pass); + } + + control { + execute(TC_NegSem_5010105_Constructors_006()); + } +} \ No newline at end of file diff --git a/oo/501_classes_and_objects/50101_classes/5010105_constructors/NegSem_5010105_Constructors_007.ttcn b/oo/501_classes_and_objects/50101_classes/5010105_constructors/NegSem_5010105_Constructors_007.ttcn new file mode 100644 index 0000000..904ced5 --- /dev/null +++ b/oo/501_classes_and_objects/50101_classes/5010105_constructors/NegSem_5010105_Constructors_007.ttcn @@ -0,0 +1,36 @@ +/***************************************************************** + ** @author STF T003 + ** @version 0.0.1 + ** @purpose 5.1.1.5, The constructor body shall not invoke any member function in the object being initialized. + ** @verdict pass reject +*****************************************************************/ +module NegSem_5010105_Constructors_007 language "TTCN-3:2018 Object-Oriented" { + + type component GeneralComp { + } + + type class MyClass { + var integer v_i; + + create(integer v_i) { + this.set_vi(v_i); //not allowed, calling of a member function in constructor body + } + + public function set_vi(integer v_i) { + this.v_i := v_i; + } + + public function get_vi() return integer { + return this.v_i; + } + } + + testcase TC_NegSem_5010105_Constructors_007() runs on GeneralComp { + var MyClass o_myClass := MyClass.create(1); + setverdict(pass); + } + + control { + execute(TC_NegSem_5010105_Constructors_007()); + } +} \ No newline at end of file diff --git a/oo/501_classes_and_objects/50101_classes/5010105_constructors/NegSem_5010105_Constructors_008.ttcn b/oo/501_classes_and_objects/50101_classes/5010105_constructors/NegSem_5010105_Constructors_008.ttcn new file mode 100644 index 0000000..3d3442e --- /dev/null +++ b/oo/501_classes_and_objects/50101_classes/5010105_constructors/NegSem_5010105_Constructors_008.ttcn @@ -0,0 +1,28 @@ +/***************************************************************** + ** @author STF T003 + ** @version 0.0.1 + ** @purpose 5.1.1.5, Ensure that constants are initialized exactly once + ** @verdict pass reject +*****************************************************************/ +module NegSem_5010105_Constructors_008 language "TTCN-3:2018 Object-Oriented" { + + type component GeneralComp { + } + + type class MyClass { + const integer c_i := 1; + + create() { + this.c_i := 1; //not allowed, constants shall be initialized exactly once + } + } + + testcase TC_NegSem_5010105_Constructors_008() runs on GeneralComp { + var MyClass o_myClass := MyClass.create(); + setverdict(pass); + } + + control { + execute(TC_NegSem_5010105_Constructors_008()); + } +} \ No newline at end of file diff --git a/oo/501_classes_and_objects/50101_classes/5010105_constructors/NegSem_5010105_Constructors_009.ttcn b/oo/501_classes_and_objects/50101_classes/5010105_constructors/NegSem_5010105_Constructors_009.ttcn new file mode 100644 index 0000000..c20328a --- /dev/null +++ b/oo/501_classes_and_objects/50101_classes/5010105_constructors/NegSem_5010105_Constructors_009.ttcn @@ -0,0 +1,28 @@ +/***************************************************************** + ** @author STF T003 + ** @version 0.0.1 + ** @purpose 5.1.1.5, Ensure that templates are initialized exactly once + ** @verdict pass reject +*****************************************************************/ +module NegSem_5010105_Constructors_009 language "TTCN-3:2018 Object-Oriented" { + + type component GeneralComp { + } + + type class MyClass { + template integer t_i := 1; + + create() { + this.t_i := 1; //not allowed, templates shall be initialized exactly once + } + } + + testcase TC_NegSem_5010105_Constructors_009() runs on GeneralComp { + var MyClass o_myClass := MyClass.create(); + setverdict(pass); + } + + control { + execute(TC_NegSem_5010105_Constructors_009()); + } +} \ No newline at end of file diff --git a/oo/501_classes_and_objects/50101_classes/5010105_constructors/NegSem_5010105_Constructors_010.ttcn b/oo/501_classes_and_objects/50101_classes/5010105_constructors/NegSem_5010105_Constructors_010.ttcn new file mode 100644 index 0000000..3e12874 --- /dev/null +++ b/oo/501_classes_and_objects/50101_classes/5010105_constructors/NegSem_5010105_Constructors_010.ttcn @@ -0,0 +1,24 @@ +/***************************************************************** + ** @author STF T003 + ** @version 0.0.1 + ** @purpose 5.1.1.5, Ensure that the initializer of a field shall not use the same field directly or indirectly + ** @verdict pass reject +*****************************************************************/ +module NegSem_5010105_Constructors_010 language "TTCN-3:2018 Object-Oriented" { + + type component GeneralComp { + } + + type class MyClass { + var integer v_i := v_i + 1; //not allowed, cyclic initialization + } + + testcase TC_NegSem_5010105_Constructors_010() runs on GeneralComp { + var MyClass o_myClass := MyClass.create(); + setverdict(pass); + } + + control { + execute(TC_NegSem_5010105_Constructors_010()); + } +} \ No newline at end of file diff --git a/oo/501_classes_and_objects/50101_classes/5010105_constructors/NegSem_5010105_Constructors_011.ttcn b/oo/501_classes_and_objects/50101_classes/5010105_constructors/NegSem_5010105_Constructors_011.ttcn new file mode 100644 index 0000000..70b0c5e --- /dev/null +++ b/oo/501_classes_and_objects/50101_classes/5010105_constructors/NegSem_5010105_Constructors_011.ttcn @@ -0,0 +1,25 @@ +/***************************************************************** + ** @author STF T003 + ** @version 0.0.1 + ** @purpose 5.1.1.5, Ensure that the initializer of a field shall not use a field that does not have an initializer + ** @verdict pass reject +*****************************************************************/ +module NegSem_5011105_Constructors_011 language "TTCN-3:2018 Object-Oriented" { + + type component GeneralComp { + } + + type class MyClass { + var integer v_u; + var integer v_i := v_u; //not allowed, v_u is uninitialized + } + + testcase TC_NegSem_5010105_Constructors_011() runs on GeneralComp { + var MyClass o_myClass := MyClass.create(1); + setverdict(pass); + } + + control { + execute(TC_NegSem_5010105_Constructors_011()); + } +} \ No newline at end of file diff --git a/oo/501_classes_and_objects/50101_classes/5010105_constructors/Sem_5010105_Constructors_001.ttcn b/oo/501_classes_and_objects/50101_classes/5010105_constructors/Sem_5010105_Constructors_001.ttcn new file mode 100755 index 0000000..cc115ba --- /dev/null +++ b/oo/501_classes_and_objects/50101_classes/5010105_constructors/Sem_5010105_Constructors_001.ttcn @@ -0,0 +1,42 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 5.1.1.5, Ensure that use class constructor with formal parameter. + ** @verdict pass accept +*****************************************************************/ +module Sem_5010105_Constructors_001 "TTCN-3:2018 Object-Oriented" { + + type component GeneralComp { + } + + type class MyClass { + var integer v_i; + var charstring v_id; + + create(integer v_i, charstring v_id) { + this.v_i := v_i; + this.v_id := v_id; + } + + public function get_vi() return integer { + return this.v_i; + } + + public function get_vid() return charstring { + return this.v_id; + } + } + + testcase TC_Sem_5010105_Constructors_001() runs on GeneralComp { + var MyClass v_a := MyClass.create(5, "abc"); + if (v_a.get_vi() == 5 and v_a.get_vid() == "abc") { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_5010105_Constructors_001()); + } +} \ No newline at end of file diff --git a/oo/501_classes_and_objects/50101_classes/5010105_constructors/Sem_5010105_Constructors_002.ttcn b/oo/501_classes_and_objects/50101_classes/5010105_constructors/Sem_5010105_Constructors_002.ttcn new file mode 100755 index 0000000..b8cf2b0 --- /dev/null +++ b/oo/501_classes_and_objects/50101_classes/5010105_constructors/Sem_5010105_Constructors_002.ttcn @@ -0,0 +1,44 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 5.1.1.5, Ensure that use class constructor with its superclass constructor. + ** @verdict pass accept +*****************************************************************/ +module Sem_5010105_Constructors_002 "TTCN-3:2018 Object-Oriented" { + + type component GeneralComp { + } + + type class MySuperClass { + var octetstring v_o; + + create(octetstring v_o) { + this.v_o := v_o; + } + + public function get_vo() return octetstring { + return this.v_o; + } + } + + type class MySubClass extends MySuperClass { + var template charstring vt_cstr; + + create(template charstring vt_cstr) : MySuperClass('AA5600'O) { + this.vt_cstr := vt_cstr; + } + } + + testcase TC_Sem_5010105_Constructors_002() runs on GeneralComp { + var MySubClass v_a := MySubClass.create( pattern "?abc*"); + if (v_a.get_vo() == 'AA5600'O) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_5010105_Constructors_002()); + } +} \ No newline at end of file diff --git a/oo/501_classes_and_objects/50101_classes/5010106_constructor_invocation/NegSem_5010106_ConstructorInvocation_001.ttcn b/oo/501_classes_and_objects/50101_classes/5010106_constructor_invocation/NegSem_5010106_ConstructorInvocation_001.ttcn new file mode 100644 index 0000000..abc94d9 --- /dev/null +++ b/oo/501_classes_and_objects/50101_classes/5010106_constructor_invocation/NegSem_5010106_ConstructorInvocation_001.ttcn @@ -0,0 +1,46 @@ +/***************************************************************** + ** @author TTF T003 + ** @version 0.0.1 + ** @purpose 5.1.1.6, Ensure that class constructor can be invoked. + ** @verdict pass reject +*****************************************************************/ +module NegSem_5010106_ConstructorInvocation_001 language "TTCN-3:2018 Object-Oriented" { + + type component GeneralComp { + } + + type class MyClass { + var integer v_id; + + public function get_vid() return integer { + return this.v_id; + } + } + + type external class MyExternalClass extends MyClass { + var charstring v_cstr; + + create(integer id) + external (charstring cstr): MyClass(id){ + this.v_cstr := cstr; + } + + public function get_vcstr() return charstring { + return this.v_cstr; + } + } + + testcase TC_NegSem_5010106_ConstructorInvocation_001() runs on GeneralComp { + var MyExternalClass v_ext := MyExternalClass.create(123, "abc"); //not allowed + + if (v_ext.get_vcstr() == "abc") { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_NegSem_5010106_ConstructorInvocation_001()); + } +} \ No newline at end of file diff --git a/oo/501_classes_and_objects/50101_classes/5010106_constructor_invocation/NegSem_5010106_ConstructorInvocation_002.ttcn b/oo/501_classes_and_objects/50101_classes/5010106_constructor_invocation/NegSem_5010106_ConstructorInvocation_002.ttcn new file mode 100644 index 0000000..65dd507 --- /dev/null +++ b/oo/501_classes_and_objects/50101_classes/5010106_constructor_invocation/NegSem_5010106_ConstructorInvocation_002.ttcn @@ -0,0 +1,46 @@ +/***************************************************************** + ** @author TTF T003 + ** @version 0.0.1 + ** @purpose 5.1.1.6, Ensure that external class constructor with parameter list can not be invoked without external actual parameter. + ** @verdict pass reject +*****************************************************************/ +module NegSem_5010106_ConstructorInvocation_002 language "TTCN-3:2018 Object-Oriented" { + + type component GeneralComp { + } + + type class MyClass { + var integer v_id; + + public function get_vid() return integer { + return this.v_id; + } + } + + type external class MyExternalClass extends MyClass { + var charstring v_cstr; + + create(integer id) + external (charstring cstr): MyClass(id){ + this.v_cstr := cstr; + } + + public function get_vcstr() return charstring { + return this.v_cstr; + } + } + + testcase TC_NegSem_5010106_ConstructorInvocation_002() runs on GeneralComp { + var MyExternalClass v_ext := MyExternalClass.create(123); //not allowed: "external" is missing + + if (v_ext.get_vid() == 123) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_NegSem_5010106_ConstructorInvocation_002()); + } +} \ No newline at end of file diff --git a/oo/501_classes_and_objects/50101_classes/5010106_constructor_invocation/Sem_5010106_ConstructorInvocation_001.ttcn b/oo/501_classes_and_objects/50101_classes/5010106_constructor_invocation/Sem_5010106_ConstructorInvocation_001.ttcn new file mode 100644 index 0000000..3f67159 --- /dev/null +++ b/oo/501_classes_and_objects/50101_classes/5010106_constructor_invocation/Sem_5010106_ConstructorInvocation_001.ttcn @@ -0,0 +1,44 @@ +/***************************************************************** + ** @author TTF T003 + ** @version 0.0.1 + ** @purpose 5.1.1.6, Ensure that class constructor can be invoked and return reference to the newly constructed object. + ** @verdict pass accept +*****************************************************************/ +module Sem_5010106_ConstructorInvocation_001 language "TTCN-3:2018 Object-Oriented" { + + type component GeneralComp { + } + + type class MyClass { + var integer v_id; + + create(integer id){ + this.v_id := id; + } + + public function get_vid() return integer { + return this.v_id; + } + } + + testcase TC_Sem_5010106_ConstructorInvocation_001() runs on GeneralComp { + var MyClass v_a := MyClass.create(123); + + if (v_a.get_vid() == 123) { + setverdict(pass); + } else { + setverdict(fail); + } + + v_a := MyClass.create(321); //return reference to the newly constructed object. + if (v_a.get_vid() == 321) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_5010106_ConstructorInvocation_001()); + } +} \ No newline at end of file diff --git a/oo/501_classes_and_objects/50101_classes/5010106_constructor_invocation/Sem_5010106_ConstructorInvocation_002.ttcn b/oo/501_classes_and_objects/50101_classes/5010106_constructor_invocation/Sem_5010106_ConstructorInvocation_002.ttcn new file mode 100644 index 0000000..c8c6546 --- /dev/null +++ b/oo/501_classes_and_objects/50101_classes/5010106_constructor_invocation/Sem_5010106_ConstructorInvocation_002.ttcn @@ -0,0 +1,46 @@ +/***************************************************************** + ** @author TTF T003 + ** @version 0.0.1 + ** @purpose 5.1.1.6, Ensure that external class constructor can be invoked with additional external parameter list. + ** @verdict pass accept +*****************************************************************/ +module Sem_5010106_ConstructorInvocation_002 language "TTCN-3:2018 Object-Oriented" { + + type component GeneralComp { + } + + type class MyClass { + var integer v_id; + + public function get_vid() return integer { + return this.v_id; + } + } + + type external class MyExternalClass extends MyClass { + var charstring v_cstr; + + create(integer id) + external (charstring cstr): MyClass(id){ + this.v_cstr := cstr; + } + + public function get_vcstr() return charstring { + return this.v_cstr; + } + } + + testcase TC_Sem_5010106_ConstructorInvocation_002() runs on GeneralComp { + var MyExternalClass v_ext := MyExternalClass.create(123) external ("abc"); + + if (v_ext.get_vid() == 123 and v_ext.get_vcstr() == "abc") { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_5010106_ConstructorInvocation_002()); + } +} \ No newline at end of file diff --git a/oo/501_classes_and_objects/50101_classes/5010106_constructor_invocation/Sem_5010106_ConstructorInvocation_003.ttcn b/oo/501_classes_and_objects/50101_classes/5010106_constructor_invocation/Sem_5010106_ConstructorInvocation_003.ttcn new file mode 100644 index 0000000..92aff7a --- /dev/null +++ b/oo/501_classes_and_objects/50101_classes/5010106_constructor_invocation/Sem_5010106_ConstructorInvocation_003.ttcn @@ -0,0 +1,33 @@ +/***************************************************************** + ** @author TTF T003 + ** @version 0.0.1 + ** @purpose 5.1.1.6, Ensure that class constructor can be invoked with no actual parameter list. + ** @verdict pass accept +*****************************************************************/ +module Sem_5010106_ConstructorInvocation_003 language "TTCN-3:2018 Object-Oriented" { + + type component GeneralComp { + } + + type external class MyExternalClass { + //var integer v_id; + + public function get_sum(integer x, integer y) return integer { + return x + y; + } + } + + testcase TC_Sem_5010106_ConstructorInvocation_003() runs on GeneralComp { + var MyExternalClass v_ext := MyExternalClass.create(); + + if (v_ext.get_sum(1,2) == 3) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_5010106_ConstructorInvocation_003()); + } +} diff --git a/oo/501_classes_and_objects/50101_classes/5010107_destructors/Sem_5010107_Destructors_001.ttcn b/oo/501_classes_and_objects/50101_classes/5010107_destructors/Sem_5010107_Destructors_001.ttcn new file mode 100755 index 0000000..c01c969 --- /dev/null +++ b/oo/501_classes_and_objects/50101_classes/5010107_destructors/Sem_5010107_Destructors_001.ttcn @@ -0,0 +1,48 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 5.1.1.7, Ensure that class destructors can be used + ** @verdict pass accept +*****************************************************************/ +module Sem_5010107_Destructors_001 language "TTCN-3:2018 Object-Oriented" { + + type component GeneralComp { + port MyPort p1; + } + + type port MyPort message { + inout integer; + } + + type class MyClass { + var integer v_i; + + create(integer v_i) { + this.v_i := v_i; + } + + public function get_vi() return integer { + return this.v_i; + } + } finally { + this.v_i := 0; + } + + testcase TC_Sem_5010107_Destructors_001() runs on GeneralComp { + var MyClass v_a := MyClass.create(7); + timer T1 := 5.0; + connect(self:p1, self:p1); + p1.send(v_a.get_vi()); + alt { + [] p1.receive(7) { T1.stop; setverdict(pass); } + [] p1.receive { T1.stop; setverdict(fail); } + [] T1.timeout { setverdict(fail); } + } + disconnect(self:p1, self:p1); + } + + control { + execute(TC_Sem_5010107_Destructors_001()); + } + +} \ No newline at end of file diff --git a/oo/501_classes_and_objects/50101_classes/5010107_methods/NegSem_5010107_Methods_001.ttcn b/oo/501_classes_and_objects/50101_classes/5010107_methods/NegSem_5010107_Methods_001.ttcn new file mode 100755 index 0000000..03e3586 --- /dev/null +++ b/oo/501_classes_and_objects/50101_classes/5010107_methods/NegSem_5010107_Methods_001.ttcn @@ -0,0 +1,39 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 5.1.1.7, Ensure that public methods shall be overridden only by public methods. + ** @verdict pass reject +*****************************************************************/ +module NegSem_5010107_Methods_001 "TTCN-3:2018 Object-Oriented" { + + type component GeneralComp { + } + + type class MySuperClass { + var octetstring v_o; + + public function doSomething() return integer { + return oct2int(this.v_o); + } + } + + type class MySubClass extends MySuperClass { + + private function doSomething() return integer { //not allowed + return 1; + } + } + + testcase TC_NegSem_5010107_Methods_001() runs on GeneralComp { + var MySubClass v_a := MySubClass.create('AAFF'O); + if (v_a.doSomething() == 1) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_NegSem_5010107_Methods_001()); + } +} diff --git a/oo/501_classes_and_objects/50101_classes/5010107_methods/NegSem_5010107_Methods_003.ttcn b/oo/501_classes_and_objects/50101_classes/5010107_methods/NegSem_5010107_Methods_003.ttcn new file mode 100755 index 0000000..7ec1859 --- /dev/null +++ b/oo/501_classes_and_objects/50101_classes/5010107_methods/NegSem_5010107_Methods_003.ttcn @@ -0,0 +1,42 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 5.1.1.7, Ensure that The return type of an overriding function shall be the same as the return type of the overridden function with the same template restrictions and modifiers. + ** @verdict pass reject +*****************************************************************/ +module NegSem_5010107_Methods_003 "TTCN-3:2018 Object-Oriented" { + + type component GeneralComp { + } + + type integer Mytype1; + type Mytype1 Mytype2; + + type class MySuperClass { + var octetstring v_o; + + function doSomething() return Mytype1 { + return oct2int(this.v_o); + } + } + + type class MySubClass extends MySuperClass { + + function doSomething() return Mytype2 { //allowed? + return 1; + } + } + + testcase TC_NegSem_5010107_Methods_003() runs on GeneralComp { + var MySubClass v_a := MySubClass.create('AAFF'O) : MySuperClass(); + if (v_a.doSomething() == 1) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_NegSem_5010107_Methods_003()); + } +} \ No newline at end of file diff --git a/oo/501_classes_and_objects/50101_classes/5010107_methods/Sem_5010107_Methods_001.ttcn b/oo/501_classes_and_objects/50101_classes/5010107_methods/Sem_5010107_Methods_001.ttcn new file mode 100755 index 0000000..afd7ff1 --- /dev/null +++ b/oo/501_classes_and_objects/50101_classes/5010107_methods/Sem_5010107_Methods_001.ttcn @@ -0,0 +1,37 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 5.1.1.7, Ensure that use class methods. + ** @verdict pass accept +*****************************************************************/ +module Sem_5010107_Methods_001 "TTCN-3:2018 Object-Oriented" { + + type component GeneralComp { + } + + type class MyClass { + var integer v_i; + + create(integer v_i) { + this.v_i := v_i; + } + + public function doSomething() return integer { + return this.v_i + 1; + } + } + + testcase TC_Sem_5010107_Methods_001() runs on GeneralComp { + var MyClass v_a := MyClass.create(126); + if (v_a.doSomething() == 127) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_5010107_Methods_001()); + } + +} \ No newline at end of file diff --git a/oo/501_classes_and_objects/50101_classes/5010107_methods/Sem_5010107_Methods_002.ttcn b/oo/501_classes_and_objects/50101_classes/5010107_methods/Sem_5010107_Methods_002.ttcn new file mode 100755 index 0000000..46ada03 --- /dev/null +++ b/oo/501_classes_and_objects/50101_classes/5010107_methods/Sem_5010107_Methods_002.ttcn @@ -0,0 +1,39 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 5.1.1.7, Ensure that a method inherited from a superclass can be overridden by the subclass. + ** @verdict pass accept +*****************************************************************/ +module Sem_5010107_Methods_002 "TTCN-3:2018 Object-Oriented" { + + type component GeneralComp { + } + + type class MySuperClass { + var octetstring v_o; + + public function doSomething() return integer { + return oct2int(this.v_o); + } + } + + type class MySubClass extends MySuperClass { + + public function doSomething() return integer { + return 1; + } + } + + testcase TC_Sem_5010107_Methods_002() runs on GeneralComp { + var MySubClass v_a := MySubClass.create('AAFF'O) : MySuperClass(); + if (v_a.doSomething() == 1) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_5010107_Methods_002()); + } +} \ No newline at end of file diff --git a/oo/501_classes_and_objects/50101_classes/5010107_methods/Sem_5010107_Methods_003.ttcn b/oo/501_classes_and_objects/50101_classes/5010107_methods/Sem_5010107_Methods_003.ttcn new file mode 100755 index 0000000..1713fad --- /dev/null +++ b/oo/501_classes_and_objects/50101_classes/5010107_methods/Sem_5010107_Methods_003.ttcn @@ -0,0 +1,36 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 5.1.1.7, Ensure that a method shall not be overridden by any subclass, it can be declared as @final. + ** @verdict pass accept +*****************************************************************/ +module Sem_5010107_Methods_003 "TTCN-3:2018 Object-Oriented" { + + type component GeneralComp { + } + + type class MySuperClass { + var octetstring v_o; + + public function @final doSomething() return integer { + return oct2int(this.v_o); + } + } + + type class MySubClass extends MySuperClass { + + } + + testcase TC_Sem_5010107_Methods_003() runs on GeneralComp { + var MySubClass v_a := MySubClass.create('AAFF'O) : MySuperClass(); + if (v_a.doSomething() == 43775) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_5010107_Methods_003()); + } +} \ No newline at end of file diff --git a/oo/501_classes_and_objects/50101_classes/5010108_method_invocation/Sem_5010108_MethodInvocation_001.ttcn b/oo/501_classes_and_objects/50101_classes/5010108_method_invocation/Sem_5010108_MethodInvocation_001.ttcn new file mode 100755 index 0000000..6b90fd7 --- /dev/null +++ b/oo/501_classes_and_objects/50101_classes/5010108_method_invocation/Sem_5010108_MethodInvocation_001.ttcn @@ -0,0 +1,32 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 5.1.1.8, Ensure that use method invocation. + ** @verdict pass accept +*****************************************************************/ +module Sem_5010108_MethodInvocation_001 "TTCN-3:2018 Object-Oriented" { + + type component GeneralComp { + } + + type class MyClass { + var hexstring v_h; + + public function f_hex() return bitstring { + return hex2bit(this.v_h); + } + } + + testcase TC_Sem_5010108_MethodInvocation_001() runs on GeneralComp { + var MyClass v_a := MyClass.create('FA1'H); + if (v_a.f_hex() == '111110100001'B) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_5010108_MethodInvocation_001()); + } +} \ No newline at end of file diff --git a/oo/501_classes_and_objects/50101_classes/5010108_methods/NegSem_5010108_Methods_002.ttcn b/oo/501_classes_and_objects/50101_classes/5010108_methods/NegSem_5010108_Methods_002.ttcn new file mode 100644 index 0000000..32a30f6 --- /dev/null +++ b/oo/501_classes_and_objects/50101_classes/5010108_methods/NegSem_5010108_Methods_002.ttcn @@ -0,0 +1,39 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 5.1.1.8, Ensure that protected methods may be overridden by public or protected methods only + ** @verdict pass reject +*****************************************************************/ +module NegSem_5010108_Methods_002 language "TTCN-3:2018 Object-Oriented" { + + type component GeneralComp { + } + + type class MySuperClass { + var octetstring v_o; + + function doSomething() return integer { //protected method + return oct2int(this.v_o); + } + } + + type class MySubClass extends MySuperClass { + + private function doSomething() return integer { //not allowed + return 1; + } + } + + testcase TC_NegSem_5010108_Methods_002() runs on GeneralComp { + var MySubClass v_a := MySubClass.create('AAFF'O); + if (v_a.doSomething() == 1) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_NegSem_5010108_Methods_002()); + } +} diff --git a/oo/501_classes_and_objects/50101_classes/5010108_methods/NegSem_5010108_Methods_003.ttcn b/oo/501_classes_and_objects/50101_classes/5010108_methods/NegSem_5010108_Methods_003.ttcn new file mode 100644 index 0000000..fd3621c --- /dev/null +++ b/oo/501_classes_and_objects/50101_classes/5010108_methods/NegSem_5010108_Methods_003.ttcn @@ -0,0 +1,44 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 5.1.1.8, Ensure that if a public method is overridden, + ** the overriding method shall have the same formal parameters in the same order as the + ** overridden method + ** @verdict pass reject +*****************************************************************/ +module NegSem_5010108_Methods_003 language "TTCN-3:2018 Object-Oriented" { + + type component GeneralComp { + } + + type integer Mytype1; + type Mytype1 Mytype2; + + type class MySuperClass { + var octetstring v_o; + + public function doSomething(in integer a, in integer b) return integer { + return oct2int(this.v_o); + } + } + + type class MySubClass extends MySuperClass { + + public function doSomething(in integer b, in integer a) return integer { //Not allowed, not the same method signature + return a; + } + } + + testcase TC_NegSem_5010108_Methods_003() runs on GeneralComp { + var MySubClass v_a := MySubClass.create('AAFF'O); + if (v_a.doSomething(1,1) == 1) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_NegSem_5010108_Methods_003()); + } +} \ No newline at end of file diff --git a/oo/501_classes_and_objects/50101_classes/5010108_methods/NegSem_5010108_Methods_004.ttcn b/oo/501_classes_and_objects/50101_classes/5010108_methods/NegSem_5010108_Methods_004.ttcn new file mode 100644 index 0000000..2baca74 --- /dev/null +++ b/oo/501_classes_and_objects/50101_classes/5010108_methods/NegSem_5010108_Methods_004.ttcn @@ -0,0 +1,39 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 5.1.1.8, Ensure that is 'runs on, mtc, system' clauses are not permitted on methods. + ** @verdict pass reject + *****************************************************************/ +module NegSem_5010108_Methods_004 language "TTCN-3:2018 Object-Oriented" { + + type component GeneralComp { + } + + type class MySuperClass runs on GeneralComp { + var octetstring v_o; + + function doSomething() return integer runs on GeneralComp { //not allowed + return oct2int(this.v_o); + } + } + + type class MySubClass extends MySuperClass { + + function doSomething() return integer runs on GeneralComp { + return 1; + } + } + + testcase TC_NegSem_5010108_Methods_004() runs on GeneralComp { + var MySubClass v_a := MySubClass.create('AAFF'O); + if (v_a.doSomething() == 1) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_NegSem_5010108_Methods_004()); + } +} \ No newline at end of file diff --git a/oo/501_classes_and_objects/50101_classes/5010108_methods/NegSem_5010108_Methods_005.ttcn b/oo/501_classes_and_objects/50101_classes/5010108_methods/NegSem_5010108_Methods_005.ttcn new file mode 100644 index 0000000..74ea831 --- /dev/null +++ b/oo/501_classes_and_objects/50101_classes/5010108_methods/NegSem_5010108_Methods_005.ttcn @@ -0,0 +1,39 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 5.1.1.8, Ensure that is 'runs on, mtc, system' clauses are not permitted on methods. + ** @verdict pass reject + *****************************************************************/ +module NegSem_5010108_Methods_005 language "TTCN-3:2018 Object-Oriented" { + + type component GeneralComp { + } + + type class MySuperClass runs on GeneralComp { + var octetstring v_o; + + function doSomething() return integer system GeneralComp { //not allowed + return oct2int(this.v_o); + } + } + + type class MySubClass extends MySuperClass { + + function doSomething() return integer system GeneralComp { + return 1; + } + } + + testcase TC_NegSem_5010108_Methods_005() runs on GeneralComp { + var MySubClass v_a := MySubClass.create('AAFF'O); + if (v_a.doSomething() == 1) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_NegSem_5010108_Methods_005()); + } +} \ No newline at end of file diff --git a/oo/501_classes_and_objects/50101_classes/5010108_methods/NegSem_5010108_Methods_006.ttcn b/oo/501_classes_and_objects/50101_classes/5010108_methods/NegSem_5010108_Methods_006.ttcn new file mode 100644 index 0000000..3827502 --- /dev/null +++ b/oo/501_classes_and_objects/50101_classes/5010108_methods/NegSem_5010108_Methods_006.ttcn @@ -0,0 +1,39 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 5.1.1.8, Ensure that is 'runs on, mtc, system' clauses are not permitted on methods. + ** @verdict pass reject + *****************************************************************/ +module NegSem_5010108_Methods_006 language "TTCN-3:2018 Object-Oriented" { + + type component GeneralComp { + } + + type class MySuperClass runs on GeneralComp { + var octetstring v_o; + + function doSomething() return integer mtc GeneralComp { //not allowed + return oct2int(this.v_o); + } + } + + type class MySubClass extends MySuperClass { + + function doSomething() return integer mtc GeneralComp { + return 1; + } + } + + testcase TC_NegSem_5010108_Methods_006() runs on GeneralComp { + var MySubClass v_a := MySubClass.create('AAFF'O); + if (v_a.doSomething() == 1) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_NegSem_5010108_Methods_006()); + } +} \ No newline at end of file diff --git a/oo/501_classes_and_objects/50101_classes/5010108_methods/Sem_5010108_Methods_001.ttcn b/oo/501_classes_and_objects/50101_classes/5010108_methods/Sem_5010108_Methods_001.ttcn new file mode 100644 index 0000000..7a87482 --- /dev/null +++ b/oo/501_classes_and_objects/50101_classes/5010108_methods/Sem_5010108_Methods_001.ttcn @@ -0,0 +1,37 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 5.1.1.8, Ensure that class methods can be used. + ** @verdict pass accept +*****************************************************************/ +module Sem_5010108_Methods_001 language "TTCN-3:2018 Object-Oriented" { + + type component GeneralComp { + } + + type class MyClass { + var integer v_i; + + create(integer v_i) { + this.v_i := v_i; + } + + public function doSomething() return integer { + return this.v_i + 1; + } + } + + testcase TC_Sem_5010108_Methods_001() runs on GeneralComp { + var MyClass v_a := MyClass.create(126); + if (v_a.doSomething() == 127) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_5010108_Methods_001()); + } + +} \ No newline at end of file diff --git a/oo/501_classes_and_objects/50101_classes/5010108_methods/Sem_5010108_Methods_002.ttcn b/oo/501_classes_and_objects/50101_classes/5010108_methods/Sem_5010108_Methods_002.ttcn new file mode 100644 index 0000000..f991daa --- /dev/null +++ b/oo/501_classes_and_objects/50101_classes/5010108_methods/Sem_5010108_Methods_002.ttcn @@ -0,0 +1,39 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 5.1.1.8, Ensure that a method inherited from a superclass can be overridden by the subclass. + ** @verdict pass accept +*****************************************************************/ +module Sem_5010108_Methods_002 language "TTCN-3:2018 Object-Oriented" { + + type component GeneralComp { + } + + type class MySuperClass { + var octetstring v_o; + + public function doSomething() return integer { + return oct2int(this.v_o); + } + } + + type class MySubClass extends MySuperClass { + + public function doSomething() return integer { + return 1; + } + } + + testcase TC_Sem_5010108_Methods_002() runs on GeneralComp { + var MySubClass v_a := MySubClass.create('AAFF'O); + if (v_a.doSomething() == 1) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_5010108_Methods_002()); + } +} \ No newline at end of file diff --git a/oo/501_classes_and_objects/50101_classes/5010108_methods/Sem_5010108_Methods_003.ttcn b/oo/501_classes_and_objects/50101_classes/5010108_methods/Sem_5010108_Methods_003.ttcn new file mode 100644 index 0000000..29dbd9f --- /dev/null +++ b/oo/501_classes_and_objects/50101_classes/5010108_methods/Sem_5010108_Methods_003.ttcn @@ -0,0 +1,36 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 5.1.1.8, Ensure that if a method shall not be overridden by any subclass, it can be declared as @final. + ** @verdict pass accept +*****************************************************************/ +module Sem_5010108_Methods_003 language "TTCN-3:2018 Object-Oriented" { + + type component GeneralComp { + } + + type class MySuperClass { + var octetstring v_o; + + public function @final doSomething() return integer { + return oct2int(this.v_o); + } + } + + type class MySubClass extends MySuperClass { + + } + + testcase TC_Sem_5010108_Methods_003() runs on GeneralComp { + var MySubClass v_a := MySubClass.create('AAFF'O); + if (v_a.doSomething() == 43775) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_5010108_Methods_003()); + } +} \ No newline at end of file diff --git a/oo/501_classes_and_objects/50101_classes/5010109_method_invocation/NegSem_5010109_MethodInvocation_001.ttcn b/oo/501_classes_and_objects/50101_classes/5010109_method_invocation/NegSem_5010109_MethodInvocation_001.ttcn new file mode 100644 index 0000000..4dc1bb4 --- /dev/null +++ b/oo/501_classes_and_objects/50101_classes/5010109_method_invocation/NegSem_5010109_MethodInvocation_001.ttcn @@ -0,0 +1,38 @@ +/***************************************************************** + ** @author TTF T003 + ** @version 0.0.1 + ** @purpose 5.1.1.9, Ensure that "super" keyword can be used from inside a class member only. + ** @verdict pass reject +*****************************************************************/ +module NegSem_5010109_MethodInvocation_001 language "TTCN-3:2018 Object-Oriented" { + + type component GeneralComp { + } + + type class MySuperClass { + private const charstring cons_name := "MySuperClass"; + + create() {} + + public function f_super_name() return charstring { + return this.cons_name; + } + } + + type class MySubClass extends MySuperClass { + + } + + testcase TC_NegSem_5010109_MethodInvocation_001() runs on GeneralComp { + var MySubClass v_sub := MySubClass.create(); + if (v_sub.super.f_super() == "MySuperClass") { //not allowed + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_NegSem_5010109_MethodInvocation_001()); + } +} \ No newline at end of file diff --git a/oo/501_classes_and_objects/50101_classes/5010109_method_invocation/Sem_5010109_MethodInvocation_001.ttcn b/oo/501_classes_and_objects/50101_classes/5010109_method_invocation/Sem_5010109_MethodInvocation_001.ttcn new file mode 100644 index 0000000..7983982 --- /dev/null +++ b/oo/501_classes_and_objects/50101_classes/5010109_method_invocation/Sem_5010109_MethodInvocation_001.ttcn @@ -0,0 +1,32 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 5.1.1.9, Ensure that method invocation can be used. + ** @verdict pass accept +*****************************************************************/ +module Sem_5010109_MethodInvocation_001 language "TTCN-3:2018 Object-Oriented" { + + type component GeneralComp { + } + + type class MyClass { + var hexstring v_h; + + public function f_hex() return bitstring { + return hex2bit(this.v_h); + } + } + + testcase TC_Sem_5010109_MethodInvocation_001() runs on GeneralComp { + var MyClass v_a := MyClass.create('FA1'H); + if (v_a.f_hex() == '111110100001'B) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_5010109_MethodInvocation_001()); + } +} \ No newline at end of file diff --git a/oo/501_classes_and_objects/50101_classes/5010109_method_invocation/Sem_5010109_MethodInvocation_002.ttcn b/oo/501_classes_and_objects/50101_classes/5010109_method_invocation/Sem_5010109_MethodInvocation_002.ttcn new file mode 100644 index 0000000..10f6d23 --- /dev/null +++ b/oo/501_classes_and_objects/50101_classes/5010109_method_invocation/Sem_5010109_MethodInvocation_002.ttcn @@ -0,0 +1,39 @@ +/***************************************************************** + ** @author TTF T003 + ** @version 0.0.1 + ** @purpose 5.1.1.9, Ensure that method invocation with "super" keyword can be used. + ** @verdict pass accept +*****************************************************************/ +module Sem_5010109_MethodInvocation_002 language "TTCN-3:2018 Object-Oriented" { + + type component GeneralComp { + } + + type class MySuperClass { + var hexstring v_h; + + public function f_super_hex() return bitstring { + return hex2bit(this.v_h); + } + } + + type class MySubClass extends MySuperClass { + + public function f_hex() return bitstring { + return super.f_super_hex(); + } + } + + testcase TC_Sem_5010109_MethodInvocation_002() runs on GeneralComp { + var MySubClass v_sub := MySubClass.create('FA1'H); + if (v_sub.f_hex() == '111110100001'B) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_5010109_MethodInvocation_002()); + } +} \ No newline at end of file diff --git a/oo/501_classes_and_objects/50101_classes/5010110_visibility/NegSem_5010110_Visibility_001.ttcn b/oo/501_classes_and_objects/50101_classes/5010110_visibility/NegSem_5010110_Visibility_001.ttcn new file mode 100755 index 0000000..5b94ec3 --- /dev/null +++ b/oo/501_classes_and_objects/50101_classes/5010110_visibility/NegSem_5010110_Visibility_001.ttcn @@ -0,0 +1,28 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 5.1.1.9, Ensure that fields can be declared as private or protected only. + ** @verdict pass reject +*****************************************************************/ +module NegSem_5010110_Visibility_001 "TTCN-3:2018 Object-Oriented" { + + type component GeneralComp { + } + + type class MyClass { + public var integer v_i; // not allowed + } + + testcase TC_NegSem_5010110_Visibility_001() runs on GeneralComp { + var MyClass v_a := MyClass.create(1); + if (v_a.v_i == 1) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_NegSem_5010110_Visibility_001()); + } +} \ No newline at end of file diff --git a/oo/501_classes_and_objects/50101_classes/5010110_visibility/NegSem_5010110_Visibility_002.ttcn b/oo/501_classes_and_objects/50101_classes/5010110_visibility/NegSem_5010110_Visibility_002.ttcn new file mode 100644 index 0000000..2a23c0a --- /dev/null +++ b/oo/501_classes_and_objects/50101_classes/5010110_visibility/NegSem_5010110_Visibility_002.ttcn @@ -0,0 +1,34 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 5.1.1.10, Ensure that a field of any visibility cannot be overridden in a subclass. + ** @verdict pass reject +*****************************************************************/ +module NegSem_5010110_Visibility_002 language "TTCN-3:2018 Object-Oriented" { + + type component GeneralComp { + } + + type charstring MyType; + + type class MySuperClass { + private var MyType v_my; + } + + type class MySubClass extends MySuperClass { + var MyType v_my; //not allowed + } + + testcase TC_NegSem_5010110_Visibility_002() runs on GeneralComp { + var MySubClass v_a := MySubClass.create("abc"); + if (v_a.v_my == "abc") { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_NegSem_5010110_Visibility_002()); + } +} \ No newline at end of file diff --git a/oo/501_classes_and_objects/50101_classes/5010110_visibility/NegSem_5010110_Visibility_003.ttcn b/oo/501_classes_and_objects/50101_classes/5010110_visibility/NegSem_5010110_Visibility_003.ttcn new file mode 100755 index 0000000..b8be206 --- /dev/null +++ b/oo/501_classes_and_objects/50101_classes/5010110_visibility/NegSem_5010110_Visibility_003.ttcn @@ -0,0 +1,39 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 5.1.1.9, Ensure that a public member function can only be overridden by another public member function. + ** @verdict pass reject +*****************************************************************/ +module NegSem_5010110_Visibility_003 "TTCN-3:2018 Object-Oriented" { + + type component GeneralComp { + } + + type class MySuperClass { + var integer v_i; + + public function f_add(integer inint) return integer { + return this.v_i + inint; + } + } + + type class MySubClass extends MySuperClass { + + function f_add(integer inint) return integer { //not allowed + return this.v_i + 1; + } + } + + testcase TC_NegSem_5010110_Visibility_003() runs on GeneralComp { + var MySubClass v_a := MySubClass.create(1); + if (v_a.f_add(2) == 3) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_NegSem_5010110_Visibility_003()); + } +} \ No newline at end of file diff --git a/oo/501_classes_and_objects/50101_classes/5010110_visibility/NegSem_5010110_Visibility_004.ttcn b/oo/501_classes_and_objects/50101_classes/5010110_visibility/NegSem_5010110_Visibility_004.ttcn new file mode 100755 index 0000000..95c8609 --- /dev/null +++ b/oo/501_classes_and_objects/50101_classes/5010110_visibility/NegSem_5010110_Visibility_004.ttcn @@ -0,0 +1,28 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 5.1.1.9, Ensure that private members can only be accessed directly from inside their surrounding class's scope. + ** @verdict pass reject +*****************************************************************/ +module NegSem_5010110_Visibility_004 "TTCN-3:2018 Object-Oriented" { + + type component GeneralComp { + } + + type class MyClass { + private var integer v_i; + } + + testcase TC_NegSem_5010110_Visibility_004() runs on GeneralComp { + var MyClass v_a := MyClass.create(1); + if (v_a.v_i == 1) { //not allowed + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_NegSem_5010110_Visibility_004()); + } +} \ No newline at end of file diff --git a/oo/501_classes_and_objects/50101_classes/5010110_visibility/Sem_50101010_Visibility_001.ttcn b/oo/501_classes_and_objects/50101_classes/5010110_visibility/Sem_50101010_Visibility_001.ttcn new file mode 100755 index 0000000..9f4663c --- /dev/null +++ b/oo/501_classes_and_objects/50101_classes/5010110_visibility/Sem_50101010_Visibility_001.ttcn @@ -0,0 +1,35 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 5.1.1.9, Ensure that private member functions are not visible and can be present in multiple classes of the same hierarchy with different parameter lists and return values. + ** @verdict pass accept +*****************************************************************/ +module Sem_5010110_Visibility_001 "TTCN-3:2018 Object-Oriented" { + + type component GeneralComp { + } + + type class MySuperClass { + var integer v_i; + + private function f_do(integer v_i) return integer { + return this.v_i + v_i; + } + } + + type class MySubClass extends MySuperClass { + + private function f_do() { + log("Do nothing!!! (Visibility)"); + } + } + + testcase TC_Sem_5010110_Visibility_001() runs on GeneralComp { + var MySubClass v_a := MySubClass.create(32) : MySuperClass(); + setverdict(pass); + } + + control { + execute(TC_Sem_5010110_Visibility_001()); + } +} \ No newline at end of file diff --git a/oo/501_classes_and_objects/50101_classes/5010110_visibility/Sem_50101010_Visibility_002.ttcn b/oo/501_classes_and_objects/50101_classes/5010110_visibility/Sem_50101010_Visibility_002.ttcn new file mode 100755 index 0000000..3971ebd --- /dev/null +++ b/oo/501_classes_and_objects/50101_classes/5010110_visibility/Sem_50101010_Visibility_002.ttcn @@ -0,0 +1,32 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 5.1.1.9, Ensure that public member functions can be called from any behaviour running on the object's owner component. + ** @verdict pass accept +*****************************************************************/ +module Sem_5010110_Visibility_002 "TTCN-3:2018 Object-Oriented" { + + type component GeneralComp { + const hexstring general_vh := 'A'H; + } + + type class MyClass runs on GeneralComp { + var integer v_i; + + public function f_add(hexstring vh) return hexstring { + return int2hex((hex2int(vh) + this.v_i), 1); + } + } + + testcase TC_Sem_5010110_Visibility_002() runs on GeneralComp { + var MyClass v_a := MyClass.create(5); + if (v_a.f_add(general_vh) == 'F'H) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_5010110_Visibility_002()); + } diff --git a/oo/501_classes_and_objects/50101_classes/5010110_visibility/Sem_5010110_Visibility_003.ttcn b/oo/501_classes_and_objects/50101_classes/5010110_visibility/Sem_5010110_Visibility_003.ttcn new file mode 100755 index 0000000..c57ae1a --- /dev/null +++ b/oo/501_classes_and_objects/50101_classes/5010110_visibility/Sem_5010110_Visibility_003.ttcn @@ -0,0 +1,39 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 5.1.1.9, Ensure that a public member function can only be overridden by another public member function. + ** @verdict pass accept +*****************************************************************/ +module Sem_5010110_Visibility_003 "TTCN-3:2018 Object-Oriented" { + + type component GeneralComp { + } + + type class MySuperClass { + var integer v_i; + + public function f_add(integer inint) return integer { + return this.v_i + inint; + } + } + + type class MySubClass extends MySuperClass { + + public function f_add(integer inint) return integer { + return this.v_i + 1; + } + } + + testcase TC_Sem_5010110_Visibility_003() runs on GeneralComp { + var MySubClass v_a := MySubClass.create(1); + if (v_a.f_add(2) == 2) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_5010110_Visibility_003()); + } +} \ No newline at end of file diff --git a/oo/501_classes_and_objects/50101_classes/5010110_visibility/Sem_5010110_Visibility_004.ttcn b/oo/501_classes_and_objects/50101_classes/5010110_visibility/Sem_5010110_Visibility_004.ttcn new file mode 100644 index 0000000..e22a985 --- /dev/null +++ b/oo/501_classes_and_objects/50101_classes/5010110_visibility/Sem_5010110_Visibility_004.ttcn @@ -0,0 +1,35 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 5.1.1.10, Ensure that private member functions can be present in multiple classes of the same hierarchy with different parameter lists and return values. + ** @verdict pass accept +*****************************************************************/ +module Sem_5010110_Visibility_001 language "TTCN-3:2018 Object-Oriented" { + + type component GeneralComp { + } + + type class MySuperClass { + var integer v_i; + + private function f_do(integer v_i) return integer { + return this.v_i + v_i; + } + } + + type class MySubClass extends MySuperClass { + + private function f_do() { + log("Do nothing!!! (Visibility)"); + } + } + + testcase TC_Sem_5010110_Visibility_001() runs on GeneralComp { + var MySubClass v_a := MySubClass.create(32); + setverdict(pass); + } + + control { + execute(TC_Sem_5010110_Visibility_001()); + } +} \ No newline at end of file diff --git a/oo/501_classes_and_objects/50101_classes/5010112_nested_classes/NegSem_5010112_NestedClasses_001.ttcn b/oo/501_classes_and_objects/50101_classes/5010112_nested_classes/NegSem_5010112_NestedClasses_001.ttcn new file mode 100644 index 0000000..7bd7427 --- /dev/null +++ b/oo/501_classes_and_objects/50101_classes/5010112_nested_classes/NegSem_5010112_NestedClasses_001.ttcn @@ -0,0 +1,29 @@ +/***************************************************************** + ** @author TTF T003 + ** @version 0.0.1 + ** @purpose 5.1.1.12, Ensure that nested classes constructor can not be invoked without an instance of the containing class. + ** @verdict pass reject +*****************************************************************/ +module NegSem_5010112_ConstructorInvocation_001 language "TTCN-3:2018 Object-Oriented" { + + type component GeneralComp { + } + + type class Parent { + + type class Child { + //empty class + } + } + + testcase TC_NegSem_5010112_ConstructorInvocation_001 () runs on GeneralComp { + var Parent.Child v_child := Child.create(); //not allowed + + //empty test + setverdict(pass); + } + + control { + execute(TC_NegSem_5010112_ConstructorInvocation_001()); + } +} \ No newline at end of file diff --git a/oo/501_classes_and_objects/50101_classes/5010112_nested_classes/NegSem_5010112_NestedClasses_002.ttcn b/oo/501_classes_and_objects/50101_classes/5010112_nested_classes/NegSem_5010112_NestedClasses_002.ttcn new file mode 100644 index 0000000..f354bd5 --- /dev/null +++ b/oo/501_classes_and_objects/50101_classes/5010112_nested_classes/NegSem_5010112_NestedClasses_002.ttcn @@ -0,0 +1,29 @@ +/***************************************************************** + ** @author TTF T003 + ** @version 0.0.1 + ** @purpose 5.1.1.12, Ensure that members of a nested class have not the same name as one of the members of the containing class. + ** @verdict pass reject +*****************************************************************/ +module NegSem_5010112_ConstructorInvocation_002 language "TTCN-3:2018 Object-Oriented" { + + type component GeneralComp { + } + + type class Parent { + var charstring v_name; + + type class Child { + var charstring v_name; // not allowed + + } + } + + testcase TC_NegSem_5010112_ConstructorInvocation_002 () runs on GeneralComp { + //empy testcase + setverdict(pass); + } + + control { + execute(TC_NegSem_5010112_ConstructorInvocation_002()); + } +} \ No newline at end of file diff --git a/oo/501_classes_and_objects/50101_classes/5010112_nested_classes/NegSem_5010112_NestedClasses_003.ttcn b/oo/501_classes_and_objects/50101_classes/5010112_nested_classes/NegSem_5010112_NestedClasses_003.ttcn new file mode 100644 index 0000000..d9ad486 --- /dev/null +++ b/oo/501_classes_and_objects/50101_classes/5010112_nested_classes/NegSem_5010112_NestedClasses_003.ttcn @@ -0,0 +1,36 @@ +/***************************************************************** + ** @author TTF T003 + ** @version 0.0.1 + ** @purpose 5.1.1.12, Ensure that members of a nested class have not the same name as one of the members of a indirectly containing class. + ** @verdict pass reject +*****************************************************************/ +module NegSem_5010112_ConstructorInvocation_003 language "TTCN-3:2018 Object-Oriented" { + + type component GeneralComp { + } + + + type class MySuperClass { + var charstring v_id; + } + + type class MyClass extends MySuperClass { + } + + type class Grandparent extends MyClass{ + type class Parent { + type class Child { + var charstring v_id; // not allowed + } + } + } + + testcase TC_NegSem_5010112_ConstructorInvocation_003 () runs on GeneralComp { + //empy testcase + setverdict(pass); + } + + control { + execute(TC_NegSem_5010112_ConstructorInvocation_003()); + } +} \ No newline at end of file diff --git a/oo/501_classes_and_objects/50101_classes/5010112_nested_classes/NegSem_5010112_NestedClasses_004.ttcn b/oo/501_classes_and_objects/50101_classes/5010112_nested_classes/NegSem_5010112_NestedClasses_004.ttcn new file mode 100644 index 0000000..28ce1ea --- /dev/null +++ b/oo/501_classes_and_objects/50101_classes/5010112_nested_classes/NegSem_5010112_NestedClasses_004.ttcn @@ -0,0 +1,38 @@ +/***************************************************************** + ** @author TTF T004 + ** @version 0.0.1 + ** @purpose 5.1.1.12, Ensure that referencing the name of a nested class in a null reference cause an error. + ** @verdict pass reject +*****************************************************************/ +module NegSem_5010112_ConstructorInvocation_004 language "TTCN-3:2018 Object-Oriented" { + + type component GeneralComp { + } + + + type class Parent { + type class Child { + var charstring v_name; + + public function get_name() return charstring { + return v_name; + } + } + } + + testcase TC_NegSem_5010112_ConstructorInvocation_004 () runs on GeneralComp { + var Parent v_parent := Parent.create(); + v_parent := null; + var Parent.Child v_child := v_parent.Child.create("child"); //cause an error + + if (v_child.get_name() == "child") { + setverdict(fail); + } else { + setverdict(inconc); + } + } + + control { + execute(TC_NegSem_5010112_ConstructorInvocation_004()); + } +} \ No newline at end of file diff --git a/oo/501_classes_and_objects/50101_classes/5010112_nested_classes/NegSem_5010112_NestedClasses_005.ttcn b/oo/501_classes_and_objects/50101_classes/5010112_nested_classes/NegSem_5010112_NestedClasses_005.ttcn new file mode 100644 index 0000000..da0d0fe --- /dev/null +++ b/oo/501_classes_and_objects/50101_classes/5010112_nested_classes/NegSem_5010112_NestedClasses_005.ttcn @@ -0,0 +1,37 @@ +/***************************************************************** + ** @author TTF T003 + ** @version 0.0.1 + ** @purpose 5.1.1.12, Ensure that the type of the nested class can not be referenced directly. + ** @verdict pass accept +*****************************************************************/ +module NegSem_5010112_ConstructorInvocation_003 language "TTCN-3:2018 Object-Oriented" { + + type component GeneralComp { + } + + type class Parent { + var charstring v_name; + + type class Child { + + public function get_parent_name() return charstring { + return v_name; + } + + } + } + + testcase TC_NegSem_5010112_ConstructorInvocation_003 () runs on GeneralComp { + var Parent v_parent := Parent.create("parent"); + var Parent.Child v_child := v_parent.Child.create(); + + select class (v_child) { + case(Child) { setverdict(pass);} //not allowed + case else {setverdict(fail);} + } + } + + control { + execute(TC_NegSem_5010112_ConstructorInvocation_003()); + } +} \ No newline at end of file diff --git a/oo/501_classes_and_objects/50101_classes/5010112_nested_classes/Sem_5010112_NestedClasses_001.ttcn b/oo/501_classes_and_objects/50101_classes/5010112_nested_classes/Sem_5010112_NestedClasses_001.ttcn new file mode 100644 index 0000000..f8c6868 --- /dev/null +++ b/oo/501_classes_and_objects/50101_classes/5010112_nested_classes/Sem_5010112_NestedClasses_001.ttcn @@ -0,0 +1,30 @@ +/***************************************************************** + ** @author TTF T003 + ** @version 0.0.1 + ** @purpose 5.1.1.12, Ensure that nested classes can be used. + ** @verdict pass accept +*****************************************************************/ +module Sem_5010112_ConstructorInvocation_001 language "TTCN-3:2018 Object-Oriented" { + + type component GeneralComp { + } + + type class Parent { + + type class Child { + //empty class + } + } + + testcase TC_Sem_5010112_ConstructorInvocation_001 () runs on GeneralComp { + var Parent v_parent := Parent.create(); + var Parent.Child v_child := v_parent.Child.create(); + + //empty test + setverdict(pass); + } + + control { + execute(TC_Sem_5010112_ConstructorInvocation_001()); + } +} \ No newline at end of file diff --git a/oo/501_classes_and_objects/50101_classes/5010112_nested_classes/Sem_5010112_NestedClasses_002.ttcn b/oo/501_classes_and_objects/50101_classes/5010112_nested_classes/Sem_5010112_NestedClasses_002.ttcn new file mode 100644 index 0000000..4b8d6bf --- /dev/null +++ b/oo/501_classes_and_objects/50101_classes/5010112_nested_classes/Sem_5010112_NestedClasses_002.ttcn @@ -0,0 +1,38 @@ +/***************************************************************** + ** @author TTF T003 + ** @version 0.0.1 + ** @purpose 5.1.1.12, Ensure that nested class can access named entities of the containing class. + ** @verdict pass accept +*****************************************************************/ +module Sem_5010112_ConstructorInvocation_002 language "TTCN-3:2018 Object-Oriented" { + + type component GeneralComp { + } + + type class Parent { + var charstring v_name; + + type class Child { + + public function get_parent_name() return charstring { + return v_name; + } + + } + } + + testcase TC_Sem_5010112_ConstructorInvocation_002 () runs on GeneralComp { + var Parent v_parent := Parent.create("parent"); + var Parent.Child v_child := v_parent.Child.create(); + + if (v_child.get_parent_name() == "parent") { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_5010112_ConstructorInvocation_002()); + } +} \ No newline at end of file diff --git a/oo/501_classes_and_objects/50101_classes/5010112_nested_classes/Sem_5010112_NestedClasses_003.ttcn b/oo/501_classes_and_objects/50101_classes/5010112_nested_classes/Sem_5010112_NestedClasses_003.ttcn new file mode 100644 index 0000000..2d79898 --- /dev/null +++ b/oo/501_classes_and_objects/50101_classes/5010112_nested_classes/Sem_5010112_NestedClasses_003.ttcn @@ -0,0 +1,37 @@ +/***************************************************************** + ** @author TTF T003 + ** @version 0.0.1 + ** @purpose 5.1.1.12, Ensure that nested class can be referenced with the dotted notation. + ** @verdict pass accept +*****************************************************************/ +module Sem_5010112_ConstructorInvocation_003 language "TTCN-3:2018 Object-Oriented" { + + type component GeneralComp { + } + + type class Parent { + var charstring v_name; + + type class Child { + + public function get_parent_name() return charstring { + return v_name; + } + + } + } + + testcase TC_Sem_5010112_ConstructorInvocation_003 () runs on GeneralComp { + var Parent v_parent := Parent.create("parent"); + var Parent.Child v_child := v_parent.Child.create(); + + select class (v_child) { + case(Parent.Child) { setverdict(pass);} + case else {setverdict(fail);} + } + } + + control { + execute(TC_Sem_5010112_ConstructorInvocation_003()); + } +} \ No newline at end of file diff --git a/oo/501_classes_and_objects/50101_classes/5010112_nested_classes/Sem_5010112_NestedClasses_004.ttcn b/oo/501_classes_and_objects/50101_classes/5010112_nested_classes/Sem_5010112_NestedClasses_004.ttcn new file mode 100644 index 0000000..74f7a10 --- /dev/null +++ b/oo/501_classes_and_objects/50101_classes/5010112_nested_classes/Sem_5010112_NestedClasses_004.ttcn @@ -0,0 +1,42 @@ +/***************************************************************** + ** @author TTF T003 + ** @version 0.0.1 + ** @purpose 5.1.1.12, Ensure that the identifier of the nested class can be used without dotted notation. + ** @verdict pass accept +*****************************************************************/ +module Sem_5010112_ConstructorInvocation_004 language "TTCN-3:2018 Object-Oriented" { + + type component GeneralComp { + } + + type class Parent { + var charstring v_name; + + type class Child { + + public function get_parent_name() return charstring { + return v_name; + } + } + + public function create_child() return Parent.Child { + var Child v_child := Child.create(); + return v_child; + } + } + + testcase TC_Sem_5010112_ConstructorInvocation_004 () runs on GeneralComp { + var Parent v_parent := Parent.create("parent"); + var Parent.Child v_child := v_parent.create_child(); + + if (v_child.get_parent_name() == "parent") { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_5010112_ConstructorInvocation_004()); + } +} \ No newline at end of file diff --git a/oo/501_classes_and_objects/50101_classes/50101_top_level/NegSem_50101_top_level_001.ttcn b/oo/501_classes_and_objects/50101_classes/50101_top_level/NegSem_50101_top_level_001.ttcn new file mode 100755 index 0000000..9d2a531 --- /dev/null +++ b/oo/501_classes_and_objects/50101_classes/50101_top_level/NegSem_50101_top_level_001.ttcn @@ -0,0 +1,30 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 5.1.1.0, Ensure that a class members' names are unique. + ** @verdict pass reject +*****************************************************************/ +module NegSem_50101_top_level_001 "TTCN-3:2018 Object-Oriented" { + + type component GeneralComp { + } + + public type class t_class_member_overloading { + + var integer v_i := 10; + var integer v_i := 5; // not allowed + } + + testcase TC_NegSem_50101_top_level_001() runs on GeneralComp { + var t_class_member_overloading v_a := t_class_member_overloading.create(); + if (v_a.v_i == 5) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_NegSem_50101_top_level_001()); + } +} \ No newline at end of file diff --git a/oo/501_classes_and_objects/50101_classes/50101_top_level/NegSem_50101_top_level_002.ttcn b/oo/501_classes_and_objects/50101_classes/50101_top_level/NegSem_50101_top_level_002.ttcn new file mode 100755 index 0000000..8c0e4f4 --- /dev/null +++ b/oo/501_classes_and_objects/50101_classes/50101_top_level/NegSem_50101_top_level_002.ttcn @@ -0,0 +1,33 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 5.1.1.0, Ensure that a class members' names are unique. + ** @verdict pass reject +*****************************************************************/ +module NegSem_50101_top_level_002 "TTCN-3:2018 Object-Oriented" { + + type component GeneralComp { + } + + public type class t_class_member_overloading { + + var integer v_i := 10; + + public function v_i() return integer { // not allowed + return 5; + } + } + + testcase TC_NegSem_50101_top_level_002() runs on GeneralComp { + var t_class_member_overloading v_a := t_class_member_overloading.create(); + if (v_a.v_i() == 5) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_NegSem_50101_top_level_002()); + } +} \ No newline at end of file diff --git a/oo/501_classes_and_objects/50101_classes/50101_top_level/NegSem_50101_top_level_003.ttcn b/oo/501_classes_and_objects/50101_classes/50101_top_level/NegSem_50101_top_level_003.ttcn new file mode 100755 index 0000000..612594d --- /dev/null +++ b/oo/501_classes_and_objects/50101_classes/50101_top_level/NegSem_50101_top_level_003.ttcn @@ -0,0 +1,33 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 5.1.1.0, Ensure that templates are not allowed for class types. + ** @verdict pass reject +*****************************************************************/ +module NegSem_50101_top_level_003 "TTCN-3:2018 Object-Oriented" { + + type component GeneralComp { + } + + public type template class t_templ_class_const_field { //not allowed + private const charstring cons_ver_id := "0.0.1"; + + public function get_cons_verid() return charstring { + return this.cons_ver_id; + } + } + + testcase TC_NegSem_50101_top_level_003() runs on GeneralComp { + var t_templ_class_const_field v_a := t_templ_class_const_field.create(); + if (v_a.get_cons_verid() == "0.0.1") { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_NegSem_50101_top_level_003()); + } + +} \ No newline at end of file diff --git a/oo/501_classes_and_objects/50101_classes/50101_top_level/NegSem_50101_top_level_004.ttcn b/oo/501_classes_and_objects/50101_classes/50101_top_level/NegSem_50101_top_level_004.ttcn new file mode 100755 index 0000000..f1d2198 --- /dev/null +++ b/oo/501_classes_and_objects/50101_classes/50101_top_level/NegSem_50101_top_level_004.ttcn @@ -0,0 +1,42 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 5.1.1.0, Ensure that passing of object references to the create operation of a component type or a function started on another component is not allowed. + ** @verdict pass reject +*****************************************************************/ +module NegSem_50101_top_level_004 "TTCN-3:2018 Object-Oriented" { + + type component GeneralComp { + + } + + type component MyNotEmptyComponent{ + const charstring c_MyCstr := "def"; + + function doSomething(in MyEmptyClass e) { + log("Nothing in MyEmptyClass e"); + } + } + + public type class MyEmptyClass runs on GeneralComp { + + } + + testcase TC_NegSem_50101_top_level_004_01() runs on GeneralComp { + var MyEmptyClass v_MyClass := MyEmptyClass.create(); + var GeneralComp v_MyComponent := GeneralComp.create(v_MyClass); //not allowed + setverdict(pass); + } + + testcase TC_NegSem_50101_top_level_004_02() runs on GeneralComp { + var MyEmptyClass v_MyClass := MyEmptyClass.create(); + var MyNotEmptyComponent v_MyComponent := MyNotEmptyComponent.create alive; + v_MyComponent.start(doSomething(v_MyClass)); //not allowed + setverdict(pass); + } + + control { + execute(TC_NegSem_50101_top_level_004_01()); + execute(TC_NegSem_50101_top_level_004_02()); + } +} \ No newline at end of file diff --git a/oo/501_classes_and_objects/50101_classes/50101_top_level/NegSem_50101_top_level_005.ttcn b/oo/501_classes_and_objects/50101_classes/50101_top_level/NegSem_50101_top_level_005.ttcn new file mode 100755 index 0000000..69db3bd --- /dev/null +++ b/oo/501_classes_and_objects/50101_classes/50101_top_level/NegSem_50101_top_level_005.ttcn @@ -0,0 +1,25 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 5.1.1.0, Ensure that subtyping definition is not allowed for class types via the normal subtype definition. + ** @verdict pass reject +*****************************************************************/ +module NegSem_50101_top_level_005 "TTCN-3:2018 Object-Oriented"{ + + type component GeneralComp { + } + + public type class t_empty_class { + } + + type t_empty_class MyClassType; //not allowed + + testcase TC_NegSem_50101_top_level_005() runs on GeneralComp { + var t_empty_class v_a := t_empty_class.create() + setverdict(pass); + } + + control { + execute(TC_NegSem_50101_top_level_005()); + } +} \ No newline at end of file diff --git a/oo/501_classes_and_objects/50101_classes/50101_top_level/NegSem_50101_top_level_006.ttcn b/oo/501_classes_and_objects/50101_classes/50101_top_level/NegSem_50101_top_level_006.ttcn new file mode 100755 index 0000000..d260060 --- /dev/null +++ b/oo/501_classes_and_objects/50101_classes/50101_top_level/NegSem_50101_top_level_006.ttcn @@ -0,0 +1,35 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 5.1.1.0, Ensure that local/global constants or module parameters of class type or containing class type fields or elements are not allowed. + ** @verdict pass reject +*****************************************************************/ +module NegSem_50101_top_level_006 "TTCN-3:2018 Object-Oriented" { + + type component GeneralComp { + } + + public type class t_class_simple_class { + private var hexstring v_hstr := 'AF37D'H; + + public function get_hexstr() return hexstring { + return v_hstr; + } + } + + const t_class_simple_class const_simple := t_class_simple_class.create(); // not allowed + modulepar t_class_simple_class mod_par_simple; // not allowed + + testcase TC_NegSem_50101_top_level_006() runs on GeneralComp { + var t_class_simple_class v_a := t_class_simple_class.create(); + if (v_a.get_hexstr() == 'AF37D'H) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_NegSem_50101_top_level_006()); + } +} \ No newline at end of file diff --git a/oo/501_classes_and_objects/50101_classes/50101_top_level/NegSem_50101_top_level_007.ttcn b/oo/501_classes_and_objects/50101_classes/50101_top_level/NegSem_50101_top_level_007.ttcn new file mode 100755 index 0000000..d37148f --- /dev/null +++ b/oo/501_classes_and_objects/50101_classes/50101_top_level/NegSem_50101_top_level_007.ttcn @@ -0,0 +1,26 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 5.1.1.0, Ensure that class type cannot be the contained value of an anytype value. + ** @verdict pass reject +*****************************************************************/ +module NegSem_50101_top_level_007 "TTCN-3:2018 Object-Oriented" { + + type component GeneralComp { + } + + public type class t_class_anytype_class { + //empty class + } + + testcase TC_NegSem_50101_top_level_007() runs on GeneralComp { + var t_class_anytype_class v_class := t_class_anytype_class.create(); + var anytype v_Myanytype; + v_Myanytype.t_class_anytype_class := v_class; // not allowed + setverdict(pass); + } + + control { + execute(TC_NegSem_50101_top_level_007()); + } +} \ No newline at end of file diff --git a/oo/501_classes_and_objects/50101_classes/50101_top_level/NegSem_50101_top_level_008.ttcn b/oo/501_classes_and_objects/50101_classes/50101_top_level/NegSem_50101_top_level_008.ttcn new file mode 100755 index 0000000..d9cc27c --- /dev/null +++ b/oo/501_classes_and_objects/50101_classes/50101_top_level/NegSem_50101_top_level_008.ttcn @@ -0,0 +1,52 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 5.1.1.0, Ensure that the functions of a class shall not have a runs on, mtc or system clause. + ** @verdict pass reject +*****************************************************************/ +module NegSem_50101_top_level_008 "TTCN-3:2018 Object-Oriented" { + + type component GeneralComp { + } + + public type class t_class_with_utility_functions { + + public function isRightCharstring(in charstring arg_cstr) runs on GeneralComp return boolean { //not allowed + if (arg_cstr == "def") { + return true; + } else { + return false; + } + } + + public function isPositive(in integer arg_int) mtc GeneralComp return boolean { //not allowed + if (arg_int > 0) { + return true; + } else { + return false; + } + } + public function isNegative(in integer arg_int) system GeneralComp return boolean { //not allowed + if (arg_int < 0) { + return true; + } else { + return false; + } + } + + const integer c_int := 5057; + } + + testcase TC_NegSem_50101_top_level_008() runs on GeneralComp { + var t_class_with_utility_functions v_a := t_class_with_utility_functions.create(); + if (v_a.c_int == 5057) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_NegSem_50101_top_level_008()); + } +} \ No newline at end of file diff --git a/oo/501_classes_and_objects/50101_classes/50101_top_level/NegSem_50101_top_level_009.ttcn b/oo/501_classes_and_objects/50101_classes/50101_top_level/NegSem_50101_top_level_009.ttcn new file mode 100755 index 0000000..3d51d85 --- /dev/null +++ b/oo/501_classes_and_objects/50101_classes/50101_top_level/NegSem_50101_top_level_009.ttcn @@ -0,0 +1,40 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 5.1.1.0, Ensure that the runs on type of a class shall be runs on compatible with the runs on type of the behaviour creating a class. + ** @verdict pass reject +*****************************************************************/ +module NegSem_50101_top_level_009 "TTCN-3:2018 Object-Oriented" { + + type port MyPort message { + inout integer; + } + + type component GeneralComp { + } + + type component TestComp { + const charstring c_cstr := "Sunday"; + port MyPort p1; + } + + public type class t_class_non_compatible runs on GeneralComp { + + public function f_skip_weekend() return charstring { + return "Monday"; + } + } + + testcase TC_NegSem_50101_top_level_009() runs on TestComp { + var t_class_non_compatible v_a := t_class_non_compatible.create(); // not allowed + if (v_a.f_skip_weekend() == "Monday") { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_NegSem_50101_top_level_009()); + } +} \ No newline at end of file diff --git a/oo/501_classes_and_objects/50101_classes/50101_top_level/NegSem_50101_top_level_010.ttcn b/oo/501_classes_and_objects/50101_classes/50101_top_level/NegSem_50101_top_level_010.ttcn new file mode 100755 index 0000000..afce332 --- /dev/null +++ b/oo/501_classes_and_objects/50101_classes/50101_top_level/NegSem_50101_top_level_010.ttcn @@ -0,0 +1,45 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 5.1.1.0, Ensure that The runs on type of a class shall be runs on compatible with the runs on type of the superclass. + ** @verdict pass reject +*****************************************************************/ +module NegSem_50101_top_level_010 "TTCN-3:2018 Object-Oriented" { + + type component GeneralComp { + } + + type port Myport message { + inout octetstring; + } + + type component MessageComp { + port Myport p1; + }; + + public type class t_superclass_with_incompatible runs on MessageComp { + var octetstring v_o := '1100'O; + + public function sending_vo() { + log(this.v_o); + } + } + + public type class t_subclass extends t_superclass_with_incompatible runs on GeneralComp { + + } + + testcase TC_NegSem_50101_top_level_010() runs on GeneralComp { + var t_subclass v_a := t_subclass.create(); // not allowed + if (v_a.v_o == '1100'O) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_NegSem_50101_top_level_010()); + } + +} \ No newline at end of file diff --git a/oo/501_classes_and_objects/50101_classes/50101_top_level/NegSem_50101_top_level_011.ttcn b/oo/501_classes_and_objects/50101_classes/50101_top_level/NegSem_50101_top_level_011.ttcn new file mode 100755 index 0000000..c852ee7 --- /dev/null +++ b/oo/501_classes_and_objects/50101_classes/50101_top_level/NegSem_50101_top_level_011.ttcn @@ -0,0 +1,58 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 5.1.1.0, Ensure that The mtc and system type of a class shall be mtc and system compatible with the mtc and system types of the superclass, respectively. + ** @verdict pass reject +*****************************************************************/ +module NegSem_50101_top_level_011 "TTCN-3:2018 Object-Oriented" { + + type component GeneralComp { + } + + type port Myport message { + inout octetstring; + } + + type component MessageComp { + port Myport p1; + } + + public type class t_superclass_with_incompatible_system system GeneralComp { + var hexstring v_h := '1100FAD'H; + } + + public type class t_subclass_system extends t_superclass_with_incompatible_system system MessageComp { // not allowed + + } + + public type class t_superclass_with_incompatible_mtc mtc GeneralComp { + var integer v_i := 9919; + } + + public type class t_subclass_mtc extends t_superclass_with_incompatible_mtc mtc MessageComp { // not allowed + + } + + testcase TC_NegSem_50101_top_level_011_01() runs on MessageComp system GeneralComp { + var t_subclass_system v_a := t_subclass_system.create(); // not allowed + if (v_a.v_h == '1100FAD'H) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + testcase TC_NegSem_50101_top_level_011_02() runs on MessageComp { + var t_subclass_mtc v_a := t_subclass_mtc.create(); // not allowed + if (v_a.v_i == 9919) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_NegSem_50101_top_level_011_01()); + execute(TC_NegSem_50101_top_level_011_02()); + } +} \ No newline at end of file diff --git a/oo/501_classes_and_objects/50101_classes/50101_top_level/Sem_50101_top_level_001.ttcn b/oo/501_classes_and_objects/50101_classes/50101_top_level/Sem_50101_top_level_001.ttcn new file mode 100755 index 0000000..cbd36d8 --- /dev/null +++ b/oo/501_classes_and_objects/50101_classes/50101_top_level/Sem_50101_top_level_001.ttcn @@ -0,0 +1,67 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 5.1.1.0, Ensure that a class declare variables as its members. + ** @verdict pass accept +*****************************************************************/ +module Sem_50101_top_level_001 "TTCN-3:2018 Object-Oriented" { + + type component GeneralComp { + } + + public type class t_class_var_fields { + private var integer v_i := 1; + private var float v_f := 0.55; + private var bitstring v_bs := '1101'B; + private var hexstring v_hs := '1CD5'H; + private var octetstring v_os := '00FFCD58'O; + private var charstring v_cs := "abc"; + private var universal charstring v_ucs := char(0, 0, 0, 97); + private var boolean v_b := true; + + public function get_v_os() return octetstring { + return this.v_os; + } + + public function get_v_b() return boolean { + return this.v_b; + } + + public function get_v_i() return integer { + return this.v_i; + } + + public function get_v_f() return float { + return this.v_f; + } + + public function get_v_bs() return bitstring { + return this.v_bs; + } + + public function get_v_hs() return hexstring { + return this.v_hs; + } + + public function get_v_cs() return charstring { + return this.v_cs; + } + + public function get_v_ucs() return universal charstring { + return this.v_ucs; + } + } + + testcase TC_Sem_50101_top_level_001() runs on GeneralComp { + var t_class_var_fields v_a := t_class_var_fields.create(); + if (v_a.get_v_i() == 1 and v_a.get_v_f() == 0.55 and v_a.get_v_bs() == '1101'B and v_a.get_v_hs() == '1CD5'H and v_a.get_v_os() == '00FFCD58'O and v_a.get_v_cs() == "abc" and v_a.get_v_ucs() == char(0,0,0,97) and v_a.get_v_b()) { + setverdict(pass) + } else { + setverdict(fail) + } + } + + control { + execute(TC_Sem_50101_top_level_001()); + } +} \ No newline at end of file diff --git a/oo/501_classes_and_objects/50101_classes/50101_top_level/Sem_50101_top_level_002.ttcn b/oo/501_classes_and_objects/50101_classes/50101_top_level/Sem_50101_top_level_002.ttcn new file mode 100755 index 0000000..d0e7aa5 --- /dev/null +++ b/oo/501_classes_and_objects/50101_classes/50101_top_level/Sem_50101_top_level_002.ttcn @@ -0,0 +1,34 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 5.1.1.0, Ensure that a class declare a subtype variable as its field member. + ** @verdict pass accept +*****************************************************************/ +module Sem_50101_top_level_002 "TTCN-3:2018 Object-Oriented" { + + type component GeneralComp { + } + + type integer MyType; + + public type class t_class_subt_var_field { + var MyType v_mytype := 345; + + function get_v_mytype() return MyType { + return this.v_mytype; + } + } + + testcase TC_Sem_50101_top_level_002() runs on GeneralComp { + var t_class_subt_var_field v_a := t_class_subt_var_field.create(); + if (v_a.get_v_mytype() == 345) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_50101_top_level_002()); + } +} \ No newline at end of file diff --git a/oo/501_classes_and_objects/50101_classes/50101_top_level/Sem_50101_top_level_003.ttcn b/oo/501_classes_and_objects/50101_classes/50101_top_level/Sem_50101_top_level_003.ttcn new file mode 100755 index 0000000..af851ff --- /dev/null +++ b/oo/501_classes_and_objects/50101_classes/50101_top_level/Sem_50101_top_level_003.ttcn @@ -0,0 +1,32 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 5.1.1.0, Ensure that a class declare constants as its members. + ** @verdict pass accept +*****************************************************************/ +module Sem_50101_top_level_003 "TTCN-3:2018 Object-Oriented" { + + type component GeneralComp { + } + + public type class t_class_const_field { + private const charstring cons_ver_id := "1.0v12"; + + public function get_cons_verid() return charstring { + return this.cons_ver_id; + } + } + + testcase TC_Sem_50101_top_level_003() runs on GeneralComp { + var t_class_const_field v_a := t_class_const_field.create(); + if (v_a.get_cons_verid() == "1.0v12") { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_50101_top_level_003()); + } +} \ No newline at end of file diff --git a/oo/501_classes_and_objects/50101_classes/50101_top_level/Sem_50101_top_level_004.ttcn b/oo/501_classes_and_objects/50101_classes/50101_top_level/Sem_50101_top_level_004.ttcn new file mode 100755 index 0000000..cec772b --- /dev/null +++ b/oo/501_classes_and_objects/50101_classes/50101_top_level/Sem_50101_top_level_004.ttcn @@ -0,0 +1,34 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 5.1.1.0, Ensure that a class declare templates as its members. + ** @verdict pass accept +*****************************************************************/ +module Sem_50101_top_level_004 "TTCN-3:2018 Object-Oriented" { + + type component GeneralComp { + } + + public type class t_class_template_field { + var template charstring vt_cs := pattern "[abc]"; + + public function get_vtcs() return template charstring { + return this.vt_cs; + } + } + + testcase TC_Sem_50101_top_level_004() runs on GeneralComp { + var charstring v_cs := "b"; + var t_class_template_field v_a := t_class_template_field.create(); + + if (match(v_cs, v_a.get_vtcs())) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_50101_top_level_004()); + } +} \ No newline at end of file diff --git a/oo/501_classes_and_objects/50101_classes/50101_top_level/Sem_50101_top_level_005.ttcn b/oo/501_classes_and_objects/50101_classes/50101_top_level/Sem_50101_top_level_005.ttcn new file mode 100755 index 0000000..d5515cf --- /dev/null +++ b/oo/501_classes_and_objects/50101_classes/50101_top_level/Sem_50101_top_level_005.ttcn @@ -0,0 +1,28 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 5.1.1.0, Ensure that a class declare port as its member. + ** @verdict pass accept +*****************************************************************/ +module Sem_50101_top_level_005 "TTCN-3:2018 Object-Oriented" { + + type port PortType message { + inout integer; + } + + type component TestComp { + } + + public type class t_class_port_field { + port PortType p1; + } + + //TODO: if port members in classes are not allowed this testcase is unnecessary. + testcase TC_Sem_50101_top_level_005() runs on TestComp { + var t_class_port_field myClass := t_class_port_field.create(); + } + + control { + execute(TC_Sem_50101_top_level_005()); + } +} \ No newline at end of file diff --git a/oo/501_classes_and_objects/50101_classes/50101_top_level/Sem_50101_top_level_006.ttcn b/oo/501_classes_and_objects/50101_classes/50101_top_level/Sem_50101_top_level_006.ttcn new file mode 100755 index 0000000..98ac93b --- /dev/null +++ b/oo/501_classes_and_objects/50101_classes/50101_top_level/Sem_50101_top_level_006.ttcn @@ -0,0 +1,23 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 5.1.1.0, Ensure that a class declare timer as its member. + ** @verdict pass accept +*****************************************************************/ +module Sem_50101_top_level_006 "TTCN-3:2018 Object-Oriented" { + + type component GeneralComp { + } + + public type class t_class_timer_field { + timer t_timer := 5.0; + } + + testcase TC_Sem_50101_top_level_006() runs on GeneralComp { + var t_class_timer_field v_a := t_class_timer_field.create(); + } + + control { + execute(TC_Sem_50101_top_level_006()); + } +} \ No newline at end of file diff --git a/oo/501_classes_and_objects/50101_classes/50101_top_level/Sem_50101_top_level_007.ttcn b/oo/501_classes_and_objects/50101_classes/50101_top_level/Sem_50101_top_level_007.ttcn new file mode 100755 index 0000000..247da13 --- /dev/null +++ b/oo/501_classes_and_objects/50101_classes/50101_top_level/Sem_50101_top_level_007.ttcn @@ -0,0 +1,36 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 5.1.1.0, Ensure that a class extend an other class. + ** @verdict pass accept +*****************************************************************/ +module Sem_50101_top_level_007 "TTCN-3:2018 Object-Oriented" { + +type component GeneralComp{ +} + +public type class t_class_superclass { + const integer c_i := 15; + + public function get_ci() return integer { + return this.c_i; + } +} + +public type class t_class_subclass extends t_class_superclass { +} + +testcase TC_Sem_50101_top_level_007() runs on GeneralComp { + var t_class_subclass v_a := t_class_subclass.create(); + if (v_a.get_ci() == 15) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control { + execute(TC_Sem_50101_top_level_007()); +} + +} \ No newline at end of file diff --git a/oo/501_classes_and_objects/50101_classes/50101_top_level/Sem_50101_top_level_008.ttcn b/oo/501_classes_and_objects/50101_classes/50101_top_level/Sem_50101_top_level_008.ttcn new file mode 100755 index 0000000..dbc2c51 --- /dev/null +++ b/oo/501_classes_and_objects/50101_classes/50101_top_level/Sem_50101_top_level_008.ttcn @@ -0,0 +1,63 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 5.1.1.0, Ensure that a class have an optional "runs on", "mtc", or "system" clause. + ** @verdict pass accept +*****************************************************************/ +module Sem_50101_top_level_008 "TTCN-3:2018 Object-Oriented" { + + type component GeneralComp { + } + + type port Myport message { + inout charstring; + } + + type component TestComp { + port Myport p1; + } + + public type class t_class_with_runs_on runs on GeneralComp { + var octetstring v_o := '11AD0000'O; + + public function get_vo() return octetstring{ + return this.v_o; + } + } + + public type class t_class_with_runs_on_with_system runs on TestComp system TestComp { + const charstring c_cstr := "Finally"; + + public function get_ccstr() return charstring{ + return this.c_cstr; + } + + } + + testcase TC_Sem_50101_top_level_008_01() runs on GeneralComp { + var t_class_with_runs_on v_a := t_class_with_runs_on.create(); + if (v_a.get_vo() == '11AD0000'O) { + setverdict(pass) + } else { + setverdict(fail); + } + } + + testcase TC_Sem_50101_top_level_008_02() runs on TestComp system TestComp { + map(self:p1,system:p1); + timer T1 := 5.0; + var t_class_with_runs_on_with_system v_a := t_class_with_runs_on_with_system.create(); + p1.send(v_a.get_ccstr()); + alt { + [] p1.receive("Finally") { T1.stop; setverdict(pass); } + [] p1.receive { T1.stop; setverdict(fail); } + [] T1.timeout { setverdict(fail); } + } + unmap(self:p1,system:p1); + } + + control { + execute(TC_Sem_50101_top_level_008_01()); + execute(TC_Sem_50101_top_level_008_02()); + } +} \ No newline at end of file diff --git a/oo/501_classes_and_objects/50102_objects/5010202_object_references/NegSem_5010202_ObjectReferences_001.ttcn b/oo/501_classes_and_objects/50102_objects/5010202_object_references/NegSem_5010202_ObjectReferences_001.ttcn new file mode 100755 index 0000000..894b5b2 --- /dev/null +++ b/oo/501_classes_and_objects/50102_objects/5010202_object_references/NegSem_5010202_ObjectReferences_001.ttcn @@ -0,0 +1,41 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 5.1.2.2, Ensure that Object References shall not be passed as actual parameter or part of an actual parameter. + ** @verdict pass reject +*****************************************************************/ +module NegSem_5010202_ObjectReferences_001 "TTCN-3:2018 Object-Oriented" { + + type component GeneralComp { + } + + type class MyClass { + var integer x; + + public function setX(integer x) { + this.x := x; + } + + public function getX() return integer { + return this.x; + } + } + + function f_something(MyClass my) runs on GeneralComp { + my.setX(1); + } + + testcase TC_NegSem_5010202_ObjectReferences_001() runs on GeneralComp { + var MyClass v_a := MyClass.create(7); + var GeneralComp v_MyGeneralComp := GeneralComp.create; + v_MyGeneralComp.start(f_something(v_a)); //not allowed + if (v_a.getX() == 7) { + setverdict(pass); + } else { + setverdict(fail); + } + } + control { + execute(TC_NegSem_5010202_ObjectReferences_001()); + } +} \ No newline at end of file diff --git a/oo/501_classes_and_objects/50102_objects/5010202_object_references/NegSem_5010202_ObjectReferences_002.ttcn b/oo/501_classes_and_objects/50102_objects/5010202_object_references/NegSem_5010202_ObjectReferences_002.ttcn new file mode 100755 index 0000000..296ebab --- /dev/null +++ b/oo/501_classes_and_objects/50102_objects/5010202_object_references/NegSem_5010202_ObjectReferences_002.ttcn @@ -0,0 +1,42 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 5.1.2.2, Ensure that in a structured type field of a class type, this type is not seen as a data type and its values cannot be used for sending and receiving or as an argument to any expression other than the equality/inequality operator. + ** @verdict pass reject +*****************************************************************/ +module NegSem_5010202_ObjectReferences_002 "TTCN-3:2018 Object-Oriented" { + + type component GeneralComp { + } + + type class MyClass { + var integer x; + + public function setX(integer x) { + this.x := x; + } + + public function getX() return integer { + return this.x; + } + } + + type record MyRecord { + integer x, + MyClass c + }; + + testcase TC_NegSem_5010202_ObjectReferences_002() runs on GeneralComp { + var MyClass v_class := MyClass.create(1); + var MyRecord v_rec := {5, v_class}; + if (int2bit(v_rec.c.getX(), 1) == '1'B) { //not allowed + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_NegSem_5010202_ObjectReferences_002()); + } +} \ No newline at end of file diff --git a/oo/501_classes_and_objects/50102_objects/5010202_object_references/Sem_5010202_ObjectReferences_001.ttcn b/oo/501_classes_and_objects/50102_objects/5010202_object_references/Sem_5010202_ObjectReferences_001.ttcn new file mode 100755 index 0000000..3328088 --- /dev/null +++ b/oo/501_classes_and_objects/50102_objects/5010202_object_references/Sem_5010202_ObjectReferences_001.ttcn @@ -0,0 +1,38 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 5.1.2.2, Ensure that multiple variables can contain a reference to the same object simultaneously. + ** @verdict pass accept +*****************************************************************/ +module Sem_5010202_ObjectReferences_001 "TTCN-3:2018 Object-Oriented" { + + type component GeneralComp { + } + + type class MyClass { + var integer x; + + public function setX(integer x) { + this.x := x; + } + + public function getX() return integer { + return this.x; + } + } + + testcase TC_Sem_5010202_ObjectReferences_001() runs on GeneralComp { + var MyClass v_a := MyClass.create(7); + var MyClass v_b := v_a; + var MyClass v_c := v_b; + v_a.setX(5); + if (v_c.getX() == 5) { + setverdict(pass); + } else { + setverdict(fail); + } + } + control { + execute(TC_Sem_5010202_ObjectReferences_001()); + } +} \ No newline at end of file diff --git a/oo/501_classes_and_objects/50102_objects/5010203_null_reference/Sem_5010203_NullReference_001.ttcn b/oo/501_classes_and_objects/50102_objects/5010203_null_reference/Sem_5010203_NullReference_001.ttcn new file mode 100755 index 0000000..6d307d1 --- /dev/null +++ b/oo/501_classes_and_objects/50102_objects/5010203_null_reference/Sem_5010203_NullReference_001.ttcn @@ -0,0 +1,31 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 5.1.2.3, Ensure that an object variable or parameter may be compared with the special value null + ** @verdict pass accept +*****************************************************************/ +module Sem_5010203_NullReference_001 "TTCN-3:2018 Object-Oriented" { + + type component GeneralComp { + } + + type class MyClass { + var boolean v_bool; + } + + testcase TC_Sem_5010203_NullReference_001() runs on GeneralComp { + var MyClass v_a; + var MyClass v_b := MyClass.create(true); + var MyClass v_c := null; + if (v_a == null and v_b != null and v_c == null) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_em_5010203_NullReference_001()); + } + +} \ No newline at end of file diff --git a/oo/501_classes_and_objects/50102_objects/5010204_select_class-statement/NegSem_5010204_SelectClassStatement_001.ttcn b/oo/501_classes_and_objects/50102_objects/5010204_select_class-statement/NegSem_5010204_SelectClassStatement_001.ttcn new file mode 100755 index 0000000..f379dd2 --- /dev/null +++ b/oo/501_classes_and_objects/50102_objects/5010204_select_class-statement/NegSem_5010204_SelectClassStatement_001.ttcn @@ -0,0 +1,31 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 5.1.2.4, Ensure that if a class from one case is a superclass of a class from another case, then the case of the subclass shall be precede the case of the superclass. + ** @verdict pass reject +*****************************************************************/ +module NegSem_5010204_SelectClassStatement_001 language "TTCN-3:2018 Object-Oriented" { + + type component GeneralComp { + } + + type class MySuperClass { + //empty class + } + + type class MySubClass extends MySuperClass { + //empty class + } + + testcase TC_NegSem_5010204_SelectClassStatement_001() runs on GeneralComp { + var MySubClass v_a := MySubClass.create(); + select class (v_a) { + case (MySuperClass) { setverdict(fail); } //not allowed + case (MySubClass) { setverdict(pass); } + } + } + + control { + execute(TC_NegSem_5010204_SelectClassStatement_001()); + } +} \ No newline at end of file diff --git a/oo/501_classes_and_objects/50102_objects/5010204_select_class-statement/Sem_5010204_SelectClassStatement_001.ttcn b/oo/501_classes_and_objects/50102_objects/5010204_select_class-statement/Sem_5010204_SelectClassStatement_001.ttcn new file mode 100755 index 0000000..c069935 --- /dev/null +++ b/oo/501_classes_and_objects/50102_objects/5010204_select_class-statement/Sem_5010204_SelectClassStatement_001.ttcn @@ -0,0 +1,36 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 5.1.2.4, Ensure that the right class can be chosen in a select class-statement. + ** @verdict pass accept +*****************************************************************/ +module Sem_5010204_SelectClassStatement_001 language "TTCN-3:2018 Object-Oriented" { + + type component GeneralComp { + } + + type class MySuperClass { + //empty class + } + + type class MySubClass extends MySuperClass { + //empty class + } + + testcase TC_Sem_5010204_SelectClassStatement_001() runs on GeneralComp { + var MySubClass v_a := MySubClass.create(); + var MySuperClass v_b := MySubClass.create(); + select class (v_a) { + case (MySubClass) { setverdict(pass); } + case (MySuperClass) { setverdict(fail); } + } + select class (v_b) { + case (MySubClass) { setverdict(pass); } + case (MySuperClass) { setverdict(fail); } + } + } + + control { + execute(TC_Sem_5010204_SelectClassStatement_001()); + } +} \ No newline at end of file diff --git a/oo/501_classes_and_objects/50102_objects/5010204_select_class-statement/Sem_5010204_SelectClassStatement_002.ttcn b/oo/501_classes_and_objects/50102_objects/5010204_select_class-statement/Sem_5010204_SelectClassStatement_002.ttcn new file mode 100644 index 0000000..a3a6a20 --- /dev/null +++ b/oo/501_classes_and_objects/50102_objects/5010204_select_class-statement/Sem_5010204_SelectClassStatement_002.ttcn @@ -0,0 +1,37 @@ +/***************************************************************** + ** @author TTF T003 + ** @version 0.0.1 + ** @purpose 5.1.2.4, Ensure that the statement block in the ElseCase will be executed if the Object is not an instance of any of the ClassReferences in the select class-statement. + ** @verdict pass accept +*****************************************************************/ +module Sem_5010204_SelectClassStatement_002 language "TTCN-3:2018 Object-Oriented" { + + type component GeneralComp { + } + + type class MyClass_A { + //empty class + } + + type class MyClass_B extends MyClass_A { + //empty class + } + + type class MyClass_C extends MyClass_A { + //empty class + } + + testcase TC_Sem_5010204_SelectClassStatement_002() runs on GeneralComp { + var MyClass_A v_a := MyClass_A.create(); + + select class (v_a) { + case (MyClass_B) { setverdict(fail); } + case (MyClass_C) { setverdict(fail); } + case else {setverdict(pass);} + } + } + + control { + execute(TC_Sem_5010204_SelectClassStatement_002()); + } +} \ No newline at end of file diff --git a/oo/501_classes_and_objects/50102_objects/5010205_of_operator/Sem_5010205_OfOperator_001.ttcn b/oo/501_classes_and_objects/50102_objects/5010205_of_operator/Sem_5010205_OfOperator_001.ttcn new file mode 100755 index 0000000..fb01d99 --- /dev/null +++ b/oo/501_classes_and_objects/50102_objects/5010205_of_operator/Sem_5010205_OfOperator_001.ttcn @@ -0,0 +1,32 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 5.1.2.5, Ensure that of operator gives the most specific class instance. + ** @verdict pass reject +*****************************************************************/ +module Sem_5010205_OfOperator_001 "TTCN-3:2018 Object-Oriented" { + + type component GeneralComp { + } + + type class MySuperClass { + //empty class + } + + type class MySubClass extends MySuperClass { + //empty class + } + + testcase TC_Sem_5010205_OfOperator_001() runs on GeneralComp { + var MySubClass v_a := MySubClass.create(); + if (v_a of MySubClass) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_5010205_OfOperator_001()); + } +} \ No newline at end of file diff --git a/oo/501_classes_and_objects/50102_objects/5010206_casting/NegSem_5010206_Casting_001.ttcn b/oo/501_classes_and_objects/50102_objects/5010206_casting/NegSem_5010206_Casting_001.ttcn new file mode 100755 index 0000000..4e5aa96 --- /dev/null +++ b/oo/501_classes_and_objects/50102_objects/5010206_casting/NegSem_5010206_Casting_001.ttcn @@ -0,0 +1,37 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 5.1.2.6, Ensure that if the class the object is being cast to is not in the set of superclasses or the concrete class of the object, the cast operation shall result in an error. + ** @verdict pass reject +*****************************************************************/ +module NegSem_5010206_Casting_001 "TTCN-3:2018 Object-Oriented" { + + type component GeneralComp { + } + + type class MySuperClass { + //empty class + } + + type class MySubClass extends MySuperClass { + //empty class + } + + type class MyOtherClass { + const integer x:= 111; + } + + testcase TC_NegSem_5010206_Casting_001 () runs on GeneralComp { + var MyOtherClass v_a := MyOtherClass.create(); + var MySubClass v_b := v_a => MySubClass; //not allowed + if (v_b of MySubClass) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_NegSem_5010206_Casting_001()); + } +} \ No newline at end of file diff --git a/oo/501_classes_and_objects/50102_objects/5010206_casting/Sem_5010206_Casting_001.ttcn b/oo/501_classes_and_objects/50102_objects/5010206_casting/Sem_5010206_Casting_001.ttcn new file mode 100755 index 0000000..5d9ddb6 --- /dev/null +++ b/oo/501_classes_and_objects/50102_objects/5010206_casting/Sem_5010206_Casting_001.ttcn @@ -0,0 +1,33 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 5.1.2.6, Ensure that cast an object into an other class. + ** @verdict pass accept +*****************************************************************/ +module Sem_5010206_Casting_001 "TTCN-3:2018 Object-Oriented" { + + type component GeneralComp { + } + + type class MySuperClass { + //empty class + } + + type class MySubClass extends MySuperClass { + //empty class + } + + testcase TC_Sem_5010206_Casting_001() runs on GeneralComp { + var MySuperClass v_a := MySubClass.create(); + var MySubClass v_b := v_a => MySubClass; + if (v_b of MySubClass) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_5010206_Casting_001()); + } +} \ No newline at end of file diff --git a/oo/502_exception_handling/50201_functions/Sem_50201_Functions_001.ttcn b/oo/502_exception_handling/50201_functions/Sem_50201_Functions_001.ttcn new file mode 100755 index 0000000..01f486d --- /dev/null +++ b/oo/502_exception_handling/50201_functions/Sem_50201_Functions_001.ttcn @@ -0,0 +1,38 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 5.2.1, Ensure that functions is extended with an optional exception clause. + ** @verdict pass accept +*****************************************************************/ +module Sem_50201_Functions_001 "TTCN-3:2018 Object-Oriented" { + + type component GeneralComp { + } + + type integer MyIntegerType; + + function f_raise() runs on GeneralComp exception(integer) { + raise 6; + } + + function f_exception() runs on GeneralComp return integer { + f_raise(); + return 0; + } catch(integer e) { + return 1; + } catch(MyIntegerType e) { + return 1; + } + + testcase TC_Sem_50201_Functions_001() runs on GeneralComp { + if (f_exception() == 1) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_50201_Functions_001()); + } +} \ No newline at end of file diff --git a/oo/502_exception_handling/50202_external_functions/Sem_50202_ExternalFunctions_001.ttcn b/oo/502_exception_handling/50202_external_functions/Sem_50202_ExternalFunctions_001.ttcn new file mode 100755 index 0000000..2d8d74d --- /dev/null +++ b/oo/502_exception_handling/50202_external_functions/Sem_50202_ExternalFunctions_001.ttcn @@ -0,0 +1,24 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 5.2.2, Ensure that external functions is extended with an optional exception clause. + ** @verdict pass accept +*****************************************************************/ +module Sem_50202_ExternalFunctions_001 "TTCN-3:2018 Object-Oriented" { + + type component GeneralComp { + } + + type integer MyIntegerType; + + external function f_external() exception(MyIntegerType); + + testcase TC_Sem_50202_ExternalFunctions_001() runs on GeneralComp { + //empty testcase + setverdict(pass); + } + + control { + execute(TC_Sem_50202_ExternalFunctions_001()); + } +} \ No newline at end of file diff --git a/oo/502_exception_handling/50203_invoking_functions/Sem_50203_invoking_functions_001.ttcn b/oo/502_exception_handling/50203_invoking_functions/Sem_50203_invoking_functions_001.ttcn new file mode 100755 index 0000000..449e208 --- /dev/null +++ b/oo/502_exception_handling/50203_invoking_functions/Sem_50203_invoking_functions_001.ttcn @@ -0,0 +1,36 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 5.2.3, Ensure that raising an exception with the raise exception statement. + ** @verdict pass accept +*****************************************************************/ +module Sem_50203_invoking_functions_001 "TTCN-3:2018 Object-Oriented" { + + type component GeneralComp { + } + + type integer MyIntegerType; + + + function f_exception(in integer e) runs on GeneralComp return integer { + if (e > 10) { + raise 1; + } else { + return 1; + } + } catch(integer) { + return 0; + } + + testcase TC_Sem_50203_invoking_functions_001() runs on GeneralComp { + if (f_exception(12) == 0) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_50203_invoking_functions_001()); + } +} \ No newline at end of file diff --git a/oo/502_exception_handling/50204_altsteps/Sem_50204_altsteps_001.ttcn b/oo/502_exception_handling/50204_altsteps/Sem_50204_altsteps_001.ttcn new file mode 100755 index 0000000..2676f15 --- /dev/null +++ b/oo/502_exception_handling/50204_altsteps/Sem_50204_altsteps_001.ttcn @@ -0,0 +1,40 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 5.2.4, Ensure that altstep is extended with the optional exception, catch and finally clauses + ** @verdict pass accept +*****************************************************************/ +module Sem_50204_altsteps_001 "TTCN-3:2018 Object-Oriented" { + + type port Myport message { + inout charstring; + } + + type component TestComp { + port Myport p1; + } + + type integer MyInteger; + + altstep MyAltStep(inout timer t) runs on TestComp exception(MyInteger) { + [] p1.receive("Hello") { setverdict(pass); } + [] p1.receive { setverdict(fail); } + [] t.timeout { setverdict(inconc); } + } catch(MyInteger e) { + log("Catch an MyInteger type exception."); + } finally { + log ("Finally block!"); + } + + testcase TC_Sem_50204_altsteps_001() runs on TestComp system TestComp { + map(self:p1,system:p1); + timer T1 := 5.0; + p1.send("Hello"); + MyAltStep(T1); + unmap(self:p1,system:p1); + } + + control { + execute(TC_Sem_50204_altsteps_001()); + } +} \ No newline at end of file diff --git a/oo/502_exception_handling/50205_test_cases/Sem_50205_test_cases_001.ttcn b/oo/502_exception_handling/50205_test_cases/Sem_50205_test_cases_001.ttcn new file mode 100755 index 0000000..5cec259 --- /dev/null +++ b/oo/502_exception_handling/50205_test_cases/Sem_50205_test_cases_001.ttcn @@ -0,0 +1,28 @@ +/***************************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 5.2.5, Ensure that test cases may have a finally block. + ** @verdict pass accept +*****************************************************************/ +module Sem_50205_test_cases_001 "TTCN-3:2018 Object-Oriented" { + + type component GeneralComp { + } + + function f_raise() runs on GeneralComp exception (integer) { + raise 7; + } + + testcase TC_Sem_50205_test_cases_001() runs on GeneralComp { + f_raise(); + setverdict(fail); + } catch(integer e) { + setverdict(pass); + } finally { + log("This part is always executed!"); + } + + control { + execute(TC_Sem_50205_test_cases_001()); + } +} \ No newline at end of file diff --git a/xml/05_mapping_xml_schemas/0501_namespaces/050101_namespaces/Pos_050101_namespaces_005/Pos_050101_namespaces_005.ttcn b/xml/05_mapping_xml_schemas/0501_namespaces/050101_namespaces/Pos_050101_namespaces_005/Pos_050101_namespaces_005.ttcn new file mode 100644 index 0000000..6f3409e --- /dev/null +++ b/xml/05_mapping_xml_schemas/0501_namespaces/050101_namespaces/Pos_050101_namespaces_005/Pos_050101_namespaces_005.ttcn @@ -0,0 +1,92 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:5.1.1, Verify schema with no target namespace is correctly translated into single module + ** @verdict pass accept, ttcn3verdict:pass + ** @configuration xsd_base_file +***************************************************/ +// The following requirements are tested: +// A single XML Schema may be composed of a single or several schema element information +// items, and shall be translated to one or more TTCN-3 modules, corresponding to schema +// components that have the same target namespace. For XSD schemas with the same target +// namespace (including absence of the target namespace) exactly one TTCN-3 module shall +// be generated. +// The names of the TTCN 3 modules generated based on this clause shall be the result of +// applying the name transformation rules in clause 5.2.2 to ... to the name generated by +// appending "NoTargetNamespace-" with the base filename of the xsd file. + +module Pos_050101_namespaces_002 { + + import from NoTargetNamespace_Pos_050101_namespaces_005_xsd language "XSD" all; + + template MyType m_msg := 2; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_050101_namespaces_005() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_050101_namespaces_005.xml", { "Pos_050101_namespaces_005.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_050101_namespaces_005(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/xml/05_mapping_xml_schemas/0501_namespaces/050101_namespaces/Pos_050101_namespaces_005/Pos_050101_namespaces_005.xml b/xml/05_mapping_xml_schemas/0501_namespaces/050101_namespaces/Pos_050101_namespaces_005/Pos_050101_namespaces_005.xml new file mode 100644 index 0000000..f6423a7 --- /dev/null +++ b/xml/05_mapping_xml_schemas/0501_namespaces/050101_namespaces/Pos_050101_namespaces_005/Pos_050101_namespaces_005.xml @@ -0,0 +1,2 @@ + +2 \ No newline at end of file diff --git a/xml/05_mapping_xml_schemas/0501_namespaces/050101_namespaces/Pos_050101_namespaces_005/Pos_050101_namespaces_005.xsd b/xml/05_mapping_xml_schemas/0501_namespaces/050101_namespaces/Pos_050101_namespaces_005/Pos_050101_namespaces_005.xsd new file mode 100644 index 0000000..5462cd0 --- /dev/null +++ b/xml/05_mapping_xml_schemas/0501_namespaces/050101_namespaces/Pos_050101_namespaces_005/Pos_050101_namespaces_005.xsd @@ -0,0 +1,5 @@ + + + + diff --git a/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_026/Pos_050202_name_conversion_rules_026.ttcn b/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_026/Pos_050202_name_conversion_rules_026.ttcn new file mode 100644 index 0000000..8fbfcf1 --- /dev/null +++ b/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_026/Pos_050202_name_conversion_rules_026.ttcn @@ -0,0 +1,89 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 9:5.2.2, Verify that suffix is attached in case of name clash between field name and keyword from extension package + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// Rule k: +// Field names that are one of the ... keywords used in extension packages ... +// after applying the postfix to clashing field names, shall be suffixed by +// a single "_" (LOW LINE) character. +module Pos_050202_name_conversion_rules_026 { + + import from schema_Pos_050202_name_conversion_rules_026 language "XSD" all; + + template MyType m_msg := + { + choice:= { history_ := 0 } + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout MyType, Raw; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_050202_name_conversion_rules_026() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_050202_name_conversion_rules_026.xml", { "Pos_050202_name_conversion_rules_026.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_050202_name_conversion_rules_026(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_026/Pos_050202_name_conversion_rules_026.xml b/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_026/Pos_050202_name_conversion_rules_026.xml new file mode 100644 index 0000000..a33bcf8 --- /dev/null +++ b/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_026/Pos_050202_name_conversion_rules_026.xml @@ -0,0 +1,4 @@ + + + 0 + \ No newline at end of file diff --git a/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_026/Pos_050202_name_conversion_rules_026.xsd b/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_026/Pos_050202_name_conversion_rules_026.xsd new file mode 100644 index 0000000..d81eab1 --- /dev/null +++ b/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_026/Pos_050202_name_conversion_rules_026.xsd @@ -0,0 +1,14 @@ + + + + + + + + + + + + diff --git a/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_027/Pos_050202_name_conversion_rules_027.ttcn b/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_027/Pos_050202_name_conversion_rules_027.ttcn new file mode 100644 index 0000000..c501d06 --- /dev/null +++ b/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_027/Pos_050202_name_conversion_rules_027.ttcn @@ -0,0 +1,87 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 9:5.2.2, Verify that suffix is attached in case of name clash between enumerated item and keyword from extension package + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// Rule k: +// Enumeration names that are one of the ... keywords used in extension packages +// ... after applying the postfix to clashing enumeration names, shall be suffixed +// by a single "_" (LOW LINE) character. + +module Pos_050202_name_conversion_rules_027 { + + import from schema_Pos_050202_name_conversion_rules_027 language "XSD" all; + + template MyType m_msg := conjunct_; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout MyType, Raw; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_050202_name_conversion_rules_027() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_050202_name_conversion_rules_027.xml", { "Pos_050202_name_conversion_rules_027.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_050202_name_conversion_rules_027(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_027/Pos_050202_name_conversion_rules_027.xml b/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_027/Pos_050202_name_conversion_rules_027.xml new file mode 100644 index 0000000..0dc493b --- /dev/null +++ b/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_027/Pos_050202_name_conversion_rules_027.xml @@ -0,0 +1,2 @@ + +conjunct \ No newline at end of file diff --git a/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_027/Pos_050202_name_conversion_rules_027.xsd b/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_027/Pos_050202_name_conversion_rules_027.xsd new file mode 100644 index 0000000..51caae6 --- /dev/null +++ b/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_027/Pos_050202_name_conversion_rules_027.xsd @@ -0,0 +1,13 @@ + + + + + + + + + + + diff --git a/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_028/Pos_050202_name_conversion_rules_028.ttcn b/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_028/Pos_050202_name_conversion_rules_028.ttcn new file mode 100644 index 0000000..cf9eee5 --- /dev/null +++ b/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_028/Pos_050202_name_conversion_rules_028.ttcn @@ -0,0 +1,93 @@ +/*************************************************** + ** @author STF 572 + ** @version 0.0.1 + ** @purpose 9:5.2.2, Verify that suffix is attached in case of name clash between field name and effective fields + ** @verdict pass accept, ttcn3verdict:pass + ** @configuration elem_subst +***************************************************/ +// The following requirements are tested: +// Rule l: +// If the name being generated is the identifier of a field of a record or a union type, +// and the character string generated by the rules in items a) to i) above ... +// is identical to any identifier from the list of effective fields (see clause 6.2.5.0 +// of ETSI ES 201 873 1 [1]), then a postfix shall be appended to the character string +// generated by the above rules. + +module Pos_050202_name_conversion_rules_028 { + + import from schema_Pos_050202_name_conversion_rules_028 language "XSD" all; + + template MyType m_msg := + { + field := { foo_1 := { foo := "foo", bar := "bar" } } + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout MyType, Raw; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_050202_name_conversion_rules_028() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_050202_name_conversion_rules_026.xml", { "Pos_050202_name_conversion_rules_026.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_050202_name_conversion_rules_028(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_028/Pos_050202_name_conversion_rules_028.xml b/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_028/Pos_050202_name_conversion_rules_028.xml new file mode 100644 index 0000000..e9f0f58 --- /dev/null +++ b/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_028/Pos_050202_name_conversion_rules_028.xml @@ -0,0 +1,7 @@ + + + + foo + bar + + \ No newline at end of file diff --git a/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_028/Pos_050202_name_conversion_rules_028.xsd b/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_028/Pos_050202_name_conversion_rules_028.xsd new file mode 100644 index 0000000..620add8 --- /dev/null +++ b/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_028/Pos_050202_name_conversion_rules_028.xsd @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + diff --git a/xml/06_built_in_data_types/0608_anytype_and_anysimpletype_types/Pos_0608_anytype_and_anysimpletype_types_006/Pos_0608_anytype_and_anysimpletype_types_006.ttcn b/xml/06_built_in_data_types/0608_anytype_and_anysimpletype_types/Pos_0608_anytype_and_anysimpletype_types_006/Pos_0608_anytype_and_anysimpletype_types_006.ttcn index b704382..ff09944 100644 --- a/xml/06_built_in_data_types/0608_anytype_and_anysimpletype_types/Pos_0608_anytype_and_anysimpletype_types_006/Pos_0608_anytype_and_anysimpletype_types_006.ttcn +++ b/xml/06_built_in_data_types/0608_anytype_and_anysimpletype_types/Pos_0608_anytype_and_anysimpletype_types_006/Pos_0608_anytype_and_anysimpletype_types_006.ttcn @@ -1,63 +1,63 @@ -/*************************************************** - ** @author STF 548 - ** @version 0.0.1 - ** @purpose 9:6.8, Verify conversion of XSD anySimpleType to TTCN-3 anytype - ** @verdict pass accept, ttcn3verdict:pass - ** @configuration any_to_anytype -***************************************************/ - -module Pos_Pos_0608_anytype_and_anysimpletype_types_006 { - - import from schema_Pos_0608_anytype_and_anysimpletype_types_006 language "XSD" all; - - template MyType m_msg := { integer := 1 }; - - - - /** - * @desc The timeout given in seconds after which the test case will be stopped. - */ - modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; - - type universal charstring Raw; - - type port P message { - inout all; - } - type component C { - port P p; - } - - testcase TC_Pos_0608_anytype_and_anysimpletype_types_006() runs on C system C { - var Raw v_rcv; - - map(self:p, system:p); - - // encode the message - p.send(m_msg); - - alt { - [] p.check(receive(Raw:?) -> value v_rcv) { - log("XML message ", v_rcv); - alt { - // match decoded value to pass test - [] p.receive(m_msg) { - setverdict(pass, "Decoded value matches encoded template"); - } - [] p.receive { - setverdict(fail, "XML decoding failure"); - } - } - } - [] p.receive { - setverdict(fail, "Raw decoding failure"); - } - } - } - - control { - execute(TC_Pos_0608_anytype_and_anysimpletype_types_006(), PX_TC_EXECUTION_TIMEOUT); - } - - -} +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 9:6.8, Verify conversion of XSD anySimpleType to TTCN-3 anytype + ** @verdict pass accept, ttcn3verdict:pass + ** @configuration any_to_anytype +***************************************************/ + +module Pos_Pos_0608_anytype_and_anysimpletype_types_006 { + + import from schema_Pos_0608_anytype_and_anysimpletype_types_006 language "XSD" all; + + template MyType m_msg := { integer := 1 }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type port P message { + inout all; + } + type component C { + port P p; + } + + testcase TC_Pos_0608_anytype_and_anysimpletype_types_006() runs on C system C { + var Raw v_rcv; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_0608_anytype_and_anysimpletype_types_006(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/xml/06_built_in_data_types/0608_anytype_and_anysimpletype_types/Pos_0608_anytype_and_anysimpletype_types_007/Pos_0608_anytype_and_anysimpletype_types_007.ttcn b/xml/06_built_in_data_types/0608_anytype_and_anysimpletype_types/Pos_0608_anytype_and_anysimpletype_types_007/Pos_0608_anytype_and_anysimpletype_types_007.ttcn index 1991563..96c95b6 100644 --- a/xml/06_built_in_data_types/0608_anytype_and_anysimpletype_types/Pos_0608_anytype_and_anysimpletype_types_007/Pos_0608_anytype_and_anysimpletype_types_007.ttcn +++ b/xml/06_built_in_data_types/0608_anytype_and_anysimpletype_types/Pos_0608_anytype_and_anysimpletype_types_007/Pos_0608_anytype_and_anysimpletype_types_007.ttcn @@ -1,63 +1,63 @@ -/*************************************************** - ** @author STF 548 - ** @version 0.0.1 - ** @purpose 9:6.8, Verify conversion of XSD anyType to TTCN-3 anytype - ** @verdict pass accept, ttcn3verdict:pass - ** @configuration any_to_anytype -***************************************************/ - -module Pos_Pos_0608_anytype_and_anysimpletype_types_007 { - - import from schema_Pos_0608_anytype_and_anysimpletype_types_007 language "XSD" all; - - template MyType m_msg := { embed_values := omit, attr := omit, elem_list := { { Something := 1 } } }; - - - - /** - * @desc The timeout given in seconds after which the test case will be stopped. - */ - modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; - - type universal charstring Raw; - - type port P message { - inout all; - } - type component C { - port P p; - } - - testcase TC_Pos_0608_anytype_and_anysimpletype_types_007() runs on C system C { - var Raw v_rcv; - - map(self:p, system:p); - - // encode the message - p.send(m_msg); - - alt { - [] p.check(receive(Raw:?) -> value v_rcv) { - log("XML message ", v_rcv); - alt { - // match decoded value to pass test - [] p.receive(m_msg) { - setverdict(pass, "Decoded value matches encoded template"); - } - [] p.receive { - setverdict(fail, "XML decoding failure"); - } - } - } - [] p.receive { - setverdict(fail, "Raw decoding failure"); - } - } - } - - control { - execute(TC_Pos_0608_anytype_and_anysimpletype_types_007(), PX_TC_EXECUTION_TIMEOUT); - } - - -} +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 9:6.8, Verify conversion of XSD anyType to TTCN-3 anytype + ** @verdict pass accept, ttcn3verdict:pass + ** @configuration any_to_anytype +***************************************************/ + +module Pos_Pos_0608_anytype_and_anysimpletype_types_007 { + + import from schema_Pos_0608_anytype_and_anysimpletype_types_007 language "XSD" all; + + template MyType m_msg := { embed_values := omit, attr := omit, elem_list := { { Something := 1 } } }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type port P message { + inout all; + } + type component C { + port P p; + } + + testcase TC_Pos_0608_anytype_and_anysimpletype_types_007() runs on C system C { + var Raw v_rcv; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_0608_anytype_and_anysimpletype_types_007(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/xml/06_built_in_data_types/0608_anytype_and_anysimpletype_types/Pos_0608_anytype_and_anysimpletype_types_008/Pos_0608_anytype_and_anysimpletype_types_008.ttcn b/xml/06_built_in_data_types/0608_anytype_and_anysimpletype_types/Pos_0608_anytype_and_anysimpletype_types_008/Pos_0608_anytype_and_anysimpletype_types_008.ttcn new file mode 100644 index 0000000..b0be45d --- /dev/null +++ b/xml/06_built_in_data_types/0608_anytype_and_anysimpletype_types/Pos_0608_anytype_and_anysimpletype_types_008/Pos_0608_anytype_and_anysimpletype_types_008.ttcn @@ -0,0 +1,101 @@ +/*************************************************** + ** @author TTF T014 + ** @version 0.0.1 + ** @purpose 9:6.8, Whitespace handling in anyType with mixed content + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// An element of anyType is able to carry any syntactically valid (well-formed) +// XML content, including mixed content. +// Rule for embed_values from B.3.10 restriction d: +// At the end of decoding, the decoder shall remove all empty strings at the end +// of the embed_values field. As the result of this action, the decoded embed_values +// field either contains no items or its last item is a non empty string. + +module Pos_0608_anytype_and_anysimpletype_types_003 { + + import from schema_Pos_0608_anytype_and_anysimpletype_types_003 language "XSD" all; + + template MyType m_msg := { + embed_values := { "The ordered ", " has arrived. ", ""}, + attr := {"schema:Pos_0608_anytype_and_anysimpletype_types_003 attr=""abc"""}, + elem_list := { + "foo", + "bar" + } + }; + + template MyType m_msg1 modifies m_msg := { + embed_values := { "The ordered ", " has arrived. "}, + }; + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_0608_anytype_and_anysimpletype_types_003() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_0608_anytype_and_anysimpletype_types_003.xml", { "Pos_0608_anytype_and_anysimpletype_types_003.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(fail, "Invalid decoding: the last item of the decoded embed_values field cannot contain empty strings"); + } + [] p.receive(m_msg1) { + setverdict(pass, "Empty strings correctly skipped"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_0608_anytype_and_anysimpletype_types_003(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/xml/06_built_in_data_types/0608_anytype_and_anysimpletype_types/Pos_0608_anytype_and_anysimpletype_types_008/Pos_0608_anytype_and_anysimpletype_types_008.xml b/xml/06_built_in_data_types/0608_anytype_and_anysimpletype_types/Pos_0608_anytype_and_anysimpletype_types_008/Pos_0608_anytype_and_anysimpletype_types_008.xml new file mode 100644 index 0000000..66a5d36 --- /dev/null +++ b/xml/06_built_in_data_types/0608_anytype_and_anysimpletype_types/Pos_0608_anytype_and_anysimpletype_types_008/Pos_0608_anytype_and_anysimpletype_types_008.xml @@ -0,0 +1,2 @@ + +The ordered foo has arrived. bar \ No newline at end of file diff --git a/xml/06_built_in_data_types/0608_anytype_and_anysimpletype_types/Pos_0608_anytype_and_anysimpletype_types_008/Pos_0608_anytype_and_anysimpletype_types_008.xsd b/xml/06_built_in_data_types/0608_anytype_and_anysimpletype_types/Pos_0608_anytype_and_anysimpletype_types_008/Pos_0608_anytype_and_anysimpletype_types_008.xsd new file mode 100644 index 0000000..3544151 --- /dev/null +++ b/xml/06_built_in_data_types/0608_anytype_and_anysimpletype_types/Pos_0608_anytype_and_anysimpletype_types_008/Pos_0608_anytype_and_anysimpletype_types_008.xsd @@ -0,0 +1,9 @@ + + + + + + + diff --git a/xml/07_mapping_xsd_components/0701_component_attributes/070101_id/Pos_070101_id_001/Pos_070101_id_001.ttcn b/xml/07_mapping_xsd_components/0701_component_attributes/070101_id/Pos_070101_id_001/Pos_070101_id_001.ttcn index 7fc3630..f12fc44 100644 --- a/xml/07_mapping_xsd_components/0701_component_attributes/070101_id/Pos_070101_id_001/Pos_070101_id_001.ttcn +++ b/xml/07_mapping_xsd_components/0701_component_attributes/070101_id/Pos_070101_id_001/Pos_070101_id_001.ttcn @@ -1,87 +1,87 @@ -/*************************************************** - ** @author STF 475 - ** @version 0.0.1 - ** @purpose 9:7.1.1, Verify conversion of id attribute of global element - ** @verdict pass accept, ttcn3verdict:pass -***************************************************/ -// The following requirements are tested: -// The attribute id enables a unique identification of an XSD component. They -// shall be mapped to TTCN-3 as simple type references, e.g. any component -// mapping to a type with name typeName and an attribute id="ID" shall result in -// an additional TTCN-3 type declaration. - -module Pos_070101_id_001 { - - import from schema_Pos_070101_id_001 language "XSD" all; - - template ProductType m_base := {name := "Moby Dick", price := "$12.4"}; - template MyType m_msg := m_base; - - - - /** - * @desc The timeout given in seconds after which the test case will be stopped. - */ - modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; - - type universal charstring Raw; - - type universal charstring File; - type record of File FileList; - - type port P message { - inout all; - } - type component C { - port P p; - } - - /** - * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure - * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file - * @param p_referenceXmlFile the XML file - * @param p_xsdFileList the list of XSD files - * @param p_matchError the error result in case it did not match - * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. - * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure - */ - external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; - - testcase TC_Pos_070101_id_001() runs on C system C { - var Raw v_rcv; - var universal charstring v_matchError; - - map(self:p, system:p); - - // encode the message - p.send(m_msg); - - alt { - // compare the encoded message with the reference XML file - [] p.check(receive(Raw:?) -> value v_rcv) { - log("XML message ", v_rcv); - if (matchFile(v_rcv, "Pos_070101_id_001.xml", { "Pos_070101_id_001.xsd" }, v_matchError)) { - alt { - // match decoded value to pass test - [] p.receive(m_msg) { - setverdict(pass, "Decoded value matches encoded template and reference XML"); - } - [] p.receive { - setverdict(fail, "XML decoding failure"); - } - } - } else { - setverdict(fail, v_matchError); - } - } - [] p.receive { - setverdict(fail, "Raw decoding failure"); - } - } - } - - control { - execute(TC_Pos_070101_id_001(), PX_TC_EXECUTION_TIMEOUT); - } - -} +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.1.1, Verify conversion of id attribute of global element + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// The attribute id enables a unique identification of an XSD component. They +// shall be mapped to TTCN-3 as simple type references, e.g. any component +// mapping to a type with name typeName and an attribute id="ID" shall result in +// an additional TTCN-3 type declaration. + +module Pos_070101_id_001 { + + import from schema_Pos_070101_id_001 language "XSD" all; + + template ProductType m_base := {name := "Moby Dick", price := "$12.4"}; + template MyType m_msg := m_base; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070101_id_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_070101_id_001.xml", { "Pos_070101_id_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070101_id_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/xml/07_mapping_xsd_components/0701_component_attributes/070101_id/Pos_070101_id_002/Pos_070101_id_002.ttcn b/xml/07_mapping_xsd_components/0701_component_attributes/070101_id/Pos_070101_id_002/Pos_070101_id_002.ttcn index 3bfe501..a86691b 100644 --- a/xml/07_mapping_xsd_components/0701_component_attributes/070101_id/Pos_070101_id_002/Pos_070101_id_002.ttcn +++ b/xml/07_mapping_xsd_components/0701_component_attributes/070101_id/Pos_070101_id_002/Pos_070101_id_002.ttcn @@ -1,90 +1,90 @@ -/*************************************************** - ** @author STF 475 - ** @version 0.0.1 - ** @purpose 9:7.1.1, verify conversion of id attribute of local element - ** @verdict pass accept, ttcn3verdict:pass -***************************************************/ -// The following requirements are tested: -// The attribute id enables a unique identification of an XSD component. They -// shall be mapped to TTCN-3 as simple type references, e.g. any component -// mapping to a type with name typeName and an attribute id="ID" shall result in -// an additional TTCN-3 type declaration. - -module Pos_070101_id_002 { - - import from schema_Pos_070101_id_002 language "XSD" all; - - template E01 m_base := "test"; - template MyType m_msg := { - foo := m_base - }; - - - - /** - * @desc The timeout given in seconds after which the test case will be stopped. - */ - modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; - - type universal charstring Raw; - - type universal charstring File; - type record of File FileList; - - type port P message { - inout all; - } - type component C { - port P p; - } - - /** - * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure - * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file - * @param p_referenceXmlFile the XML file - * @param p_xsdFileList the list of XSD files - * @param p_matchError the error result in case it did not match - * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. - * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure - */ - external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; - - testcase TC_Pos_070101_id_002() runs on C system C { - var Raw v_rcv; - var universal charstring v_matchError; - - map(self:p, system:p); - - // encode the message - p.send(m_msg); - - alt { - // compare the encoded message with the reference XML file - [] p.check(receive(Raw:?) -> value v_rcv) { - log("XML message ", v_rcv); - if (matchFile(v_rcv, "Pos_070101_id_002.xml", { "Pos_070101_id_002.xsd" }, v_matchError)) { - alt { - // match decoded value to pass test - [] p.receive(m_msg) { - setverdict(pass, "Decoded value matches encoded template and reference XML"); - } - [] p.receive { - setverdict(fail, "XML decoding failure"); - } - } - } else { - setverdict(fail, v_matchError); - } - } - [] p.receive { - setverdict(fail, "Raw decoding failure"); - } - } - } - - control { - execute(TC_Pos_070101_id_002(), PX_TC_EXECUTION_TIMEOUT); - } - - -} +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.1.1, verify conversion of id attribute of local element + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// The attribute id enables a unique identification of an XSD component. They +// shall be mapped to TTCN-3 as simple type references, e.g. any component +// mapping to a type with name typeName and an attribute id="ID" shall result in +// an additional TTCN-3 type declaration. + +module Pos_070101_id_002 { + + import from schema_Pos_070101_id_002 language "XSD" all; + + template E01 m_base := "test"; + template MyType m_msg := { + foo := m_base + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070101_id_002() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_070101_id_002.xml", { "Pos_070101_id_002.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070101_id_002(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/xml/07_mapping_xsd_components/0705_simpletype_components/070503_derivation_by_union/Pos_070503_derivation_by_union_007/Pos_070503_derivation_by_union_007.ttcn b/xml/07_mapping_xsd_components/0705_simpletype_components/070503_derivation_by_union/Pos_070503_derivation_by_union_007/Pos_070503_derivation_by_union_007.ttcn index 246bb6b..db78938 100644 --- a/xml/07_mapping_xsd_components/0705_simpletype_components/070503_derivation_by_union/Pos_070503_derivation_by_union_007/Pos_070503_derivation_by_union_007.ttcn +++ b/xml/07_mapping_xsd_components/0705_simpletype_components/070503_derivation_by_union/Pos_070503_derivation_by_union_007/Pos_070503_derivation_by_union_007.ttcn @@ -1,81 +1,81 @@ -/*************************************************** - ** @author STF 548 - ** @version 0.0.1 - ** @purpose 9:7.5.3, Verify transformation of union restricted by enum facets (anonymous union members) - ** @verdict pass accept, ttcn3verdict:pass -***************************************************/ -module Pos_070503_derivation_by_union_007 { - - import from schema_Pos_070503_derivation_by_union_007 language "XSD" all; - - template MyType m_msg := { xsiType := alt_, content := x20 }; - - - - /** - * @desc The timeout given in seconds after which the test case will be stopped. - */ - modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; - - type universal charstring Raw; - - type universal charstring File; - type record of File FileList; - - type port P message { - inout all; - } - type component C { - port P p; - } - - /** - * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure - * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file - * @param p_referenceXmlFile the XML file - * @param p_xsdFileList the list of XSD files - * @param p_matchError the error result in case it did not match - * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. - * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure - */ - external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; - - testcase TC_Pos_070503_derivation_by_union_007() runs on C system C { - var Raw v_rcv; - var universal charstring v_matchError; - - map(self:p, system:p); - - // encode the message - p.send(m_msg); - - alt { - // compare the encoded message with the reference XML file - [] p.check(receive(Raw:?) -> value v_rcv) { - log("XML message ", v_rcv); - if (matchFile(v_rcv, "Pos_070503_derivation_by_union_007.xml", { "Pos_070503_derivation_by_union_007.xsd" }, v_matchError)) { - alt { - // match decoded value to pass test - [] p.receive(m_msg) { - setverdict(pass, "Decoded value matches encoded template and reference XML"); - } - [] p.receive { - setverdict(fail, "XML decoding failure"); - } - } - } else { - setverdict(fail, v_matchError); - } - } - [] p.receive { - setverdict(fail, "Raw decoding failure"); - } - } - } - - control { - execute(TC_Pos_070503_derivation_by_union_007(), PX_TC_EXECUTION_TIMEOUT); - } - - -} +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 9:7.5.3, Verify transformation of union restricted by enum facets (anonymous union members) + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +module Pos_070503_derivation_by_union_007 { + + import from schema_Pos_070503_derivation_by_union_007 language "XSD" all; + + template MyType m_msg := { xsiType := alt_, content := x20 }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070503_derivation_by_union_007() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_070503_derivation_by_union_007.xml", { "Pos_070503_derivation_by_union_007.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070503_derivation_by_union_007(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/xml/07_mapping_xsd_components/0705_simpletype_components/070503_derivation_by_union/Pos_070503_derivation_by_union_008/Pos_070503_derivation_by_union_008.ttcn b/xml/07_mapping_xsd_components/0705_simpletype_components/070503_derivation_by_union/Pos_070503_derivation_by_union_008/Pos_070503_derivation_by_union_008.ttcn index 296dcf7..b6fb53d 100644 --- a/xml/07_mapping_xsd_components/0705_simpletype_components/070503_derivation_by_union/Pos_070503_derivation_by_union_008/Pos_070503_derivation_by_union_008.ttcn +++ b/xml/07_mapping_xsd_components/0705_simpletype_components/070503_derivation_by_union/Pos_070503_derivation_by_union_008/Pos_070503_derivation_by_union_008.ttcn @@ -1,81 +1,81 @@ -/*************************************************** - ** @author STF 548 - ** @version 0.0.1 - ** @purpose 9:7.5.3, Verify transformation of union restricted by enum facets (referenced union members) - ** @verdict pass accept, ttcn3verdict:pass -***************************************************/ -module Pos_070503_derivation_by_union_008 { - - import from schema_Pos_070503_derivation_by_union_008 language "XSD" all; - - template MyType m_msg := { xsiType := integer_, content := x20 }; - - - - /** - * @desc The timeout given in seconds after which the test case will be stopped. - */ - modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; - - type universal charstring Raw; - - type universal charstring File; - type record of File FileList; - - type port P message { - inout all; - } - type component C { - port P p; - } - - /** - * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure - * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file - * @param p_referenceXmlFile the XML file - * @param p_xsdFileList the list of XSD files - * @param p_matchError the error result in case it did not match - * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. - * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure - */ - external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; - - testcase TC_Pos_070503_derivation_by_union_008() runs on C system C { - var Raw v_rcv; - var universal charstring v_matchError; - - map(self:p, system:p); - - // encode the message - p.send(m_msg); - - alt { - // compare the encoded message with the reference XML file - [] p.check(receive(Raw:?) -> value v_rcv) { - log("XML message ", v_rcv); - if (matchFile(v_rcv, "Pos_070503_derivation_by_union_008.xml", { "Pos_070503_derivation_by_union_008.xsd" }, v_matchError)) { - alt { - // match decoded value to pass test - [] p.receive(m_msg) { - setverdict(pass, "Decoded value matches encoded template and reference XML"); - } - [] p.receive { - setverdict(fail, "XML decoding failure"); - } - } - } else { - setverdict(fail, v_matchError); - } - } - [] p.receive { - setverdict(fail, "Raw decoding failure"); - } - } - } - - control { - execute(TC_Pos_070503_derivation_by_union_008(), PX_TC_EXECUTION_TIMEOUT); - } - - -} +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 9:7.5.3, Verify transformation of union restricted by enum facets (referenced union members) + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +module Pos_070503_derivation_by_union_008 { + + import from schema_Pos_070503_derivation_by_union_008 language "XSD" all; + + template MyType m_msg := { xsiType := integer_, content := x20 }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070503_derivation_by_union_008() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_070503_derivation_by_union_008.xml", { "Pos_070503_derivation_by_union_008.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070503_derivation_by_union_008(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070701_the_any_element/Pos_070701_the_any_element_007/Pos_070701_the_any_element_007.ttcn b/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070701_the_any_element/Pos_070701_the_any_element_007/Pos_070701_the_any_element_007.ttcn index a053887..7ff5f4d 100644 --- a/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070701_the_any_element/Pos_070701_the_any_element_007/Pos_070701_the_any_element_007.ttcn +++ b/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070701_the_any_element/Pos_070701_the_any_element_007/Pos_070701_the_any_element_007.ttcn @@ -1,63 +1,63 @@ -/*************************************************** - ** @author STF 548 - ** @version 0.0.1 - ** @purpose 9:7.7.1, Verify conversion of the any element to TTCN-3 anytype - ** @verdict pass accept, ttcn3verdict:pass - ** @configuration any_to_anytype -***************************************************/ - -module Pos_070701_the_any_element_007 { - - import from schema_Pos_070701_the_any_element_007 language "XSD" all; - - template MyType m_msg := { elem := { Test := "abc" } }; - - - - /** - * @desc The timeout given in seconds after which the test case will be stopped. - */ - modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; - - type universal charstring Raw; - - type port P message { - inout all; - } - type component C { - port P p; - } - - testcase TC_Pos_070701_the_any_element_007() runs on C system C { - var Raw v_rcv; - - map(self:p, system:p); - - // encode the message - p.send(m_msg); - - alt { - [] p.check(receive(Raw:?) -> value v_rcv) { - log("XML message ", v_rcv); - alt { - // match decoded value to pass test - [] p.receive(m_msg) { - setverdict(pass, "Decoded value matches encoded template"); - } - [] p.receive { - setverdict(fail, "XML decoding failure"); - } - } - } - [] p.receive { - setverdict(fail, "Raw decoding failure"); - } - } - } - - control { - execute(TC_Pos_070701_the_any_element_007(), PX_TC_EXECUTION_TIMEOUT); - } - - -} +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 9:7.7.1, Verify conversion of the any element to TTCN-3 anytype + ** @verdict pass accept, ttcn3verdict:pass + ** @configuration any_to_anytype +***************************************************/ + +module Pos_070701_the_any_element_007 { + + import from schema_Pos_070701_the_any_element_007 language "XSD" all; + + template MyType m_msg := { elem := { Test := "abc" } }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type port P message { + inout all; + } + type component C { + port P p; + } + + testcase TC_Pos_070701_the_any_element_007() runs on C system C { + var Raw v_rcv; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070701_the_any_element_007(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070702_the_anyattribute_element/Pos_070702_the_anyattribute_element_006/Pos_070702_the_anyattribute_element_006.ttcn b/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070702_the_anyattribute_element/Pos_070702_the_anyattribute_element_006/Pos_070702_the_anyattribute_element_006.ttcn index e121a43..d4b8df0 100644 --- a/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070702_the_anyattribute_element/Pos_070702_the_anyattribute_element_006/Pos_070702_the_anyattribute_element_006.ttcn +++ b/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070702_the_anyattribute_element/Pos_070702_the_anyattribute_element_006/Pos_070702_the_anyattribute_element_006.ttcn @@ -1,63 +1,63 @@ -/*************************************************** - ** @author STF 548 - ** @version 0.0.1 - ** @purpose 9:7.7.2, Verify conversion of anyAttribute element to TTCN-3 anytype - ** @verdict pass accept, ttcn3verdict:pass - ** @configuration any_to_anytype -***************************************************/ - -module Pos_070702_the_anyattribute_element_006 { - - import from schema_Pos_070702_the_anyattribute_element_006 language "XSD" all; - - template MyType m_msg := { attr := { {Bar := "bar"}, { Foo := "foo" } }, base := "Hello world!" }; - - - - /** - * @desc The timeout given in seconds after which the test case will be stopped. - */ - modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; - - type universal charstring Raw; - - type port P message { - inout all; - } - type component C { - port P p; - } - - testcase TC_Pos_070702_the_anyattribute_element_006() runs on C system C { - var Raw v_rcv; - - map(self:p, system:p); - - // encode the message - p.send(m_msg); - - alt { - [] p.check(receive(Raw:?) -> value v_rcv) { - log("XML message ", v_rcv); - alt { - // match decoded value to pass test - [] p.receive(m_msg) { - setverdict(pass, "Decoded value matches encoded template"); - } - [] p.receive { - setverdict(fail, "XML decoding failure"); - } - } - } - [] p.receive { - setverdict(fail, "Raw decoding failure"); - } - } - } - - control { - execute(TC_Pos_070702_the_anyattribute_element_006(), PX_TC_EXECUTION_TIMEOUT); - } - - -} +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 9:7.7.2, Verify conversion of anyAttribute element to TTCN-3 anytype + ** @verdict pass accept, ttcn3verdict:pass + ** @configuration any_to_anytype +***************************************************/ + +module Pos_070702_the_anyattribute_element_006 { + + import from schema_Pos_070702_the_anyattribute_element_006 language "XSD" all; + + template MyType m_msg := { attr := { {Bar := "bar"}, { Foo := "foo" } }, base := "Hello world!" }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type port P message { + inout all; + } + type component C { + port P p; + } + + testcase TC_Pos_070702_the_anyattribute_element_006() runs on C system C { + var Raw v_rcv; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070702_the_anyattribute_element_006(), PX_TC_EXECUTION_TIMEOUT); + } + + +} -- GitLab