C++test can accommodate a number of strategies for programming test case-specific stub behavior. The most common strategies are to use the Test Case Editor Stubs step (see Working with Steps) or the dynamic stubs configuration API (see Dynamic Stubs Configuration). In the rare instances that these approaches are insufficient, you can replace the stub body with your own custom logic implementation an create a stub that is driven by the test case.
The following functions can be used in the stub code to get information about the currently executed test case. This information is superseded by the dynamic stubs configuration functionality and should only be used for legacy stubs and for cases where dynamic stubs configuration functionality is insufficient.
const char* CppTest_GetCurrentTestCaseName()
|Returns the name of the currently executed test case.
const char* CppTest_GetCurrentTestSuiteName()
|Returns the name of the currently executed test suite.
bool CppTest_IsCurrentTestCase(const char* id)
|Allows you to query the currently executed test case. It will return true if the specified id equals the name of the currently executed test case. Otherwise, it will return false.