diff options
author | Michael Vogt <egon@debian-devbox> | 2011-10-14 11:54:12 +0200 |
---|---|---|
committer | Michael Vogt <egon@debian-devbox> | 2011-10-14 11:54:12 +0200 |
commit | 1d51f78e9d128191ff8b2d48e42d90ebdbff2588 (patch) | |
tree | af05e41a53bcc9f22f146573ed0f1ff5311b97ad /test/libapt/assert.h | |
parent | 324fc8af296953857ebfc76deaadd4d224e081e3 (diff) | |
parent | f3b8d8571faf62265266ac0f9da60ad73885214b (diff) |
merged from lp:~donkult/apt/sid
Diffstat (limited to 'test/libapt/assert.h')
-rw-r--r-- | test/libapt/assert.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/libapt/assert.h b/test/libapt/assert.h index fae9b6c64..ce5accc1c 100644 --- a/test/libapt/assert.h +++ b/test/libapt/assert.h @@ -54,6 +54,21 @@ void assertEqualsOr2(int const &expect1, int const &expect2, unsigned int const } +#define equalsOr3(w,x,y,z) assertEqualsOr3(x, y, z, w, __LINE__) + +template < typename X, typename Y > +void OutputAssertEqualOr3(X expect1, X expect2, X expect3, char const* compare, Y get, unsigned long const &line) { + std::cerr << "Test FAILED: »" << expect1 << "« or »" << expect2 << "« or »" << expect3 << "« " << compare << " »" << get << "« at line " << line << std::endl; +} + +template < typename X, typename Y > +void assertEqualsOr3(X expect1, X expect2, X expect3, Y get, unsigned long const &line) { + if (expect1 == get || expect2 == get || expect3 == get) + return; + OutputAssertEqualOr3(expect1, expect2, expect3, "==", get, line); +} + + // simple helper to quickly output a vectors template < typename X > void dumpVector(X vec) { |