Sync with 5.1.0
[deliverable/titan.core.git] / regression_test / predefFunction / tcname_OK.ttcn
1 /******************************************************************************
2 * Copyright (c) 2000-2014 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 module tcname_OK {
9
10 type component PDTestComponent {};
11
12 /* Tests for testcasename() function. */
13
14 function testcasename_in_func() return charstring {
15 return testcasename()
16 }
17
18 function testcasename_in_func_runson() runs on PDTestComponent return charstring {
19 return testcasename()
20 }
21
22 modulepar charstring expected_tc_name := "testcasename_in_tc";
23
24 testcase testcasename_in_tc() runs on PDTestComponent {
25 if ("testcasename_in_tc" == testcasename_in_func())
26 { setverdict(pass) }
27 else { setverdict(fail) }
28 // For simple cases these should be the same.
29 if (%testcaseId == testcasename_in_func())
30 { setverdict(pass) }
31 else { setverdict(fail) }
32 if (%testcaseId == testcasename_in_func_runson())
33 { setverdict(pass) }
34 else { setverdict(fail) }
35 if (testcasename() == expected_tc_name)
36 { setverdict(pass) }
37 else { setverdict(fail) }
38 }
39
40 // Empty string from the control part.
41 testcase testcasename_from_control(in charstring p) runs on PDTestComponent {
42 if (p == "") { setverdict(pass) } else { setverdict(fail) }
43 }
44
45 control {
46 execute(testcasename_in_tc());
47 execute(testcasename_from_control(testcasename()));
48 // Call again outside testcase, but not directly from the control part.
49 execute(testcasename_from_control(testcasename_in_func()));
50 }
51
52
53 }
This page took 0.031682 seconds and 5 git commands to generate.