Boost logo

Boost Users :

Subject: Re: [Boost-users] [test] testing protected/private methods out of test suits
From: Robert Mecklenburg (rmecklenburg_at_[hidden])
Date: 2008-09-18 11:16:27


M. Siebeneicher writes:
> I tried to test protected/private class methods by declaring the
> test-case-class as a friend of the class-to-test.

Here's what we do to unit test our classes:

    #define private public
    #define protected public
    #include <common/Blob.hpp>

This makes our unit testing much easier! ;-)

Cheers,

-- 
Robert

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net