/***************************************************
 ** @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());
	}
}
