test.h File Reference

#include <iostream>
#include <cstdlib>

Include dependency graph for test.h:

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

Go to the source code of this file.

Classes

struct  Location
struct  AssertFailure

Defines

#define LOCATION(stmt)   Location( __FILE__, __LINE__, stmt )
#define assert(x)   assert_fn( LOCATION( #x ), x )
#define assert_eq(x, y)   assert_eq_fn( LOCATION( #x " == " #y ), x, y )
#define assert_neq(x, y)   assert_neq_fn( LOCATION( #x " != " #y ), x, y )
#define CHECK_ASSERT(x)

Typedefs

typedef void Test

Functions

template<typename X>
void assert_fn (Location l, X x)
template<typename X, typename Y>
void assert_eq_fn (Location l, X x, Y y)
template<typename X, typename Y>
void assert_neq_fn (Location l, X x, Y y)
void beginAssertFailure ()
void endAssertFailure ()

Variables

int assertFailure


Define Documentation

#define assert (  )     assert_fn( LOCATION( #x ), x )

#define assert_eq ( x,
 )     assert_eq_fn( LOCATION( #x " == " #y ), x, y )

#define assert_neq ( x,
 )     assert_neq_fn( LOCATION( #x " != " #y ), x, y )

#define CHECK_ASSERT (  ) 

Value:

do {                                                                \
        if ( x ) return;                                                \
        else if ( assertFailure )                                       \
        {                                                               \
            ++assertFailure;                                            \
            return;                                                     \
        }                                                               \
    } while (0)

Referenced by assert_eq_fn(), assert_fn(), and assert_neq_fn().

#define LOCATION ( stmt   )     Location( __FILE__, __LINE__, stmt )


Typedef Documentation

typedef void Test


Function Documentation

template<typename X, typename Y>
void assert_eq_fn ( Location  l,
x,
y 
) [inline]

References CHECK_ASSERT.

template<typename X>
void assert_fn ( Location  l,
x 
) [inline]

References CHECK_ASSERT.

template<typename X, typename Y>
void assert_neq_fn ( Location  l,
x,
y 
) [inline]

References CHECK_ASSERT.

void beginAssertFailure (  )  [inline]

References assertFailure.

Referenced by AssertFailure::AssertFailure().

void endAssertFailure (  )  [inline]

References assert, and assertFailure.

Referenced by AssertFailure::~AssertFailure().


Variable Documentation


Generated on Tue Mar 11 11:44:37 2008 for wibble by  doxygen 1.5.5