/*****************************************************************
 ** @author   TTF T014
 ** @version  0.0.1
 ** @purpose  1:15.5, Ensure that modified templates with same restrictions are supported.
 ** @verdict  pass accept
 *****************************************************************/
// The following requirement is tested:
// b) Restrictions on referencing elements of templates or template fields are described in clause
//EXAMPLE 8

module Sem_1505_ModifiedTemplates_015 {

    type component GeneralComp {
    }

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

	template MyRecordType m_myUnrestrictedRecTemplate1 :=
	{
		field1 := 123,
		field2 := "A string",
		field3 := true
	}

    testcase TC_Sem_1505_ModifiedTemplates_015() runs on GeneralComp {
		template MyRecordType m_myUnrestrictedRecTemplate2 modifies m_myUnrestrictedRecTemplate1 :=	{
			field2 := "A modified string" // field1, field3 is unchanged
		}

        if(
	        valueof(m_myUnrestrictedRecTemplate2.field1) == valueof(m_myUnrestrictedRecTemplate1.field1) and
			valueof(m_myUnrestrictedRecTemplate2.field2) == "A modified string" and
			valueof(m_myUnrestrictedRecTemplate2.field3) == valueof(m_myUnrestrictedRecTemplate1.field3)
		){
         setverdict(pass);
        }else{
         setverdict(fail);
        }

    }

    control{
        execute(TC_Sem_1505_ModifiedTemplates_015());
    }


}