Class: TAbstractTest

Declaration: AbstractTest.h

Taxonomy Categories:

Member Functions:


Member Functions:


Interface Category:

Developer Tool Programmer Interface.

Inherits From:

None.

Inherited By:

TTest

Purpose:

A framework abstract base class that models a unit test of a piece of system or application code, called a target. All functions in this class are pure virtual functions that perform no operation in TAbstractTest. Refer to descriptions for TTest.

Instantiation:

Allocate on the heap or the stack.

Deriving Classes:

You do not need to derive TAbstractTest. Use the derived classes of TTest to create their tests.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Member Function: TAbstractTest::~TAbstractTest

virtual ~ TAbstractTest ()

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: TAbstractTest::SetTarget

virtual void SetTarget (void * target)

Interface Category:

Developer Tool Programmer Interface.

Purpose:

Overriding functions should set the object being tested to the given target. Refer to descriptions of TTest.

Calling Context:

Pure virtual -not called.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TAbstractTest::GetTarget

virtual void * GetTarget () const

Interface Category:

Developer Tool Programmer Interface.

Purpose:

Overriding functions should get the target being tested. Refer to descriptions of TTest.

Calling Context:

Pure virtual -not called.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TAbstractTest::Run

virtual void Run ()

Interface Category:

Developer Tool Programmer Interface.

Purpose:

Overriding Run functions should call Test to actually perform the test. Run should also call the Test Framework functions Reset (if Run has been called before), Setup, Test, and Cleanup. Refer to descriptions of TTest.

Calling Context:

Pure virtual -not called.

Parameters:

Return Value:

None.

Exceptions:

Any exceptions during a function before Cleanup are to be caught and cause remaining functions to be skipped. Exceptions thrown during Cleanup are to be caught separately. Exceptions are not to be passed through to the caller.

Concurrency:

Not multithread safe.

Other Considerations:

Refer to descriptions of TTest.

Member Function: TAbstractTest::GetSuccess

virtual bool GetSuccess () const

Interface Category:

Developer Tool Programmer Interface.

Purpose:

Overriding functions should return the success of the last Run for the test. Refer to descriptions of TTest.

Calling Context:

Pure virtual -not called.

Parameters:

Return Value:

Overriding function should return true if the test ran successfully.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TAbstractTest::GetRunCount

virtual unsigned long GetRunCount () const

Interface Category:

Developer Tool Programmer Interface.

Purpose:

Overriding function should return the number of times that Run has been called since this object was created. Refer to descriptions of TTest.

Calling Context:

Pure virtual -not called.

Parameters:

Return Value:

Overriding function should return the number of times that Run has been called since this object was created.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TAbstractTest::TAbstractTest

  1. TAbstractTest ()
  2. TAbstractTest (const TAbstractTest & test)

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: TAbstractTest::Reset

virtual void Reset ()

Interface Category:

Developer Tool Programmer Interface.

Purpose:

Overriding functions are called to perform necessary reinitialization operations for tests that can be run more than once. Refer to descriptions of TTest.

Calling Context:

Pure virtual -not called.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

Refer to descriptions of TTest.

Member Function: TAbstractTest::Setup

virtual void Setup ()

Interface Category:

Developer Tool Programmer Interface.

Purpose:

Overriding functions are called to do whatever setup work the test needs. Refer to descriptions of TTest.

Calling Context:

Pure virtual -not called.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TAbstractTest::Test

virtual void Test ()

Interface Category:

Developer Tool Programmer Interface.

Purpose:

Overriding functions are called to actually perform the test. Refer to descriptions of TTest.

Calling Context:

Pure virtual -not called.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

Refer to descriptions of TTest.

Member Function: TAbstractTest::Cleanup

virtual void Cleanup ()

Interface Category:

Developer Tool Programmer Interface.

Purpose:

Overriding functions are called to restore the system to its previous state. Refer to descriptions of TTest.

Calling Context:

Pure virtual -not called.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TAbstractTest::SetSuccess

virtual void SetSuccess (bool success)

Interface Category:

Developer Tool Programmer Interface.

Purpose:

Overriding functions are called to indicate the test's success. Refer to descriptions of TTest.

Calling Context:

Pure virtual -not called.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TAbstractTest::SetStickySuccess

virtual void SetStickySuccess (bool success)

Interface Category:

Developer Tool Programmer Interface.

Purpose:

Overriding functions are called to indicate the test's success. The difference between SetStickySuccess and SetSuccess is that SetStickySuccess is called to preserve the failure of a test. Refer to the descriptions of TTest.

Calling Context:

Pure virtual -not called.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TAbstractTest::IsSuccessUndecided

virtual bool IsSuccessUndecided () const

Interface Category:

Developer Tool Programmer Interface.

Purpose:

Overriding functions should return a bool indicating whether SetSuccess or SetStickySuccess has been called. Refer to descriptions of TTest.

Calling Context:

Pure virtual -not called.

Parameters:

Return Value:

Overriding functions should return true if SetSuccess or SetStickySuccess has been called.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TAbstractTest::IsReset

virtual bool IsReset () const

Interface Category:

Developer Tool Programmer Interface.

Purpose:

Overriding functions return a flag indicating whether the test is in a reset state. Refer to descriptions of TTest.

Calling Context:

Pure virtual -not called.

Parameters:

Return Value:

Overriding functions should return true if the test is in a reset state.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Class: TAbstractTest

