# testcasename

The testcasename function returns the unqualified name of the actually executing test case. When it's called from the control part and no testcase is being executed, it returns the empty string. (For more information check ETSI ES 201 873-1 (TTCN-3 Core Language).)

Related keywords:

- charstring
- testcase

### testcasename() return charstring

Example 1:

    module MyModule {
      type component Empty { }

      testcase MyTestCase() runs on Empty {
        // It'll return "MyTestCase".
        var charstring TCName := testcasename()
      }

      control {
        // It'll return "".
        var charstring TCName := testcasename()
      }
    }
    module YourModule {
      function MyFunction() {
        // It'll return "MyTestCase" if the function is called e.g. by another function
        // during the execution of MyTestCase.
        var charstring TCName := testcasename()
      }
    }