Class: TTestMultiplexer

Declaration: TestMultiplexer.h

Taxonomy Categories:

Member Functions:


Interface Category:

Developer Tool Programmer Interface.

Inherits From:

TTest

Inherited By:

None.

Purpose:

A derived class of TTest that supports the model of multiple decisions functions applied to a single test target. Derive TTestMultiplexer when you want to test many functions on a single target object without creating a TTest derived class for each test.

Instantiation:

Allocate on the heap or the stack.

Deriving Classes:

This is a framework class. To use it, derive it and override the LoadDecisions function. Derived classes should not override any other function (not even the Test function). Derived classes should declare a new decision function for each test, define a key for each decision function, and register each key-decision function pair in LoadDecisions. LoadDecisions should call AddDecision for each key-decision function pair.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Member Function: TTestMultiplexer::operator=

TTestMultiplexer & operator =(const TTestMultiplexer & copyIn)

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: TTestMultiplexer::~TTestMultiplexer

virtual ~ TTestMultiplexer ()

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

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

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

virtual TStream & operator >>=(TStream & toWhere) 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: TTestMultiplexer::CopyDecisionKeys

virtual void CopyDecisionKeys (TCollectionOf<TText>& textsToWhere) const

Interface Category:

Developer Tool Programmer Interface.

Purpose:

Adds all legal keys in the key-decision table to the given collection.

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: TTestMultiplexer::SetDecisionKey

virtual bool SetDecisionKey (const TText & key)

Interface Category:

Developer Tool Programmer Interface.

Purpose:

Sets the key that is used in subsequent calls to Test.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns true if the current key is set to the given key. Returns false is the key is invalid.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TTestMultiplexer::GetDecisionKey

virtual void GetDecisionKey (TText & dest) const

Interface Category:

Developer Tool Programmer Interface.

Purpose:

Returns the current key in the given key.

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: TTestMultiplexer::SetInputsAsKeys

virtual void SetInputsAsKeys (unsigned int howMany)

Interface Category:

Developer Tool Programmer Interface.

Purpose:

Allows the client to specify how many of the TTest input arguments, starting with the first one, are interpreted as keys.

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: TTestMultiplexer::GetInputsAsKeys

virtual unsigned int GetInputsAsKeys () const

Interface Category:

Developer Tool Programmer Interface.

Purpose:

Returns the number of input arguments that are interpreted as keys.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns the number of input arguments that are interpreted as keys.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TTestMultiplexer::TTestMultiplexer

  1. TTestMultiplexer ()
  2. TTestMultiplexer (const TText & theKey, unsigned int howManyInputsAsKeys =0)
  3. TTestMultiplexer (const TTestMultiplexer &)

Interface Category:

Developer Tool Programmer Interface.

Purpose:

  1. Default constructor.
  2. Constructor taking the key and the number of inputs as keys.
  3. Copy constructor.

Calling Context:

  1. Called by the stream-in operators and RunTest.
  2. Call this function directly.
  3. 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: TTestMultiplexer::LoadDecisions

virtual void LoadDecisions (TDictionaryOf < TText, TDecisionFnWrapper >& coln) const

Interface Category:

Developer Tool Programmer Interface.

Purpose:

A framework function that derived classes must override. Inside LoadDecisions, derived classes should register each key-decision function pair by calling AddDecision.

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: TTestMultiplexer::AddDecision

virtual void AddDecision (TDictionaryOf < TText, TDecisionFnWrapper >& coln, const TText & key, TTestDecisionFn fun) const

Interface Category:

Developer Tool Programmer Interface.

Purpose:

Adds a key-function pair to the given collection. Derived classes should call AddDecision in their LoadDecisions function to register each decision function that they have defined or overridden.

Calling Context:

Called by the client in LoadDecisions.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TTestMultiplexer::Test

virtual void Test ()

Interface Category:

Developer Tool Programmer Interface.

Purpose:

Runs whatever decision functions have previously been specified by their keys and calls SetSuccess with the logical AND of the results.

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: TTestMultiplexer::AndAllDecisions

virtual bool AndAllDecisions ()

Interface Category:

Developer Tool Programmer Interface.

Purpose:

The decision function that TTest calls if the key kAllDecisions is in effect.

Calling Context:

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

Parameters:

Return Value:

Returns true if the results of all decision functions are true.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TTestMultiplexer::Print

virtual void Print (TTieredTextBuffer &)

Interface Category:

Developer Tool Programmer Interface.

Purpose:

Prints the keys used in running the test 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.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.