ARB
Classes | Namespaces | Macros | Functions | Variables
test_unit.h File Reference
#include <arb_assert.h>
#include <arbtools.h>
#include <cstdarg>
#include <cstdlib>
#include <errno.h>
#include <dupstr.h>
Include dependency graph for test_unit.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  arb_test::str
 
class  arb_test::locinfo
 
struct  arb_test::StaticCode
 
class  arb_test::copy< T >
 
class  arb_test::copy< const char * >
 
class  arb_test::copy< copy< T > >
 
class  arb_test::epsilon_similar
 
class  arb_test::containing
 
struct  arb_test::expectation
 
class  arb_test::asserter
 
class  arb_test::debug_asserter
 
struct  arb_test::matchable
 
struct  arb_test::matcher
 
class  arb_test::match_expectation
 
class  arb_test::predicate_description
 
class  arb_test::predicate< FUNC >
 
class  arb_test::FINAL_TYPE< T >
 
class  arb_test::value_matcher< T >
 
class  arb_test::predicate_matcher< T, FUNC >
 
class  arb_test::expectation_group
 
struct  arb_test::group_match
 
class  arb_test::FINAL_TYPE< T >
 

Namespaces

 arb_test
 

Macros

#define ENABLE_CRASH_TESTS
 
#define __ATTR__REDUCED_OPTIMIZE
 
#define __ATTR__NO_GCSE_OPTIMIZE
 
#define __ATTR__REDUCED_OPTIMIZE__NO_GCSE   __ATTR__REDUCED_OPTIMIZE __ATTR__NO_GCSE_OPTIMIZE
 
#define ANY_SETUP   "any_env_setup"
 
#define WITHVALISTFROM(format, CODE)   do { va_list parg; va_start(parg, format); CODE; va_end(parg); } while(0)
 
#define VPRINTFORMAT(format)   WITHVALISTFROM(format, vfprintf(stderr, format, parg))
 
#define VCOMPILERMSG(msgtype, format)   WITHVALISTFROM(format, vcompiler_msg(msgtype, format, parg))
 
#define HASTOBE_CLONABLE(type)   virtual type *clone() const = 0
 
#define MAKE_CLONABLE(type)   type *clone() const OVERRIDE { return new type(*this); }
 
#define MATCHABLE_ARGS_UNTYPED(val)   val, #val
 
#define MATCHABLE_ARGS_TYPED(val)   make_copy(val), #val
 
#define is_equal_to(val)   equals_expectation(true, MATCHABLE_ARGS_UNTYPED(val))
 
#define does_differ_from(val)   equals_expectation(false, MATCHABLE_ARGS_UNTYPED(val))
 
#define is_equal_to_NULL()   null_expectation(true)
 
#define does_differ_from_NULL()   null_expectation(false)
 
#define is_less_than(val)   lessThan_expectation(true, MATCHABLE_ARGS_UNTYPED(val))
 
#define is_more_than(val)   moreThan_expectation(true, MATCHABLE_ARGS_UNTYPED(val))
 
#define is_less_or_equal(val)   moreThan_expectation(false, MATCHABLE_ARGS_UNTYPED(val))
 
#define is_more_or_equal(val)   lessThan_expectation(false, MATCHABLE_ARGS_UNTYPED(val))
 
#define fulfills(pred, arg)   predicate_expectation(true, MATCHABLE_ARGS_UNTYPED(pred), MATCHABLE_ARGS_UNTYPED(arg))
 
#define contradicts(pred, arg)   predicate_expectation(false, MATCHABLE_ARGS_UNTYPED(pred), MATCHABLE_ARGS_UNTYPED(arg))
 
#define does_contain(val)   fulfills(containing(),val)
 
#define doesnt_contain(val)   contradicts(containing(),val)
 
#define that(thing)   CREATE_matchable(MATCHABLE_ARGS_TYPED(thing))
 
#define TEST_EXPECTATION(EXPCTN)   do { using namespace arb_test; asserter(EXPCTN, #EXPCTN, __FILE__, __LINE__).expect_that(); } while(0)
 
#define TEST_EXPECTATION__BROKEN_SIMPLE(EXPCTN)   do { using namespace arb_test; asserter(EXPCTN, #EXPCTN, __FILE__, __LINE__).expect_broken(); } while(0)
 
#define TEST_EXPECTATION__BROKEN_AT_LOC(WANTED, GOT, FILE, LINE)   do { using namespace arb_test; asserter(WANTED, #WANTED, FILE, LINE).expect_broken(); asserter(GOT, #GOT, FILE, LINE).expect_that(); } while(0)
 
#define TEST_EXPECTATION__BROKEN(WANTED, GOT)   TEST_EXPECTATION__BROKEN_AT_LOC(WANTED, GOT, __FILE__, __LINE__)
 
#define TEST_EXPECTATION__WANTED(EXPCTN)   do { using namespace arb_test; asserter(EXPCTN, #EXPCTN, __FILE__, __LINE__).expect_wanted_behavior(); } while(0)
 
#define TEST_EXPECTATION__BROKENIF(COND, EXPCTN)   do { using namespace arb_test; asserter(EXPCTN, #EXPCTN, __FILE__, __LINE__).expect_brokenif(COND,#COND); } while(0)
 
#define DEBUG_TEST_EXPECTATION(EXPCTN)
 
#define HERE   arb_test::locinfo(__FILE__, __LINE__)
 
#define TEST_WARNING(format, strarg)   HERE.warningf(format, (strarg))
 
#define TEST_WARNING2(format, strarg1, strarg2)   HERE.warningf(format, (strarg1), (strarg2))
 
#define TEST_ERROR(format, strarg)   HERE.errorf(true, format, (strarg))
 
