Re: [Boost-bugs] [Boost C++ Libraries] #5282: Test fixtures do not support virtual inheritance

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #5282: Test fixtures do not support virtual inheritance
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-11-09 22:20:31


#5282: Test fixtures do not support virtual inheritance
--------------------------------------+-------------------------------------
  Reporter: tye.zdrojewski@… | Owner: rogeeff
      Type: Feature Requests | Status: new
 Milestone: To Be Determined | Component: test
   Version: Boost 1.45.0 | Severity: Problem
Resolution: | Keywords:
--------------------------------------+-------------------------------------

Comment (by Tye Z. <tye.zdrojewski@…>):

 Sorry, I forgot to add that {{{TestMe}}} extends another class:
> {{{
> class TestMe : public TestMeParent
> {
> protected:
> bool protectedValue = 0;
> int protectedMethod(int arg) { ... }
> void someProtectedBehavior() { ... }
> }
> }}}

 ...which is fine. But if the inheritance is '''virtual''', and
 {{{TestMeParent}}} does not have a default constructor, then its
 constructor must be specified by every subclass at any level:

 {{{
 class TestMeParent
 {
 public:
    TestMeParent(int initValue) { ... }
 }

 class TestMe : public virtual TestMeParent
 {
 public:
    TestMe() :
       TestMeParent(678) // initializer required at every inheritance level
    {
       ...
    }
 }

 }}}

 This breaks my fixture arrangement, because the fixture is subclassed
 again by the fixture macros.

 Hopefully I explained it clearly enough! :)

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/5282#comment:3>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:07 UTC