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_009.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 record values can be anytype
13 ** @verdict pass accept, ttcn3verdict:pass
14 ***************************************************/
15 module Sem_060206_anytype_009 {
16
17 type record MyRec
18 {
19 anytype cs1 //Record type MyRec element is an anytype data
20 }
21
22 type component GeneralComp {
23 var MyRec R;
24 var anytype c,d;
25 }
26
27 testcase TC_Sem_060206_anytype_009() runs on GeneralComp {
28
29 R.cs1.charstring := "abc"; // cs1 in R record is now charstring
30 c.charstring := R.cs1.charstring; // anytype c becomes a charstring
31
32 R.cs1.integer := 15; // cs1 in R record now integer
33 d.integer := R.cs1.integer; //anytype d becomes integer
34
35
36 if ( match(c.charstring, "abc") and match(d.integer, 15)) {
37 setverdict(pass);
38 }
39 else {
40 setverdict(fail);
41 }
42
43 }
44
45 control {
46 execute(TC_Sem_060206_anytype_009());
47 }
48
49 }
50 with {
51 extension "anytype charstring, integer"
52 }
This page took 0.033796 seconds and 5 git commands to generate.