From 2d98e62c8803a7c2412730419104a8ccf2e30c3b Mon Sep 17 00:00:00 2001 From: Wootak Jung Date: Thu, 20 Aug 2020 13:27:52 +0900 Subject: [PATCH] Add le_is_discovering unit test Change-Id: I38d0b9bc89b7324ca59994e9ea1617ae82acbf6f Signed-off-by: Wootak Jung --- tests/test/bt_unit_test.c | 13 +++++++++++++ tests/test/bt_unit_test.h | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/tests/test/bt_unit_test.c b/tests/test/bt_unit_test.c index 4df300a..28d409b 100644 --- a/tests/test/bt_unit_test.c +++ b/tests/test/bt_unit_test.c @@ -312,6 +312,8 @@ tc_table_t tc_adapter_le[] = { , BT_UNIT_TEST_FUNCTION_ADAPTER_LE_START_SCAN}, {"bt_adapter_le_stop_scan" , BT_UNIT_TEST_FUNCTION_ADAPTER_LE_STOP_SCAN}, + {"bt_adapter_le_is_discovering" + , BT_UNIT_TEST_FUNCTION_ADAPTER_LE_IS_DISCOVERING}, {"bt_adapter_le_add_advertising_data" , BT_UNIT_TEST_FUNCTION_ADAPTER_LE_ADD_ADVERTISING_DATA}, {"bt_adapter_le_set_advertising_mode" @@ -4854,6 +4856,17 @@ int test_input_callback(void *data) break; } + case BT_UNIT_TEST_FUNCTION_ADAPTER_LE_IS_DISCOVERING: { + bool is_discovering = FALSE; + ret = bt_adapter_le_is_discovering(&is_discovering); + if (ret < BT_ERROR_NONE) + TC_PRT("returns %s\n", __bt_get_error_message(ret)); + else + TC_PRT("le_is_discovering: %d", is_discovering); + + break; + } + case BT_UNIT_TEST_FUNCTION_ADAPTER_LE_ADD_ADVERTISING_DATA: { int adv_data_type = 3; /* default all */ int manufacturer_id = 117; diff --git a/tests/test/bt_unit_test.h b/tests/test/bt_unit_test.h index 375a497..5bdc38a 100644 --- a/tests/test/bt_unit_test.h +++ b/tests/test/bt_unit_test.h @@ -116,7 +116,7 @@ typedef enum { BT_UNIT_TEST_FUNCTION_ADAPTER_LE_SET_SCAN_CUSTOMIZED, BT_UNIT_TEST_FUNCTION_ADAPTER_LE_START_SCAN, BT_UNIT_TEST_FUNCTION_ADAPTER_LE_STOP_SCAN, - BT_UNIT_TEST_FUNCTION_ADAPTER_LE_STOP_DEVICE_DISCOVERY, + BT_UNIT_TEST_FUNCTION_ADAPTER_LE_IS_DISCOVERING, BT_UNIT_TEST_FUNCTION_ADAPTER_LE_ADD_ADVERTISING_DATA, BT_UNIT_TEST_FUNCTION_ADAPTER_LE_ADD_HOGP_ADVERTISING_DATA, BT_UNIT_TEST_FUNCTION_ADAPTER_LE_SET_ADVERTISING_MODE, -- 2.7.4