Code

t/unit/: Create one test binary for each *_test.c file.
[sysdb.git] / t / unit / core / object_test.c
index dec6d41c73a3f989e97fcd85c79e4a950908ab79..d0a78656f1f7074966d8c9a75d90ce25ab4be887 100644 (file)
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+#if HAVE_CONFIG_H
+#      include "config.h"
+#endif
+
 #include "core/object.h"
-#include "libsysdb_test.h"
+#include "testutils.h"
 
 #include <check.h>
 
@@ -275,8 +279,7 @@ START_TEST(test_obj_ref)
                        "%d time%s; expected: 0", destroy_noop_called == 1 ? "" : "2",
                        destroy_noop_called);
 
-       /* test_obj_create already checks the ref_cnt == 1 case */
-       obj->ref_cnt = 0;
+       obj->ref_cnt = 1;
        sdb_object_deref(obj);
        fail_unless(init_noop_called == 1,
                        "after some sdb_object_{de,}ref(); object's init called %d times; "
@@ -320,21 +323,16 @@ START_TEST(test_obj_cmp)
 }
 END_TEST
 
-Suite *
-core_object_suite(void)
+TEST_MAIN("core::object")
 {
-       Suite *s = suite_create("core::object");
-       TCase *tc;
-
-       tc = tcase_create("core");
+       TCase *tc = tcase_create("core");
        tcase_add_test(tc, test_obj_create);
        tcase_add_test(tc, test_obj_wrapper);
        tcase_add_test(tc, test_obj_ref);
        tcase_add_test(tc, test_obj_cmp);
-       suite_add_tcase(s, tc);
-
-       return s;
-} /* core_object_suite */
+       ADD_TCASE(tc);
+}
+TEST_MAIN_END
 
 /* vim: set tw=78 sw=4 ts=4 noexpandtab : */