class Foo {
friend class FooForTesting;
};
class FooForTesting : public Foo {
public:
// exposes otherwise private/protected members and methods in Foo.
};
Rather than testing Foo, you will test FooForTesting instead. The
FooForTesting class makes it obvious which internal parts of Foo you
are relying on for the tests.
liulk