#define TEST_ERROR2(format, strarg1, strarg2)   HERE.errorf(true, format, (strarg1), (strarg2))
 
#define TEST_IOERROR(format, strarg)   HERE.ioerrorf(true, format, (strarg))
 
#define TEST_FAILS_INSIDE_VALGRIND(THETEST)
 
#define TEST_EXPECT_ZERO(cond)   TEST_EXPECT_EQUAL(cond, 0)
 
#define TEST_EXPECT_ZERO__BROKEN(cond, got)   TEST_EXPECT_EQUAL__BROKEN(cond, 0, got)
 
#define TEST_REJECT_ZERO(cond)   TEST_EXPECTATION(that(cond).does_differ_from(0))
 
#define TEST_REJECT_ZERO__BROKEN(cond)   TEST_EXPECTATION__BROKEN_SIMPLE(that(cond).does_differ_from(0))
 
#define TEST_EXPECT_ZERO_OR_SHOW_ERRNO(iocond)
 
#define MISSING_TEST(description)   TEST_WARNING("Missing test '%s'", #description)
 
#define TEST_EXPECT_ERROR_CONTAINS(call, part)   TEST_EXPECTATION (reported_error_contains(call, part))
 
#define TEST_EXPECT_ERROR_CONTAINS__BROKEN(call, part)   TEST_EXPECTATION__BROKEN_SIMPLE(reported_error_contains(call, part))
 
#define TEST_EXPECT_ANY_ERROR(call)   TEST_EXPECTATION (reports_error(call))
 
#define TEST_EXPECT_ANY_ERROR__BROKEN(call)   TEST_EXPECTATION__BROKEN_SIMPLE(reports_error(call))
 
#define TEST_EXPECT_NO_ERROR(call)   TEST_EXPECTATION (doesnt_report_error(call))
 
#define TEST_EXPECT_NO_ERROR__BROKEN(call)   TEST_EXPECTATION__BROKEN_SIMPLE(doesnt_report_error(call))
 
#define TEST_EXPECT_NO_SEGFAULT(cb)   TEST_EXPECTATION(expect_callback(cb, DOESNT_SEGFAULT, FULFILLS_ASSERTIONS, CALL_WONT_SEGFAULT))
 
#define TEST_EXPECT_NO_SEGFAULT__WANTED(cb)   TEST_EXPECTATION__WANTED(expect_callback(cb, DOESNT_SEGFAULT, FULFILLS_ASSERTIONS, CALL_WILL_SEGFAULT))
 
#define TEST_EXPECT_CODE_ASSERTION_FAILS(cb)   TEST_EXPECTATION(expect_callback(cb, DOES_SEGFAULT, FAILS_ASSERTION, CALL_WILL_SEGFAULT))
 
#define TEST_EXPECT_CODE_ASSERTION_FAILS__WANTED(cb)   TEST_EXPECTATION__WANTED(expect_callback(cb, DOES_SEGFAULT, FAILS_ASSERTION, CALL_WONT_SEGFAULT))
 
#define TEST_EXPECT_CODE_ASSERTION_FAILS__UNWANTED(cb)   TEST_EXPECT_NO_SEGFAULT__WANTED(cb)
 
#define TEST_EXPECT_SEGFAULT(cb)   TEST_EXPECTATION(expect_callback(cb, DOES_SEGFAULT, FULFILLS_ASSERTIONS, CALL_WILL_SEGFAULT))
 
#define TEST_EXPECT_SEGFAULT__WANTED(cb)   TEST_EXPECTATION__WANTED(expect_callback(cb, DOES_SEGFAULT, FULFILLS_ASSERTIONS, CALL_WONT_SEGFAULT))
 
#define TEST_EXPECT_SEGFAULT__UNWANTED(cb)   TEST_EXPECT_NO_SEGFAULT__WANTED(cb)
 
#define TEST_EXPECT_EQUAL(expr, want)   TEST_EXPECTATION(that(expr).is_equal_to(want))
 
#define TEST_EXPECT_EQUAL__BROKEN(expr, want, got)   do{ using namespace arb_test; expect_broken(that(expr), want, got, __FILE__, __LINE__); }while(0)
 
#define TEST_EXPECT_EQUAL__IGNARG(expr, want, ign)   TEST_EXPECTATION(that(expr).is_equal_to(want))
 
#define TEST_EXPECT_SIMILAR(expr, want, epsilon)   TEST_EXPECTATION(that(expr).fulfills(epsilon_similar(epsilon), want))
 
#define TEST_EXPECT_SIMILAR__BROKEN(expr, want, epsilon)   TEST_EXPECTATION__BROKEN_SIMPLE(that(expr).fulfills(epsilon_similar(epsilon), want))
 
#define TEST_EXPECT_DIFFERENT(expr, want)   TEST_EXPECTATION(that(expr).does_differ_from(want));
 
#define TEST_EXPECT_DIFFERENT__BROKEN(expr, want)   TEST_EXPECTATION__BROKEN_SIMPLE(that(expr).does_differ_from(want));
 
#define TEST_EXPECT_LESS(val, ref)   TEST_EXPECTATION(that(val).is_less_than(ref))
 
#define TEST_EXPECT_MORE(val, ref)   TEST_EXPECTATION(that(val).is_more_than(ref))
 
#define TEST_EXPECT_LESS_EQUAL(val, ref)   TEST_EXPECTATION(that(val).is_less_or_equal(ref))
 
#define TEST_EXPECT_MORE_EQUAL(val, ref)   TEST_EXPECTATION(that(val).is_more_or_equal(ref))
 
