Menu

Testing & inheritance

2003-07-08
2003-07-08
  • Ofri Sadowsky

    Ofri Sadowsky - 2003-07-08

    I have the following class structure, which I would like to test:

    class A;  // abstract base class

    template<class SomeDataType>
    class B : public A;  // still abstract

    class C : public B<DataType>;

    class D1 : public C;
    class D2 : public C;

    Naturally, I would create test classes such as TestA, TestB, TestC, TestD1, and TestD2, with corresponding inheritance relation. However, it seems to be difficult to use the Helper Macros to define the "test suite" that each of the classes provides. Does anyone have an idea about how to easily augment the suite of TestA from within TestB (or any of the others)?

     
    • Ofri Sadowsky

      Ofri Sadowsky - 2003-07-08

      Well, I just use the CPPUNIT_TEST_SUB_SUITE macro instead of CPPUNIT_TEST_SUITE.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.