summaryrefslogtreecommitdiff
path: root/src/utils/checkutils.h
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-05-03 00:22:11 +0300
committerAndrei Karas <akaras@inbox.ru>2016-05-03 00:22:11 +0300
commit972a7923355b87f7570bae37306d9ec8121c86da (patch)
tree332cac6474d3c33c8e032d21b32f293b69921a5d /src/utils/checkutils.h
parent9ffe81e93fe8561d01a4985e565d2f9664431338 (diff)
downloadplus-972a7923355b87f7570bae37306d9ec8121c86da.tar.gz
plus-972a7923355b87f7570bae37306d9ec8121c86da.tar.bz2
plus-972a7923355b87f7570bae37306d9ec8121c86da.tar.xz
plus-972a7923355b87f7570bae37306d9ec8121c86da.zip
Add functions failFalse and failTrue and tests.
Diffstat (limited to 'src/utils/checkutils.h')
-rw-r--r--src/utils/checkutils.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/utils/checkutils.h b/src/utils/checkutils.h
index 539614a7a..fea0a0f67 100644
--- a/src/utils/checkutils.h
+++ b/src/utils/checkutils.h
@@ -29,6 +29,12 @@
#define reportTrue(val) \
reportTrueReal(val, #val, __FILE__, __LINE__, __func__)
+#define failFalse(val) \
+ failFalseReal(val, #val, __FILE__, __LINE__, __func__)
+
+#define failTrue(val) \
+ failTrueReal(val, #val, __FILE__, __LINE__, __func__)
+
bool reportFalseReal(const bool val,
const char *const text,
const char *const file,
@@ -41,6 +47,18 @@ bool reportTrueReal(const bool val,
const unsigned line,
const char *const func);
+bool failFalseReal(const bool val,
+ const char *const text,
+ const char *const file,
+ const unsigned line,
+ const char *const func);
+
+bool failTrueReal(const bool val,
+ const char *const text,
+ const char *const file,
+ const unsigned line,
+ const char *const func);
+
void reportStack(const char *const file,
const unsigned int line,
const char *const func,
@@ -51,6 +69,8 @@ void reportStack(const char *const file,
#define reportFalse(val) (val)
#define reportTrue(val) (val)
+#define failFalse(val) (val)
+#define failTrue(val) (val)
#endif // ENABLE_ASSERTS
#endif // UTILS_CHECKUTILS_H