Class: TBaseStreamTest

Declaration: NewStreamTest.h

Taxonomy Categories:

Member Functions:


Interface Category:

Developer Tool Programmer Interface.

Inherits From:

TBaseComparisonTest

Inherited By:

TStreamTestOf

Purpose:

An abstract base class derived from TBaseComparisonTest that defines the protocol used for TStreamTestOf tests. TBaseStreamTest tests the streaming of the target using a streamer (TAbstractStreamer).

Instantiation:

Allocate on the heap or the stack.

Deriving Classes:

TBaseStreamTest cannot be used directly. Use the template class TStreamTestOf or the TStreamTestOf macros. The template class defines all the functions that you must override for TBaseStreamTest.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Member Function: TBaseStreamTest::~TBaseStreamTest

virtual ~ TBaseStreamTest ()

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: TBaseStreamTest::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: TBaseStreamTest::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: TBaseStreamTest::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: TBaseStreamTest::GetCheckEqual

virtual bool GetCheckEqual () const

Interface Category:

Developer Tool Programmer Interface.

Purpose:

Gets a Boolean that controls whether the equality checking is done. If true, the Test function checks for equality when streaming objects.

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:

None.

Member Function: TBaseStreamTest::SetCheckEqual

virtual void SetCheckEqual (bool check)

Interface Category:

Developer Tool Programmer Interface.

Purpose:

Sets a Boolean that controls whether the equality checking is done. If true, the Test function checks for equality when streaming objects.

Calling Context:

Called by Test framework and directly.

Parameters:

Return Value:

Returns true if the equality checking is done in the Test function.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TBaseStreamTest::GetCheckVersionHandling

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 stream test checks for correct handling of invalid version number in stream when streaming in 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.

Member Function: TBaseStreamTest::SetCheckVersionHandling

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 stream test checks for correct handling of invalid version number in stream when streaming in target object.

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:

None.

Member Function: TBaseStreamTest::AdoptStreamer

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.

Member Function: TBaseStreamTest::OrphanStreamer

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.

Member Function: TBaseStreamTest::GetStreamer

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.

Member Function: TBaseStreamTest::TBaseStreamTest

  1. TBaseStreamTest ()
  2. TBaseStreamTest (const TBaseStreamTest & source)

Interface Category:

Developer Tool Programmer Interface.

Purpose:

  1. Default constructor.
  2. Copy constructor.

Calling Context:

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

TBaseStreamTest & operator =(const TBaseStreamTest & 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.

Member Function: TBaseStreamTest::Setup

virtual void Setup ()

Interface Category:

Developer Tool Programmer Interface.

Purpose:

Parses the inputs for the test and calls SetCheckEqual(false) if the -e 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.

Member Function: TBaseStreamTest::Test

virtual void Test ()

Interface Category:

Developer Tool Programmer Interface.

Purpose:

Streams the target object out to and in from the test stream at each of three freeze levels: same team, same session, and deep freeze. If equality checking is enabled, it compares the streamed-in object with the original. If version handling checking is enabled, it checks that the stream-in operator for the target object correctly throws the TInvalidVersionError exception when an invalid version number is placed in the stream. Test also verifies that the stream position is consistent after the object is streamed in.

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: TBaseStreamTest::SetupStreamer

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.

Member Function: TBaseStreamTest::PrepareToReadBack

virtual void PrepareToReadBack ()

Interface Category:

Developer Tool Programmer Interface.

Purpose:

Resets things after streaming out the object and before streaming it in so that the same object is streamed back.

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: TBaseStreamTest::GetTestStream

TRandomAccessStream & GetTestStream ()

Interface Category:

Developer Tool Programmer Interface.

Purpose:

Returns the stream to be used for streaming in and streaming out the target.

Calling Context:

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

Parameters:

Return Value:

Returns the stream to be used for streaming in and streaming out the target.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TBaseStreamTest::StreamTarget

virtual void * StreamTarget ()

Interface Category:

Developer Tool Programmer Interface.

Purpose:

Streams the target object to the test stream using the streamer, rewinds the stream, streams the target back in, and returns the streamed in object.

Calling Context:

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

Parameters:

Return Value:

Returns the streamed in target object.

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.