/***************************************************
 ** @author   STF 521
 ** @version  0.0.1
 ** @purpose  1:B.1.2.1, Ensure that the IUT correctly handles template list corretly
 ** @verdict  pass accept, ttcn3verdict:pass
 ***************************************************/

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

module Sem_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_Sem_B010201_value_list_004() runs on GeneralComp {

    var MessageType v_testMessage;
     v_testMessage:=  {
  	         field1:= 1,
             field2:= "abc"
	}

 messagePort.send(v_testMessage);

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

control{
    execute(TC_Sem_B010201_value_list_004());
}

}