/*****************************************************************
 ** @author   STF 487
 ** @version  0.0.1
 ** @purpose  1:15.5, Ensure that default values in formal parameters of modified templates are working as expected.
 ** @verdict  pass accept, ttcn3verdict:pass
 *****************************************************************/

 //Restriction b)

/*If a record or set field or its corresponding matching mechanism is – implicitly or explicitly by using the not used symbol "-" -
left unspecified in the modified template, then the matching mechanism in the corresponding field of the
parent template shall be used.*/

module Sem_1505_ModifiedTemplates_007 {

type component GeneralComp { }

type record MyMessageType {
	integer field1,
	charstring field2,
	boolean field3
}

template MyMessageType m_templateOne(integer p_intValue) := {
	field1 := p_intValue,
	field2 := "Hello World",
	field3 := true
}

template MyMessageType m_templateTwo(integer p_intValue:=2, boolean p_boolValue:=false) modifies m_templateOne := {
	field1 := p_intValue,
	field2 := -,		//not used symbol
	field3 := p_boolValue
}

testcase TC_Sem_1505_ModifiedTemplates_007() runs on GeneralComp {
	if (match(valueof(m_templateTwo.field1) , 2) and
	    match(valueof(m_templateTwo.field2) , "Hello World") and
	    match(valueof(m_templateTwo.field3) , false)
	   ) {
		setverdict(pass);
	} else {
		setverdict(fail);
	}
}

control{
    execute(TC_Sem_1505_ModifiedTemplates_007());
}

}