Code

t/unit/: Create one test binary for each *_test.c file.
[sysdb.git] / t / unit / core / store_test.c
index 262f681de1ba8a7b69ca846ba20525b60cf67820..7ea53bcaf76d25bb8efd70e12ea4f13db6dadb8d 100644 (file)
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+#if HAVE_CONFIG_H
+#      include "config.h"
+#endif
+
 #include "core/store.h"
 #include "core/store-private.h"
-#include "libsysdb_test.h"
+#include "testutils.h"
 
 #include <check.h>
 #include <string.h>
@@ -693,8 +697,8 @@ START_TEST(test_scan)
        /* empty store */
        check = sdb_store_scan(SDB_HOST, /* m, filter = */ NULL, NULL,
                        scan_count, &i);
-       fail_unless(check == -1,
-                       "sdb_store_scan(HOST), empty store = %d; expected: -1", check);
+       fail_unless(check == 0,
+                       "sdb_store_scan(HOST), empty store = %d; expected: 0", check);
        fail_unless(i == 0,
                        "sdb_store_scan(HOST) called callback %d times; "
                        "expected: 0", (int)i);
@@ -738,13 +742,9 @@ START_TEST(test_scan)
 }
 END_TEST
 
-Suite *
-core_store_suite(void)
+TEST_MAIN("core::store")
 {
-       Suite *s = suite_create("core::store");
-       TCase *tc;
-
-       tc = tcase_create("core");
+       TCase *tc = tcase_create("core");
        tcase_add_test(tc, test_store_host);
        tcase_add_test(tc, test_store_get_host);
        tcase_add_test(tc, test_store_attr);
@@ -757,10 +757,9 @@ core_store_suite(void)
        tcase_add_test(tc, test_interval);
        tcase_add_test(tc, test_scan);
        tcase_add_unchecked_fixture(tc, NULL, sdb_store_clear);
-       suite_add_tcase(s, tc);
-
-       return s;
-} /* core_store_suite */
+       ADD_TCASE(tc);
+}
+TEST_MAIN_END
 
 /* vim: set tw=78 sw=4 ts=4 noexpandtab : */