summaryrefslogtreecommitdiff
path: root/test/libapt/assert.h
diff options
context:
space:
mode:
authorDavid Kalnischkies <kalnischkies@gmail.com>2011-10-05 23:00:47 +0200
committerDavid Kalnischkies <kalnischkies@gmail.com>2011-10-05 23:00:47 +0200
commitd073d7db69eddd2d9c22e8ded7c6b871bca1716a (patch)
treeb8244eb97f78e96e34cf1fc5f1c0b19ec4bd5ab3 /test/libapt/assert.h
parent061c58b61ab5aae4689386bd2ab1e36e71470dfc (diff)
cherrypick from my apt/experimental branch
* apt-pkg/deb/debmetaindex.cc: - none is a separator, not a language: no need for Index (Closes: #624218) * apt-pkg/aptconfiguration.cc: - do not builtin languages only if none is forced (Closes: #643787)
Diffstat (limited to 'test/libapt/assert.h')
-rw-r--r--test/libapt/assert.h15
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) {