summaryrefslogtreecommitdiff
path: root/uunit.h
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2020-10-26 19:40:44 +0100
committerBent Bisballe Nyeng <deva@aasimon.org>2020-10-26 19:51:28 +0100
commita0ce0a75828401be43132fdfffa89f5ae903f501 (patch)
tree0d678d0faf7b9119acc80155b912cc44adf69b1e /uunit.h
parentec88915a05a39f2edce5ac01e51f2be971f12b13 (diff)
Add abbreviated convenience macros.
Diffstat (limited to 'uunit.h')
-rw-r--r--uunit.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/uunit.h b/uunit.h
index 9c0775d..c9cb258 100644
--- a/uunit.h
+++ b/uunit.h
@@ -167,6 +167,7 @@ protected:
}
#define uUNIT_TEST(func) \
registerTest(this, &func, #func, __FILE__)
+ #define uTEST(args...) uUNIT_TEST(args)
void u_assert(bool value, const char* expr,
const char* file, std::size_t line)
@@ -182,6 +183,7 @@ protected:
//! Convenience macro to pass along filename and linenumber
#define uUNIT_ASSERT(value) \
u_assert(value, #value, __FILE__, __LINE__)
+ #define uASSERT(args...) uUNIT_ASSERT(args)
void assert_equal(double expected, double value,
const char* file, std::size_t line)
@@ -211,7 +213,7 @@ protected:
//! Convenience macro to pass along filename and linenumber
#define uUNIT_ASSERT_EQUAL(expected, value) \
assert_equal(expected, value, __FILE__, __LINE__)
-
+ #define uASSERT_EQUAL(args...) uUNIT_ASSERT_EQUAL(args)
template<typename T>
void assert_throws(const char* expected, std::function<void()> expr,
@@ -241,6 +243,7 @@ protected:
}
#define uUNIT_ASSERT_THROWS(expected, expr) \
assert_throws<expected>(#expected, [&](){ expr; }, __FILE__, __LINE__)
+ #define uASSERT_THROWS(args...) uUNIT_ASSERT_THROWS(args)
private:
static std::string sanitize(const std::string& input)