Class: TWellBehavedObjectTestOf

Declaration: WellBehavedObjectTest.h

Taxonomy Categories:

Member Functions:


Interface Category:

Developer Tool Programmer Interface.

Inherits From:

TBaseWellBehavedObjectTest

Inherited By:

None.

Purpose:

A template class derived from TBaseWellBehavedObjectTest. It tests the copying, streaming, and flattening of the target by creating TCopyTestOf, TFlattenResurrectTestOf, and TStreamTestOf tests for the target and running the tests. The test also does all the testing done by TBasePrimitiveComparisonTest by creating a TPrimitiveComparisonTestOf test for the target and running it.

Instantiation:

Allocate on the heap or the stack.

Deriving Classes:

TWellBehavedObjectTestOf should not be used directly. It is best to create a derived class of TWellBehavedObjectTestOf and overload the SetupComparator function to specify which comparator to use for the test, the SetupStreamer function to specify which streamer to use for the test, and the CreateNewTarget function to create the target. You can also override the CreateEqualTarget and CreateUnequalTarget to create the objects used to check equality and inequality. The TWellBehavedObjectTestOf macros can be used to create your derived class and define all the functions you need to override.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Member Function: TWellBehavedObjectTestOf::~TWellBehavedObjectTestOf

virtual ~ TWellBehavedObjectTestOf ()

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: TWellBehavedObjectTestOf::TWellBehavedObjectTestOf

  1. TWellBehavedObjectTestOf ()
  2. TWellBehavedObjectTestOf (const TWellBehavedObjectTestOf < AType > & that)

Interface Category:

Developer Tool Programmer Interface.

Purpose:

  1. Default constructor.
  2. Copy constructor.

Calling Context:

  1. Called by the stream-in operators.
  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: TWellBehavedObjectTestOf::operator=

TWellBehavedObjectTestOf < AType > & operator =(const TWellBehavedObjectTestOf < AType > & that)

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: TWellBehavedObjectTestOf::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:

The target object for the test is streamed in by the streaming operator.

Member Function: TWellBehavedObjectTestOf::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:

The target object for the test is streamed out by the streaming operator.

Member Function: TWellBehavedObjectTestOf::GetTargetClassNameAsString

virtual const char * GetTargetClassNameAsString () const

Interface Category:

Developer Tool Programmer Interface.

Purpose:

Returns the name of the target class.

Calling Context:

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

Parameters:

Return Value:

Returns the name of the target class.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TWellBehavedObjectTestOf::DeleteTarget

virtual void DeleteTarget (void *) const

Interface Category:

Developer Tool Programmer Interface.

Purpose:

Deletes the given target object after casting it to the target class to invoke the correct destructor.

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: TWellBehavedObjectTestOf::CreateNewTarget

virtual void * CreateNewTarget () const

Interface Category:

Developer Tool Programmer Interface.

Purpose:

Returns a NIL pointer. Derived classes must overload CreateNewTarget to create the target object.

Calling Context:

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

Parameters:

Return Value:

Returns a NIL pointer.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TWellBehavedObjectTestOf::CreateStreamTest

virtual TBaseStreamTest * CreateStreamTest () const

Interface Category:

Developer Tool Programmer Interface.

Purpose:

Creates the stream test for the target class.

Calling Context:

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

Parameters:

Return Value:

Returns the stream test for the target class.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TWellBehavedObjectTestOf::CreateFlattenResurrectTest

virtual TBaseFlattenResurrectTest * CreateFlattenResurrectTest () const

Interface Category:

Developer Tool Programmer Interface.

Purpose:

Creates the flatten/resurrect test for the target class.

Calling Context:

Do not call this function directly.

Parameters:

Return Value:

Returns the flatten/resurrect test for the target class.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TWellBehavedObjectTestOf::CreateCopyTest

virtual TBaseCopyTest * CreateCopyTest () const

Interface Category:

Developer Tool Programmer Interface.

Purpose:

Creates the copy test for the target class.

Calling Context:

Do not call this function directly.

Parameters:

Return Value:

Returns the copy test for the target class.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TWellBehavedObjectTestOf::CreatePrimitiveComparisonTest

virtual TBasePrimitiveComparisonTest * CreatePrimitiveComparisonTest () const

Interface Category:

Developer Tool Programmer Interface.

Purpose:

Creates the primitive comparison test for the target class.

Calling Context:

Do not call this function directly.

Parameters:

Return Value:

Returns the primitive comparison test for the target class.

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.