diff options
author | Benjamin Dauvergne <bdauvergne@entrouvert.com> | 2010-03-27 16:51:21 +0000 |
---|---|---|
committer | Benjamin Dauvergne <bdauvergne@entrouvert.com> | 2010-03-27 16:51:21 +0000 |
commit | 7948fab3e216a2a27d8d3b76c3c6095cf255964d (patch) | |
tree | 6ce8f0e491b7c1982cbc2f957ede3b6777e01633 /tests | |
parent | cdaf6377375eecdbc1f320cb7c5d470edfb45048 (diff) | |
download | lasso-7948fab3e216a2a27d8d3b76c3c6095cf255964d.tar.gz lasso-7948fab3e216a2a27d8d3b76c3c6095cf255964d.tar.xz lasso-7948fab3e216a2a27d8d3b76c3c6095cf255964d.zip |
Tests: add macros check_equals and check_not_equals
Diffstat (limited to 'tests')
-rw-r--r-- | tests/tests.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/tests.h b/tests/tests.h index 78c941c8..46b260d2 100644 --- a/tests/tests.h +++ b/tests/tests.h @@ -46,4 +46,18 @@ fail_unless(__rc == how, "%s:%i: " #what " is not %s(%i), rc = %s(%i)", __func__, __LINE__, lasso_strerror(how), how, lasso_strerror(__rc), __rc); \ } +#define check_equals(what,to) \ +{ typeof(what) __tmp1, __tmp2; \ + __tmp1 = (what); \ + __tmp2 = (to); \ + fail_unless(__tmp1 == __tmp2, "%s:%i: " #what " is not equal to " #to "(%p)", __func__, __LINE__, (void*)__tmp2); \ +} + +#define check_not_equals(what,to) \ +{ typeof(what) __tmp1, __tmp2; \ + __tmp1 = (what); \ + __tmp2 = (to); \ + fail_unless(__tmp1 != __tmp2, "%s:%i: " #what " is equal to " #to "(%p)", __func__, __LINE__, (void*)__tmp2); \ +} + #endif /*__TESTS_H__ */ |