#define TEST_EXPECT_IN_RANGE(val, lower, higher)   TEST_EXPECTATION(all().of(that(val).is_more_or_equal(lower), that(val).is_less_or_equal(higher)))
 
#define TEST_EXPECT_IN_RANGE__BROKEN(val, lower, higher)   TEST_EXPECTATION__BROKEN_SIMPLE(all().of(that(val).is_more_or_equal(lower), that(val).is_less_or_equal(higher)))
 
#define TEST_EXPECT_CONTAINS(str, part)   TEST_EXPECTATION(that(str).does_contain(part))
 
#define TEST_EXPECT_CONTAINS__BROKEN(str, part)   TEST_EXPECTATION__BROKEN_SIMPLE(that(str).does_contain(part))
 
#define TEST_EXPECT_DOESNT_CONTAIN(str, part)   TEST_EXPECTATION(that(str).doesnt_contain(part))
 
#define TEST_EXPECT_DOESNT_CONTAIN__BROKEN(str, part)   TEST_EXPECTATION__BROKEN_SIMPLE(that(str).doesnt_contain(part))
 
#define TEST_EXPECT_NULL(n)   TEST_EXPECT_EQUAL(n, (typeof(n))NULp)
 
#define TEST_EXPECT_NULL__BROKEN(n, got)   TEST_EXPECT_EQUAL__BROKEN(n, (typeof(n))NULp, got)
 
#define TEST_EXPECT_NULL__BROKEN_SIMPLE(n)   TEST_EXPECTATION__BROKEN_SIMPLE(that(n).is_equal_to((typeof(n))NULp))
 
#define TEST_REJECT_NULL(n)   TEST_EXPECT_DIFFERENT(n, (typeof(n))NULp)
 
#define TEST_REJECT_NULL__BROKEN(n)   TEST_EXPECT_DIFFERENT__BROKEN(n, (typeof(n))NULp)
 
#define TEST_EXPECT(cond)   TEST_EXPECTATION(that(cond).is_equal_to(true))
 
#define TEST_EXPECT__BROKEN(cond)   TEST_EXPECTATION__BROKEN_SIMPLE(that(cond).is_equal_to(true))
 
#define TEST_REJECT(cond)   TEST_EXPECTATION(that(cond).is_equal_to(false))
 
#define TEST_REJECT__BROKEN(cond)   TEST_EXPECTATION__BROKEN_SIMPLE(that(cond).is_equal_to(false))
 
#define TEST_VALIDITY(valid)   TEST_EXPECT_NULL((valid).why_not())
 
#define TEST_VALIDITY__BROKEN(valid, why)   TEST_EXPECT_NULL__BROKEN((valid).why_not(),why)
 
#define WARN_MISS_ARBDIFF()   need_include__arb_diff_h__BEFORE__test_unit_h
 
#define TEST_EXPECT_TEXTFILE_DIFFLINES(fgot, fwant, diff)   WARN_MISS_ARBDIFF()
 
#define TEST_EXPECT_TEXTFILE_DIFFLINES__BROKEN(fgot, fwant, diff)   WARN_MISS_ARBDIFF()
 
#define TEST_EXPECT_TEXTFILE_DIFFLINES_IGNORE_DATES(fgot, fwant, diff)   WARN_MISS_ARBDIFF()
 
#define TEST_EXPECT_TEXTFILE_DIFFLINES_IGNORE_DATES__BROKEN(fgot, fwant, diff)   WARN_MISS_ARBDIFF()
 
#define TEST_EXPECT_FILES_EQUAL(f1, f2)   WARN_MISS_ARBDIFF()
 
#define TEST_EXPECT_FILES_EQUAL__BROKEN(f1, f2)   WARN_MISS_ARBDIFF()
 
#define TEST_EXPECT_TEXTFILES_EQUAL(fgot, fwant)   WARN_MISS_ARBDIFF()
 
#define TEST_EXPECT_TEXTFILES_EQUAL__BROKEN(fgot, fwant)   WARN_MISS_ARBDIFF()
 
#define TEST_EXPECT_FILES_DIFFER(f1, f2)   WARN_MISS_ARBDIFF()
 
#define TEST_EXPECT_FILES_DIFFER__BROKEN(f1, f2)   WARN_MISS_ARBDIFF()
 
#define TEST_EXPECT_TEXTFILES_DIFFER(fgot, fwant)   WARN_MISS_ARBDIFF()
 
#define TEST_EXPECT_TEXTFILES_DIFFER__BROKEN(fgot, fwant)   WARN_MISS_ARBDIFF()
 
#define TEST_EXPECT_MEM_EQUAL(m1, m2, size)   WARN_MISS_ARBDIFF()
 
#define TEST_EXPECT_MEM_EQUAL__BROKEN(m1, m2, size)   WARN_MISS_ARBDIFF()
 
#define memory_is_equal(m1, m2, size)   WARN_MISS_ARBDIFF()
 
#define files_are_equal(f1, f2)   WARN_MISS_ARBDIFF()
 
#define textfiles_have_difflines(f1, f2, ed)   WARN_MISS_ARBDIFF()
 
#define textfiles_have_difflines_ignoreDates(f1, f2, ed)   WARN_MISS_ARBDIFF()
 
#define WARN_MISS_ADTREE()   need_include__TreeNode_h__BEFORE__test_unit_h
 
#define TEST_EXPECT_NEWICK(format, tree, expected_newick)   WARN_MISS_ADTREE()
 
#define TEST_EXPECT_NEWICK__BROKEN(format, tree, expected_newick)   WARN_MISS_ADTREE()
 
#define TEST_EXPECT_SAVED_NEWICK(format, gb_main, treename, expected_newick)   WARN_MISS_ADTREE()
 