Declaration: AbstractTest.h

Taxonomy Categories:

Member Functions:


Member Functions:


Interface Category:

Developer Tool Programmer Interface.

Inherits From:

None.

Inherited By:

TTest

Purpose:

A framework abstract base class that models a unit test of a piece of system or application code, called a target. All functions in this class are pure virtual functions that perform no operation in TAbstractTest. Refer to descriptions for TTest.

Instantiation:

Allocate on the heap or the stack.

Deriving Classes:

You do not need to derive TAbstractTest. Use the derived classes of TTest to create their tests.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Member Function: TAbstractTest::~TAbstractTest

virtual ~ TAbstractTest ()

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: TAbstractTest::SetTarget

virtual void SetTarget (void * target)

Interface Category:

Developer Tool Programmer Interface.

Purpose:

Overriding functions should set the object being tested to the given target. Refer to descriptions of TTest.

Calling Context:

Pure virtual -not called.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TAbstractTest::GetTarget

virtual void * GetTarget () const

Interface Category:

Developer Tool Programmer Interface.

Purpose:

Overriding functions should get the target being tested. Refer to descriptions of TTest.

Calling Context:

Pure virtual -not called.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TAbstractTest::Run

virtual void Run ()

Interface Category:

Developer Tool Programmer Interface.

Purpose:

Overriding Run functions should call Test to actually perform the test. Run should also call the Test Framework functions Reset (if Run has been called before), Setup, Test, and Cleanup. Refer to descriptions of TTest.

Calling Context:

Pure virtual -not called.

Parameters:

Return Value:

None.

Exceptions:

Any exceptions during a function before Cleanup are to be caught and cause remaining functions to be skipped. Exceptions thrown during Cleanup are to be caught separately. Exceptions are not to be passed through to the caller.

Concurrency:

Not multithread safe.

Other Considerations:

Refer to descriptions of TTest.

Member Function: TAbstractTest::GetSuccess

virtual bool GetSuccess () const

Interface Category:

Developer Tool Programmer Interface.

Purpose:

Overriding functions should return the success of the last Run for the test. Refer to descriptions of TTest.

Calling Context:

Pure virtual -not called.

Parameters:

Return Value:

Overriding function should return true if the test ran successfully.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TAbstractTest::GetRunCount

virtual unsigned long GetRunCount () const

Interface Category:

Developer Tool Programmer Interface.

Purpose:

Overriding function should return the number of times that Run has been called since this object was created. Refer to descriptions of TTest.

Calling Context:

Pure virtual -not called.

Parameters:

Return Value:

Overriding function should return the number of times that Run has been called since this object was created.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TAbstractTest::TAbstractTest

  1. TAbstractTest ()
  2. TAbstractTest (const TAbstractTest & test)

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: TAbstractTest::Reset

virtual void Reset ()

Interface Category:

Developer Tool Programmer Interface.

Purpose:

Overriding functions are called to perform necessary reinitialization operations for tests that can be run more than once. Refer to descriptions of TTest.

Calling Context:

Pure virtual -not called.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

Refer to descriptions of TTest.

Member Function: TAbstractTest::Setup

virtual void Setup ()

Interface Category:

Developer Tool Programmer Interface.

Purpose:

Overriding functions are called to do whatever setup work the test needs. Refer to descriptions of TTest.

Calling Context:

Pure virtual -not called.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TAbstractTest::Test

virtual void Test ()

Interface Category:

Developer Tool Programmer Interface.

Purpose:

Overriding functions are called to actually perform the test. Refer to descriptions of TTest.

Calling Context:

Pure virtual -not called.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

Refer to descriptions of TTest.

Member Function: TAbstractTest::Cleanup

virtual void Cleanup ()

Interface Category:

Developer Tool Programmer Interface.

Purpose:

Overriding functions are called to restore the system to its previous state. Refer to descriptions of TTest.

Calling Context:

Pure virtual -not called.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TAbstractTest::SetSuccess

virtual void SetSuccess (bool success)

Interface Category:

Developer Tool Programmer Interface.

Purpose:

Overriding functions are called to indicate the test's success. Refer to descriptions of TTest.

Calling Context:

Pure virtual -not called.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TAbstractTest::SetStickySuccess

virtual void SetStickySuccess (bool success)

Interface Category:

Developer Tool Programmer Interface.

Purpose:

Overriding functions are called to indicate the test's success. The difference between SetStickySuccess and SetSuccess is that SetStickySuccess is called to preserve the failure of a test. Refer to the descriptions of TTest.

Calling Context:

Pure virtual -not called.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TAbstractTest::IsSuccessUndecided

virtual bool IsSuccessUndecided () const

Interface Category:

Developer Tool Programmer Interface.

Purpose:

Overriding functions should return a bool indicating whether SetSuccess or SetStickySuccess has been called. Refer to descriptions of TTest.

Calling Context:

Pure virtual -not called.

Parameters:

Return Value:

Overriding functions should return true if SetSuccess or SetStickySuccess has been called.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TAbstractTest::IsReset

virtual bool IsReset () const

Interface Category:

Developer Tool Programmer Interface.

Purpose:

Overriding functions return a flag indicating whether the test is in a reset state. Refer to descriptions of TTest.

Calling Context:

Pure virtual -not called.

Parameters:

Return Value:

Overriding functions should return true if the test is in a reset state.

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.