conformance_test/positive_tests added
[deliverable/titan.core.git] / conformance_test / positive_tests / 15_templates / 1505_modified_templates / Sem_1505_ModifiedTemplates_008.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.5, Ensure that the values of plain modified template definitions are as expected.
13 ** @verdict pass accept, ttcn3verdict:pass
14 *****************************************************************/
15
16 /*A modified template may also be declared fuzzy using the @fuzzy modifier.
17 If a fuzzy modified template modifies a non-fuzzy unparameterized template, the inherited fields before modification will be the same for every evaluation of the fuzzy template.*/
18
19 module Sem_1505_ModifiedTemplates_008 {
20
21 type port MyMessagePortType message {
22 inout MyMessageType
23 }
24
25 type component GeneralComp {
26 port MyMessagePortType pt_myPort;
27 }
28
29 type record MyMessageType {
30 integer field1,
31 charstring field2,
32 boolean field3
33 }
34
35 template MyMessageType m_templateOne := {
36 field1 := 2,
37 field2 := "Hello World",
38 field3 := -
39 }
40
41 template @fuzzy MyMessageType m_templateTwo modifies m_templateOne := {
42 field1 := 4,
43 field3 := true
44 }
45
46 testcase TC_Sem_1505_ModifiedTemplates_008() runs on GeneralComp {
47 if ((valueof(m_templateTwo.field1) == 4) and
48 (valueof(m_templateTwo.field2) == "Hello World") and
49 (valueof(m_templateTwo.field3) == true)
50 ) {
51 setverdict(pass);
52 } else {
53 setverdict(fail);
54 }
55 }
56
57 control{
58 execute(TC_Sem_1505_ModifiedTemplates_008());
59 }
60
61 }
This page took 0.033889 seconds and 5 git commands to generate.