X-Git-Url: https://git.tokkee.org/?p=sysdb.git;a=blobdiff_plain;f=t%2Funit%2Futils%2Funixsock_test.c;h=6ddb6d453abf739fec49a51e13953d213b2d1e1e;hp=82a1daf7b6986a4ae4746dcfd151947a6db39aa5;hb=41730b69312c672a73f8991fec4f83a1b1d11d30;hpb=13fe0f9ec3d161fab7a015054649910541d75f5e diff --git a/t/unit/utils/unixsock_test.c b/t/unit/utils/unixsock_test.c index 82a1daf..6ddb6d4 100644 --- a/t/unit/utils/unixsock_test.c +++ b/t/unit/utils/unixsock_test.c @@ -35,7 +35,7 @@ #endif #include "utils/unixsock.h" -#include "libsysdb_test.h" +#include "testutils.h" #include @@ -104,7 +104,7 @@ mock_write(void *cookie, const char *buf, size_t size) if (last_write) free(last_write); - last_write = strdup(buf); + last_write = strndup(buf, size); ++c->pos; return (ssize_t)size; } /* mock_write */ @@ -362,22 +362,17 @@ START_TEST(test_sdb_unixsock_client_recv) } END_TEST -Suite * -util_unixsock_suite(void) +TEST_MAIN("utils::unixsock") { - Suite *s = suite_create("utils::unixsock"); - TCase *tc; - - tc = tcase_create("core"); + TCase *tc = tcase_create("core"); tcase_add_checked_fixture(tc, setup, teardown); tcase_add_test(tc, test_sdb_unixsock_client_create); tcase_add_test(tc, test_sdb_unixsock_client_connect); tcase_add_test(tc, test_sdb_unixsock_client_send); tcase_add_test(tc, test_sdb_unixsock_client_recv); - suite_add_tcase(s, tc); - - return s; -} /* util_unixsock_suite */ + ADD_TCASE(tc); +} +TEST_MAIN_END /* vim: set tw=78 sw=4 ts=4 noexpandtab : */