feisty meow concerns codebase  2.140
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

 unit_test
 Useful support functions for unit testing, especially within hoople.
 

Macros

#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)
 

Macro Definition Documentation

◆ ASSERT_EQUAL

#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); \
}
Provides a dynamically resizable ASCII character string.
Definition: astring.h:35
#define test_name()

Definition at line 38 of file unit_base.h.

◆ ASSERT_FALSE

#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.

◆ ASSERT_INEQUAL

#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.

◆ ASSERT_NON_NULL

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

Definition at line 56 of file unit_base.h.

◆ ASSERT_NULL

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

Definition at line 55 of file unit_base.h.

◆ ASSERT_TRUE

#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.

◆ UNIT_BASE_THIS_OBJECT

#define UNIT_BASE_THIS_OBJECT   (*this)

Definition at line 35 of file unit_base.h.