logog
logger optimized for games
UnitTest Class Referenceabstract

#include <unittest.hpp>

Public Member Functions

 UnitTest (const TestNameType &sTestName)
 
virtual ~UnitTest ()
 
virtual TestNameTypeGetName ()
 
virtual int RunTest ()=0
 
virtual void FreeInternals ()
 

Protected Attributes

TestNameType m_sTestName
 
TestSignupm_pTestSignup
 

Detailed Description

The base class for unit testing. Children of UnitTest are instanced by the UNITTEST() macro.

Constructor & Destructor Documentation

UnitTest ( const TestNameType sTestName)

Instances a test. An instanced test is automatically executed when the RunAllTests() function is called.

Parameters
sTestNameA string representing the name of this test.
virtual ~UnitTest ( )
virtual

Member Function Documentation

virtual void FreeInternals ( )
virtual

This function is called during ShutdownTests(). Its purpose is to free the internal structures allocated by the UnitTest without freeing the UnitTest itself. Microsoft's leak detector will flag the internals of a UnitTest as a leak unless these internals are explicitly destroyed prior to exit().

virtual TestNameType& GetName ( )
virtual

Returns the name of this UnitTest provided at construction time.

virtual int RunTest ( )
pure virtual

Child classes of UnitTest() must provide a RunTest() function. A RunTest() function must initialize logog, conduct its tests, and return 0 if the test was successful, a non-0 value otherwise. If any RunTest() function returns any value other than zero, then the main RunAllTests() function will return non zero as well.

Member Data Documentation

TestSignup* m_pTestSignup
protected

A pointer to the TestSignup constructed by this UnitTest.

TestNameType m_sTestName
protected

The name of this particular test.


The documentation for this class was generated from the following file: