Code

t/unit/core/timeseries_test: Add minimalistic test for timeseries.
[sysdb.git] / t / unit / testutils.h
index 3bdf0a1c98f9f4c9db9e0cb657674a1038c16e19..a550be2af27b6529436db16e482c83747f39ea9a 100644 (file)
@@ -37,6 +37,7 @@
 #include <check.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <time.h>
 
 #define TEST_MAIN(name) \
        int main(void) \
@@ -45,7 +46,9 @@
                Suite *s; \
                int failed; \
                putenv("TZ=UTC"); \
+               tzset(); \
                s = suite_create(name); \
+               sr = srunner_create(s); \
 
 #define TC_ADD_LOOP_TEST(tc, name) \
        tcase_add_loop_test((tc), test_ ## name, \
@@ -54,7 +57,6 @@
 #define ADD_TCASE(tc) suite_add_tcase(s, (tc))
 
 #define TEST_MAIN_END \
-               sr = srunner_create(s); \
                srunner_run_all(sr, CK_NORMAL); \
                failed = srunner_ntests_failed(sr); \
                srunner_free(sr); \
 int
 sdb_regmatches(const char *regex, const char *string);
 
+/*
+ * sdb_diff_strings:
+ * Compare two strings and fail the test if there's a difference.
+ */
+void
+sdb_diff_strings(const char *desc, const char *got, const char *expected);
+
 #endif /* T_LIBSYSDB_UTILS_H */
 
 /* vim: set tw=78 sw=4 ts=4 noexpandtab : */