summaryrefslogtreecommitdiffstats
path: root/tests/test_echo_tcp_writev_readv.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_echo_tcp_writev_readv.c')
-rw-r--r--tests/test_echo_tcp_writev_readv.c24
1 files changed, 17 insertions, 7 deletions
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 <stdio.h>
#include <unistd.h>
-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;
}