summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2025-01-22 17:22:53 +0100
committerBent Bisballe Nyeng <deva@aasimon.org>2025-01-22 17:22:53 +0100
commit0f371777e02dd068f9675a05a29230221d5d6a7f (patch)
treef9b3e517742c6cd19b195618718898b1b2a0cded
parentbc078da645412c6b36ef59e635d6c35d11088c96 (diff)
Support msvc toolchain with multi-arg macros.HEADmaster
-rw-r--r--uunit.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/uunit.h b/uunit.h
index 92feb8d..97879ee 100644
--- a/uunit.h
+++ b/uunit.h
@@ -180,9 +180,10 @@ public:
}
}
//! Convenience macro to pass along filename and linenumber
- #define uUNIT_ASSERT(value) \
+ #define uUNIT_ASSERT(value) \
+ uUnit::u_assert(value, #value, __FILE__, __LINE__)
+ #define uASSERT(value) \
uUnit::u_assert(value, #value, __FILE__, __LINE__)
- #define uASSERT(...) uUNIT_ASSERT(__VA_ARGS__)
static void assert_equal(double expected, double value,
const char* file, std::size_t line)
@@ -211,9 +212,10 @@ public:
}
}
//! Convenience macro to pass along filename and linenumber
- #define uUNIT_ASSERT_EQUAL(expected, value) \
- uUnit::assert_equal(expected, value, __FILE__, __LINE__)
- #define uASSERT_EQUAL(...) uUNIT_ASSERT_EQUAL(__VA_ARGS__)
+ #define uUNIT_ASSERT_EQUAL(...) \
+ uUnit::assert_equal(__VA_ARGS__, __FILE__, __LINE__)
+ #define uASSERT_EQUAL(...) \
+ uUnit::assert_equal(__VA_ARGS__, __FILE__, __LINE__)
template<typename T>
static void assert_throws(const char* expected, std::function<void()> expr,