NegSem_10_Constants_005.ttcn 1.07 KB
Newer Older
kovacsa's avatar
kovacsa committed
/***************************************************
 ** @author   STF 487
 ** @version  0.0.1
 ** @purpose  1:10, Ensure that index notation of a field in a set of type, which actual value is null shall cause an error
 ** @verdict  pass reject
 ***************************************************/

/* The following requirements are tested:
Using the dot notation and index notation for referencing a field, alternative or element of an address value, which actual value is null shall cause an
error.
*/

module NegSem_10_Constants_005 {

    type integer address;
    type default MyDef;
    type set of address MySetofInt;

    type component GeneralComp {
    }
    
    testcase TC_NegSem_10_Constants_005() runs on GeneralComp {

   var MySetofInt R1:= {[0] := null};
   var MyDef R2:=  null;
  
   const default C2 := R2;       //allowed     
   const integer C1 := R1[0];    //error
        
kovacsa's avatar
kovacsa committed
	if (match(C1,R1[0])) { setverdict(pass,"match") }
kovacsa's avatar
kovacsa committed
		else { setverdict(fail) }
    }
    
    control{
        execute(TC_NegSem_10_Constants_005());
    }
}