aboutsummaryrefslogtreecommitdiffstats
path: root/test/test.h
diff options
context:
space:
mode:
Diffstat (limited to 'test/test.h')
-rw-r--r--test/test.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/test.h b/test/test.h
index 31806fddb..b1fd311e6 100644
--- a/test/test.h
+++ b/test/test.h
@@ -127,6 +127,22 @@ extern "C" {
}
/**
+ * @brief Test assertion with lock.
+ *
+ * @param[in] point numeric assertion identifier
+ * @param[in] condition a boolean expression that must be verified to be true
+ * @param[in] msg failure message
+ */
+#define test_assert_lock(point, condition, msg) { \
+ chSysLock(); \
+ if (_test_assert(point, condition)) { \
+ chSysUnlock(); \
+ return; \
+ } \
+ chSysUnlock(); \
+}
+
+/**
* @brief Test sequence assertion.
*
* @param[in] point numeric assertion identifier