Main Page   Modules   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

at_unit_test.h File Reference

#include "at_exports.h"
#include "at_factory.h"
#include "at_types.h"
#include "at_source_locator.h"
#include "at_start_up.h"

Include dependency graph for at_unit_test.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Namespaces

namespace  at
namespace  std

Defines

#define x_at_unit_test_h_x   1
#define AT_TCAssert(x_expr, x_description)
#define AT_TestArea(x_area, x_description)
#define AT_DefineTest_(x_name, x_area, x_description, x_expect, x_level)
#define AT_DefineTestExpect(x_name, x_area, x_description, x_expect)
#define AT_DefineTestLevel(x_name, x_area, x_description, x_expect, x_level)
#define AT_DefineTest(x_name, x_area, x_description)
#define AT_RegisterTest(x_name, x_area)
#define AT_MAINTEST


Define Documentation

#define AT_DefineTest x_name,
x_area,
x_description   
 

Value:

AT_DefineTest_(                                                     \
        x_name,                                                         \
        x_area,                                                         \
        x_description,                                                  \
        UnitTestTraits::TestSuccess,                                    \
        UnitTestKey_Basic::m_level_default                              \
    )                                                                   \

#define AT_DefineTest_ x_name,
x_area,
x_description,
x_expect,
x_level   
 

Value:

\
    UnitTestKey_Basic   __g_TestKey_ ## x_area ## _ ## x_name(           \
        & x_g_TestArea_ ## x_area,                                       \
        # x_name,                                                        \
        x_description,                                                   \
        __FILE__,                                                        \
        __LINE__,                                                        \
        x_expect,                                                        \
        x_level                                                          \
    );                                                                   \
                                                                         \
    class __g_TestLocatorClass_ ## x_area ## _ ## x_name                 \
      : public UnitTest                                                  \
    {                                                                    \
        public:                                                          \
                                                                         \
        UnitTestKey_Basic * Locator()                                    \
        {                                                                \
            return & __g_TestKey_ ## x_area ## _ ## x_name;              \
        }                                                                \
    };                                                                   \
                                                                         \
                                                                         \
    class __g_TestClass_ ## x_area ## _ ## x_name                        \
      : public __g_TestLocatorClass_ ## x_area ## _ ## x_name            \
AT_DefineTest allows definition of the unit test class.

#define AT_DefineTestExpect x_name,
x_area,
x_description,
x_expect   
 

Value:

AT_DefineTest_(                                                     \
        x_name,                                                         \
        x_area,                                                         \
        x_description,                                                  \
        x_expect,                                                       \
        UnitTestKey_Basic::m_level_default                              \
    )                                                                   \

#define AT_DefineTestLevel x_name,
x_area,
x_description,
x_expect,
x_level   
 

Value:

AT_DefineTest_(                                                     \
        x_name,                                                         \
        x_area,                                                         \
        x_description,                                                  \
        x_expect,                                                       \
        UnitTestKey_Basic::m_level_default + (x_level)                  \
    )                                                                   \

#define AT_MAINTEST
 

Value:

int main( int argc, const char ** argv )            \
{                                                                       \
    MainInitializer     l_initializer( argc, argv );                    \
    return UnitTestExec( argc, argv );                                  \
}                                                                       \
AT_MAINTEST is a shortcut macro for defining the basic main() method for running the test.

#define AT_RegisterTest x_name,
x_area   
 

Value:

\
    FactoryImpl0P<                                                      \
        __g_TestClass_ ## x_area ## _ ## x_name,                        \
        UnitTest,                                                       \
        UnitTestKey_Basic                                               \
    >   __g_TestFactory_ ## x_area ## _ ## x_name(                      \
        __g_TestKey_ ## x_area ## _ ## x_name,                          \
        __FILE__,                                                       \
        __LINE__,                                                       \
        "Unit test " # x_area " " # x_name                              \
    )                                                                   \
AT_RegisterTest registers the unit test in the unit test factory registry.

#define AT_TCAssert x_expr,
x_description   
 

Value:

if ( !( x_expr ) ) {                                                \
        throw TestCase_Exception(                                       \
            AT_String( x_description ),                                 \
            __FILE__,                                                   \
            __LINE__                                                    \
        );                                                              \
    }                                                                   \
The AT_TCAssert macro throws a test case assert.

#define AT_TestArea x_area,
x_description   
 

Value:

static UnitTestArea_Basic   x_g_TestArea_ ## x_area(                \
        # x_area, x_description, __FILE__, __LINE__                     \
    )                                                                   \
AT_TestArea creates a unit test area.

#define x_at_unit_test_h_x   1
 

at_unit_test.h

Generated for Austria by doxygen and MakeXS at Sun Oct 24 17:35:34 PDT 2004