conformance_test/positive_tests added
[deliverable/titan.core.git] / conformance_test / positive_tests / 15_templates / 1508_template_restrictions / NegSem_1508_TemplateRestrictions_029.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 the template(present) with anyvalue(?) can't be assigned to an omit restricted variable template
13 ** @verdict pass reject
14 *****************************************************************/
15
16
17 module NegSem_1508_TemplateRestrictions_029 {
18
19 type record ExampleType { // Exampletype record contains a charstring and a boolean
20 charstring a,
21 boolean b
22 }
23
24 type component GeneralComp {
25 var template (omit) ExampleType v_omit; //omit restricted template variable
26 }
27
28 template (present) ExampleType MyintTemplate :={
29 //actual template with present restriction contains anytype (?)
30 a := ?,
31 b := false
32 }
33
34 testcase TC_NegSem_1508_TemplateRestrictions_029() runs on GeneralComp {
35
36 v_omit := MyintTemplate; //error: v_omit is omit restricted, hence can not contain anytype(?)
37
38 if (valueof(v_omit.b) == false) {
39 setverdict(pass);
40 } else {
41 setverdict(fail);
42 }
43 }
44
45 control{
46 execute(TC_NegSem_1508_TemplateRestrictions_029());
47 }
48 }
This page took 0.031741 seconds and 5 git commands to generate.