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_018.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 comprise set of and record of types
13 ** @verdict pass accept, ttcn3verdict:pass
14 ***************************************************/
15 module Sem_060206_anytype_018 {
16
17 type record of integer FirstRecordOf; // record of integers
18 type set of boolean FirstSetOf; // set of booleans
19
20
21 type component GeneralComp {
22
23 var anytype x; // Anytype x and y variables
24 var anytype y;
25
26 var FirstRecordOf MyVar1 := { 0, 5, 2, -, 6 };
27 // MyVar1 follows type FirstRecordOf with values 0,5,2,-,6
28 var FirstSetOf MyVar2 := { true, -,-, false, true};
29 // MyVar2 follows type FirstSetOf with values true,-,-,false,true
30
31 }
32
33 testcase TC_Sem_060206_anytype_018() runs on GeneralComp {
34
35 x.FirstRecordOf := MyVar1; // anytype x is now a record of type with values of MyVar1
36 y.FirstSetOf := MyVar2; // anytype x is now a set of type with values of MyVar2
37
38 if (match(x.FirstRecordOf[0], 0) and match(x.FirstRecordOf[4], 6) and match(y.FirstSetOf[0], true) and match(y.FirstSetOf[3], false) ) {
39 setverdict(pass);
40 }
41 else {
42 setverdict(fail);
43 }
44
45 }
46
47 control {
48 execute(TC_Sem_060206_anytype_018());
49 }
50
51 }
52 with {
53 extension "anytype FirstRecordOf, FirstSetOf"
54 }
This page took 0.03364 seconds and 5 git commands to generate.