#define TEST_EXPECT_SAVED_NEWICK__BROKEN(format, gb_main, treename, expected_newick)   WARN_MISS_ADTREE()
 
#define TEST_SETUP_GLOBAL_ENVIRONMENT(modulename)
 
#define TEST_PUBLISH(testfunction)
 

Functions

chararb_test::val2readable (bool b)
 
chararb_test::val2readable (int i)
 
chararb_test::val2hex (int i)
 
chararb_test::val2readable (long L)
 
chararb_test::val2hex (long L)
 
chararb_test::val2readable (size_t z)
 
chararb_test::val2hex (size_t z)
 
chararb_test::val2readable (long unsigned u)
 
chararb_test::val2hex (long unsigned u)
 
chararb_test::val2readable (double d)
 
chararb_test::val2readable (unsigned char c)
 
chararb_test::val2readable (const char *s)
 
template<typename T >
copy< Tarb_test::make_copy (const T &t)
 
copy< const char * > arb_test::make_copy (const char *p)
 
copy< const char * > arb_test::make_copy (char *p)
 
copy< const char * > arb_test::make_copy (const unsigned char *p)
 
copy< const char * > arb_test::make_copy (unsigned char *p)
 
copy< const char * > arb_test::make_copy (const signed char *p)
 
copy< const char * > arb_test::make_copy (signed char *p)
 
copy< unsigned chararb_test::make_copy (char p)
 
copy< unsigned chararb_test::make_copy (unsigned char p)
 
copy< unsigned chararb_test::make_copy (signed char p)
 
template<typename T >
str arb_test::readable (const copy< T > &v)
 
template<typename T >
str arb_test::readableHex (const copy< T > &v)
 
template<typename T >
bool arb_test::operator== (const copy< T > &v1, const copy< T > &v2)
 
template<typename T >
bool arb_test::operator!= (const copy< T > &v1, const copy< T > &v2)
 
template<>
bool arb_test::operator==< const char * > (const copy< const char * > &v1, const copy< const char * > &v2)
 
template<typename T >
void arb_test::print (const T &t)
 
template<typename T >
void arb_test::print_hex (const T &t)
 
template<typename T1 , typename T2 >
void arb_test::print_pair (T1 t1, T2 t2)
 
template<typename T1 , typename T2 >
void arb_test::print_hex_pair (T1 t1, T2 t2)
 
void arb_test::print (const char *s)
 
void arb_test::print (char c)
 
void arb_test::print (int i)
 
void arb_test::space ()
 
void arb_test::nl ()
 
void arb_test::print_indent (int indent)
 
void arb_test::spaced (const char *word)
 
void arb_test::select_spaced (bool first, const char *singular, const char *plural)
 
template<typename FUNC >
predicate< FUNC > arb_test::make_predicate (FUNC func, const char *primary, const char *inverse)
 
template<typename T >
bool arb_test::equals (const copy< T > &t1, const copy< T > &t2)
 
template<typename T >
bool arb_test::less (const copy< T > &t1, const copy< T > &t2)
 
template<typename T >
bool arb_test::more (const copy< T > &t1, const copy< T > &t2)
 
template<typename T , typename U >
const matchable_value< Tarb_test::make_matchable_value (const U &other, const char *code_)
 
template<typename T >
const matchable_value< Tarb_test::CREATE_matchable (const copy< T > &val, const char *code)
 
group_matcher arb_test::all ()
 
group_matcher arb_test::none ()
 
group_matcher arb_test::atleast (int min)
 
group_matcher arb_test::atmost (int max)
 
group_matcher arb_test::exactly (int amount)
 
match_expectation arb_test::wrong (const expectation &e)
 
match_expectation arb_test::reports_error (const char *error)
 
match_expectation arb_test::doesnt_report_error (const char *error)
 
match_expectation arb_test::reported_error_contains (const char *error, const char *part)
 
template<typename T , typename U , typename V >
void arb_test::expect_broken (const arb_test::matchable_value< T > &That, const U &want, const V &got, const char *file, int line)
 

Variables

const int arb_test::MAX_GROUP_SIZE = 5
 

Macro Definition Documentation

#define ENABLE_CRASH_TESTS

Definition at line 45 of file test_unit.h.

#define __ATTR__REDUCED_OPTIMIZE

Definition at line 83 of file test_unit.h.

#define __ATTR__NO_GCSE_OPTIMIZE

Definition at line 84 of file test_unit.h.

#define __ATTR__REDUCED_OPTIMIZE__NO_GCSE   __ATTR__REDUCED_OPTIMIZE __ATTR__NO_GCSE_OPTIMIZE

Definition at line 88 of file test_unit.h.

#define ANY_SETUP   "any_env_setup"

Definition at line 93 of file test_unit.h.

Referenced by been_inside_environment(), and reset_test_local_flags().

#define WITHVALISTFROM (   format,
  CODE 
)    do { va_list parg; va_start(parg, format); CODE; va_end(parg); } while(0)

Definition at line 124 of file test_unit.h.

#define VPRINTFORMAT (   format)    WITHVALISTFROM(format, vfprintf(stderr, format, parg))

Definition at line 125 of file test_unit.h.

#define VCOMPILERMSG (   msgtype,
  format 
)    WITHVALISTFROM(format, vcompiler_msg(msgtype, format, parg))

Definition at line 126 of file test_unit.h.

Referenced by arb_test::locinfo::if().

#define HASTOBE_CLONABLE (   type)    virtual type *clone() const = 0

Definition at line 412 of file test_unit.h.

#define MAKE_CLONABLE (   type)    type *clone() const OVERRIDE { return new type(*this); }

Definition at line 413 of file test_unit.h.

#define MATCHABLE_ARGS_UNTYPED (   val)    val, #val

