Sync with 5.4.0
[deliverable/titan.core.git] / regression_test / XML / xsdConverter / HO21968 / HO21968.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 HO21968 {
9
10import from titan_HO21968_prefix all;
11external function enc_pfx(in MySeqPrefix par) return octetstring
12with { extension "prototype(convert) encode(XER:XER_EXTENDED)" }
13
14const MySeqPrefix sp := {
15 i_list := {}
16}
17
18import from titan_HO21968_noprefix all;
19external function enc_nopfx(in MySeq par) return octetstring
20with { extension "prototype(convert) encode(XER:XER_EXTENDED)" }
21
22const MySeq sn := {
23 i_list := {}
24}
25
26type component C {}
27
28
29// Check that the result of both encodings
30// 1. Look like the beginning of XML (first character is '<')
31// 2. Do not look like a made-up prefix ("tq")
32testcase tcp() runs on C {
33 var octetstring encoded;
34 encoded := enc_pfx(sp);
35 log(encoded);
36 if (encoded[0]==char2oct("<")) { setverdict(pass); }
37 else { setverdict(fail); }
38 if (encoded[1]==char2oct("t") and encoded[2]==char2oct("q")) { setverdict(fail); }
39 else { setverdict(pass); }
40}
41
42testcase tcn() runs on C {
43 var octetstring encoded;
44 encoded := enc_nopfx(sn);
45 log(encoded);
46 if (encoded[0]==char2oct("<")) { setverdict(pass); }
47 else { setverdict(fail); }
48 if (encoded[1]==char2oct("t") and encoded[2]==char2oct("q")) { setverdict(fail); }
49 else { setverdict(pass); }
50}
51
52control {
53 execute(tcp())
54 execute(tcn())
55}
56
57}
This page took 0.029594 seconds and 5 git commands to generate.