conformance_test/positive_tests added
[deliverable/titan.core.git] / conformance_test / positive_tests / 15_templates / 1505_modified_templates / NegSyn_1505_ModifiedTemplates_001.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 base template and modified template cannot be the same
13 ** @verdict pass reject, noexectuion
14 *****************************************************************/
15 //Restriction a)
16 /*A modified template shall not refer to itself, either directly or indirectly, i.e. recursive derivation is not
17 allowed.*/
18
19 module NegSyn_1505_ModifiedTemplates_001{
20
21 type component GeneralComp { }
22
23 type record MyMessageType {
24 integer field1,
25 charstring field2,
26 boolean field3
27 }
28
29 template MyMessageType m_templateOne(integer p_intValue) := {
30 field1 := p_intValue,
31 field2 := "Hello World",
32 field3 := true
33 }
34
35 template MyMessageType m_templateTwo(integer p_intValue) modifies m_templateOne := {
36 field1 := 5
37 }
38
39 //error: not allowed to modify itself
40 template MyMessageType m_templateTwo(integer p_intValue) modifies m_templateTwo := {
41 field1 := 10
42 }
43
44 }
This page took 0.032899 seconds and 5 git commands to generate.