How do I unit test a protected method in C++?
In Java, I\'d either create the test class in the same package as the class under test or create an anonymous subcla
Declare a friend class MyClass_UnitTest; in your MyClass. You can then define MyClass_UnitTest elsewhere in your unit test program that has full access to MyClass internals, but you don't have to provide an implementation in your release application. See CppUnit documentation for a good example of how this is done.