
4 Nov
2012
4 Nov
'12
9:57 a.m.
Thorsten Ottosen <thorsten.ottosen <at> dezide.com> writes:
Another issue. It would be cool to be able to give access to private members in the unit test. So given
BOOST_AUTO_TEST_CASE( testMyClass ) { ... }
I would be able to test private functions with:
class MyClass { friend void boost::test::testMyClass(); // or friend class boost::test::access; };
I believe you can just name struct testMyClass a friend of MyClass and that's it. If your test case is within a test suite you'll name to mention it as well test_suite::test_case_name. Gennadiy