Taxonomy Categories:
Member Functions:
Interface Category:
Developer Tool Programmer Interface.
Inherits From:
TBaseComparisonTest
Inherited By:
TWellBehavedObjectTestOf
Purpose:
TBaseWellBehavedObject test is an abstract base class derived from TBaseComparisonTest that defines the protocol used for TWellBehavedTestOf tests. TBaseWellBehavedObjectTest bundles TBaseCopyTest, TBaseFlattenResurrectTest, TBaseStreamTest, and TBasePrimitiveComparisonTest into a single test. TBaseWellBehavedObjectTest tests the copying, flattening, and the streaming 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 (for example, testing constructor, destructor, assignment operator) by creating a TPrimitiveComparisonTestOf test for the target and running it.
Instantiation:
Allocate on the heap or the stack.
Deriving Classes:
TBaseWellBehavedObjectTest cannot be used directly. Use the template class TWellBehavedObjectTestOf or the TWellBehavedObjectTestOf macros. The template class defines all the functions that you must override for TBaseWellBehavedObjectTest.
Concurrency:
Not multithread safe.
Resource Use:
No special requirements.
virtual ~ TBaseWellBehavedObjectTest ()
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.
virtual TStream & operator <<= (TStream & source)
Interface Category:
Developer Tool Programmer Interface.
Purpose:
Stream-in operator.
Calling Context:
Called to stream in data.
Parameters:
- TStream & source -The stream the object is streamed in from.
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.
virtual TStream & operator >>=(TStream & destination) const
Interface Category:
Developer Tool Programmer Interface.
Purpose:
Stream-out operator.
Calling Context:
Called to stream out data.
Parameters:
- TStream & destination -The stream the object is streamed out to.
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.
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.
virtual bool GetCheckPrimitiveComparison () const
Interface Category:
Developer Tool Programmer Interface.
Purpose:
Sets a Boolean that controls whether the primitive comparison test is run for the target. If true, the Test function creates a TPrimitiveComparisonTestOf test for the target and runs the test.
Calling Context:
Called by Test framework and directly.
Parameters:
Return Value:
Returns true if the primitive comparison test is run for the target class.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
virtual void SetCheckPrimitiveComparison (bool check)
Interface Category:
Developer Tool Programmer Interface.
Purpose:
Gets whether the Test member function will run the TBasePrimitiveComparisonTest for the target.
Calling Context:
Called by Test framework.
Parameters:
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
virtual bool GetCheckVersionHandling () const
Interface Category:
Developer Tool Programmer Interface.
Purpose:
Gets a Boolean that controls whether the version handling checking is done in the stream test. If true, the Test member function checks for correct handling of invalid version number in stream when streaming in the target object.
Calling Context:
Called by test framework and directly.
Parameters:
Return Value:
Returns true if version handling checking is done in the stream test.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
virtual void SetCheckVersionHandling (bool check)
Interface Category:
Developer Tool Programmer Interface.
Purpose:
Sets a Boolean that controls whether the version handling checking is done in the stream test. If true, the Test member function checks for correct handling of invalid version number in stream when streaming in the target object.
Calling Context:
Called by test framework and directly.
Parameters:
- bool check -If true, the equality checking is done in the Test function.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
void AdoptStreamer (TAbstractStreamer * streamer)
Interface Category:
Developer Tool Programmer Interface.
Purpose:
Sets the streamer to be used for the test.
Calling Context:
Called by Test framework and directly.
Parameters:
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
After this call, this object owns the streamer and deletes it.
TAbstractStreamer * OrphanStreamer ()
Interface Category:
Developer Tool Programmer Interface.
Purpose:
Returns a pointer to the streamer previously set by AdoptStreamer, or zero if no streamer has been set.
Calling Context:
Called by Test framework and directly.
Parameters:
Return Value:
Returns a pointer to the streamer previously set by AdoptStreamer, or zero if no streamer has been set.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
The caller owns the object that is returned and is responsible for deleting it.
TAbstractStreamer * GetStreamer ()
Interface Category:
Developer Tool Programmer Interface.
Purpose:
Returns a pointer to the streamer previously set by AdoptStreamer, or zero if no streamer has been set.
Calling Context:
Called by Test framework and directly.
Parameters:
Return Value:
Returns a pointer to the streamer previously set by AdoptStreamer, or zero if no streamer has been set.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
The caller must not delete the streamer that is returned.
- TBaseWellBehavedObjectTest ()
- TBaseWellBehavedObjectTest (const TBaseWellBehavedObjectTest & source)
Interface Category:
Developer Tool Programmer Interface.
Purpose:
- Default constructor.
- Copy constructor.
Calling Context:
- Called by the stream-in operators.
- Called to copy an object.
Parameters:
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
TBaseWellBehavedObjectTest & operator =(const TBaseWellBehavedObjectTest & rhs)
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.
virtual void Setup ()
Interface Category:
Developer Tool Programmer Interface.
Purpose:
Parses the inputs for the test and calls SetCheckPrimitiveComparison if the -p option is specified. It then calls SetupStreamer if the streamer is not set.
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.
virtual void Test ()
Interface Category:
Developer Tool Programmer Interface.
Purpose:
Creates the copy test, the streaming test, and the flattening test for the target class and runs these tests. If version handling checking is enabled, the stream test will test version handling of the target's stream-in operator. If primitive comparison checking is enabled, it creates the primitive comparison test for the target class and runs the test.
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.
virtual void SetupStreamer ()
Interface Category:
Developer Tool Programmer Interface.
Purpose:
Sets up the streamer to be used for the test. Derived classes should overload SetupStreamer to instantiate the streamer and call AdoptStreamer for the streamer.
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.
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.
virtual TBaseCopyTest * CreateCopyTest () const
Interface Category:
Developer Tool Programmer Interface.
Purpose:
Creates the copy test for the target class.
Calling Context:
Called by Test framework. 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.
virtual TBaseFlattenResurrectTest * CreateFlattenResurrectTest () const
Interface Category:
Developer Tool Programmer Interface.
Purpose:
Creates the flatten/resurrect test for the target class.
Calling Context:
Called by Test framework. 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.
virtual TBasePrimitiveComparisonTest * CreatePrimitiveComparisonTest () const
Interface Category:
Developer Tool Programmer Interface.
Purpose:
Creates the primitive comparison test for the target class.
Calling Context:
Called by Test framework. 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.
virtual void * CreateEqualTarget () const
Interface Category:
Developer Tool Programmer Interface.
Purpose:
Creates an object that is equal to the target. By default, this function calls CreateNewTarget to create the equal object. Derived classes can overload this function to create an object equal to the target object in another way.
Calling Context:
Called by Test framework. Do not call this function directly.
Parameters:
Return Value:
Returns the object equal to the target object.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
Derived classes can overload CreateEqualTarget to create an object equal to the target object.
virtual void * CreateUnequalTarget () const
Interface Category:
Developer Tool Programmer Interface.
Purpose:
Creates an object that is unequal to the target and returns the unequal target. By default, this function returns a NIL pointer.
Calling Context:
Called by Test framework. Do not call this function directly.
Parameters:
Return Value:
Returns the object that is not equal to the target object.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
Derived classes can overload CreateUnequalTarget to create an object that is not equal to the target.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.