From 055eb78f3690008021e17da8714da9db5247308c Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Thu, 6 Aug 2015 16:08:32 +0200 Subject: tests: Migrate to new cmocka API Signed-off-by: Andreas Schneider Reviewed-by: Stefan Metzmacher --- tests/test_echo_tcp_writev_readv.c | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) (limited to 'tests/test_echo_tcp_writev_readv.c') diff --git a/tests/test_echo_tcp_writev_readv.c b/tests/test_echo_tcp_writev_readv.c index 7a8b436..e011236 100644 --- a/tests/test_echo_tcp_writev_readv.c +++ b/tests/test_echo_tcp_writev_readv.c @@ -16,21 +16,27 @@ #include #include -static void setup_echo_srv_tcp_ipv4(void **state) +static int setup_echo_srv_tcp_ipv4(void **state) { torture_setup_echo_srv_tcp_ipv4(state); + + return 0; } #ifdef HAVE_IPV6 -static void setup_echo_srv_tcp_ipv6(void **state) +static int setup_echo_srv_tcp_ipv6(void **state) { torture_setup_echo_srv_tcp_ipv6(state); + + return 0; } #endif -static void teardown(void **state) +static int teardown(void **state) { torture_teardown_echo_srv(state); + + return 0; } static void test_writev_readv_ipv4(void **state) @@ -166,14 +172,18 @@ static void test_writev_readv_ipv6(void **state) int main(void) { int rc; - const UnitTest tests[] = { - unit_test_setup_teardown(test_writev_readv_ipv4, setup_echo_srv_tcp_ipv4, teardown), + const struct CMUnitTest tcp_writev_tests[] = { + cmocka_unit_test_setup_teardown(test_writev_readv_ipv4, + setup_echo_srv_tcp_ipv4, + teardown), #ifdef HAVE_IPV6 - unit_test_setup_teardown(test_writev_readv_ipv6, setup_echo_srv_tcp_ipv6, teardown), + cmocka_unit_test_setup_teardown(test_writev_readv_ipv6, + setup_echo_srv_tcp_ipv6, + teardown), #endif }; - rc = run_tests(tests); + rc = cmocka_run_group_tests(tcp_writev_tests, NULL, NULL); return rc; } -- cgit