From: DoHyun Pyun Date: Wed, 20 Jun 2018 01:57:10 +0000 (+0900) Subject: Add testcases for ag-agent X-Git-Tag: accepted/tizen/unified/20180813.061325~13 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fconnectivity%2Fbluetooth-agent.git;a=commitdiff_plain;h=c6109d08c82582185f6d05642885edb78e53939e Add testcases for ag-agent Change-Id: Id7e394bbb0ef386e91dfaa472871b8fbd70a6933 Signed-off-by: DoHyun Pyun --- diff --git a/unittest/CMakeLists.txt b/unittest/CMakeLists.txt index 4d686db..c18abc1 100644 --- a/unittest/CMakeLists.txt +++ b/unittest/CMakeLists.txt @@ -21,26 +21,29 @@ SET(TARGET_GTEST_TESTS "gtest-bluetooth-agent") INCLUDE_DIRECTORIES(/usr/include) INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) INCLUDE_DIRECTORIES(/usr/include/glib-2.0) +INCLUDE_DIRECTORIES(/usr/include/dlog) +INCLUDE_DIRECTORIES(/usr/include/vconf) INCLUDE_DIRECTORIES(/usr/lib/glib-2.0/include/) +INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/ag-agent) SET(PREFIX ${CMAKE_INSTALL_PREFIX}) SET(EXEC_PREFIX "\${prefix}") SET(INCLUDEDIR "/usr/include") INCLUDE(FindPkgConfig) -pkg_check_modules(testpkgs REQUIRED glib-2.0 gmock) +pkg_check_modules(testpkgs REQUIRED dlog glib-2.0 gmock) SET(GTEST_TESTS_SOURCES bluetooth-agent_test.cpp ) ADD_EXECUTABLE(${TARGET_GTEST_TESTS} - ${GTEST_TESTS_SOURCES} + ${GTEST_TESTS_SOURCES} ) TARGET_LINK_LIBRARIES(${TARGET_GTEST_TESTS} - ${pkgs_LDFLAGS} - ${pkgs_LIBRARIES} + ${testpkgs_LDFLAGS} + ${testpkgs_LIBRARIES} gmock -L${CMAKE_SOURCE_DIR}/ag-agent -L${CMAKE_SOURCE_DIR}/hf-agent diff --git a/unittest/bluetooth-agent_test.cpp b/unittest/bluetooth-agent_test.cpp index 8bc7b63..f669110 100644 --- a/unittest/bluetooth-agent_test.cpp +++ b/unittest/bluetooth-agent_test.cpp @@ -25,6 +25,10 @@ #include #include +/* ag-agent header files */ +#include "bluetooth-ag-agent.h" +#include "bluetooth-ag-handler.h" + using ::testing::EmptyTestEventListener; using ::testing::InitGoogleTest; using ::testing::Test; @@ -34,6 +38,725 @@ using ::testing::TestInfo; using ::testing::TestPartResult; using ::testing::UnitTest; +static GMainLoop *mainloop = NULL; + +static bt_ag_info_t* __bt_create_ag_info(void) +{ + bt_ag_info_t *bt_ag_info = g_new0(bt_ag_info_t, 1); + + bt_ag_info->rfcomm = NULL; + bt_ag_info->slc = NULL; + bt_ag_info->hfp_active = TRUE; + bt_ag_info->vr_blacklisted = FALSE; + bt_ag_info->state = HEADSET_STATE_DISCONNECTED; + bt_ag_info->sco_server_started = FALSE; + bt_ag_info->path = "dev_00_1C_43_2B_1A_E5"; + + bt_ag_info->remote_addr = g_strdup("00:1C:43:2B:1A:E5"); + + bt_ag_info->slc = g_new0(bt_ag_slconn_t, 1); + bt_ag_info->slc->speaker_gain = 15; + bt_ag_info->slc->microphone_gain = 15; + bt_ag_info->slc->is_nrec = TRUE; + + return bt_ag_info; +} + +static void __bt_destroy_ag_info(bt_ag_info_t *ag_info) +{ + if (ag_info == NULL) + return; + + g_free(ag_info->remote_addr); + g_free(ag_info->slc); + + g_free(ag_info); +} + +static gboolean timeout_func(gpointer data) +{ + g_main_loop_quit((GMainLoop *)data); + return FALSE; +} + +static void wait_for_async(void) +{ + int timeout_id = 0; + mainloop = g_main_loop_new(NULL, FALSE); + + timeout_id = g_timeout_add(2000, timeout_func, mainloop); + g_main_loop_run(mainloop); + g_source_remove(timeout_id); +} + + +TEST(BluetoothAGAgent_test, _bt_ag_slconn_complete) { + bt_ag_info_t* ag_info = __bt_create_ag_info(); + + _bt_ag_slconn_complete(ag_info); + + /* Need to wait 2 sec for invoking callback */ + wait_for_async(); + + __bt_destroy_ag_info(ag_info); +} + +TEST(BluetoothAGAgent_test, _bt_ag_send_response) { + int ret = BT_HFP_AGENT_ERROR_NONE; + bt_ag_info_t* ag_info = __bt_create_ag_info(); + + ret = _bt_ag_send_response(ag_info, HFP_STATE_MNGR_ERR_NONE); + ASSERT_TRUE(ret == BT_HFP_AGENT_ERROR_NONE); + + ret = _bt_ag_send_response(ag_info, HFP_STATE_MNGR_ERR_NO_NETWORK_SERVICE); + ASSERT_TRUE(ret == BT_HFP_AGENT_ERROR_NONE); + + ret = _bt_ag_send_response(ag_info, HFP_STATE_MNGR_ERR_AG_FAILURE); + ASSERT_TRUE(ret == BT_HFP_AGENT_ERROR_NONE); + + ag_info->slc->is_cme_enabled = TRUE; + + ret = _bt_ag_send_response(ag_info, HFP_STATE_MNGR_ERR_NO_NETWORK_SERVICE); + ASSERT_TRUE(ret == BT_HFP_AGENT_ERROR_NONE); + + __bt_destroy_ag_info(ag_info); +} + +TEST(BluetoothAGAgent_test, _bt_hfp_call_hold_request) { + const char *cmd = "AT+CHLD"; + bt_ag_info_t* ag_info = __bt_create_ag_info(); + + _bt_hfp_call_hold_request(cmd, ag_info); + + __bt_destroy_ag_info(ag_info); +} + +TEST(BluetoothAGAgent_test, _bt_hfp_key_press_request) { + const char *cmd = "AT+CKPD"; + bt_ag_info_t* ag_info = __bt_create_ag_info(); + + _bt_hfp_key_press_request(cmd, ag_info); + + __bt_destroy_ag_info(ag_info); +} + +TEST(BluetoothAGAgent_test, _bt_hfp_terminate_call_request) { + bt_ag_info_t* ag_info = __bt_create_ag_info(); + + _bt_hfp_terminate_call_request(ag_info); + + __bt_destroy_ag_info(ag_info); +} + +TEST(BluetoothAGAgent_test, _bt_hfp_answer_call_request) { + bt_ag_info_t* ag_info = __bt_create_ag_info(); + + _bt_hfp_answer_call_request(ag_info); + + __bt_destroy_ag_info(ag_info); +} + +TEST(BluetoothAGAgent_test, _bt_hfp_update_event_request) { + bt_ag_info_t* ag_info = __bt_create_ag_info(); + + _bt_hfp_update_event_request(0, ag_info); + + _bt_hfp_update_event_request(1, ag_info); + + __bt_destroy_ag_info(ag_info); +} + +TEST(BluetoothAGAgent_test, _bt_hfp_response_and_hold_request) { + bt_ag_info_t* ag_info = __bt_create_ag_info(); + + _bt_hfp_response_and_hold_request(ag_info); + + __bt_destroy_ag_info(ag_info); +} + +TEST(BluetoothAGAgent_test, _bt_hfp_last_dialed_number_request) { + bt_ag_info_t* ag_info = __bt_create_ag_info(); + + _bt_hfp_last_dialed_number_request(ag_info); + + __bt_destroy_ag_info(ag_info); +} + +TEST(BluetoothAGAgent_test, _bt_hfp_dial_number_request) { + bt_ag_info_t* ag_info = __bt_create_ag_info(); + const char *number1 = "#31#"; + const char *number2 = "*31#"; + const char *number3 = ">123"; + const char *number4 = "0123456789"; + + _bt_hfp_dial_number_request(number1, ag_info); + + _bt_hfp_dial_number_request(number2, ag_info); + + _bt_hfp_dial_number_request(number3, ag_info); + + _bt_hfp_dial_number_request(number4, ag_info); + + __bt_destroy_ag_info(ag_info); +} + +TEST(BluetoothAGAgent_test, _bt_hfp_channel_dtmf_request) { + bt_ag_info_t* ag_info = __bt_create_ag_info(); + const char tone = '1'; + + _bt_hfp_channel_dtmf_request(tone, ag_info); + + __bt_destroy_ag_info(ag_info); +} + +TEST(BluetoothAGAgent_test, _bt_hfp_subscriber_number_request) { + bt_ag_info_t* ag_info = __bt_create_ag_info(); + + _bt_hfp_subscriber_number_request(ag_info); + + __bt_destroy_ag_info(ag_info); +} + +TEST(BluetoothAGAgent_test, _bt_hfp_get_operator_selection_request) { + bt_ag_info_t* ag_info = __bt_create_ag_info(); + + _bt_hfp_get_operator_selection_request(ag_info); + + __bt_destroy_ag_info(ag_info); +} + +TEST(BluetoothAGAgent_test, _bt_hfp_noise_red_and_echo_cancel_request) { + bt_ag_info_t* ag_info = __bt_create_ag_info(); + + _bt_hfp_noise_red_and_echo_cancel_request(TRUE, ag_info); + + _bt_hfp_noise_red_and_echo_cancel_request(FALSE, ag_info); + + __bt_destroy_ag_info(ag_info); +} + +TEST(BluetoothAGAgent_test, _bt_hfp_voice_dial_request) { + bt_ag_info_t* ag_info = __bt_create_ag_info(); + + _bt_hfp_voice_dial_request(TRUE, ag_info); + + _bt_hfp_voice_dial_request(FALSE, ag_info); + + __bt_destroy_ag_info(ag_info); +} + +TEST(BluetoothAGAgent_test, _bt_hfp_set_indicators) { + bt_ag_info_t* ag_info = __bt_create_ag_info(); + + const char *cmd = "AT+BIA=call"; + + _bt_hfp_set_indicators(cmd, ag_info); + + __bt_destroy_ag_info(ag_info); +} + +TEST(BluetoothAGAgent_test, _bt_hfp_select_phonebook_memory_status) { + bt_ag_info_t* ag_info = __bt_create_ag_info(); + + _bt_hfp_select_phonebook_memory_status(ag_info); + + __bt_destroy_ag_info(ag_info); +} + +TEST(BluetoothAGAgent_test, _bt_hfp_select_phonebook_memory_list) { + bt_ag_info_t* ag_info = __bt_create_ag_info(); + + _bt_hfp_select_phonebook_memory_list(ag_info); + + __bt_destroy_ag_info(ag_info); +} + +TEST(BluetoothAGAgent_test, _bt_hfp_select_phonebook_memory) { + bt_ag_info_t* ag_info = __bt_create_ag_info(); + const char *pb_path = "user"; + + _bt_hfp_select_phonebook_memory(ag_info, pb_path); + + __bt_destroy_ag_info(ag_info); +} + +TEST(BluetoothAGAgent_test, _bt_hfp_read_phonebook_entries_list) { + bt_ag_info_t* ag_info = __bt_create_ag_info(); + + _bt_hfp_read_phonebook_entries_list(ag_info); + + __bt_destroy_ag_info(ag_info); +} + +TEST(BluetoothAGAgent_test, _bt_hfp_read_phonebook_entries) { + bt_ag_info_t* ag_info = __bt_create_ag_info(); + const char *cmd = "AT+CPBR=1,4"; + + _bt_hfp_read_phonebook_entries(ag_info, cmd); + + __bt_destroy_ag_info(ag_info); +} + +TEST(BluetoothAGAgent_test, _bt_hfp_find_phonebook_entries_status) { + bt_ag_info_t* ag_info = __bt_create_ag_info(); + + _bt_hfp_find_phonebook_entries_status(ag_info); + + __bt_destroy_ag_info(ag_info); +} + +TEST(BluetoothAGAgent_test, _bt_hfp_find_phonebook_entries) { + bt_ag_info_t* ag_info = __bt_create_ag_info(); + const char *cmd = "AT+CPBR=1,4"; + + _bt_hfp_find_phonebook_entries(ag_info, cmd); + + __bt_destroy_ag_info(ag_info); +} + +TEST(BluetoothAGAgent_test, _bt_hfp_get_character_set) { + bt_ag_info_t* ag_info = __bt_create_ag_info(); + + _bt_hfp_get_character_set(ag_info); + + __bt_destroy_ag_info(ag_info); +} + +TEST(BluetoothAGAgent_test, _bt_hfp_list_supported_character) { + bt_ag_info_t* ag_info = __bt_create_ag_info(); + + _bt_hfp_list_supported_character(ag_info); + + __bt_destroy_ag_info(ag_info); +} + +TEST(BluetoothAGAgent_test, _bt_hfp_set_character_set) { + bt_ag_info_t* ag_info = __bt_create_ag_info(); + const char *cmd = "\"UTF-8\""; + + _bt_hfp_set_character_set(ag_info, cmd); + + __bt_destroy_ag_info(ag_info); +} + +TEST(BluetoothAGAgent_test, _bt_hfp_get_battery_property) { + bt_ag_info_t* ag_info = __bt_create_ag_info(); + + _bt_hfp_get_battery_property(ag_info); + + __bt_destroy_ag_info(ag_info); +} + +TEST(BluetoothAGAgent_test, _bt_hfp_signal_quality_reply) { + bt_ag_info_t* ag_info = __bt_create_ag_info(); + + _bt_hfp_signal_quality_reply(1, 1, ag_info); + + __bt_destroy_ag_info(ag_info); +} + +TEST(BluetoothAGAgent_test, _bt_hfp_battery_property_reply) { + bt_ag_info_t* ag_info = __bt_create_ag_info(); + + _bt_hfp_battery_property_reply(ag_info, 1, 1); + + __bt_destroy_ag_info(ag_info); +} + +TEST(BluetoothAGAgent_test, _bt_hfp_operator_reply) { + bt_ag_info_t* ag_info = __bt_create_ag_info(); + + _bt_hfp_operator_reply("Tizen", ag_info); + + __bt_destroy_ag_info(ag_info); +} + +TEST(BluetoothAGAgent_test, _bt_ag_agent_dial_num) { + bt_ag_info_t* ag_info = __bt_create_ag_info(); + int ret = BT_HFP_AGENT_ERROR_NONE; + + ret = _bt_ag_agent_dial_num("01012345678", 0); + ASSERT_TRUE(ret == BT_HFP_AGENT_ERROR_NONE); + + __bt_destroy_ag_info(ag_info); +} + +TEST(BluetoothAGAgent_test, _bt_ag_agent_dial_last_num) { + bt_ag_info_t* ag_info = __bt_create_ag_info(); + int ret = BT_HFP_AGENT_ERROR_NONE; + + ret = _bt_ag_agent_dial_last_num(ag_info); + ASSERT_TRUE(ret == BT_HFP_AGENT_ERROR_NONE); + + __bt_destroy_ag_info(ag_info); +} + +TEST(BluetoothAGAgent_test, _bt_ag_agent_get_signal_quality) { + bt_ag_info_t* ag_info = __bt_create_ag_info(); + gboolean ret = FALSE; + + ret = _bt_ag_agent_get_signal_quality(ag_info); + ASSERT_TRUE(ret == TRUE); + + __bt_destroy_ag_info(ag_info); +} + +TEST(BluetoothAGAgent_test, _bt_ag_agent_get_battery_status) { + bt_ag_info_t* ag_info = __bt_create_ag_info(); + gboolean ret = FALSE; + + ret = _bt_ag_agent_get_battery_status(ag_info); + ASSERT_TRUE(ret == TRUE); + + __bt_destroy_ag_info(ag_info); +} + +TEST(BluetoothAGAgent_test, _bt_ag_agent_get_operator_name) { + bt_ag_info_t* ag_info = __bt_create_ag_info(); + gboolean ret = FALSE; + + ret = _bt_ag_agent_get_operator_name(ag_info); + ASSERT_TRUE(ret == TRUE); + + __bt_destroy_ag_info(ag_info); +} + +TEST(BluetoothAGAgent_test, _bt_hfp_agent_nrec_status) { + bt_ag_info_t* ag_info = __bt_create_ag_info(); + gboolean ret = FALSE; + + ret = _bt_hfp_agent_nrec_status(TRUE, ag_info); + ASSERT_TRUE(ret == TRUE); + + ret = _bt_hfp_agent_nrec_status(FALSE, ag_info); + ASSERT_TRUE(ret == TRUE); + + __bt_destroy_ag_info(ag_info); +} + +TEST(BluetoothAGAgent_test, _bt_ag_agent_voice_dial) { + bt_ag_info_t* ag_info = __bt_create_ag_info(); + gboolean ret = FALSE; + + ret = _bt_ag_agent_voice_dial(FALSE); + ASSERT_TRUE(ret == TRUE); + + __bt_destroy_ag_info(ag_info); +} + +TEST(BluetoothAGAgent_test, _bt_list_current_calls) { + bt_ag_info_t* ag_info = __bt_create_ag_info(); + + _bt_list_current_calls(ag_info); + + __bt_destroy_ag_info(ag_info); +} + +TEST(BluetoothAGAgent_test, _bt_get_activity_status) { + bt_ag_info_t* ag_info = __bt_create_ag_info(); + + _bt_get_activity_status(ag_info); + + __bt_destroy_ag_info(ag_info); +} + +TEST(BluetoothAGAgent_test, _bt_hfp_set_property_name) { + const char *property1 = "OperatorNameChanged"; + const char *property2 = "SubscriberNumberChanged"; + const char *operator_name = "Tizen"; + int ret = 0; + + ret = _bt_hfp_set_property_name(property1, operator_name); + ASSERT_TRUE(ret == 1); + + ret = _bt_hfp_set_property_name(property2, operator_name); + ASSERT_TRUE(ret == 1); +} + +TEST(BluetoothAGAgent_test, _bt_hfp_get_imei_number_reply) { + bt_ag_info_t* ag_info = __bt_create_ag_info(); + + _bt_hfp_get_imei_number_reply("1234", ag_info); + + __bt_destroy_ag_info(ag_info); +} + +TEST(BluetoothAGAgent_test, _bt_hfp_get_model_info_reply) { + bt_ag_info_t* ag_info = __bt_create_ag_info(); + + _bt_hfp_get_model_info_reply("Tizen", ag_info); + + __bt_destroy_ag_info(ag_info); +} + +TEST(BluetoothAGAgent_test, _bt_hfp_get_device_manufacturer_reply) { + bt_ag_info_t* ag_info = __bt_create_ag_info(); + + _bt_hfp_get_device_manufacturer_reply("Tizen", ag_info); + + __bt_destroy_ag_info(ag_info); +} + +TEST(BluetoothAGAgent_test, _bt_hfp_get_revision_info_reply) { + bt_ag_info_t* ag_info = __bt_create_ag_info(); + + _bt_hfp_get_revision_info_reply("5.0", ag_info); + + __bt_destroy_ag_info(ag_info); +} + +TEST(BluetoothAGAgent_test, _bt_hfp_device_disconnected) { + bt_ag_info_t* ag_info = __bt_create_ag_info(); + + _bt_hfp_device_disconnected(ag_info); + + __bt_destroy_ag_info(ag_info); +} + +TEST(BluetoothAGAgent_test, _bt_hfp_get_equipment_identity) { + bt_ag_info_t* ag_info = __bt_create_ag_info(); + const char *cmd1 = "AT+CGSN=?"; + const char *cmd2 = "AT+CGSN"; + int ret = BT_HFP_AGENT_ERROR_NONE; + + ret = _bt_hfp_get_equipment_identity(ag_info, cmd1); + ASSERT_TRUE(ret == BT_HFP_AGENT_ERROR_NONE); + + ret = _bt_hfp_get_equipment_identity(ag_info, cmd2); + ASSERT_TRUE(ret == BT_HFP_AGENT_ERROR_NONE); + + __bt_destroy_ag_info(ag_info); +} + +TEST(BluetoothAGAgent_test, _bt_hfp_get_model_information) { + bt_ag_info_t* ag_info = __bt_create_ag_info(); + const char *cmd1 = "AT+CGMM=?"; + const char *cmd2 = "AT+CGMM"; + int ret = BT_HFP_AGENT_ERROR_NONE; + + ret = _bt_hfp_get_model_information(ag_info, cmd1); + ASSERT_TRUE(ret == BT_HFP_AGENT_ERROR_NONE); + + ret = _bt_hfp_get_model_information(ag_info, cmd2); + ASSERT_TRUE(ret == BT_HFP_AGENT_ERROR_NONE); + + __bt_destroy_ag_info(ag_info); +} + +TEST(BluetoothAGAgent_test, _bt_hfp_get_device_manufacturer) { + bt_ag_info_t* ag_info = __bt_create_ag_info(); + const char *cmd1 = "AT+CGMI=?"; + const char *cmd2 = "AT+CGMI"; + int ret = BT_HFP_AGENT_ERROR_NONE; + + ret = _bt_hfp_get_device_manufacturer(ag_info, cmd1); + ASSERT_TRUE(ret == BT_HFP_AGENT_ERROR_NONE); + + ret = _bt_hfp_get_device_manufacturer(ag_info, cmd2); + ASSERT_TRUE(ret == BT_HFP_AGENT_ERROR_NONE); + + __bt_destroy_ag_info(ag_info); +} + +TEST(BluetoothAGAgent_test, _bt_hfp_get_imsi) { + bt_ag_info_t* ag_info = __bt_create_ag_info(); + const char *cmd1 = "AT+IMSI=?"; + const char *cmd2 = "AT+IMSI"; + int ret = BT_HFP_AGENT_ERROR_NONE; + + ret = _bt_hfp_get_imsi(ag_info, cmd1); + ASSERT_TRUE(ret == BT_HFP_AGENT_ERROR_NONE); + + ret = _bt_hfp_get_imsi(ag_info, cmd2); + ASSERT_TRUE(ret == BT_HFP_AGENT_ERROR_NONE); + + __bt_destroy_ag_info(ag_info); +} + +TEST(BluetoothAGAgent_test, _bt_hfp_get_creg_status) { + bt_ag_info_t* ag_info = __bt_create_ag_info(); + const char *cmd1 = "AT+IMSI=?"; + const char *cmd2 = "AT+IMSI"; + const char *cmd3 = "AT+IMSI?"; + int ret = BT_HFP_AGENT_ERROR_NONE; + + ret = _bt_hfp_get_creg_status(ag_info, cmd1); + ASSERT_TRUE(ret == BT_HFP_AGENT_ERROR_NONE); + + ret = _bt_hfp_get_creg_status(ag_info, cmd2); + ASSERT_TRUE(ret == BT_HFP_AGENT_ERROR_NONE); + + ret = _bt_hfp_get_creg_status(ag_info, cmd3); + ASSERT_TRUE(ret == BT_HFP_AGENT_ERROR_NONE); + + __bt_destroy_ag_info(ag_info); +} + +TEST(BluetoothAGAgent_test, _bt_hfp_get_revision_information) { + bt_ag_info_t* ag_info = __bt_create_ag_info(); + const char *cmd1 = "AT+CGMR=?"; + const char *cmd2 = "AT+CGMR"; + int ret = BT_HFP_AGENT_ERROR_NONE; + + ret = _bt_hfp_get_revision_information(ag_info, cmd1); + ASSERT_TRUE(ret == BT_HFP_AGENT_ERROR_NONE); + + ret = _bt_hfp_get_revision_information(ag_info, cmd2); + ASSERT_TRUE(ret == BT_HFP_AGENT_ERROR_NONE); + + __bt_destroy_ag_info(ag_info); +} + +TEST(BluetoothAGAgent_test, _bt_hfp_get_equipment_identity_req) { + bt_ag_info_t* ag_info = __bt_create_ag_info(); + + _bt_hfp_get_equipment_identity_req(ag_info); + + __bt_destroy_ag_info(ag_info); +} + +TEST(BluetoothAGAgent_test, _bt_hfp_initialize_telephony_manager) { + uint32_t ag_features = BT_AG_FEATURE_EC_AND_NR | + BT_AG_FEATURE_REJECT_CALL | + BT_AG_FEATURE_ENHANCED_CALL_STATUS | + BT_AG_FEATURE_THREE_WAY_CALL | + BT_AG_FEATURE_EXTENDED_ERROR_RESULT_CODES | + BT_AG_FEATURE_CODEC_NEGOTIATION; + + _bt_hfp_initialize_telephony_manager(ag_features); + + _bt_hfp_deinitialize_telephony_manager(); +} + +TEST(BluetoothAGAgent_test, _bt_hfp_get_model_info_req) { + bt_ag_info_t* ag_info = __bt_create_ag_info(); + + _bt_hfp_get_model_info_req(ag_info); + + __bt_destroy_ag_info(ag_info); +} + +TEST(BluetoothAGAgent_test, _bt_hfp_get_device_manufacturer_req) { + bt_ag_info_t* ag_info = __bt_create_ag_info(); + + _bt_hfp_get_device_manufacturer_req(ag_info); + + __bt_destroy_ag_info(ag_info); +} + +TEST(BluetoothAGAgent_test, _bt_hfp_get_imsi_req) { + bt_ag_info_t* ag_info = __bt_create_ag_info(); + + _bt_hfp_get_imsi_req(ag_info); + + __bt_destroy_ag_info(ag_info); +} + +TEST(BluetoothAGAgent_test, _bt_hfp_get_creg_status_req) { + bt_ag_info_t* ag_info = __bt_create_ag_info(); + + _bt_hfp_get_creg_status_req(ag_info); + + __bt_destroy_ag_info(ag_info); +} + +TEST(BluetoothAGAgent_test, _bt_hfp_get_revision_info_req) { + bt_ag_info_t* ag_info = __bt_create_ag_info(); + + _bt_hfp_get_revision_info_req(ag_info); + + __bt_destroy_ag_info(ag_info); +} + +TEST(BluetoothAGAgent_test, _bt_hfp_is_call_exist) { + gboolean ret = FALSE; + + ret = _bt_hfp_is_call_exist(); +} + +TEST(BluetoothAGAgent_test, _bt_hfp_release_all_calls_by_sender) { + const char *sender = "sender"; + + _bt_hfp_release_all_calls_by_sender(sender); +} + +TEST(BluetoothAGAgent_test, _bt_hfp_get_imsi_reply) { + bt_ag_info_t* ag_info = __bt_create_ag_info(); + + _bt_hfp_get_imsi_reply(NULL, NULL, NULL, ag_info); + + _bt_hfp_get_imsi_reply("mmc", "mnc", "msin", ag_info); + + __bt_destroy_ag_info(ag_info); +} + +TEST(BluetoothAGAgent_test, _bt_hfp_get_creg_status_reply) { + bt_ag_info_t* ag_info = __bt_create_ag_info(); + + _bt_hfp_get_creg_status_reply(1, 0, ag_info); + + __bt_destroy_ag_info(ag_info); +} + +TEST(BluetoothAGAgent_test, _bt_hfp_vendor_cmd_request) { + bt_ag_info_t* ag_info = __bt_create_ag_info(); + const char *cmd = "AT+VND"; + + _bt_hfp_vendor_cmd_request(cmd, ag_info); + + __bt_destroy_ag_info(ag_info); +} + +TEST(BluetoothAGAgent_test, _bt_ag_agent_get_model_name) { + bt_ag_info_t* ag_info = __bt_create_ag_info(); + + _bt_ag_agent_get_model_name(ag_info); + + __bt_destroy_ag_info(ag_info); +} + +TEST(BluetoothAGAgent_test, _bt_ag_agent_get_manufacturer_name) { + bt_ag_info_t* ag_info = __bt_create_ag_info(); + + _bt_ag_agent_get_manufacturer_name(ag_info); + + __bt_destroy_ag_info(ag_info); +} + +TEST(BluetoothAGAgent_test, _bt_ag_agent_get_imsi) { + bt_ag_info_t* ag_info = __bt_create_ag_info(); + + _bt_ag_agent_get_imsi(ag_info); + + __bt_destroy_ag_info(ag_info); +} + +TEST(BluetoothAGAgent_test, _bt_ag_agent_get_creg_status) { + bt_ag_info_t* ag_info = __bt_create_ag_info(); + + _bt_ag_agent_get_creg_status(ag_info); + + __bt_destroy_ag_info(ag_info); +} + +TEST(BluetoothAGAgent_test, _bt_ag_agent_get_revision_information) { + bt_ag_info_t* ag_info = __bt_create_ag_info(); + + _bt_ag_agent_get_revision_information(ag_info); + + __bt_destroy_ag_info(ag_info); +} + +#ifdef TIZEN_FEATURE_BT_MEDIA_ENHANCE +TEST(BluetoothAGAgent_test, _bt_ag_agent_check_transport_state) { + bt_ag_info_t* ag_info = __bt_create_ag_info(); + + _bt_ag_agent_check_transport_state(ag_info); + + __bt_destroy_ag_info(ag_info); +} +#endif + int main(int argc, char **argv) { InitGoogleTest(&argc, argv);