Loading ATS/06_types_and_values/0602_structured_types_and_values/060207_arrays/Sem_060207_arrays_011.ttcn +14 −12 Original line number Original line Diff line number Diff line /*************************************************** /*************************************************** ** @author STF 470 ** @author STF 487 ** @version 0.0.1 ** @version 0.0.1 ** @purpose 1:6.2.7, verify that arrays can be used to specify record of type and they are compatible ** @purpose 1:6.2.7, index notation applied to omitted array field on left hand side of assignment ** @verdict pass accept, ttcn3verdict:pass ** @verdict pass accept, ttcn3verdict:pass ***************************************************/ ***************************************************/ // The following requirement is tested: // The following requirement is tested: // If an indexing operator at the left-hand side of an assignment refers to // All elements in an array value that are not set explicitly are undefined. // a non-existent element, the value at the right-hand side is assigned to // When referencing an element of an uninitialized array value or field or // the element and all elements with an index smaller than the actual index // omitted field on the left hand side of an assignment, the rules for record // and without assigned value are created with an undefined value. // of values specified in 6.2.3 apply. module Sem_060207_arrays_011 { module Sem_060207_arrays_011 { type component GeneralComp { type component GeneralComp { } } type integer MyArrayType1[3]; type record R { type record length (3) of integer MyRecordOfType1; integer field1[3] optional } testcase TC_Sem_060207_arrays_011() runs on GeneralComp { testcase TC_Sem_060207_arrays_011() runs on GeneralComp { var MyArrayType1 a1 := {7, 8, 9}; var R v_rec := { field1 := omit }; var MyRecordOfType1 r1 := a1; v_rec.field1[2] := 3; var integer myArray1[3] := r1;//shall be pass due to clause 6.2.7. Example 1 if (r1 == a1) { if (not isbound(v_rec.field1[0]) and not isbound(v_rec.field1[1]) and v_rec.field1[2] == 3) { setverdict(pass); setverdict(pass); } } else { else { Loading Loading
ATS/06_types_and_values/0602_structured_types_and_values/060207_arrays/Sem_060207_arrays_011.ttcn +14 −12 Original line number Original line Diff line number Diff line /*************************************************** /*************************************************** ** @author STF 470 ** @author STF 487 ** @version 0.0.1 ** @version 0.0.1 ** @purpose 1:6.2.7, verify that arrays can be used to specify record of type and they are compatible ** @purpose 1:6.2.7, index notation applied to omitted array field on left hand side of assignment ** @verdict pass accept, ttcn3verdict:pass ** @verdict pass accept, ttcn3verdict:pass ***************************************************/ ***************************************************/ // The following requirement is tested: // The following requirement is tested: // If an indexing operator at the left-hand side of an assignment refers to // All elements in an array value that are not set explicitly are undefined. // a non-existent element, the value at the right-hand side is assigned to // When referencing an element of an uninitialized array value or field or // the element and all elements with an index smaller than the actual index // omitted field on the left hand side of an assignment, the rules for record // and without assigned value are created with an undefined value. // of values specified in 6.2.3 apply. module Sem_060207_arrays_011 { module Sem_060207_arrays_011 { type component GeneralComp { type component GeneralComp { } } type integer MyArrayType1[3]; type record R { type record length (3) of integer MyRecordOfType1; integer field1[3] optional } testcase TC_Sem_060207_arrays_011() runs on GeneralComp { testcase TC_Sem_060207_arrays_011() runs on GeneralComp { var MyArrayType1 a1 := {7, 8, 9}; var R v_rec := { field1 := omit }; var MyRecordOfType1 r1 := a1; v_rec.field1[2] := 3; var integer myArray1[3] := r1;//shall be pass due to clause 6.2.7. Example 1 if (r1 == a1) { if (not isbound(v_rec.field1[0]) and not isbound(v_rec.field1[1]) and v_rec.field1[2] == 3) { setverdict(pass); setverdict(pass); } } else { else { Loading