Skip to content

Commit

Permalink
tests: net: websocket: Fix crash when tearing down tests
Browse files Browse the repository at this point in the history
No need to have setup and teardown functions. Teardown will
even cause crash when tearing down last IPv4 test.

Fixes #9617

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
  • Loading branch information
jukkar authored and nashif committed Aug 29, 2018
1 parent a81aad9 commit 44498e6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
8 changes: 2 additions & 6 deletions tests/net/websocket/src/main.c
Expand Up @@ -569,10 +569,6 @@ void test_v4_send_multi_msg(void)
test_send_multi_msg(&app_ctx_v4);
}

static void test_setup(void)
{
return;
}
void test_main(void)
{
ztest_test_suite(websocket,
Expand All @@ -588,7 +584,7 @@ void test_main(void)
ztest_unit_test(test_v6_send_recv_6),
ztest_unit_test(test_v6_send_recv_7),
ztest_unit_test(test_v6_send_multi_msg),
ztest_unit_test_setup_teardown(test_v6_close, test_setup, websocket_cleanup_server),
ztest_unit_test(test_v6_close),
ztest_unit_test(test_websocket_init_server),
ztest_unit_test(test_v4_init),
ztest_unit_test(test_v4_connect),
Expand All @@ -600,7 +596,7 @@ void test_main(void)
ztest_unit_test(test_v4_send_recv_6),
ztest_unit_test(test_v4_send_recv_7),
ztest_unit_test(test_v4_send_multi_msg),
ztest_unit_test_setup_teardown(test_v4_close, test_setup, websocket_cleanup_server)
ztest_unit_test(test_v4_close)
);

ztest_run_test_suite(websocket);
Expand Down
6 changes: 0 additions & 6 deletions tests/net/websocket/src/server.c
Expand Up @@ -357,9 +357,3 @@ void test_websocket_init_server(void)

ws_ctx = &http_ctx;
}

void websocket_cleanup_server(void)
{
http_server_disable(&http_ctx);
http_release(&http_ctx);
}

0 comments on commit 44498e6

Please sign in to comment.