summaryrefslogtreecommitdiff
path: root/utests/utest_assert.hpp
diff options
context:
space:
mode:
authorBenjamin Segovia <segovia.benjamin@gmail.com>2012-05-03 17:12:18 +0000
committerKeith Packard <keithp@keithp.com>2012-08-10 16:16:59 -0700
commit14430f2092f27a4fda9d8d80be90373388a06801 (patch)
tree5fa0ec1d8cf63d3c8c033d5e389130a0cbaf4851 /utests/utest_assert.hpp
parentccd746d3af1a4778e5c145fb752ea5a739f70840 (diff)
downloadbeignet-14430f2092f27a4fda9d8d80be90373388a06801.tar.gz
Finished the small test framework
Diffstat (limited to 'utests/utest_assert.hpp')
-rw-r--r--utests/utest_assert.hpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/utests/utest_assert.hpp b/utests/utest_assert.hpp
index d124e9fb..f93f9ac7 100644
--- a/utests/utest_assert.hpp
+++ b/utests/utest_assert.hpp
@@ -28,5 +28,17 @@
/*! To ensure that condition truth. Optional message is supported */
void onFailedAssertion(const char *msg, const char *file, const char *fn, int line);
+#define OCL_ASSERT(EXPR) \
+ do { \
+ if (!(EXPR)) \
+ onFailedAssertion(#EXPR, __FILE__, __FUNCTION__, __LINE__); \
+ } while (0)
+
+#define OCL_ASSERTM(EXPR, MSG) \
+ do { \
+ if (!(EXPR)) \
+ onFailedAssertion(MSG, __FILE__, __FUNCTION__, __LINE__); \
+ } while (0)
+
#endif /* __OCL_ASSERT_HPP__ */