Definition at line 1011 of file test_unit.h.

#define MATCHABLE_ARGS_TYPED (   val)    make_copy(val), #val

Definition at line 1012 of file test_unit.h.

#define is_equal_to (   val)    equals_expectation(true, MATCHABLE_ARGS_UNTYPED(val))

Definition at line 1014 of file test_unit.h.

Referenced by CommandOutput::Equals(), and CommandOutput::has_checksum().

#define does_differ_from (   val)    equals_expectation(false, MATCHABLE_ARGS_UNTYPED(val))

Definition at line 1015 of file test_unit.h.

#define is_equal_to_NULL ( )    null_expectation(true)

Definition at line 1017 of file test_unit.h.

#define does_differ_from_NULL ( )    null_expectation(false)

Definition at line 1018 of file test_unit.h.

#define is_less_than (   val)    lessThan_expectation(true, MATCHABLE_ARGS_UNTYPED(val))

Definition at line 1020 of file test_unit.h.

#define is_more_than (   val)    moreThan_expectation(true, MATCHABLE_ARGS_UNTYPED(val))

Definition at line 1021 of file test_unit.h.

#define is_less_or_equal (   val)    moreThan_expectation(false, MATCHABLE_ARGS_UNTYPED(val))

Definition at line 1023 of file test_unit.h.

#define is_more_or_equal (   val)    lessThan_expectation(false, MATCHABLE_ARGS_UNTYPED(val))

Definition at line 1024 of file test_unit.h.

#define fulfills (   pred,
  arg 
)    predicate_expectation(true, MATCHABLE_ARGS_UNTYPED(pred), MATCHABLE_ARGS_UNTYPED(arg))

Definition at line 1026 of file test_unit.h.

#define contradicts (   pred,
  arg 
)    predicate_expectation(false, MATCHABLE_ARGS_UNTYPED(pred), MATCHABLE_ARGS_UNTYPED(arg))

Definition at line 1027 of file test_unit.h.

#define does_contain (   val)    fulfills(containing(),val)

Definition at line 1029 of file test_unit.h.

Referenced by CommandOutput::Contains().

#define doesnt_contain (   val)    contradicts(containing(),val)

Definition at line 1030 of file test_unit.h.

#define that (   thing)    CREATE_matchable(MATCHABLE_ARGS_TYPED(thing))
#define TEST_EXPECTATION (   EXPCTN)    do { using namespace arb_test; asserter(EXPCTN, #EXPCTN, __FILE__, __LINE__).expect_that(); } while(0)

Definition at line 1037 of file test_unit.h.

#define TEST_EXPECTATION__BROKEN_SIMPLE (   EXPCTN)    do { using namespace arb_test; asserter(EXPCTN, #EXPCTN, __FILE__, __LINE__).expect_broken(); } while(0)

Definition at line 1038 of file test_unit.h.

#define TEST_EXPECTATION__BROKEN_AT_LOC (   WANTED,
  GOT,
  FILE,
  LINE 
)    do { using namespace arb_test; asserter(WANTED, #WANTED, FILE, LINE).expect_broken(); asserter(GOT, #GOT, FILE, LINE).expect_that(); } while(0)

Definition at line 1039 of file test_unit.h.

Referenced by arb_test::expect_broken().

#define TEST_EXPECTATION__BROKEN (   WANTED,
  GOT 
)    TEST_EXPECTATION__BROKEN_AT_LOC(WANTED, GOT, __FILE__, __LINE__)

Definition at line 1040 of file test_unit.h.

#define TEST_EXPECTATION__WANTED (   EXPCTN)    do { using namespace arb_test; asserter(EXPCTN, #EXPCTN, __FILE__, __LINE__).expect_wanted_behavior(); } while(0)

Definition at line 1041 of file test_unit.h.

#define TEST_EXPECTATION__BROKENIF (   COND,
  EXPCTN 
)    do { using namespace arb_test; asserter(EXPCTN, #EXPCTN, __FILE__, __LINE__).expect_brokenif(COND,#COND); } while(0)

Definition at line 1043 of file test_unit.h.

#define DEBUG_TEST_EXPECTATION (   EXPCTN)
Value:
do { \
using namespace arb_test; \
debug_asserter(EXPCTN, #EXPCTN, __FILE__, __LINE__). \
debug_expectations(); \
debug_asserter(wrong(EXPCTN), "wrong(" #EXPCTN ")", __FILE__, __LINE__). \
debug_expectations(); \
} while(0)
match_expectation wrong(const expectation &e)
Definition: test_unit.h:1006

Definition at line 1045 of file test_unit.h.

#define HERE   arb_test::locinfo(__FILE__, __LINE__)

Definition at line 1055 of file test_unit.h.

#define TEST_WARNING (   format,
  strarg 
)    HERE.warningf(format, (strarg))

Definition at line 1057 of file test_unit.h.

#define TEST_WARNING2 (   format,
  strarg1,
  strarg2 
)    HERE.warningf(format, (strarg1), (strarg2))

Definition at line 1058 of file test_unit.h.

#define TEST_ERROR (   format,
  strarg 
)    HERE.errorf(true, format, (strarg))

Definition at line 1059 of file test_unit.h.

#define TEST_ERROR2 (   format,
  strarg1,
  strarg2 
)    HERE.errorf(true, format, (strarg1), (strarg2))

Definition at line 1060 of file test_unit.h.

#define TEST_IOERROR (   format,
  strarg 
)    HERE.ioerrorf(true, format, (strarg))

Definition at line 1061 of file test_unit.h.

