conformance_test/positive_tests added
[deliverable/titan.core.git] / conformance_test / positive_tests / 15_templates / 1508_template_restrictions / Sem_1508_TemplateRestrictions_026.ttcn
1 /******************************************************************************
2 * Copyright (c) 2000-2016 Ericsson Telecom AB
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
7 *
8 * Contributors:
9 * Adrien Kirjak – initial implementation
10 *
11 ** @version 0.0.1
12 ** @purpose 1:15.8, Ensure that template(value) base templates are allowed to be modfied to template(present).
13 ** @verdict pass accept, ttcn3verdict:pass
14 *****************************************************************/
15
16 // ATTENTION: valid for TTCN-3:2013 (ETSI ES 201 873-1 V4.5.1) and newer
17 // Older versions of the core language standard didn't allow this type of
18 // modification because of restriction 15.8.c.
19
20 module Sem_1508_TemplateRestrictions_026 {
21
22 type component GeneralComp { }
23
24 type record ExampleType {
25 integer a,
26 boolean b optional
27 }
28
29 template(value) ExampleType m_baseTemplate := {
30 a := 20,
31 b := true
32 }
33
34 template(present) ExampleType m_modifiedTemplate modifies m_baseTemplate := {
35 a := 21
36 }
37
38 testcase TC_Sem_1508_TemplateRestrictions_026() runs on GeneralComp {
39 if (match(valueof(m_modifiedTemplate.a), 21) and
40 match(valueof(m_modifiedTemplate.b), true)
41 ) {
42 setverdict(pass);
43 } else {
44 setverdict(fail);
45 }
46 }
47
48 control{
49 execute(TC_Sem_1508_TemplateRestrictions_026());
50 }
51 }
This page took 0.03054 seconds and 5 git commands to generate.