/*****************************************************************
 ** @author   STF 470
 ** @version  0.0.1
 ** @purpose  1:15.8, Ensure that template(present) base templates are allowed to be modfied to template.
 ** @verdict  pass accept, ttcn3verdict:pass
 *****************************************************************/

// ATTENTION: valid for TTCN-3:2013 (ETSI ES 201 873-1 V4.5.1) and newer
// Older versions of the core languate standard didn't allow this type of
// modification because of restriction 15.8.c.

module Sem_1508_TemplateRestrictions_030 {

	type component GeneralComp { }

    type record ExampleType {
        integer a,
        boolean b optional
    }

    template(present) ExampleType m_baseTemplate := {
        a := 20,
        b := true
    }

    template ExampleType m_modifiedTemplate modifies m_baseTemplate := {
        a := 21
    }

	testcase TC_Sem_1508_TemplateRestrictions_030() runs on GeneralComp {
        if (match(valueof(m_modifiedTemplate.a), 21) and
            match(valueof(m_modifiedTemplate.b), true)
        ) {
            setverdict(pass);
        } else {
            setverdict(fail);
        }
    }

    control{
        execute(TC_Sem_1508_TemplateRestrictions_030());
    }
}