Class: TPrimitiveComparisonTestOf

Declaration: PrimitiveComparisonTest.h

Taxonomy Categories:

Member Functions:


Interface Category:

Developer Tool Programmer Interface.

Inherits From:

TBasePrimitiveComparisonTest

Inherited By:

None.

Purpose:

A template class derived from TBasePrimitiveComparisonTest. It tests the canonical functions: constructor, destructor, copy constructor, and assignment operator.

Instantiation:

Allocate on the heap or the stack.

Deriving Classes:

TPrimitiveComparisonTestOf can be used directly only if the target and comparator are set outside the test before running the test. Otherwise, create a derived class of TPrimitiveComparisonTestOf and overload the SetupComparator function to specify which comparator to use for the test, the SetupComparator function to specify which comparator to use for the test, and the CreateNewTarget function to create the target. Clients can also override the CreateEqualTarget and CreateUnequalTarget to create the objects used to check equality and inequality. The TPrimitiveComparisonTestOf 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: TPrimitiveComparisonTestOf::TPrimitiveComparisonTestOf

  1. TPrimitiveComparisonTestOf ()
  2. TPrimitiveComparisonTestOf (const TPrimitiveComparisonTestOf < 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: TPrimitiveComparisonTestOf::~TPrimitiveComparisonTestOf

virtual ~ TPrimitiveComparisonTestOf ()

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: TPrimitiveComparisonTestOf::operator=

TPrimitiveComparisonTestOf < AType > & operator =(const TPrimitiveComparisonTestOf < 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: TPrimitiveComparisonTestOf::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: TPrimitiveComparisonTestOf::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: TPrimitiveComparisonTestOf::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: TPrimitiveComparisonTestOf::AssignObjects

virtual void AssignObjects (void * source, void * destination)

Interface Category:

Developer Tool Programmer Interface.

Purpose:

Assigns the destination object to the source object after casting both pointers to the target class.

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: TPrimitiveComparisonTestOf::CheckCopyConstructedStackObject

virtual void CheckCopyConstructedStackObject (void * source)

Interface Category:

Developer Tool Programmer Interface.

Purpose:

Creates a copy-constructed object on the stack using the given source. It then compares the copy-constructed object and the source and checks that the objects are equal.

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: TPrimitiveComparisonTestOf::CreateHeapObject

virtual void * CreateHeapObject (TLocalMemoryHeap & heap, void * source)

Interface Category:

Developer Tool Programmer Interface.

Purpose:

Creates a copy-constructed object on the given heap using the source and returns the heap object.

Calling Context:

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

Parameters:

Return Value:

Returns the copy-constructed object that was allocated on the heap.

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.