 /***************************************************
 ** @author   STF 572
 ** @version  0.0.1
 ** @purpose  1:15.5, verify that matching mechanisms can be modified in inline templates
 ** @verdict  pass accept, ttcn3verdict:pass
 ***************************************************/

// The following requirement is tested:
// The modifies keyword denotes the parent template from which the new modified template shall be derived.
// This parent template may be either an original template or a modified template or also a matching mechanism.

module Sem_1505_ModifiedTemplates_013 {
    type component GeneralComp {
	}

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

	template MyRecordType m_myTemplate1(integer p_myPar) := {
		field1 := p_myPar,
		field2 := "A string",
		field3 := true
	}

    testcase TC_Sem_1505_ModifiedTemplates_013() runs on GeneralComp system GeneralComp {
		var template MyRecordType v_modification := {
		  field2 := "G string" // field1/field3 are uninitialized
		}
		var template MyRecordType v_myTemplate := modifies m_myTemplate1(5) := v_modification;
		// no modification of field1/field3
		// results in { field1 := 5, field2 := "G string", field3 := true }
        if (valueof(v_myTemplate) == { field1 := 5, field2 := "G string", field3 := true }) {
            setverdict(pass);
        } else {
            setverdict(fail);
        }
	}

	control {
		execute(TC_Sem_1505_ModifiedTemplates_013());
	}
}
