class TestWrapper : Test

Wrapper for test objects.

Objects of this class delegate all operations to the shadowed test object. This class serves as base class for other classes realizing the proxy and decorator pattern.



Public Members:
    virtual ~TestWrapper () ;
    Destructor.
    Deletes also the shadowed test object if release was set to true.

    virtual string getName () const ;
    Returns the name of the shadowed test.
    See interface Test for details.

    virtual bool run (TestConductor& conductor) ;
    Delegate the execution of the shadowed test to the given test conductor.
    See interface Test for details.

    virtual void setUp () ;
    Set-up the test fixture.
    See interface Test for details.

    virtual void test (TestConductor& conductor) ;
    Execute the shadowed test.
    See interface Test for details.

    virtual void tearDown () ;
    Tear-down of the test fixture.
    See interface Test for details.

    virtual bool isTestCase () const ;
    Check if the shadowed test is a test case.
    See interface Test for details.

    virtual int noTestCases () const ;
    Returns the number of contained test cases in the shadowed test.
    See interface Test for details.

    virtual int noTestSuites () const ;
    Returns the number of contained test suites in the shadowed test.
    See interface Test for details.

    virtual void put (ostream& stream) const ;
    Output the test case to the stream.
    Prefixes the output of the shadowed test by stating that this instance is a wrapper (or owner-wrapper) of the test.

    virtual Test* getTestObject () const ;
    Returns the shadowed test.
    Reader function.

    virtual void setTestObject ( Test* test, bool release = true ) ;
    Sets the shadowed test.
    In addition, the release status could be specified. (See also the constructor).




Protected Members:
    TestWrapper ( const string& name, Test* test, bool release ) ;
    Create a test wrapper for the given test object.
    The wrapper shadows the test object. By default, it is assumed that the shadowed test is owned by another object (release is false). But if release is true, the shadowed test is deleted when the wrapper is destroyed.

    TestWrapper ( Test* test, bool release = false ) ;
    Create a test wrapper for the given test object.
    Like above, but with no specific name; "Wrapper" is used instead.




The Scrunitizer C++ Unit Test Framework
by Bernd Linowski

[Scrunitizer]  [Overview]  [Cookbook]  [Download]  [Index]  [Linosphere]

Page generated: 1 Nov 2000
(C) by Bernd Linowski
scrunitizer@linosphere.de