#define TEST_FAILS_INSIDE_VALGRIND (   THETEST)
Value:
do { \
THETEST; \
TEST_WARNING("valgrind fails for '%s'", #THETEST); \
} \
} while(0)
#define TEST_WARNING(format, strarg)
Definition: test_unit.h:1057
bool GBK_running_on_valgrind(void)
Definition: arb_signal.cxx:98
GB_write_int const char GB_write_autoconv_string WRITE_SKELETON(write_pointer, GBDATA *,"%p", GB_write_pointer) char *AW_awa if)(!gb_var) return strdup("")
Definition: AW_awar.cxx:166

Definition at line 1065 of file test_unit.h.

#define TEST_EXPECT_ZERO (   cond)    TEST_EXPECT_EQUAL(cond, 0)

Definition at line 1074 of file test_unit.h.

#define TEST_EXPECT_ZERO__BROKEN (   cond,
  got 
)    TEST_EXPECT_EQUAL__BROKEN(cond, 0, got)

Definition at line 1075 of file test_unit.h.

#define TEST_REJECT_ZERO (   cond)    TEST_EXPECTATION(that(cond).does_differ_from(0))

Definition at line 1076 of file test_unit.h.

#define TEST_REJECT_ZERO__BROKEN (   cond)    TEST_EXPECTATION__BROKEN_SIMPLE(that(cond).does_differ_from(0))

Definition at line 1077 of file test_unit.h.

#define TEST_EXPECT_ZERO_OR_SHOW_ERRNO (   iocond)
Value:
do { \
if ((iocond)) \
TEST_IOERROR("I/O-failure in '%s'", #iocond); \
} while(0)
#define TEST_IOERROR(format, strarg)
Definition: test_unit.h:1061
GB_write_int const char GB_write_autoconv_string WRITE_SKELETON(write_pointer, GBDATA *,"%p", GB_write_pointer) char *AW_awa if)(!gb_var) return strdup("")
Definition: AW_awar.cxx:166

Definition at line 1079 of file test_unit.h.

Referenced by Flag::lower(), ptserver(), ptserver_gene(), Globals::setup_test_precondition(), and UnitTester::UnitTester().

#define MISSING_TEST (   description)    TEST_WARNING("Missing test '%s'", #description)

Definition at line 1087 of file test_unit.h.

#define TEST_EXPECT_ERROR_CONTAINS (   call,
  part 
)    TEST_EXPECTATION (reported_error_contains(call, part))

Definition at line 1103 of file test_unit.h.

#define TEST_EXPECT_ERROR_CONTAINS__BROKEN (   call,
  part 
)    TEST_EXPECTATION__BROKEN_SIMPLE(reported_error_contains(call, part))

Definition at line 1104 of file test_unit.h.

#define TEST_EXPECT_ANY_ERROR (   call)    TEST_EXPECTATION (reports_error(call))

Definition at line 1105 of file test_unit.h.

#define TEST_EXPECT_ANY_ERROR__BROKEN (   call)    TEST_EXPECTATION__BROKEN_SIMPLE(reports_error(call))

Definition at line 1106 of file test_unit.h.

#define TEST_EXPECT_NO_ERROR (   call)    TEST_EXPECTATION (doesnt_report_error(call))

Definition at line 1107 of file test_unit.h.

Referenced by ptserver(), ptserver_gene(), and test_ptserver_activate().

#define TEST_EXPECT_NO_ERROR__BROKEN (   call)    TEST_EXPECTATION__BROKEN_SIMPLE(doesnt_report_error(call))

Definition at line 1108 of file test_unit.h.

#define TEST_EXPECT_NO_SEGFAULT (   cb)    TEST_EXPECTATION(expect_callback(cb, DOESNT_SEGFAULT, FULFILLS_ASSERTIONS, CALL_WONT_SEGFAULT))

Definition at line 1239 of file test_unit.h.

#define TEST_EXPECT_NO_SEGFAULT__WANTED (   cb)    TEST_EXPECTATION__WANTED(expect_callback(cb, DOESNT_SEGFAULT, FULFILLS_ASSERTIONS, CALL_WILL_SEGFAULT))

Definition at line 1240 of file test_unit.h.

#define TEST_EXPECT_CODE_ASSERTION_FAILS (   cb)    TEST_EXPECTATION(expect_callback(cb, DOES_SEGFAULT, FAILS_ASSERTION, CALL_WILL_SEGFAULT))

Definition at line 1241 of file test_unit.h.

#define TEST_EXPECT_CODE_ASSERTION_FAILS__WANTED (   cb)    TEST_EXPECTATION__WANTED(expect_callback(cb, DOES_SEGFAULT, FAILS_ASSERTION, CALL_WONT_SEGFAULT))

Definition at line 1242 of file test_unit.h.

#define TEST_EXPECT_CODE_ASSERTION_FAILS__UNWANTED (   cb)    TEST_EXPECT_NO_SEGFAULT__WANTED(cb)

Definition at line 1243 of file test_unit.h.

#define TEST_EXPECT_SEGFAULT (   cb)    TEST_EXPECTATION(expect_callback(cb, DOES_SEGFAULT, FULFILLS_ASSERTIONS, CALL_WILL_SEGFAULT))

Definition at line 1244 of file test_unit.h.

#define TEST_EXPECT_SEGFAULT__WANTED (   cb)    TEST_EXPECTATION__WANTED(expect_callback(cb, DOES_SEGFAULT, FULFILLS_ASSERTIONS, CALL_WONT_SEGFAULT))

Definition at line 1245 of file test_unit.h.

#define TEST_EXPECT_SEGFAULT__UNWANTED (   cb)    TEST_EXPECT_NO_SEGFAULT__WANTED(cb)

Definition at line 1246 of file test_unit.h.

