Commit | Line | Data |
---|---|---|
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 | ******************************************************************************/ | |
8 | module HQ30408 | |
9 | { | |
10 | ||
11 | type component CT {} | |
12 | ||
13 | type union target | |
14 | { | |
15 | boolean moving | |
16 | } | |
17 | ||
18 | type union U | |
19 | { | |
20 | integer i, | |
21 | charstring s, | |
22 | target practice | |
23 | // this field is the kicker: union inside an union | |
24 | }; | |
25 | ||
26 | type record of U UList; | |
27 | ||
28 | external function enc_ulist(in UList ul) return octetstring | |
29 | with { extension "prototype(convert) encode(XER:XER_EXTENDED)" } | |
30 | ||
31 | external function dec_ulist(in octetstring o) return UList | |
32 | with { extension "prototype(convert) decode(XER:XER_EXTENDED)" "errorbehavior(ALL:WARNING)" | |
33 | } | |
34 | ||
35 | const UList c_ul := { | |
36 | { practice := { moving := true } } | |
37 | } | |
38 | ||
39 | testcase 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 | ||
49 | control { | |
50 | execute(hq30408()); | |
51 | } | |
52 | ||
53 | } | |
54 | with { | |
55 | variant "namespace as 'titansim:namespace:without:prefix' " | |
56 | variant "elementFormQualified" | |
57 | ||
58 | encode "XML" | |
59 | } |