summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorBenjamin Dauvergne <bdauvergne@entrouvert.com>2009-12-08 10:15:04 +0000
committerBenjamin Dauvergne <bdauvergne@entrouvert.com>2009-12-08 10:15:04 +0000
commit6dd310e68d1900da6a2adffc4bfdc9ba62854fbe (patch)
tree9807f15715f26999fc02601d1c2e7e5d323f15a7 /tests
parent4467bf8938e4c4fb5fd2d43724c0901c3c73afe1 (diff)
downloadlasso-6dd310e68d1900da6a2adffc4bfdc9ba62854fbe.tar.gz
lasso-6dd310e68d1900da6a2adffc4bfdc9ba62854fbe.tar.xz
lasso-6dd310e68d1900da6a2adffc4bfdc9ba62854fbe.zip
in tests/tests.h, Add checks for true and false conditions
Diffstat (limited to 'tests')
-rw-r--r--tests/tests.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/tests/tests.h b/tests/tests.h
index a4293ce0..78c941c8 100644
--- a/tests/tests.h
+++ b/tests/tests.h
@@ -24,20 +24,26 @@
#define __TESTS_H__
#define check_not_null(what) \
- fail_unless((what) != NULL, #what " returned NULL");
+ fail_unless((what) != NULL, "%s:%i: " #what " returned NULL", __func__, __LINE__);
#define check_null(what) \
- fail_unless((what) == NULL, #what " returned NULL");
+ fail_unless((what) == NULL, "%s:%i: "#what " returned NULL", __func__, __LINE__);
+
+#define check_true(what) \
+ fail_unless((what), "%s:%i: " #what " is not TRUE", __func__, __LINE__);
+
+#define check_false(what) \
+ fail_unless(! (what), "%s:%i: " #what " is not FALSE", __func__, __LINE__);
#define check_good_rc(what) \
{ int __rc = (what); \
- fail_unless(__rc == 0, #what " failed, rc = %s", lasso_strerror(__rc)); \
+ fail_unless(__rc == 0, "%s:%i: " #what " failed, rc = %s(%i)", __func__, __LINE__, lasso_strerror(__rc), __rc); \
}
#define check_bad_rc(what, how) \
{ int __rc = (what); \
- fail_unless(__rc == how, #what " is not %s, rc = %s", lasso_strerror(how), lasso_strerror(__rc)); \
+ fail_unless(__rc == how, "%s:%i: " #what " is not %s(%i), rc = %s(%i)", __func__, __LINE__, lasso_strerror(how), how, lasso_strerror(__rc), __rc); \
}
#endif /*__TESTS_H__ */