#define TEST_EXPECT_EQUAL (   expr,
  want 
)    TEST_EXPECTATION(that(expr).is_equal_to(want))
#define TEST_EXPECT_EQUAL__BROKEN (   expr,
  want,
  got 
)    do{ using namespace arb_test; expect_broken(that(expr), want, got, __FILE__, __LINE__); }while(0)

Definition at line 1284 of file test_unit.h.

#define TEST_EXPECT_EQUAL__IGNARG (   expr,
  want,
  ign 
)    TEST_EXPECTATION(that(expr).is_equal_to(want))

Definition at line 1285 of file test_unit.h.

#define TEST_EXPECT_SIMILAR (   expr,
  want,
  epsilon 
)    TEST_EXPECTATION(that(expr).fulfills(epsilon_similar(epsilon), want))

Definition at line 1287 of file test_unit.h.

#define TEST_EXPECT_SIMILAR__BROKEN (   expr,
  want,
  epsilon 
)    TEST_EXPECTATION__BROKEN_SIMPLE(that(expr).fulfills(epsilon_similar(epsilon), want))

Definition at line 1288 of file test_unit.h.

#define TEST_EXPECT_DIFFERENT (   expr,
  want 
)    TEST_EXPECTATION(that(expr).does_differ_from(want));

Definition at line 1290 of file test_unit.h.

#define TEST_EXPECT_DIFFERENT__BROKEN (   expr,
  want 
)    TEST_EXPECTATION__BROKEN_SIMPLE(that(expr).does_differ_from(want));

Definition at line 1291 of file test_unit.h.

#define TEST_EXPECT_LESS (   val,
  ref 
)    TEST_EXPECTATION(that(val).is_less_than(ref))

Definition at line 1293 of file test_unit.h.

#define TEST_EXPECT_MORE (   val,
  ref 
)    TEST_EXPECTATION(that(val).is_more_than(ref))

Definition at line 1294 of file test_unit.h.

#define TEST_EXPECT_LESS_EQUAL (   val,
  ref 
)    TEST_EXPECTATION(that(val).is_less_or_equal(ref))

Definition at line 1295 of file test_unit.h.

Referenced by ptserver(), and ptserver_gene().

#define TEST_EXPECT_MORE_EQUAL (   val,
  ref 
)    TEST_EXPECTATION(that(val).is_more_or_equal(ref))

Definition at line 1296 of file test_unit.h.

#define TEST_EXPECT_IN_RANGE (   val,
  lower,
  higher 
)    TEST_EXPECTATION(all().of(that(val).is_more_or_equal(lower), that(val).is_less_or_equal(higher)))

Definition at line 1298 of file test_unit.h.

#define TEST_EXPECT_IN_RANGE__BROKEN (   val,
  lower,
  higher 
)    TEST_EXPECTATION__BROKEN_SIMPLE(all().of(that(val).is_more_or_equal(lower), that(val).is_less_or_equal(higher)))

Definition at line 1299 of file test_unit.h.

#define TEST_EXPECT_CONTAINS (   str,
  part 
)    TEST_EXPECTATION(that(str).does_contain(part))

Definition at line 1301 of file test_unit.h.

#define TEST_EXPECT_CONTAINS__BROKEN (   str,
  part 
)    TEST_EXPECTATION__BROKEN_SIMPLE(that(str).does_contain(part))

Definition at line 1302 of file test_unit.h.

#define TEST_EXPECT_DOESNT_CONTAIN (   str,
  part 
)    TEST_EXPECTATION(that(str).doesnt_contain(part))

Definition at line 1304 of file test_unit.h.

#define TEST_EXPECT_DOESNT_CONTAIN__BROKEN (   str,
  part 
)    TEST_EXPECTATION__BROKEN_SIMPLE(that(str).doesnt_contain(part))

Definition at line 1305 of file test_unit.h.

#define TEST_EXPECT_NULL (   n)    TEST_EXPECT_EQUAL(n, (typeof(n))NULp)

Definition at line 1307 of file test_unit.h.

#define TEST_EXPECT_NULL__BROKEN (   n,
  got 
)    TEST_EXPECT_EQUAL__BROKEN(n, (typeof(n))NULp, got)

Definition at line 1308 of file test_unit.h.

#define TEST_EXPECT_NULL__BROKEN_SIMPLE (   n)    TEST_EXPECTATION__BROKEN_SIMPLE(that(n).is_equal_to((typeof(n))NULp))

Definition at line 1309 of file test_unit.h.

#define TEST_REJECT_NULL (   n)    TEST_EXPECT_DIFFERENT(n, (typeof(n))NULp)

Definition at line 1310 of file test_unit.h.

#define TEST_REJECT_NULL__BROKEN (   n)    TEST_EXPECT_DIFFERENT__BROKEN(n, (typeof(n))NULp)

Definition at line 1311 of file test_unit.h.

#define TEST_EXPECT (   cond)    TEST_EXPECTATION(that(cond).is_equal_to(true))

Definition at line 1313 of file test_unit.h.

#define TEST_EXPECT__BROKEN (   cond)    TEST_EXPECTATION__BROKEN_SIMPLE(that(cond).is_equal_to(true))

Definition at line 1314 of file test_unit.h.

#define TEST_REJECT (   cond)    TEST_EXPECTATION(that(cond).is_equal_to(false))

Definition at line 1315 of file test_unit.h.

#define TEST_REJECT__BROKEN (   cond)    TEST_EXPECTATION__BROKEN_SIMPLE(that(cond).is_equal_to(false))

Definition at line 1316 of file test_unit.h.

#define TEST_VALIDITY (   valid)    TEST_EXPECT_NULL((valid).why_not())

Definition at line 1319 of file test_unit.h.

