1 /******************************************************************************
2 * Copyright (c) 2000-2015 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 ******************************************************************************/
12 var template float fx;
15 testcase tc_no_par() runs on D
20 testcase tc_one_dp(in integer par1 := 42) runs on D
22 if (par1 == 42) { setverdict(pass); }
23 else { setverdict(fail); }
26 testcase tc_two_dps(in charstring s := "Stan", in charstring o := "Ollie") runs on D
28 if (s == "Stan" and o == "Ollie") { setverdict(pass); }
29 else { setverdict(fail, "here's another nice mess you've gotten me into!"); }
34 testcase tc_outpar(out integer o := dx) runs on D
36 if (o == 13) { setverdict(pass); }
37 else { setverdict(fail, match(o,13)); }
42 testcase tc_inoutpar(inout integer io := dx) runs on D
44 if (io == 13) { setverdict(pass); }
45 else { setverdict(fail, match(io, 13)); }
50 testcase tc_one_template_dp(in template charstring foobar := charstring : ("foo", "bar", "baz")) runs on D
52 if (match("baz", foobar)) { setverdict(pass); }
53 else { setverdict(fail, match("baz", foobar)); }
56 testcase tc_out_template_dp(out template float fd := fx) runs on D {
57 if (isbound(fd)) { setverdict(fail, "inbound out parameter should be unbound"); }
58 else { setverdict(pass); }
62 // This control part is not supposed to be run. The following call
63 // intentionally causes a fail verdict.
64 execute(tc_one_dp(13));
66 // These calls are here to see the generated code
67 execute(tc_out_template_dp());
69 execute(tc_inoutpar());
71 execute(tc_one_template_dp());
72 execute(tc_one_template_dp(-));
73 execute(tc_one_template_dp("baz"));
74 execute(tc_one_template_dp(?));
77 execute(tc_one_dp(-));
78 execute(tc_one_dp(42));
80 execute(tc_two_dps());
81 execute(tc_two_dps(-));
82 execute(tc_two_dps(-, -));
83 execute(tc_two_dps("Stan"));
84 execute(tc_two_dps(-, "Ollie"));
85 execute(tc_two_dps(-));
86 execute(tc_two_dps("Stan", "Ollie"));