From 9b4dea3fd57eeaeef86c173675b6a828b74b77ed Mon Sep 17 00:00:00 2001 From: Wootak Jung Date: Wed, 11 May 2022 10:38:49 +0900 Subject: [PATCH] test/bt_unit_test: Fix socket_send_data result log Change-Id: I2f00912741958a73174cde2c5cc21bda9c87f40c --- tests/test/bt_unit_test.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tests/test/bt_unit_test.c b/tests/test/bt_unit_test.c index 9b404db..a276aeb 100644 --- a/tests/test/bt_unit_test.c +++ b/tests/test/bt_unit_test.c @@ -6068,7 +6068,7 @@ int test_input_callback(void *data) if (g_test_param.param_count > 0) { ret = bt_socket_send_data(client_fd, g_test_param.params[0], - strlen(g_test_param.params[0]) + 1); + strlen(g_test_param.params[0])); __bt_free_test_param(&g_test_param); } else { @@ -6076,7 +6076,10 @@ int test_input_callback(void *data) data, sizeof(data)); } - TC_PRT("returns %s\n", __bt_get_error_message(ret)); + if (ret > 0) + TC_PRT("sending successful. size: %d\n", ret); + else + TC_PRT("sending failed. errno: %d(%s)\n", ret, strerror(ret)); break; } case BT_UNIT_TEST_FUNCTION_SOCKET_CREATE_RFCOMM_CUSTOM_UUID: { @@ -6246,7 +6249,10 @@ int test_input_callback(void *data) data, strlen(data)); } - TC_PRT("returns %d %s\n", ret, __bt_get_error_message(ret)); + if (ret > 0) + TC_PRT("sending successful. size: %d\n", ret); + else + TC_PRT("sending failed. errno: %d(%s)\n", ret, strerror(ret)); break; } case BT_UNIT_TEST_FUNCTION_SOCKET_GET_L2CAP_PSM: { -- 2.7.4