Loading ATS/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/06020101_referencing_fields_of_record_type/NegSem_06020101_ReferencingRecordFields_001.ttcn +1 −1 Original line number Diff line number Diff line /*************************************************** ** @author STF 451 ** @version 0.0.1 ** @purpose 1:6.2.1, The dot notation used in record type definitions is correctly handled ** @purpose 1:6.2.1.1, The dot notation used in record type definitions is correctly handled ** @verdict pass reject ***************************************************/ module NegSem_06020101_ReferencingRecordFields_001 { Loading ATS/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/06020101_referencing_fields_of_record_type/NegSem_06020101_ReferencingRecordFields_002.ttcn 0 → 100644 +35 −0 Original line number Diff line number Diff line /*************************************************** ** @author STF 487 ** @version 0.0.1 ** @purpose 1:6.2.1.1, verify that record fields cannot reference themselves ** @verdict pass reject ***************************************************/ // The following requirement is tested: // Fields of record type definitions shall not reference themselves. module NegSem_06020101_ReferencingRecordFields_002 { type component GeneralComp { } type record R { integer field1, R.field2 field2 optional, // this circular reference is NOT ALLOWED boolean field3 } testcase TC_NegSem_06020101_ReferencingRecordFields_002() runs on GeneralComp { var R v_rec := { field1 := 1, field2 := omit, field3 := true }; if (v_rec.field1 == 1) { setverdict(pass); } else { setverdict(fail); } } control { execute(TC_NegSem_06020101_ReferencingRecordFields_002()); } } ATS/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/06020101_referencing_fields_of_record_type/NegSem_06020101_ReferencingRecordFields_003.ttcn 0 → 100644 +38 −0 Original line number Diff line number Diff line /*************************************************** ** @author STF 487 ** @version 0.0.1 ** @purpose 1:6.2.1.1, verify that referencing uninitialized record on the right hand of an assignment is not allowed ** @verdict pass reject ***************************************************/ // The following requirement is tested: // Referencing a subfield of an uninitialized or omitted record field or value on the right // hand side of an assignment shall cause an error. module NegSem_06020101_ReferencingRecordFields_003 { type component GeneralComp { } type record R { record { integer subfield1 } field1, charstring field2 optional } testcase TC_NegSem_06020101_ReferencingRecordFields_003() runs on GeneralComp { var R v_rec; v_rec.field2 := "abc"; if (v_rec.field1.subfield1 == 5) { setverdict(fail); } else { setverdict(pass); } } control { execute(TC_NegSem_06020101_ReferencingRecordFields_003()); } } ATS/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/06020101_referencing_fields_of_record_type/NegSem_06020101_ReferencingRecordFields_004.ttcn 0 → 100644 +39 −0 Original line number Diff line number Diff line /*************************************************** ** @author STF 487 ** @version 0.0.1 ** @purpose 1:6.2.1.1, verify that referencing omitted record on the right hand of an assignment is not allowed ** @verdict pass reject ***************************************************/ // The following requirement is tested: // Referencing a subfield of an uninitialized or omitted record field or value on the right // hand side of an assignment shall cause an error. module NegSem_06020101_ReferencingRecordFields_004 { type component GeneralComp { } type record R { record { integer subfield1 } field1 optional, charstring field2 optional } testcase TC_NegSem_06020101_ReferencingRecordFields_004() runs on GeneralComp { var R v_rec; v_rec.field1 := omit; v_rec.field2 := "abc"; if (v_rec.field1.subfield1 == 5) { setverdict(fail); } else { setverdict(pass); } } control { execute(TC_NegSem_06020101_ReferencingRecordFields_004()); } } ATS/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/06020101_referencing_fields_of_record_type/Sem_06020101_ReferencingRecordFields_001.ttcn +1 −1 Original line number Diff line number Diff line /*************************************************** ** @author STF 451 ** @version 0.0.1 ** @purpose 1:6.2.1, The dot notation used in record type definitions is correctly handled ** @purpose 1:6.2.1.1, The dot notation used in record type definitions is correctly handled ** @verdict pass accept, ttcn3verdict:pass ***************************************************/ module Sem_06020101_ReferencingRecordFields_001 { Loading Loading
ATS/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/06020101_referencing_fields_of_record_type/NegSem_06020101_ReferencingRecordFields_001.ttcn +1 −1 Original line number Diff line number Diff line /*************************************************** ** @author STF 451 ** @version 0.0.1 ** @purpose 1:6.2.1, The dot notation used in record type definitions is correctly handled ** @purpose 1:6.2.1.1, The dot notation used in record type definitions is correctly handled ** @verdict pass reject ***************************************************/ module NegSem_06020101_ReferencingRecordFields_001 { Loading
ATS/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/06020101_referencing_fields_of_record_type/NegSem_06020101_ReferencingRecordFields_002.ttcn 0 → 100644 +35 −0 Original line number Diff line number Diff line /*************************************************** ** @author STF 487 ** @version 0.0.1 ** @purpose 1:6.2.1.1, verify that record fields cannot reference themselves ** @verdict pass reject ***************************************************/ // The following requirement is tested: // Fields of record type definitions shall not reference themselves. module NegSem_06020101_ReferencingRecordFields_002 { type component GeneralComp { } type record R { integer field1, R.field2 field2 optional, // this circular reference is NOT ALLOWED boolean field3 } testcase TC_NegSem_06020101_ReferencingRecordFields_002() runs on GeneralComp { var R v_rec := { field1 := 1, field2 := omit, field3 := true }; if (v_rec.field1 == 1) { setverdict(pass); } else { setverdict(fail); } } control { execute(TC_NegSem_06020101_ReferencingRecordFields_002()); } }
ATS/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/06020101_referencing_fields_of_record_type/NegSem_06020101_ReferencingRecordFields_003.ttcn 0 → 100644 +38 −0 Original line number Diff line number Diff line /*************************************************** ** @author STF 487 ** @version 0.0.1 ** @purpose 1:6.2.1.1, verify that referencing uninitialized record on the right hand of an assignment is not allowed ** @verdict pass reject ***************************************************/ // The following requirement is tested: // Referencing a subfield of an uninitialized or omitted record field or value on the right // hand side of an assignment shall cause an error. module NegSem_06020101_ReferencingRecordFields_003 { type component GeneralComp { } type record R { record { integer subfield1 } field1, charstring field2 optional } testcase TC_NegSem_06020101_ReferencingRecordFields_003() runs on GeneralComp { var R v_rec; v_rec.field2 := "abc"; if (v_rec.field1.subfield1 == 5) { setverdict(fail); } else { setverdict(pass); } } control { execute(TC_NegSem_06020101_ReferencingRecordFields_003()); } }
ATS/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/06020101_referencing_fields_of_record_type/NegSem_06020101_ReferencingRecordFields_004.ttcn 0 → 100644 +39 −0 Original line number Diff line number Diff line /*************************************************** ** @author STF 487 ** @version 0.0.1 ** @purpose 1:6.2.1.1, verify that referencing omitted record on the right hand of an assignment is not allowed ** @verdict pass reject ***************************************************/ // The following requirement is tested: // Referencing a subfield of an uninitialized or omitted record field or value on the right // hand side of an assignment shall cause an error. module NegSem_06020101_ReferencingRecordFields_004 { type component GeneralComp { } type record R { record { integer subfield1 } field1 optional, charstring field2 optional } testcase TC_NegSem_06020101_ReferencingRecordFields_004() runs on GeneralComp { var R v_rec; v_rec.field1 := omit; v_rec.field2 := "abc"; if (v_rec.field1.subfield1 == 5) { setverdict(fail); } else { setverdict(pass); } } control { execute(TC_NegSem_06020101_ReferencingRecordFields_004()); } }
ATS/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/06020101_referencing_fields_of_record_type/Sem_06020101_ReferencingRecordFields_001.ttcn +1 −1 Original line number Diff line number Diff line /*************************************************** ** @author STF 451 ** @version 0.0.1 ** @purpose 1:6.2.1, The dot notation used in record type definitions is correctly handled ** @purpose 1:6.2.1.1, The dot notation used in record type definitions is correctly handled ** @verdict pass accept, ttcn3verdict:pass ***************************************************/ module Sem_06020101_ReferencingRecordFields_001 { Loading