diff options
| author | Andreas Schneider <asn@samba.org> | 2015-08-06 16:08:32 +0200 |
|---|---|---|
| committer | Andreas Schneider <asn@samba.org> | 2015-08-11 13:58:22 +0200 |
| commit | 055eb78f3690008021e17da8714da9db5247308c (patch) | |
| tree | 55719919f9cdd60110be1ec3bb3a75918fd87f94 /tests/test_echo_tcp_bind.c | |
| parent | 00eb31542d26c4f4cfb245a58795fcaf5653c953 (diff) | |
tests: Migrate to new cmocka API
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'tests/test_echo_tcp_bind.c')
| -rw-r--r-- | tests/test_echo_tcp_bind.c | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/tests/test_echo_tcp_bind.c b/tests/test_echo_tcp_bind.c index b95724d..0baf0bd 100644 --- a/tests/test_echo_tcp_bind.c +++ b/tests/test_echo_tcp_bind.c @@ -19,19 +19,25 @@ #include <rpc/rpc.h> #endif -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; } -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; } -static void teardown(void **state) +static int teardown(void **state) { torture_teardown_echo_srv(state); + + return 0; } static void test_bind_ipv4(void **state) @@ -492,39 +498,39 @@ static void test_bindresvport_on_ipv6_sock_null(void **state) int main(void) { int rc; - const UnitTest tests[] = { - unit_test_setup_teardown(test_bind_ipv4, + const struct CMUnitTest tcp_bind_tests[] = { + cmocka_unit_test_setup_teardown(test_bind_ipv4, setup_echo_srv_tcp_ipv4, teardown), #if 0 /* TODO */ - unit_test_setup_teardown(test_bind_ipv4_addr_in_use, + cmocka_unit_test_setup_teardown(test_bind_ipv4_addr_in_use, setup_echo_srv_tcp_ipv4, teardown), #endif #ifdef HAVE_BINDRESVPORT - unit_test_setup_teardown(test_bindresvport_ipv4, + cmocka_unit_test_setup_teardown(test_bindresvport_ipv4, setup_echo_srv_tcp_ipv4, teardown), - unit_test_setup_teardown(test_bindresvport_ipv4_null, + cmocka_unit_test_setup_teardown(test_bindresvport_ipv4_null, setup_echo_srv_tcp_ipv4, teardown), #endif /* HAVE_BINDRESVPORT */ #ifdef HAVE_IPV6 - unit_test_setup_teardown(test_bind_on_ipv6_sock, + cmocka_unit_test_setup_teardown(test_bind_on_ipv6_sock, setup_echo_srv_tcp_ipv6, teardown), #ifdef HAVE_BINDRESVPORT - unit_test_setup_teardown(test_bindresvport_on_ipv6_sock, + cmocka_unit_test_setup_teardown(test_bindresvport_on_ipv6_sock, setup_echo_srv_tcp_ipv6, teardown), - unit_test_setup_teardown(test_bindresvport_on_ipv6_sock_null, + cmocka_unit_test_setup_teardown(test_bindresvport_on_ipv6_sock_null, setup_echo_srv_tcp_ipv6, teardown), #endif /* HAVE_BINDRESVPORT */ #endif /* HAVE_IPV6 */ }; - rc = run_tests(tests); + rc = cmocka_run_group_tests(tcp_bind_tests, NULL, NULL); return rc; } |
