convenient macro declaring friend for unittest classes to test private methods

release/4.3a0
Duy-Nguyen Ta 2015-05-15 08:44:15 -04:00
parent 40659cab38
commit 09ffc73b6e
1 changed files with 6 additions and 0 deletions

View File

@ -68,6 +68,12 @@ protected:
testGroup##testName##Instance; \
void testGroup##testName##Test::run (TestResult& result_)
/**
* Declare friend in a class to test its private methods
*/
#define FRIEND_TEST(testGroup, testName) \
friend class testGroup##testName##Test;
/**
* For debugging only: use TEST_UNSAFE to allow debuggers to have access to exceptions, as this
* will not wrap execution with a try/catch block