NegSem_B010201_value_list_004.ttcn 1.32 KB
Newer Older
kovacsa's avatar
kovacsa committed
/***************************************************
 ** @author   STF 521 
 ** @version  0.0.1
 ** @purpose  1:B.1.2.1, Ensure that the IUT correctly handles template list corretly
kovacsa's avatar
kovacsa committed
 ** @verdict  pass accept reject
kovacsa's avatar
kovacsa committed
 ***************************************************/

// The following requirements are tested:
// Restriction C: Templates in the template list shall obey the template(present) restriction

module NegSem_B010201_value_list_004 { 

    
	type record MessageType {
  	 integer  		field1, 
  	 charstring  	field2 optional
	}
    
    template(present) MessageType mw_examplePresent := {1, ?};

    type port loopbackPort message {
	  inout MessageType
	}
	

type component GeneralComp {	    	    
	  port loopbackPort messagePort
}	

testcase TC_NegSem_B010201_value_list_004() runs on GeneralComp {

    var MessageType v_testMessage;
    var template(omit) MessageType v_present;    
    v_present :=  mw_examplePresent;     // error: incorrect
    
    v_testMessage:=  {
  	         field1:= 1,
             field2:= "abc"
	}
 
 messagePort.send(v_testMessage);

    alt {
     [] messagePort.receive(v_present) {
        setverdict(pass);
     }
     [] messagePort.receive {
        setverdict(fail);
     }
    }
}

control{
    execute(TC_NegSem_B010201_value_list_004());
}

}