tests.h
Go to the documentation of this file.
#ifndef WIBBLE_TESTS_H
#define WIBBLE_TESTS_H
#include <string>
#include <sstream>
#include <wibble/tests/tut.h>
#include <wibble/tests/tut_reporter.h>
namespace wibble {
namespace tests {
struct Location;
struct LocationInfo;
}
}
/*
* These global arguments will be shadowed by local variables in functions that
* implement tests.
*
* They are here to act as default root nodes to fulfill method signatures when
* tests are called from outside other tests.
*/
extern const wibble::tests::Location wibble_test_location;
extern const wibble::tests::LocationInfo wibble_test_location_info;
#define TESTGRP(name) \
typedef test_group<name ## _shar> tg; \
typedef tg::object to; \
tg name ## _tg (#name);
namespace wibble {
namespace tests {
#define WIBBLE_TESTS_ALWAYS_THROWS __attribute__ ((noreturn))
class Location
{
const Location* parent;
const wibble::tests::LocationInfo* info;
const char* file;
int line;
const char* args;
Location(const Location* parent, const wibble::tests::LocationInfo& info, const char* file, int line, const char* args);
public:
Location();
// legacy
Location(const char* file, int line, const char* args);
// legacy
Location(const Location& parent, const char* file, int line, const char* args);
Location nest(const wibble::tests::LocationInfo& info, const char* file, int line, const char* args=0) const;
std::string locstr() const;
std::string msg(const std::string m) const;
void fail_test(const std::string& msg) const WIBBLE_TESTS_ALWAYS_THROWS;
void fail_test(const wibble::tests::LocationInfo& info, const char* file, int line, const char* args, const std::string& msg) const WIBBLE_TESTS_ALWAYS_THROWS;
void backtrace(std::ostream& out) const;
};
struct LocationInfo : public std::stringstream
{
std::ostream& operator()();
LocationInfo() {}
};
#define WIBBLE_TEST_LOCPRM wibble::tests::Location wibble_test_location
#define WIBBLE_TEST_INFO(name) \
wibble::tests::LocationInfo wibble_test_location_info; \
wibble::tests::LocationInfo& name = wibble_test_location_info
#define ensure(x) wibble::tests::impl_ensure(wibble::tests::Location(__FILE__, __LINE__, #x), (x))
#define inner_ensure(x) wibble::tests::impl_ensure(wibble::tests::Location(loc, __FILE__, __LINE__, #x), (x))
void impl_ensure(const Location& loc, bool res);
#define ensure_equals(x, y) wibble::tests::impl_ensure_equals(wibble::tests::Location(__FILE__, __LINE__, #x " == " #y), (x), (y))
#define inner_ensure_equals(x, y) wibble::tests::impl_ensure_equals(wibble::tests::Location(loc, __FILE__, __LINE__, #x " == " #y), (x), (y))
template <class Actual,class Expected>
void impl_ensure_equals(const Location& loc, const Actual& actual, const Expected& expected)
{
if( expected != actual )
{
std::stringstream ss;
ss << "expected '" << expected << "' actual '" << actual << "'";
loc.fail_test(ss.str());
}
}
#define ensure_similar(x, y, prec) wibble::tests::impl_ensure_similar(wibble::tests::Location(__FILE__, __LINE__, #x " == " #y), (x), (y), (prec))
#define inner_ensure_similar(x, y, prec) wibble::tests::impl_ensure_similar(wibble::tests::Location(loc, __FILE__, __LINE__, #x " == " #y), (x), (y), (prec))
template <class Actual, class Expected, class Precision>
void impl_ensure_similar(const Location& loc, const Actual& actual, const Expected& expected, const Precision& precision)
{
if( actual < expected - precision || expected + precision < actual )
{
std::stringstream ss;
ss << "expected '" << expected << "' actual '" << actual << "'";
loc.fail_test(ss.str());
}
}
#define ensure_contains(x, y) wibble::tests::impl_ensure_contains(wibble::tests::Location(__FILE__, __LINE__, #x " == " #y), (x), (y))
#define inner_ensure_contains(x, y) wibblwibblempl_ensure_contains(wibble::tests::Location(loc, __FILE__, __LINE__, #x " == " #y), (x), (y))
void impl_ensure_contains(const wibble::tests::Location& loc, const std::string& haystack, const std::string& needle);
#define ensure_not_contains(x, y) wibble::tests::impl_ensure_not_contains(wibble::tests::Location(__FILE__, __LINE__, #x " == " #y), (x), (y))
#define inner_ensure_not_contains(x, y) wibble::tests::impl_ensure_not_contains(wibble::tests::Location(loc, __FILE__, __LINE__, #x " == " #y), (x), (y))
void impl_ensure_not_contains(const wibble::tests::Location& loc, const std::string& haystack, const std::string& needle);
template<typename A>
struct TestBool
{
const A& actual;
bool inverted;
TestBool(const A& actual, bool inverted=false) : actual(actual), inverted(inverted) {}
TestBool<A> operator!() { return TestBool(actual, !inverted); }
void check(WIBBLE_TEST_LOCPRM) const
{
if (!inverted)
{
if (actual) return;
wibble_test_location.fail_test("actual value is false");
} else {
if (!actual) return;
wibble_test_location.fail_test("actual value is true");
}
}
};
template<typename A, typename E>
struct TestEquals
{
A actual;
E expected;
bool inverted;
TestEquals(const A& actual, const E& expected, bool inverted=false)
: actual(actual), expected(expected), inverted(inverted) {}
TestEquals<A, E> operator!() { return TestEquals<A, E>(actual, expected, !inverted); }
void check(WIBBLE_TEST_LOCPRM) const
{
if (!inverted)
{
if (actual == expected) return;
std::stringstream ss;
ss << "value '" << actual << "' is different than the expected '" << expected << "'";
wibble_test_location.fail_test(ss.str());
} else {
if (actual != expected) return;
std::stringstream ss;
ss << "value '" << actual << "' is not different than the expected '" << expected << "'";
wibble_test_location.fail_test(ss.str());
}
}
};
template<typename A, typename E>
struct TestIsLt
{
A actual;
E expected;
bool inverted;
TestIsLt(const A& actual, const E& expected, bool inverted=false)
: actual(actual), expected(expected), inverted(inverted) {}
TestIsLt<A, E> operator!() { return TestIsLt<A, E>(actual, expected, !inverted); }
void check(WIBBLE_TEST_LOCPRM) const
{
if (!inverted)
{
if (actual < expected) return;
std::stringstream ss;
ss << "value '" << actual << "' is not less than the expected '" << expected << "'";
wibble_test_location.fail_test(ss.str());
} else {
if (!(actual < expected)) return;
std::stringstream ss;
ss << "value '" << actual << "' is less than the expected '" << expected << "'";
wibble_test_location.fail_test(ss.str());
}
}
};
template<typename A, typename E>
struct TestIsLte
{
A actual;
E expected;
bool inverted;
TestIsLte(const A& actual, const E& expected, bool inverted=false) : actual(actual), expected(expected), inverted(inverted) {}
TestIsLte<A, E> operator!() { return TestIsLte<A, E>(actual, expected, !inverted); }
void check(WIBBLE_TEST_LOCPRM) const
{
if (!inverted)
{
if (actual <= expected) return;
std::stringstream ss;
ss << "value '" << actual << "' is not less than or equals to the expected '" << expected << "'";
wibble_test_location.fail_test(ss.str());
} else {
if (!(actual <= expected)) return;
std::stringstream ss;
ss << "value '" << actual << "' is less than or equals to the expected '" << expected << "'";
wibble_test_location.fail_test(ss.str());
}
}
};
template<typename A, typename E>
struct TestIsGt
{
A actual;
E expected;
bool inverted;
TestIsGt(const A& actual, const E& expected, bool inverted=false) : actual(actual), expected(expected), inverted(inverted) {}
TestIsGt<A, E> operator!() { return TestIsGt<A, E>(actual, expected, !inverted); }
void check(WIBBLE_TEST_LOCPRM) const
{
if (!inverted)
{
if (actual > expected) return;
std::stringstream ss;
ss << "value '" << actual << "' is not greater than the expected '" << expected << "'";
wibble_test_location.fail_test(ss.str());
} else {
if (!(actual > expected)) return;
std::stringstream ss;
ss << "value '" << actual << "' is greater than the expected '" << expected << "'";
wibble_test_location.fail_test(ss.str());
}
}
};
template<typename A, typename E>
struct TestIsGte
{
A actual;
E expected;
bool inverted;
TestIsGte(const A& actual, const E& expected, bool inverted=false) : actual(actual), expected(expected), inverted(inverted) {}
TestIsGte<A, E> operator!() { return TestIsGte<A, E>(actual, expected, !inverted); }
void check(WIBBLE_TEST_LOCPRM) const
{
if (!inverted)
{
if (actual >= expected) return;
std::stringstream ss;
ss << "value '" << actual << "' is not greater than or equals to the expected '" << expected << "'";
wibble_test_location.fail_test(ss.str());
} else {
if (!(actual >= expected)) return;
std::stringstream ss;
ss << "value '" << actual << "' is greater than or equals to the expected '" << expected << "'";
wibble_test_location.fail_test(ss.str());
}
}
};
struct TestStartsWith
{
std::string actual;
std::string expected;
bool inverted;
TestStartsWith(const std::string& actual, const std::string& expected, bool inverted=false) : actual(actual), expected(expected), inverted(inverted) {}
TestStartsWith operator!() { return TestStartsWith(actual, expected, !inverted); }
void check(WIBBLE_TEST_LOCPRM) const;
};
struct TestEndsWith
{
std::string actual;
std::string expected;
bool inverted;
TestEndsWith(const std::string& actual, const std::string& expected, bool inverted=false) : actual(actual), expected(expected), inverted(inverted) {}
TestEndsWith operator!() { return TestEndsWith(actual, expected, !inverted); }
void check(WIBBLE_TEST_LOCPRM) const;
};
struct TestContains
{
std::string actual;
std::string expected;
bool inverted;
TestContains(const std::string& actual, const std::string& expected, bool inverted=false) : actual(actual), expected(expected), inverted(inverted) {}
TestContains operator!() { return TestContains(actual, expected, !inverted); }
void check(WIBBLE_TEST_LOCPRM) const;
};
struct TestRegexp
{
std::string actual;
std::string regexp;
bool inverted;
TestRegexp(const std::string& actual, const std::string& regexp, bool inverted=false) : actual(actual), regexp(regexp), inverted(inverted) {}
TestRegexp operator!() { return TestRegexp(actual, regexp, !inverted); }
void check(WIBBLE_TEST_LOCPRM) const;
};
struct TestFileExists
{
std::string pathname;
bool inverted;
TestFileExists(const std::string& pathname, bool inverted=false) : pathname(pathname), inverted(inverted) {}
TestFileExists operator!() { return TestFileExists(pathname, !inverted); }
void check(WIBBLE_TEST_LOCPRM) const;
};
template<class A>
struct Actual
{
A actual;
Actual(const A& actual) : actual(actual) {}
~Actual() {}
template<typename E> TestEquals<A, E> operator==(const E& expected) const { return TestEquals<A, E>(actual, expected); }
template<typename E> TestEquals<A, E> operator!=(const E& expected) const { return !TestEquals<A, E>(actual, expected); }
template<typename E> TestIsLt<A, E> operator<(const E& expected) const { return TestIsLt<A, E>(actual, expected); }
template<typename E> TestIsLte<A, E> operator<=(const E& expected) const { return TestIsLte<A, E>(actual, expected); }
template<typename E> TestIsGt<A, E> operator>(const E& expected) const { return TestIsGt<A, E>(actual, expected); }
template<typename E> TestIsGte<A, E> operator>=(const E& expected) const { return TestIsGte<A, E>(actual, expected); }
TestBool<A> istrue() const { return TestBool<A>(actual); }
TestBool<A> isfalse() const { return TestBool<A>(actual, true); }
};
struct ActualString : public Actual<std::string>
{
ActualString(const std::string& s) : Actual<std::string>(s) {}
TestEquals<std::string, std::string> operator==(const std::string& expected) const { return TestEquals<std::string, std::string>(actual, expected); }
TestEquals<std::string, std::string> operator!=(const std::string& expected) const { return !TestEquals<std::string, std::string>(actual, expected); }
TestIsLt<std::string, std::string> operator<(const std::string& expected) const { return TestIsLt<std::string, std::string>(actual, expected); }
TestIsLte<std::string, std::string> operator<=(const std::string& expected) const { return TestIsLte<std::string, std::string>(actual, expected); }
TestIsGt<std::string, std::string> operator>(const std::string& expected) const { return TestIsGt<std::string, std::string>(actual, expected); }
TestIsGte<std::string, std::string> operator>=(const std::string& expected) const { return TestIsGte<std::string, std::string>(actual, expected); }
TestStartsWith startswith(const std::string& expected) const { return TestStartsWith(actual, expected); }
TestEndsWith endswith(const std::string& expected) const { return TestEndsWith(actual, expected); }
TestContains contains(const std::string& expected) const { return TestContains(actual, expected); }
TestRegexp matches(const std::string& regexp) const { return TestRegexp(actual, regexp); }
TestFileExists fileexists() const { return TestFileExists(actual); }
};
template<typename A>
inline Actual<A> actual(const A& actual) { return Actual<A>(actual); }
inline ActualString actual(const std::string& actual) { return ActualString(actual); }
inline ActualString actual(const char* actual) { return ActualString(actual ? actual : ""); }
inline ActualString actual(char* actual) { return ActualString(actual ? actual : ""); }
/*
template<typename T, typename P>
void _wassert(WIBBLE_TEST_LOCPRM, T& a, P& op)
{
op.invoke(wibble_test_location, a);
}
*/
template<typename T>
static inline void _wassert(WIBBLE_TEST_LOCPRM, const T& expr)
{
expr.check(wibble_test_location);
}
#define wibble_test_runner(loc, func, ...) \
do { try { \
func(loc, ##__VA_ARGS__); \
} catch (tut::failure) { \
throw; \
} catch (std::exception& e) { \
loc.fail_test(e.what()); \
} } while(0)
#define wrunchecked(func) \
do { try { \
func; \
} catch (tut::failure) { \
throw; \
} catch (std::exception& e) { \
wibble_test_location.fail_test(wibble_test_location_info, __FILE__, __LINE__, #func, e.what()); \
} } while(0)
// function test, just runs the function without mangling its name
#define wruntest(test, ...) wibble_test_runner(wibble_test_location.nest(wibble_test_location_info, __FILE__, __LINE__, "function: " #test "(" #__VA_ARGS__ ")"), test, ##__VA_ARGS__)
#define wassert(...) wibble_test_runner(wibble_test_location.nest(wibble_test_location_info, __FILE__, __LINE__, #__VA_ARGS__), _wassert, ##__VA_ARGS__)
}
}
#endif
wibble::tests::Location
Definition: tests.h:48
wibble::tests::Location::locstr
std::string locstr() const
Definition: tests.cpp:58
wibble::tests::Location::nest
Location nest(const wibble::tests::LocationInfo &info, const char *file, int line, const char *args=0) const
Definition: tests.cpp:43
wibble::tests::Location::backtrace
void backtrace(std::ostream &out) const
Definition: tests.cpp:48
wibble::tests::Location::msg
std::string msg(const std::string m) const
Definition: tests.cpp:65
wibble::tests::Location::Location
Location()
Definition: tests.cpp:22
wibble::tests::Location::fail_test
void fail_test(const std::string &msg) const WIBBLE_TESTS_ALWAYS_THROWS
Definition: tests.cpp:74
wibble::tests::impl_ensure_not_contains
void impl_ensure_not_contains(const wibble::tests::Location &loc, const std::string &haystack, const std::string &needle)
Definition: tests.cpp:176
wibble::tests::impl_ensure_contains
void impl_ensure_contains(const wibble::tests::Location &loc, const std::string &haystack, const std::string &needle)
Definition: tests.cpp:166
wibble::tests::actual
Actual< A > actual(const A &actual)
Definition: tests.h:384
wibble::tests::impl_ensure_similar
void impl_ensure_similar(const Location &loc, const Actual &actual, const Expected &expected, const Precision &precision)
Definition: tests.h:123
wibble::tests::impl_ensure
void impl_ensure(const Location &loc, bool res)
Definition: tests.cpp:160
wibble::tests::impl_ensure_equals
void impl_ensure_equals(const Location &loc, const Actual &actual, const Expected &expected)
Definition: tests.h:109
wibble
Definition: amorph.h:17
wibble::tests::ActualString
Definition: tests.h:368
wibble::tests::ActualString::operator<=
TestIsLte< std::string, std::string > operator<=(const std::string &expected) const
Definition: tests.h:373
wibble::tests::ActualString::contains
TestContains contains(const std::string &expected) const
Definition: tests.h:378
wibble::tests::ActualString::operator<
TestIsLt< std::string, std::string > operator<(const std::string &expected) const
Definition: tests.h:372
wibble::tests::ActualString::operator==
TestEquals< std::string, std::string > operator==(const std::string &expected) const
Definition: tests.h:370
wibble::tests::ActualString::operator!=
TestEquals< std::string, std::string > operator!=(const std::string &expected) const
Definition: tests.h:371
wibble::tests::ActualString::endswith
TestEndsWith endswith(const std::string &expected) const
Definition: tests.h:377
wibble::tests::ActualString::matches
TestRegexp matches(const std::string &regexp) const
Definition: tests.h:379
wibble::tests::ActualString::startswith
TestStartsWith startswith(const std::string &expected) const
Definition: tests.h:376
wibble::tests::ActualString::ActualString
ActualString(const std::string &s)
Definition: tests.h:369
wibble::tests::ActualString::fileexists
TestFileExists fileexists() const
Definition: tests.h:380
wibble::tests::ActualString::operator>
TestIsGt< std::string, std::string > operator>(const std::string &expected) const
Definition: tests.h:374
wibble::tests::ActualString::operator>=
TestIsGte< std::string, std::string > operator>=(const std::string &expected) const
Definition: tests.h:375
wibble::tests::Actual
Definition: tests.h:352
wibble::tests::Actual::istrue
TestBool< A > istrue() const
Definition: tests.h:363
wibble::tests::Actual::~Actual
~Actual()
Definition: tests.h:355
wibble::tests::Actual::isfalse
TestBool< A > isfalse() const
Definition: tests.h:364
wibble::tests::Actual::actual
A actual
Definition: tests.h:353
wibble::tests::Actual::operator<=
TestIsLte< A, E > operator<=(const E &expected) const
Definition: tests.h:360
wibble::tests::Actual::operator>
TestIsGt< A, E > operator>(const E &expected) const
Definition: tests.h:361
wibble::tests::Actual::operator<
TestIsLt< A, E > operator<(const E &expected) const
Definition: tests.h:359
wibble::tests::Actual::operator>=
TestIsGte< A, E > operator>=(const E &expected) const
Definition: tests.h:362
wibble::tests::Actual::operator==
TestEquals< A, E > operator==(const E &expected) const
Definition: tests.h:357
wibble::tests::Actual::operator!=
TestEquals< A, E > operator!=(const E &expected) const
Definition: tests.h:358
wibble::tests::Actual::Actual
Actual(const A &actual)
Definition: tests.h:354
wibble::tests::LocationInfo
Definition: tests.h:73
wibble::tests::LocationInfo::operator()
std::ostream & operator()()
Clear the stringstream and return self.
Definition: tests.cpp:85
wibble::tests::LocationInfo::LocationInfo
LocationInfo()
Definition: tests.h:90
wibble::tests::TestBool
Definition: tests.h:144
wibble::tests::TestBool::check
void check(WIBBLE_TEST_LOCPRM) const
Definition: tests.h:151
wibble::tests::TestBool::inverted
bool inverted
Definition: tests.h:146
wibble::tests::TestBool::TestBool
TestBool(const A &actual, bool inverted=false)
Definition: tests.h:147
wibble::tests::TestBool::actual
const A & actual
Definition: tests.h:145
wibble::tests::TestBool::operator!
TestBool< A > operator!()
Definition: tests.h:149
wibble::tests::TestContains
Definition: tests.h:319
wibble::tests::TestContains::check
void check(WIBBLE_TEST_LOCPRM) const
Definition: tests.cpp:218
wibble::tests::TestContains::inverted
bool inverted
Definition: tests.h:322
wibble::tests::TestContains::TestContains
TestContains(const std::string &actual, const std::string &expected, bool inverted=false)
Definition: tests.h:323
wibble::tests::TestContains::expected
std::string expected
Definition: tests.h:321
wibble::tests::TestContains::actual
std::string actual
Definition: tests.h:320
wibble::tests::TestContains::operator!
TestContains operator!()
Definition: tests.h:325
wibble::tests::TestEndsWith
Definition: tests.h:308
wibble::tests::TestEndsWith::inverted
bool inverted
Definition: tests.h:311
wibble::tests::TestEndsWith::expected
std::string expected
Definition: tests.h:310
wibble::tests::TestEndsWith::operator!
TestEndsWith operator!()
Definition: tests.h:314
wibble::tests::TestEndsWith::check
void check(WIBBLE_TEST_LOCPRM) const
Definition: tests.cpp:202
wibble::tests::TestEndsWith::TestEndsWith
TestEndsWith(const std::string &actual, const std::string &expected, bool inverted=false)
Definition: tests.h:312
wibble::tests::TestEndsWith::actual
std::string actual
Definition: tests.h:309
wibble::tests::TestEquals
Definition: tests.h:166
wibble::tests::TestEquals::inverted
bool inverted
Definition: tests.h:169
wibble::tests::TestEquals::TestEquals
TestEquals(const A &actual, const E &expected, bool inverted=false)
Definition: tests.h:170
wibble::tests::TestEquals::check
void check(WIBBLE_TEST_LOCPRM) const
Definition: tests.h:174
wibble::tests::TestEquals::operator!
TestEquals< A, E > operator!()
Definition: tests.h:173
wibble::tests::TestEquals::actual
A actual
Definition: tests.h:167
wibble::tests::TestEquals::expected
E expected
Definition: tests.h:168
wibble::tests::TestFileExists
Definition: tests.h:341
wibble::tests::TestFileExists::check
void check(WIBBLE_TEST_LOCPRM) const
Definition: tests.cpp:251
wibble::tests::TestFileExists::inverted
bool inverted
Definition: tests.h:343
wibble::tests::TestFileExists::TestFileExists
TestFileExists(const std::string &pathname, bool inverted=false)
Definition: tests.h:344
wibble::tests::TestFileExists::pathname
std::string pathname
Definition: tests.h:342
wibble::tests::TestFileExists::operator!
TestFileExists operator!()
Definition: tests.h:345
wibble::tests::TestIsGt
Definition: tests.h:246
wibble::tests::TestIsGt::TestIsGt
TestIsGt(const A &actual, const E &expected, bool inverted=false)
Definition: tests.h:250
wibble::tests::TestIsGt::actual
A actual
Definition: tests.h:247
wibble::tests::TestIsGt::operator!
TestIsGt< A, E > operator!()
Definition: tests.h:252
wibble::tests::TestIsGt::inverted
bool inverted
Definition: tests.h:249
wibble::tests::TestIsGt::expected
E expected
Definition: tests.h:248
wibble::tests::TestIsGt::check
void check(WIBBLE_TEST_LOCPRM) const
Definition: tests.h:253
wibble::tests::TestIsGte
Definition: tests.h:272
wibble::tests::TestIsGte::inverted
bool inverted
Definition: tests.h:275
wibble::tests::TestIsGte::expected
E expected
Definition: tests.h:274
wibble::tests::TestIsGte::TestIsGte
TestIsGte(const A &actual, const E &expected, bool inverted=false)
Definition: tests.h:276
wibble::tests::TestIsGte::operator!
TestIsGte< A, E > operator!()
Definition: tests.h:278
wibble::tests::TestIsGte::actual
A actual
Definition: tests.h:273
wibble::tests::TestIsGte::check
void check(WIBBLE_TEST_LOCPRM) const
Definition: tests.h:279
wibble::tests::TestIsLt
Definition: tests.h:193
wibble::tests::TestIsLt::expected
E expected
Definition: tests.h:195
wibble::tests::TestIsLt::inverted
bool inverted
Definition: tests.h:196
wibble::tests::TestIsLt::check
void check(WIBBLE_TEST_LOCPRM) const
Definition: tests.h:201
wibble::tests::TestIsLt::operator!
TestIsLt< A, E > operator!()
Definition: tests.h:200
wibble::tests::TestIsLt::actual
A actual
Definition: tests.h:194
wibble::tests::TestIsLt::TestIsLt
TestIsLt(const A &actual, const E &expected, bool inverted=false)
Definition: tests.h:197
wibble::tests::TestIsLte
Definition: tests.h:220
wibble::tests::TestIsLte::operator!
TestIsLte< A, E > operator!()
Definition: tests.h:226
wibble::tests::TestIsLte::inverted
bool inverted
Definition: tests.h:223
wibble::tests::TestIsLte::check
void check(WIBBLE_TEST_LOCPRM) const
Definition: tests.h:227
wibble::tests::TestIsLte::actual
A actual
Definition: tests.h:221
wibble::tests::TestIsLte::TestIsLte
TestIsLte(const A &actual, const E &expected, bool inverted=false)
Definition: tests.h:224
wibble::tests::TestIsLte::expected
E expected
Definition: tests.h:222
wibble::tests::TestRegexp
Definition: tests.h:330
wibble::tests::TestRegexp::operator!
TestRegexp operator!()
Definition: tests.h:336
wibble::tests::TestRegexp::check
void check(WIBBLE_TEST_LOCPRM) const
Definition: tests.cpp:234
wibble::tests::TestRegexp::actual
std::string actual
Definition: tests.h:331
wibble::tests::TestRegexp::inverted
bool inverted
Definition: tests.h:333
wibble::tests::TestRegexp::TestRegexp
TestRegexp(const std::string &actual, const std::string &regexp, bool inverted=false)
Definition: tests.h:334
wibble::tests::TestRegexp::regexp
std::string regexp
Definition: tests.h:332
wibble::tests::TestStartsWith
Definition: tests.h:297
wibble::tests::TestStartsWith::check
void check(WIBBLE_TEST_LOCPRM) const
Definition: tests.cpp:186
wibble::tests::TestStartsWith::inverted
bool inverted
Definition: tests.h:300
wibble::tests::TestStartsWith::operator!
TestStartsWith operator!()
Definition: tests.h:303
wibble::tests::TestStartsWith::expected
std::string expected
Definition: tests.h:299
wibble::tests::TestStartsWith::TestStartsWith
TestStartsWith(const std::string &actual, const std::string &expected, bool inverted=false)
Definition: tests.h:301
wibble::tests::TestStartsWith::actual
std::string actual
Definition: tests.h:298
wibble_test_location
const wibble::tests::Location wibble_test_location
Definition: tests.cpp:16
WIBBLE_TEST_LOCPRM
#define WIBBLE_TEST_LOCPRM
Definition: tests.h:93
wibble_test_location_info
const wibble::tests::LocationInfo wibble_test_location_info
Definition: tests.cpp:17
WIBBLE_TESTS_ALWAYS_THROWS
#define WIBBLE_TESTS_ALWAYS_THROWS
Definition: tests.h:45
tut.h
tut_reporter.h