summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorBenjamin Dauvergne <bdauvergne@entrouvert.com>2010-03-27 16:51:25 +0000
committerBenjamin Dauvergne <bdauvergne@entrouvert.com>2010-03-27 16:51:25 +0000
commitbb5ca6546defea56658eec81edae3626a181e64e (patch)
tree6a208bd04e48bea2dfe2abc7765099ddca860bb5 /tests
parent04ad7903475676fa265a8b0622f86f1bb1dbf71c (diff)
downloadlasso-bb5ca6546defea56658eec81edae3626a181e64e.tar.gz
lasso-bb5ca6546defea56658eec81edae3626a181e64e.tar.xz
lasso-bb5ca6546defea56658eec81edae3626a181e64e.zip
Tests: add macros to test for string equality
Diffstat (limited to 'tests')
-rw-r--r--tests/tests.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/tests.h b/tests/tests.h
index 46b260d2..aaa3b101 100644
--- a/tests/tests.h
+++ b/tests/tests.h
@@ -60,4 +60,16 @@
fail_unless(__tmp1 != __tmp2, "%s:%i: " #what " is equal to " #to "(%p)", __func__, __LINE__, (void*)__tmp2); \
}
+#define check_str_equals(what, to) \
+{ typeof(what) __tmp; \
+ __tmp = (what); \
+ fail_unless(g_strcmp0(__tmp, to) == 0, "%s:%i: " #what " (%s) is not equal to %s", __func__, __LINE__, __tmp, to); \
+}
+
+#define check_str_not_equals(what, to) \
+{ typeof(what) __tmp; \
+ __tmp = (what); \
+ fail_unless(g_strcmp0(__tmp, to) != 0, "%s:%i: " #what " is equal to %s", __func__, __LINE__, to); \
+}
+
#endif /*__TESTS_H__ */