Boost logo

Boost Users :

Subject: Re: [Boost-users] [test] testing protected/private methods out of testsuits
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2008-09-22 14:33:03


AMDG

trashing_at_[hidden] wrote:
> To return to your previous posting:
> I try to do my best and test only public method. But sometimes it's very hard,
> especially for complex protected methods. Either you use the way descripted
> above or you move the method to a helper class. Both alternatives are not
> elegant I think.
>

I suppose that you could add

class C {
    friend class C_test_access;
};

and define C_test_access in the tests, with
only static forwarding functions.

In Christ,
Steven Watanabe


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