X-Git-Url: https://git.tokkee.org/?p=sysdb.git;a=blobdiff_plain;f=t%2Funit%2Futils%2Fdbi_test.c;h=db467fdfdb0dbd08dae33b67337732ef3577bc8d;hp=1ad96d123f6b6431b87f8cfc3a83872ccc37fb1b;hb=967d9181f6329ca00b910c0c458b1c6b60f2a0d6;hpb=558bc860acedceb271ee54a19d99ccfeda67235a diff --git a/t/unit/utils/dbi_test.c b/t/unit/utils/dbi_test.c index 1ad96d1..db467fd 100644 --- a/t/unit/utils/dbi_test.c +++ b/t/unit/utils/dbi_test.c @@ -29,7 +29,7 @@ # include "config.h" #endif /* HAVE_CONFIG_H */ -#include "libsysdb_test.h" +#include "testutils.h" #include "utils/dbi.h" #include @@ -527,7 +527,7 @@ query_callback(sdb_dbi_client_t *c, user_data, TEST_MAGIC); for (i = 0; i < n; ++i) { - int expected_type = DBI_TYPE_TO_SC(current_query->field_types[i]); + int expected_type = DBI_TYPE_TO_SDB(current_query->field_types[i]); mock_data_t expected_data; fail_unless((int)data[i].type == expected_type, @@ -558,8 +558,8 @@ query_callback(sdb_dbi_client_t *c, case SDB_TYPE_DATETIME: fail_unless(data[i].data.datetime == SECS_TO_SDB_TIME(expected_data.datetime), - "query callback received unexpected data "PRIscTIME - " for column %zu; expected: "PRIscTIME, + "query callback received unexpected data "PRIsdbTIME + " for column %zu; expected: "PRIsdbTIME, data[i].data.integer, i, SECS_TO_SDB_TIME(expected_data.integer)); break; @@ -676,25 +676,16 @@ START_TEST(test_sdb_dbi_exec_query) } END_TEST -/* - * test API - */ - -Suite * -util_dbi_suite(void) +TEST_MAIN("utils::dbi") { - Suite *s = suite_create("utils::dbi"); - TCase *tc; - - tc = tcase_create("core"); + TCase *tc = tcase_create("core"); tcase_add_checked_fixture(tc, setup, teardown); tcase_add_test(tc, test_sdb_dbi_client_connect); tcase_add_test(tc, test_sdb_dbi_client_check_conn); tcase_add_test(tc, test_sdb_dbi_exec_query); - suite_add_tcase(s, tc); - - return s; -} /* util_llist_suite */ + ADD_TCASE(tc); +} +TEST_MAIN_END /* vim: set tw=78 sw=4 ts=4 noexpandtab : */