bt_unit_test: Change the test buffer size 54/300754/1 accepted/tizen/unified/20231106.171619
authorWootak Jung <wootak.jung@samsung.com>
Thu, 2 Nov 2023 00:45:39 +0000 (09:45 +0900)
committerWootak Jung <wootak.jung@samsung.com>
Thu, 2 Nov 2023 00:45:39 +0000 (09:45 +0900)
Change-Id: I4882a9e1885044f049c267f117cdbd29543ef093
Signed-off-by: Wootak Jung <wootak.jung@samsung.com>
tests/test/bt_unit_test.c
tests/test/bt_unit_test.h

index 825a43a..d34176f 100644 (file)
@@ -2293,7 +2293,7 @@ static void __bt_socket_connection_state_changed_cb(int result,
                void *user_data)
 {
        TC_PRT("result: %s", __bt_get_error_message(result));
-       TC_PRT("connection_state: %d", connection_state);
+       TC_PRT("connection_state: %s", connection_state == BT_SOCKET_CONNECTED ? "Connected" : "Disconnected");
 
        if (connection == NULL) {
                TC_PRT("No connection data!");
@@ -2302,7 +2302,8 @@ static void __bt_socket_connection_state_changed_cb(int result,
 
        TC_PRT("socket fd: %d", connection->socket_fd);
        TC_PRT("server socket fd: %d", connection->server_fd);
-       TC_PRT("role: %d", connection->local_role);
+       TC_PRT("role: %s", connection->local_role == BT_SOCKET_SERVER ? "Server" :
+                       (connection->local_role == BT_SOCKET_CLIENT ? "Client" : "Unknown"));
        TC_PRT("remote address: %s", connection->remote_address);
        if (strcmp(spp_uuid, connection->service_uuid) == 0) {
                TC_PRT("service_uuid: %s", spp_uuid);
@@ -2319,7 +2320,7 @@ static void __bt_socket_l2cap_channel_connection_state_changed_cb(int result,
                void *user_data)
 {
        TC_PRT("result: %s", __bt_get_error_message(result));
-       TC_PRT("connection_state: %d", connection_state);
+       TC_PRT("connection_state: %s", connection_state == BT_SOCKET_CONNECTED ? "Connected" : "Disconnected");
 
        if (connection == NULL) {
                TC_PRT("No connection data!");
@@ -2328,7 +2329,8 @@ static void __bt_socket_l2cap_channel_connection_state_changed_cb(int result,
 
        TC_PRT("socket fd: %d", connection->socket_fd);
        TC_PRT("server socket fd: %d", connection->server_fd);
-       TC_PRT("role: %d", connection->local_role);
+       TC_PRT("role: %s", connection->local_role == BT_SOCKET_SERVER ? "Server" :
+                       (connection->local_role == BT_SOCKET_CLIENT ? "Client" : "Unknown"));
        TC_PRT("remote address: %s", connection->remote_address);
        TC_PRT("PSM: %d", connection->psm);
        l2cap_le_client_fd = connection->socket_fd;
@@ -3927,6 +3929,7 @@ int test_set_params(int test_id, char *param)
                        break;
                case BT_UNIT_TEST_FUNCTION_ADAPTER_LE_REGISTER_SCAN_FILTER_DEVICE_ADDRESS:
                case BT_UNIT_TEST_FUNCTION_ADAPTER_LE_REGISTER_SCAN_FILTER_DEVICE_NAME:
+               case BT_UNIT_TEST_FUNCTION_ADAPTER_LE_REGISTER_SCAN_FILTER_SERVICE_UUID:
                case BT_UNIT_TEST_FUNCTION_ADAPTER_LE_REGISTER_SCAN_FILTER_RSSI_HIGH_THRES:
                        param_count = 1;
                        TC_PRT("Input data for LE scan filter");
@@ -5970,7 +5973,12 @@ int test_input_callback(void *data)
                        if (ret != BT_ERROR_NONE)
                                TC_PRT("failed with [0x%04x]", ret);
 
-                       ret = bt_adapter_le_scan_filter_set_service_uuid(scan_filter, "1805");
+                       if (g_test_param.param_count > 0) {
+                               ret = bt_adapter_le_scan_filter_set_service_uuid(scan_filter, g_test_param.params[0]);
+                               __bt_free_test_param(&g_test_param);
+                       } else {
+                               ret = bt_adapter_le_scan_filter_set_service_uuid(scan_filter, "1805");
+                       }
                        if (ret != BT_ERROR_NONE)
                                TC_PRT("failed with [0x%04x]", ret);
 
index d36a168..e046e87 100644 (file)
@@ -24,7 +24,7 @@
 extern "C" {
 #endif
 
-#define BUFFER_LEN 49
+#define BUFFER_LEN 0xFFFF
 #define MAX_SERVICES 10
 #define PRT(format, args...) printf("%s:%d() "format, __FUNCTION__, __LINE__, ##args)
 #define TC_PRT(format, args...) PRT(format"\n", ##args)