Class: TTestCollection

Declaration: TestCollection.h

Taxonomy Categories:

Member Functions:


Interface Category:

Developer Tool Programmer Interface.

Inherits From:

TTest

Inherited By:

TTestSequence TTestSet

Purpose:

An abstract base class that represents a protocol for classes of tests that contain other subtests.

Instantiation:

Allocate on the heap or the stack. Do not instantiate TTestCollection directly. Instead, use one of its concrete derived classes (TTestSet, TTestSequence).

Deriving Classes:

Do not derive TTestCollection directly. Instead, use one of its principal derived classes (TTestSet, TTestSequence).

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Member Function: TTestCollection::~TTestCollection

virtual ~ TTestCollection ()

Interface Category:

Developer Tool Programmer Interface.

Purpose:

Destructor.

Calling Context:

Called to destroy an object.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TTestCollection::operator<<=

virtual TStream & operator <<= (TStream & source)

Interface Category:

Developer Tool Programmer Interface.

Purpose:

Stream-in operator.

Calling Context:

Called to stream in data.

Parameters:

Return Value:

Returns a reference to the stream the object streams itself in from.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TTestCollection::operator>>=

virtual TStream & operator >>=(TStream & destination) const

Interface Category:

Developer Tool Programmer Interface.

Purpose:

Stream-out operator.

Calling Context:

Called to stream out data.

Parameters:

Return Value:

Returns a reference to the stream the object streams itself out to.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TTestCollection::CopyInfo

virtual void CopyInfo (TDictionaryOf < TStandardText, TText >& infoDict) const

Interface Category:

Developer Tool Programmer Interface.

Purpose:

Framework function that derived classes can override to provide metainformation about themselves.

Calling Context:

Called by Test framework and test logging classes.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TTestCollection::AdoptTest

virtual void AdoptTest (TTest * subTest)

Interface Category:

Developer Tool Programmer Interface.

Purpose:

Adds a subtest to the test's collection of subtests.

Calling Context:

Called directly to add subtest to collection.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

The caller must not delete the subtest after calling AdoptTest.

Member Function: TTestCollection::SetHaltOnFail

void SetHaltOnFail (bool)

Interface Category:

Developer Tool Programmer Interface.

Purpose:

Sets a Boolean that controls whether the Test function halts on a subtest failure. If true, the Test function halts when it encounters a failure in one of its subtests.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TTestCollection::GetHaltOnFail

bool GetHaltOnFail () const

Interface Category:

Developer Tool Programmer Interface.

Purpose:

Gets a Boolean that controls whether the Test function halts when one of its subtests fails. If true, the Test function halts when it encounters a failure in one of its subtests.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns true if the Test function is to halt on a subtest failure.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TTestCollection::TTestCollection

  1. TTestCollection ()
  2. TTestCollection (const TTestCollection &)

Interface Category:

Developer Tool Programmer Interface.

Purpose:

  1. Default constructor.
  2. Copy constructor.

Calling Context:

  1. Called by the stream-in operators and Runtest.
  2. Called to copy an object.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TTestCollection::operator=

TTestCollection & operator =(const TTestCollection &)

Interface Category:

Developer Tool Programmer Interface.

Purpose:

Assignment operator.

Calling Context:

Called when an object is assigned to another compatible object.

Parameters:

Return Value:

A non-const reference to the left-hand side object.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TTestCollection::Reset

virtual void Reset ()

Interface Category:

Developer Tool Programmer Interface.

Purpose:

Resets all of its subtests as well as itself. Derived classes should not override.

Calling Context:

Called by Test framework. Do not call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TTestCollection::Setup

virtual void Setup ()

Interface Category:

Developer Tool Programmer Interface.

Purpose:

Calls PropagateInputs for all subtests to pass input parameters to subtests. It then calls TTest::Setup. Derived classes should not override.

Calling Context:

Called by Test framework. Do not call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TTestCollection::Test

virtual void Test ()

Interface Category:

Developer Tool Programmer Interface.

Purpose:

Performs the test. Calls the Run function for each of its subtests.

Calling Context:

Called by Test framework. Do not call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TTestCollection::Print

virtual void Print (TTieredTextBuffer &)

Interface Category:

Developer Tool Programmer Interface.

Purpose:

Prints the results from each subtest to the given tiered text buffer.

Calling Context:

Called by Test framework. Do not call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TTestCollection::GetNewSubtests

virtual TCollectionOf < TTest > & GetNewSubtests ()

Interface Category:

Developer Tool Programmer Interface.

Purpose:

Returns a reference to the collection of subtests.

Calling Context:

Called by Test framework. Do not call this function directly.

Parameters:

Return Value:

Returns a reference to the collection of subtests.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TTestCollection::PropagateInputs

virtual void PropagateInputs (TTest & subtest)

Interface Category:

Developer Tool Programmer Interface.

Purpose:

A framework function that controls how input parameters to tests are sent to subtests. TTestCollection copies all input arguments unchanged to all subtests. Derived classes can override this function to alter this behavior.

Calling Context:

Called by Test framework. Do not call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TTestCollection::SetupSubtests

virtual void SetupSubtests ()

Interface Category:

Developer Tool Programmer Interface.

Purpose:

A framework function that controls what subtests are added to the test's collection. Derived classes should override SetupSubtests to instantiate all subtests and call AdoptTest for each subtest. Do not delete your subtests after calling AdoptTest.

Calling Context:

Called by TTestCollection::Setup.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TTestCollection::CreateNewSubtestIterator

virtual TIteratorOver < TTest > * CreateNewSubtestIterator ()

Interface Category:

Developer Tool Programmer Interface.

Purpose:

Returns a iterator over the subtests in the collection.

Calling Context:

Called by Test framework and clients.

Parameters:

Return Value:

Returns a iterator over the subtests in the collection.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.