Commit de2bc8b5 authored by urbant's avatar urbant
Browse files

Invalid array test Sem_011 replaced with a valid one (testing different requirement)

parent a01abbb3
Loading
Loading
Loading
Loading
+14 −12
Original line number Diff line number Diff line
/***************************************************
 ** @author   STF 470
 ** @author   STF 487
 ** @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
 ***************************************************/

// The following requirement is tested:
// If an indexing operator at the left-hand side of an assignment refers to 
// a non-existent element, the value at the right-hand side is assigned to 
// the element and all elements with an index smaller than the actual index 
// and without assigned value are created with an undefined value.
// All elements in an array value that are not set explicitly are undefined. 
// When referencing an element of an uninitialized array value or field or 
// omitted field on the left hand side of an assignment, the rules for record 
// of values specified in 6.2.3 apply.

module Sem_060207_arrays_011 {

	type component GeneralComp {
	}
 
    type integer MyArrayType1[3];
    type record length (3) of integer MyRecordOfType1;
    type record R {
        integer field1[3] optional
    }
	
	testcase TC_Sem_060207_arrays_011() runs on GeneralComp {

        var MyArrayType1 a1 := {7, 8, 9};
        var MyRecordOfType1 r1 := a1;
        var integer myArray1[3] := r1;//shall be pass due to clause 6.2.7. Example 1
        var R v_rec := { field1 := omit };
        v_rec.field1[2] := 3;
		
		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);
		}
		else {