unit_base.h File Reference

#include <basis/astring.h>
#include <basis/contracts.h>
#include <basis/enhance_cpp.h>
#include <basis/mutex.h>
#include <structures/string_table.h>
Include dependency graph for unit_base.h:

Go to the source code of this file.

Classes

class  unit_test::unit_base

Namespaces

namespace  unit_test
 

Useful support functions for unit testing, especially within hoople.


Defines

#define UNIT_BASE_THIS_OBJECT   (*this)
#define ASSERT_EQUAL(a, b, test_name)
#define ASSERT_INEQUAL(a, b, test_name)
#define ASSERT_TRUE(a, test_name)
#define ASSERT_FALSE(a, test_name)
#define ASSERT_NULL(x, y)   ASSERT_FALSE(x, y)
#define ASSERT_NON_NULL(x, y)   ASSERT_TRUE(x, y)

Define Documentation

#define ASSERT_EQUAL ( a,
b,
test_name   ) 
Value:
{ \
  BASE_FUNCTION(func); \
  UNIT_BASE_THIS_OBJECT.assert_equal(a, b, function_name, test_name, basis::astring(#a) + " must be equal to " + #b); \
}

Definition at line 38 of file unit_base.h.

#define ASSERT_FALSE ( a,
test_name   ) 
Value:
{ \
  BASE_FUNCTION(func); \
  UNIT_BASE_THIS_OBJECT.assert_false(a, function_name, test_name, basis::astring(#a) + " must be false"); \
}

Definition at line 50 of file unit_base.h.

#define ASSERT_INEQUAL ( a,
b,
test_name   ) 
Value:
{ \
  BASE_FUNCTION(func); \
  UNIT_BASE_THIS_OBJECT.assert_not_equal(a, b, function_name, test_name, basis::astring(#a) + " must be inequal to " + #b); \
}

Definition at line 42 of file unit_base.h.

#define ASSERT_NON_NULL ( x,
 )     ASSERT_TRUE(x, y)

Definition at line 56 of file unit_base.h.

#define ASSERT_NULL ( x,
 )     ASSERT_FALSE(x, y)

Definition at line 55 of file unit_base.h.

#define ASSERT_TRUE ( a,
test_name   ) 
Value:
{ \
  BASE_FUNCTION(func); \
  UNIT_BASE_THIS_OBJECT.assert_true(a, function_name, test_name, basis::astring(#a) + " must be true"); \
}

Definition at line 46 of file unit_base.h.

#define UNIT_BASE_THIS_OBJECT   (*this)

Definition at line 35 of file unit_base.h.

Generated on Sat Jan 28 04:24:35 2012 for hoople2 project by  doxygen 1.6.3