conformance_test/positive_tests added
[deliverable/titan.core.git] / conformance_test / positive_tests / 06_types_and_values / 0602_structured_types_and_values / 060206_anytype / Sem_060206_anytype_015.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:6.2.0.6, ensure that anytype can act as a set type
13 ** @verdict pass accept, ttcn3verdict:pass
14 ***************************************************/
15 module Sem_060206_anytype_015 {
16
17 type set MySet{
18 charstring field1,
19 boolean field2
20 };
21
22 type component GeneralComp {
23
24 var anytype x; // anytype x variable
25
26 var MySet y := {
27 field1:= "abc",
28 field2:= true
29 }; // Set y contains field1=abc and field2=true
30
31 }
32
33 testcase TC_Sem_060206_anytype_015() runs on GeneralComp {
34
35 x.MySet := y; // anytype x now gets the type MySet and the values given by y.
36
37 if ( match(x.MySet.field1, "abc") and match(x.MySet.field2, true)) {
38 setverdict(pass);
39 }
40 else {
41 setverdict(fail);
42 }
43
44 }
45
46 control {
47 execute(TC_Sem_060206_anytype_015());
48 }
49
50 }
51 with {
52 extension "anytype MySet"
53 }
This page took 0.03253 seconds and 5 git commands to generate.