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 ******************************************************************************/
10 type component PDTestComponent {};
12 /* Tests for testcasename() function. */
14 function testcasename_in_func() return charstring {
18 function testcasename_in_func_runson() runs on PDTestComponent return charstring {
22 modulepar charstring expected_tc_name := "testcasename_in_tc";
24 testcase testcasename_in_tc() runs on PDTestComponent {
25 if ("testcasename_in_tc" == testcasename_in_func())
27 else { setverdict(fail) }
28 // For simple cases these should be the same.
29 if (%testcaseId == testcasename_in_func())
31 else { setverdict(fail) }
32 if (%testcaseId == testcasename_in_func_runson())
34 else { setverdict(fail) }
35 if (testcasename() == expected_tc_name)
37 else { setverdict(fail) }
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) }
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()));