Sem_060203_records_and_sets_of_single_types_020.ttcn 1.17 KB
Newer Older
/***************************************************
 ** @author   STF 470
 ** @version  0.0.1
 ** @purpose  1:6.2.3, referencing non-existent element of set of value (left-hand side)
 ** @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.
module Sem_060203_records_and_sets_of_single_types_020 {

	type component GeneralComp {	    	    
	}
 
	type set of integer SoI;
	
	testcase TC_Sem_060203_records_and_sets_of_single_types_020() runs on GeneralComp {

		var SoI v_set := { 0, 1 };
		v_set[3] := 3; // {0, 1, -, 3}
stancakapost's avatar
stancakapost committed
		if (match(v_set[0], 0) and
			match(v_set[1], 1) and
			not isbound(v_set[2]) and
stancakapost's avatar
stancakapost committed
			match(v_set[3], 3)) {
			setverdict(pass);
		}
		else {
			setverdict(fail);
		}
	}
	
	control {
		execute(TC_Sem_060203_records_and_sets_of_single_types_020());
	}

}