Sync with 5.4.0
[deliverable/titan.core.git] / regression_test / XML / HQ30408 / HQ30408.ttcn
CommitLineData
970ed795 1/******************************************************************************
3abe9331 2 * Copyright (c) 2000-2015 Ericsson Telecom AB
970ed795
EL
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 ******************************************************************************/
8module HQ30408
9{
10
11type component CT {}
12
13type union target
14{
15 boolean moving
16}
17
18type union U
19{
20 integer i,
21 charstring s,
22 target practice
23 // this field is the kicker: union inside an union
24};
25
26type record of U UList;
27
28external function enc_ulist(in UList ul) return octetstring
29with { extension "prototype(convert) encode(XER:XER_EXTENDED)" }
30
31external function dec_ulist(in octetstring o) return UList
32with { extension "prototype(convert) decode(XER:XER_EXTENDED)" "errorbehavior(ALL:WARNING)"
33}
34
35const UList c_ul := {
36 { practice := { moving := true } }
37}
38
39testcase hq30408() runs on CT
40{
41 var octetstring encoded := enc_ulist(c_ul);
42 action(encoded);
43
44 var UList v_ul := dec_ulist(encoded);
45 if (match(v_ul, c_ul)) { setverdict(pass); }
46 else { setverdict(fail, match(v_ul, c_ul)); }
47}
48
49control {
50 execute(hq30408());
51}
52
53}
54with {
55 variant "namespace as 'titansim:namespace:without:prefix' "
56 variant "elementFormQualified"
57
58 encode "XML"
59}
This page took 0.027039 seconds and 5 git commands to generate.