#define TEST_VALIDITY__BROKEN (   valid,
  why 
)    TEST_EXPECT_NULL__BROKEN((valid).why_not(),why)

Definition at line 1320 of file test_unit.h.

#define WARN_MISS_ARBDIFF ( )    need_include__arb_diff_h__BEFORE__test_unit_h

Definition at line 1386 of file test_unit.h.

#define TEST_EXPECT_TEXTFILE_DIFFLINES (   fgot,
  fwant,
  diff 
)    WARN_MISS_ARBDIFF()

Definition at line 1388 of file test_unit.h.

#define TEST_EXPECT_TEXTFILE_DIFFLINES__BROKEN (   fgot,
  fwant,
  diff 
)    WARN_MISS_ARBDIFF()

Definition at line 1389 of file test_unit.h.

#define TEST_EXPECT_TEXTFILE_DIFFLINES_IGNORE_DATES (   fgot,
  fwant,
  diff 
)    WARN_MISS_ARBDIFF()

Definition at line 1391 of file test_unit.h.

#define TEST_EXPECT_TEXTFILE_DIFFLINES_IGNORE_DATES__BROKEN (   fgot,
  fwant,
  diff 
)    WARN_MISS_ARBDIFF()

Definition at line 1392 of file test_unit.h.

#define TEST_EXPECT_FILES_EQUAL (   f1,
  f2 
)    WARN_MISS_ARBDIFF()

Definition at line 1394 of file test_unit.h.

Referenced by ptserver(), and ptserver_gene().

#define TEST_EXPECT_FILES_EQUAL__BROKEN (   f1,
  f2 
)    WARN_MISS_ARBDIFF()

Definition at line 1395 of file test_unit.h.

#define TEST_EXPECT_TEXTFILES_EQUAL (   fgot,
  fwant 
)    WARN_MISS_ARBDIFF()

Definition at line 1396 of file test_unit.h.

Referenced by ptserver(), and ptserver_gene().

#define TEST_EXPECT_TEXTFILES_EQUAL__BROKEN (   fgot,
  fwant 
)    WARN_MISS_ARBDIFF()

Definition at line 1397 of file test_unit.h.

#define TEST_EXPECT_FILES_DIFFER (   f1,
  f2 
)    WARN_MISS_ARBDIFF()

Definition at line 1399 of file test_unit.h.

#define TEST_EXPECT_FILES_DIFFER__BROKEN (   f1,
  f2 
)    WARN_MISS_ARBDIFF()

Definition at line 1400 of file test_unit.h.

#define TEST_EXPECT_TEXTFILES_DIFFER (   fgot,
  fwant 
)    WARN_MISS_ARBDIFF()

Definition at line 1401 of file test_unit.h.

#define TEST_EXPECT_TEXTFILES_DIFFER__BROKEN (   fgot,
  fwant 
)    WARN_MISS_ARBDIFF()

Definition at line 1402 of file test_unit.h.

#define TEST_EXPECT_MEM_EQUAL (   m1,
  m2,
  size 
)    WARN_MISS_ARBDIFF()

Definition at line 1404 of file test_unit.h.

#define TEST_EXPECT_MEM_EQUAL__BROKEN (   m1,
  m2,
  size 
)    WARN_MISS_ARBDIFF()

Definition at line 1405 of file test_unit.h.

#define memory_is_equal (   m1,
  m2,
  size 
)    WARN_MISS_ARBDIFF()

Definition at line 1407 of file test_unit.h.

#define files_are_equal (   f1,
  f2 
)    WARN_MISS_ARBDIFF()

Definition at line 1408 of file test_unit.h.

#define textfiles_have_difflines (   f1,
  f2,
  ed 
)    WARN_MISS_ARBDIFF()

Definition at line 1409 of file test_unit.h.

#define textfiles_have_difflines_ignoreDates (   f1,
  f2,
  ed 
)    WARN_MISS_ARBDIFF()

Definition at line 1410 of file test_unit.h.

#define WARN_MISS_ADTREE ( )    need_include__TreeNode_h__BEFORE__test_unit_h

Definition at line 1447 of file test_unit.h.

#define TEST_EXPECT_NEWICK (   format,
  tree,
  expected_newick 
)    WARN_MISS_ADTREE()

Definition at line 1449 of file test_unit.h.

#define TEST_EXPECT_NEWICK__BROKEN (   format,
  tree,
  expected_newick 
)    WARN_MISS_ADTREE()

Definition at line 1450 of file test_unit.h.

#define TEST_EXPECT_SAVED_NEWICK (   format,
  gb_main,
  treename,
  expected_newick 
)    WARN_MISS_ADTREE()

Definition at line 1452 of file test_unit.h.

#define TEST_EXPECT_SAVED_NEWICK__BROKEN (   format,
  gb_main,
  treename,
  expected_newick 
)    WARN_MISS_ADTREE()

Definition at line 1453 of file test_unit.h.

#define TEST_SETUP_GLOBAL_ENVIRONMENT (   modulename)
Value:
do { \
arb_test::test_data().raiseLocalFlag(ANY_SETUP); \
TEST_EXPECT_NO_ERROR(GBK_system(GBS_global_string("../test_environment setup %s", (modulename)))); \
} while(0)
GB_ERROR GBK_system(const char *system_command)
Definition: arb_msg.cxx:519
const char * GBS_global_string(const char *templat,...)
Definition: arb_msg.cxx:204
#define TEST_EXPECT_NO_ERROR(call)
Definition: test_unit.h:1107
#define ANY_SETUP
Definition: test_unit.h:93

Definition at line 1459 of file test_unit.h.

#define TEST_PUBLISH (   testfunction)

Definition at line 1485 of file test_unit.h.