2 * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 * @file bluetooth-agent_test.cpp
20 * @brief Unit-tests setup
23 #include <gmock/gmock.h>
24 #include <gtest/gtest.h>
28 /* ag-agent header files */
29 #include "bluetooth-ag-agent.h"
30 #include "bluetooth-ag-handler.h"
32 using ::testing::EmptyTestEventListener;
33 using ::testing::InitGoogleTest;
34 using ::testing::Test;
35 using ::testing::TestCase;
36 using ::testing::TestEventListeners;
37 using ::testing::TestInfo;
38 using ::testing::TestPartResult;
39 using ::testing::UnitTest;
41 static GMainLoop *mainloop = NULL;
43 static bt_ag_info_t* __bt_create_ag_info(void)
45 bt_ag_info_t *bt_ag_info = g_new0(bt_ag_info_t, 1);
47 bt_ag_info->rfcomm = NULL;
48 bt_ag_info->slc = NULL;
49 bt_ag_info->hfp_active = TRUE;
50 bt_ag_info->vr_blacklisted = FALSE;
51 bt_ag_info->state = HEADSET_STATE_DISCONNECTED;
52 bt_ag_info->sco_server_started = FALSE;
53 bt_ag_info->path = "dev_00_1C_43_2B_1A_E5";
55 bt_ag_info->remote_addr = g_strdup("00:1C:43:2B:1A:E5");
57 bt_ag_info->slc = g_new0(bt_ag_slconn_t, 1);
58 bt_ag_info->slc->speaker_gain = 15;
59 bt_ag_info->slc->microphone_gain = 15;
60 bt_ag_info->slc->is_nrec = TRUE;
65 static void __bt_destroy_ag_info(bt_ag_info_t *ag_info)
70 g_free(ag_info->remote_addr);
76 static gboolean timeout_func(gpointer data)
78 g_main_loop_quit((GMainLoop *)data);
82 static void wait_for_async(void)
85 mainloop = g_main_loop_new(NULL, FALSE);
87 timeout_id = g_timeout_add(2000, timeout_func, mainloop);
88 g_main_loop_run(mainloop);
89 g_source_remove(timeout_id);
93 TEST(BluetoothAGAgent_test, _bt_ag_slconn_complete) {
94 bt_ag_info_t* ag_info = __bt_create_ag_info();
96 _bt_ag_slconn_complete(ag_info);
98 /* Need to wait 2 sec for invoking callback */
101 __bt_destroy_ag_info(ag_info);
104 TEST(BluetoothAGAgent_test, _bt_ag_send_response) {
105 int ret = BT_HFP_AGENT_ERROR_NONE;
106 bt_ag_info_t* ag_info = __bt_create_ag_info();
108 ret = _bt_ag_send_response(ag_info, HFP_STATE_MNGR_ERR_NONE);
109 ASSERT_TRUE(ret == BT_HFP_AGENT_ERROR_NONE);
111 ret = _bt_ag_send_response(ag_info, HFP_STATE_MNGR_ERR_NO_NETWORK_SERVICE);
112 ASSERT_TRUE(ret == BT_HFP_AGENT_ERROR_NONE);
114 ret = _bt_ag_send_response(ag_info, HFP_STATE_MNGR_ERR_AG_FAILURE);
115 ASSERT_TRUE(ret == BT_HFP_AGENT_ERROR_NONE);
117 ag_info->slc->is_cme_enabled = TRUE;
119 ret = _bt_ag_send_response(ag_info, HFP_STATE_MNGR_ERR_NO_NETWORK_SERVICE);
120 ASSERT_TRUE(ret == BT_HFP_AGENT_ERROR_NONE);
122 __bt_destroy_ag_info(ag_info);
125 TEST(BluetoothAGAgent_test, _bt_hfp_call_hold_request) {
126 const char *cmd = "AT+CHLD";
127 bt_ag_info_t* ag_info = __bt_create_ag_info();
129 _bt_hfp_call_hold_request(cmd, ag_info);
131 __bt_destroy_ag_info(ag_info);
134 TEST(BluetoothAGAgent_test, _bt_hfp_key_press_request) {
135 const char *cmd = "AT+CKPD";
136 bt_ag_info_t* ag_info = __bt_create_ag_info();
138 _bt_hfp_key_press_request(cmd, ag_info);
140 __bt_destroy_ag_info(ag_info);
143 TEST(BluetoothAGAgent_test, _bt_hfp_terminate_call_request) {
144 bt_ag_info_t* ag_info = __bt_create_ag_info();
146 _bt_hfp_terminate_call_request(ag_info);
148 __bt_destroy_ag_info(ag_info);
151 TEST(BluetoothAGAgent_test, _bt_hfp_answer_call_request) {
152 bt_ag_info_t* ag_info = __bt_create_ag_info();
154 _bt_hfp_answer_call_request(ag_info);
156 __bt_destroy_ag_info(ag_info);
159 TEST(BluetoothAGAgent_test, _bt_hfp_update_event_request) {
160 bt_ag_info_t* ag_info = __bt_create_ag_info();
162 _bt_hfp_update_event_request(0, ag_info);
164 _bt_hfp_update_event_request(1, ag_info);
166 __bt_destroy_ag_info(ag_info);
169 TEST(BluetoothAGAgent_test, _bt_hfp_response_and_hold_request) {
170 bt_ag_info_t* ag_info = __bt_create_ag_info();
172 _bt_hfp_response_and_hold_request(ag_info);
174 __bt_destroy_ag_info(ag_info);
177 TEST(BluetoothAGAgent_test, _bt_hfp_last_dialed_number_request) {
178 bt_ag_info_t* ag_info = __bt_create_ag_info();
180 _bt_hfp_last_dialed_number_request(ag_info);
182 __bt_destroy_ag_info(ag_info);
185 TEST(BluetoothAGAgent_test, _bt_hfp_dial_number_request) {
186 bt_ag_info_t* ag_info = __bt_create_ag_info();
187 const char *number1 = "#31#";
188 const char *number2 = "*31#";
189 const char *number3 = ">123";
190 const char *number4 = "0123456789";
192 _bt_hfp_dial_number_request(number1, ag_info);
194 _bt_hfp_dial_number_request(number2, ag_info);
196 _bt_hfp_dial_number_request(number3, ag_info);
198 _bt_hfp_dial_number_request(number4, ag_info);
200 __bt_destroy_ag_info(ag_info);
203 TEST(BluetoothAGAgent_test, _bt_hfp_channel_dtmf_request) {
204 bt_ag_info_t* ag_info = __bt_create_ag_info();
205 const char tone = '1';
207 _bt_hfp_channel_dtmf_request(tone, ag_info);
209 __bt_destroy_ag_info(ag_info);
212 TEST(BluetoothAGAgent_test, _bt_hfp_subscriber_number_request) {
213 bt_ag_info_t* ag_info = __bt_create_ag_info();
215 _bt_hfp_subscriber_number_request(ag_info);
217 __bt_destroy_ag_info(ag_info);
220 TEST(BluetoothAGAgent_test, _bt_hfp_get_operator_selection_request) {
221 bt_ag_info_t* ag_info = __bt_create_ag_info();
223 _bt_hfp_get_operator_selection_request(ag_info);
225 __bt_destroy_ag_info(ag_info);
228 TEST(BluetoothAGAgent_test, _bt_hfp_noise_red_and_echo_cancel_request) {
229 bt_ag_info_t* ag_info = __bt_create_ag_info();
231 _bt_hfp_noise_red_and_echo_cancel_request(TRUE, ag_info);
233 _bt_hfp_noise_red_and_echo_cancel_request(FALSE, ag_info);
235 __bt_destroy_ag_info(ag_info);
238 TEST(BluetoothAGAgent_test, _bt_hfp_voice_dial_request) {
239 bt_ag_info_t* ag_info = __bt_create_ag_info();
241 _bt_hfp_voice_dial_request(TRUE, ag_info);
243 _bt_hfp_voice_dial_request(FALSE, ag_info);
245 __bt_destroy_ag_info(ag_info);
248 TEST(BluetoothAGAgent_test, _bt_hfp_set_indicators) {
249 bt_ag_info_t* ag_info = __bt_create_ag_info();
251 const char *cmd = "AT+BIA=call";
253 _bt_hfp_set_indicators(cmd, ag_info);
255 __bt_destroy_ag_info(ag_info);
258 TEST(BluetoothAGAgent_test, _bt_hfp_select_phonebook_memory_status) {
259 bt_ag_info_t* ag_info = __bt_create_ag_info();
261 _bt_hfp_select_phonebook_memory_status(ag_info);
263 __bt_destroy_ag_info(ag_info);
266 TEST(BluetoothAGAgent_test, _bt_hfp_select_phonebook_memory_list) {
267 bt_ag_info_t* ag_info = __bt_create_ag_info();
269 _bt_hfp_select_phonebook_memory_list(ag_info);
271 __bt_destroy_ag_info(ag_info);
274 TEST(BluetoothAGAgent_test, _bt_hfp_select_phonebook_memory) {
275 bt_ag_info_t* ag_info = __bt_create_ag_info();
276 const char *pb_path = "user";
278 _bt_hfp_select_phonebook_memory(ag_info, pb_path);
280 __bt_destroy_ag_info(ag_info);
283 TEST(BluetoothAGAgent_test, _bt_hfp_read_phonebook_entries_list) {
284 bt_ag_info_t* ag_info = __bt_create_ag_info();
286 _bt_hfp_read_phonebook_entries_list(ag_info);
288 __bt_destroy_ag_info(ag_info);
291 TEST(BluetoothAGAgent_test, _bt_hfp_read_phonebook_entries) {
292 bt_ag_info_t* ag_info = __bt_create_ag_info();
293 const char *cmd = "AT+CPBR=1,4";
295 _bt_hfp_read_phonebook_entries(ag_info, cmd);
297 __bt_destroy_ag_info(ag_info);
300 TEST(BluetoothAGAgent_test, _bt_hfp_find_phonebook_entries_status) {
301 bt_ag_info_t* ag_info = __bt_create_ag_info();
303 _bt_hfp_find_phonebook_entries_status(ag_info);
305 __bt_destroy_ag_info(ag_info);
308 TEST(BluetoothAGAgent_test, _bt_hfp_find_phonebook_entries) {
309 bt_ag_info_t* ag_info = __bt_create_ag_info();
310 const char *cmd = "AT+CPBR=1,4";
312 _bt_hfp_find_phonebook_entries(ag_info, cmd);
314 __bt_destroy_ag_info(ag_info);
317 TEST(BluetoothAGAgent_test, _bt_hfp_get_character_set) {
318 bt_ag_info_t* ag_info = __bt_create_ag_info();
320 _bt_hfp_get_character_set(ag_info);
322 __bt_destroy_ag_info(ag_info);
325 TEST(BluetoothAGAgent_test, _bt_hfp_list_supported_character) {
326 bt_ag_info_t* ag_info = __bt_create_ag_info();
328 _bt_hfp_list_supported_character(ag_info);
330 __bt_destroy_ag_info(ag_info);
333 TEST(BluetoothAGAgent_test, _bt_hfp_set_character_set) {
334 bt_ag_info_t* ag_info = __bt_create_ag_info();
335 const char *cmd = "\"UTF-8\"";
337 _bt_hfp_set_character_set(ag_info, cmd);
339 __bt_destroy_ag_info(ag_info);
342 TEST(BluetoothAGAgent_test, _bt_hfp_get_battery_property) {
343 bt_ag_info_t* ag_info = __bt_create_ag_info();
345 _bt_hfp_get_battery_property(ag_info);
347 __bt_destroy_ag_info(ag_info);
350 TEST(BluetoothAGAgent_test, _bt_hfp_signal_quality_reply) {
351 bt_ag_info_t* ag_info = __bt_create_ag_info();
353 _bt_hfp_signal_quality_reply(1, 1, ag_info);
355 __bt_destroy_ag_info(ag_info);
358 TEST(BluetoothAGAgent_test, _bt_hfp_battery_property_reply) {
359 bt_ag_info_t* ag_info = __bt_create_ag_info();
361 _bt_hfp_battery_property_reply(ag_info, 1, 1);
363 __bt_destroy_ag_info(ag_info);
366 TEST(BluetoothAGAgent_test, _bt_hfp_operator_reply) {
367 bt_ag_info_t* ag_info = __bt_create_ag_info();
369 _bt_hfp_operator_reply("Tizen", ag_info);
371 __bt_destroy_ag_info(ag_info);
374 TEST(BluetoothAGAgent_test, _bt_ag_agent_dial_num) {
375 bt_ag_info_t* ag_info = __bt_create_ag_info();
376 int ret = BT_HFP_AGENT_ERROR_NONE;
378 ret = _bt_ag_agent_dial_num("01012345678", 0);
379 ASSERT_TRUE(ret == BT_HFP_AGENT_ERROR_NONE);
381 __bt_destroy_ag_info(ag_info);
384 TEST(BluetoothAGAgent_test, _bt_ag_agent_dial_last_num) {
385 bt_ag_info_t* ag_info = __bt_create_ag_info();
386 int ret = BT_HFP_AGENT_ERROR_NONE;
388 ret = _bt_ag_agent_dial_last_num(ag_info);
389 ASSERT_TRUE(ret == BT_HFP_AGENT_ERROR_NONE);
391 __bt_destroy_ag_info(ag_info);
394 TEST(BluetoothAGAgent_test, _bt_ag_agent_get_signal_quality) {
395 bt_ag_info_t* ag_info = __bt_create_ag_info();
396 gboolean ret = FALSE;
398 ret = _bt_ag_agent_get_signal_quality(ag_info);
399 ASSERT_TRUE(ret == TRUE);
401 __bt_destroy_ag_info(ag_info);
404 TEST(BluetoothAGAgent_test, _bt_ag_agent_get_battery_status) {
405 bt_ag_info_t* ag_info = __bt_create_ag_info();
406 gboolean ret = FALSE;
408 ret = _bt_ag_agent_get_battery_status(ag_info);
409 ASSERT_TRUE(ret == TRUE);
411 __bt_destroy_ag_info(ag_info);
414 TEST(BluetoothAGAgent_test, _bt_ag_agent_get_operator_name) {
415 bt_ag_info_t* ag_info = __bt_create_ag_info();
416 gboolean ret = FALSE;
418 ret = _bt_ag_agent_get_operator_name(ag_info);
419 ASSERT_TRUE(ret == TRUE);
421 __bt_destroy_ag_info(ag_info);
424 TEST(BluetoothAGAgent_test, _bt_hfp_agent_nrec_status) {
425 bt_ag_info_t* ag_info = __bt_create_ag_info();
426 gboolean ret = FALSE;
428 ret = _bt_hfp_agent_nrec_status(TRUE, ag_info);
429 ASSERT_TRUE(ret == TRUE);
431 ret = _bt_hfp_agent_nrec_status(FALSE, ag_info);
432 ASSERT_TRUE(ret == TRUE);
434 __bt_destroy_ag_info(ag_info);
437 TEST(BluetoothAGAgent_test, _bt_ag_agent_voice_dial) {
438 bt_ag_info_t* ag_info = __bt_create_ag_info();
439 gboolean ret = FALSE;
441 ret = _bt_ag_agent_voice_dial(FALSE);
442 ASSERT_TRUE(ret == TRUE);
444 __bt_destroy_ag_info(ag_info);
447 TEST(BluetoothAGAgent_test, _bt_list_current_calls) {
448 bt_ag_info_t* ag_info = __bt_create_ag_info();
450 _bt_list_current_calls(ag_info);
452 __bt_destroy_ag_info(ag_info);
455 TEST(BluetoothAGAgent_test, _bt_get_activity_status) {
456 bt_ag_info_t* ag_info = __bt_create_ag_info();
458 _bt_get_activity_status(ag_info);
460 __bt_destroy_ag_info(ag_info);
463 TEST(BluetoothAGAgent_test, _bt_hfp_set_property_name) {
464 const char *property1 = "OperatorNameChanged";
465 const char *property2 = "SubscriberNumberChanged";
466 const char *operator_name = "Tizen";
469 ret = _bt_hfp_set_property_name(property1, operator_name);
470 ASSERT_TRUE(ret == 1);
472 ret = _bt_hfp_set_property_name(property2, operator_name);
473 ASSERT_TRUE(ret == 1);
476 TEST(BluetoothAGAgent_test, _bt_hfp_get_imei_number_reply) {
477 bt_ag_info_t* ag_info = __bt_create_ag_info();
479 _bt_hfp_get_imei_number_reply("1234", ag_info);
481 __bt_destroy_ag_info(ag_info);
484 TEST(BluetoothAGAgent_test, _bt_hfp_get_model_info_reply) {
485 bt_ag_info_t* ag_info = __bt_create_ag_info();
487 _bt_hfp_get_model_info_reply("Tizen", ag_info);
489 __bt_destroy_ag_info(ag_info);
492 TEST(BluetoothAGAgent_test, _bt_hfp_get_device_manufacturer_reply) {
493 bt_ag_info_t* ag_info = __bt_create_ag_info();
495 _bt_hfp_get_device_manufacturer_reply("Tizen", ag_info);
497 __bt_destroy_ag_info(ag_info);
500 TEST(BluetoothAGAgent_test, _bt_hfp_get_revision_info_reply) {
501 bt_ag_info_t* ag_info = __bt_create_ag_info();
503 _bt_hfp_get_revision_info_reply("5.0", ag_info);
505 __bt_destroy_ag_info(ag_info);
508 TEST(BluetoothAGAgent_test, _bt_hfp_device_disconnected) {
509 bt_ag_info_t* ag_info = __bt_create_ag_info();
511 _bt_hfp_device_disconnected(ag_info);
513 __bt_destroy_ag_info(ag_info);
516 TEST(BluetoothAGAgent_test, _bt_hfp_get_equipment_identity) {
517 bt_ag_info_t* ag_info = __bt_create_ag_info();
518 const char *cmd1 = "AT+CGSN=?";
519 const char *cmd2 = "AT+CGSN";
520 int ret = BT_HFP_AGENT_ERROR_NONE;
522 ret = _bt_hfp_get_equipment_identity(ag_info, cmd1);
523 ASSERT_TRUE(ret == BT_HFP_AGENT_ERROR_NONE);
525 ret = _bt_hfp_get_equipment_identity(ag_info, cmd2);
526 ASSERT_TRUE(ret == BT_HFP_AGENT_ERROR_NONE);
528 __bt_destroy_ag_info(ag_info);
531 TEST(BluetoothAGAgent_test, _bt_hfp_get_model_information) {
532 bt_ag_info_t* ag_info = __bt_create_ag_info();
533 const char *cmd1 = "AT+CGMM=?";
534 const char *cmd2 = "AT+CGMM";
535 int ret = BT_HFP_AGENT_ERROR_NONE;
537 ret = _bt_hfp_get_model_information(ag_info, cmd1);
538 ASSERT_TRUE(ret == BT_HFP_AGENT_ERROR_NONE);
540 ret = _bt_hfp_get_model_information(ag_info, cmd2);
541 ASSERT_TRUE(ret == BT_HFP_AGENT_ERROR_NONE);
543 __bt_destroy_ag_info(ag_info);
546 TEST(BluetoothAGAgent_test, _bt_hfp_get_device_manufacturer) {
547 bt_ag_info_t* ag_info = __bt_create_ag_info();
548 const char *cmd1 = "AT+CGMI=?";
549 const char *cmd2 = "AT+CGMI";
550 int ret = BT_HFP_AGENT_ERROR_NONE;
552 ret = _bt_hfp_get_device_manufacturer(ag_info, cmd1);
553 ASSERT_TRUE(ret == BT_HFP_AGENT_ERROR_NONE);
555 ret = _bt_hfp_get_device_manufacturer(ag_info, cmd2);
556 ASSERT_TRUE(ret == BT_HFP_AGENT_ERROR_NONE);
558 __bt_destroy_ag_info(ag_info);
561 TEST(BluetoothAGAgent_test, _bt_hfp_get_imsi) {
562 bt_ag_info_t* ag_info = __bt_create_ag_info();
563 const char *cmd1 = "AT+IMSI=?";
564 const char *cmd2 = "AT+IMSI";
565 int ret = BT_HFP_AGENT_ERROR_NONE;
567 ret = _bt_hfp_get_imsi(ag_info, cmd1);
568 ASSERT_TRUE(ret == BT_HFP_AGENT_ERROR_NONE);
570 ret = _bt_hfp_get_imsi(ag_info, cmd2);
571 ASSERT_TRUE(ret == BT_HFP_AGENT_ERROR_NONE);
573 __bt_destroy_ag_info(ag_info);
576 TEST(BluetoothAGAgent_test, _bt_hfp_get_creg_status) {
577 bt_ag_info_t* ag_info = __bt_create_ag_info();
578 const char *cmd1 = "AT+IMSI=?";
579 const char *cmd2 = "AT+IMSI";
580 const char *cmd3 = "AT+IMSI?";
581 int ret = BT_HFP_AGENT_ERROR_NONE;
583 ret = _bt_hfp_get_creg_status(ag_info, cmd1);
584 ASSERT_TRUE(ret == BT_HFP_AGENT_ERROR_NONE);
586 ret = _bt_hfp_get_creg_status(ag_info, cmd2);
587 ASSERT_TRUE(ret == BT_HFP_AGENT_ERROR_NONE);
589 ret = _bt_hfp_get_creg_status(ag_info, cmd3);
590 ASSERT_TRUE(ret == BT_HFP_AGENT_ERROR_NONE);
592 __bt_destroy_ag_info(ag_info);
595 TEST(BluetoothAGAgent_test, _bt_hfp_get_revision_information) {
596 bt_ag_info_t* ag_info = __bt_create_ag_info();
597 const char *cmd1 = "AT+CGMR=?";
598 const char *cmd2 = "AT+CGMR";
599 int ret = BT_HFP_AGENT_ERROR_NONE;
601 ret = _bt_hfp_get_revision_information(ag_info, cmd1);
602 ASSERT_TRUE(ret == BT_HFP_AGENT_ERROR_NONE);
604 ret = _bt_hfp_get_revision_information(ag_info, cmd2);
605 ASSERT_TRUE(ret == BT_HFP_AGENT_ERROR_NONE);
607 __bt_destroy_ag_info(ag_info);
610 TEST(BluetoothAGAgent_test, _bt_hfp_get_equipment_identity_req) {
611 bt_ag_info_t* ag_info = __bt_create_ag_info();
613 _bt_hfp_get_equipment_identity_req(ag_info);
615 __bt_destroy_ag_info(ag_info);
618 TEST(BluetoothAGAgent_test, _bt_hfp_initialize_telephony_manager) {
619 uint32_t ag_features = BT_AG_FEATURE_EC_AND_NR |
620 BT_AG_FEATURE_REJECT_CALL |
621 BT_AG_FEATURE_ENHANCED_CALL_STATUS |
622 BT_AG_FEATURE_THREE_WAY_CALL |
623 BT_AG_FEATURE_EXTENDED_ERROR_RESULT_CODES |
624 BT_AG_FEATURE_CODEC_NEGOTIATION;
626 _bt_hfp_initialize_telephony_manager(ag_features);
628 _bt_hfp_deinitialize_telephony_manager();
631 TEST(BluetoothAGAgent_test, _bt_hfp_get_model_info_req) {
632 bt_ag_info_t* ag_info = __bt_create_ag_info();
634 _bt_hfp_get_model_info_req(ag_info);
636 __bt_destroy_ag_info(ag_info);
639 TEST(BluetoothAGAgent_test, _bt_hfp_get_device_manufacturer_req) {
640 bt_ag_info_t* ag_info = __bt_create_ag_info();
642 _bt_hfp_get_device_manufacturer_req(ag_info);
644 __bt_destroy_ag_info(ag_info);
647 TEST(BluetoothAGAgent_test, _bt_hfp_get_imsi_req) {
648 bt_ag_info_t* ag_info = __bt_create_ag_info();
650 _bt_hfp_get_imsi_req(ag_info);
652 __bt_destroy_ag_info(ag_info);
655 TEST(BluetoothAGAgent_test, _bt_hfp_get_creg_status_req) {
656 bt_ag_info_t* ag_info = __bt_create_ag_info();
658 _bt_hfp_get_creg_status_req(ag_info);
660 __bt_destroy_ag_info(ag_info);
663 TEST(BluetoothAGAgent_test, _bt_hfp_get_revision_info_req) {
664 bt_ag_info_t* ag_info = __bt_create_ag_info();
666 _bt_hfp_get_revision_info_req(ag_info);
668 __bt_destroy_ag_info(ag_info);
671 TEST(BluetoothAGAgent_test, _bt_hfp_is_call_exist) {
672 gboolean ret = FALSE;
674 ret = _bt_hfp_is_call_exist();
677 TEST(BluetoothAGAgent_test, _bt_hfp_release_all_calls_by_sender) {
678 const char *sender = "sender";
680 _bt_hfp_release_all_calls_by_sender(sender);
683 TEST(BluetoothAGAgent_test, _bt_hfp_get_imsi_reply) {
684 bt_ag_info_t* ag_info = __bt_create_ag_info();
686 _bt_hfp_get_imsi_reply(NULL, NULL, NULL, ag_info);
688 _bt_hfp_get_imsi_reply("mmc", "mnc", "msin", ag_info);
690 __bt_destroy_ag_info(ag_info);
693 TEST(BluetoothAGAgent_test, _bt_hfp_get_creg_status_reply) {
694 bt_ag_info_t* ag_info = __bt_create_ag_info();
696 _bt_hfp_get_creg_status_reply(1, 0, ag_info);
698 __bt_destroy_ag_info(ag_info);
701 TEST(BluetoothAGAgent_test, _bt_hfp_vendor_cmd_request) {
702 bt_ag_info_t* ag_info = __bt_create_ag_info();
703 const char *cmd = "AT+VND";
705 _bt_hfp_vendor_cmd_request(cmd, ag_info);
707 __bt_destroy_ag_info(ag_info);
710 TEST(BluetoothAGAgent_test, _bt_ag_agent_get_model_name) {
711 bt_ag_info_t* ag_info = __bt_create_ag_info();
713 _bt_ag_agent_get_model_name(ag_info);
715 __bt_destroy_ag_info(ag_info);
718 TEST(BluetoothAGAgent_test, _bt_ag_agent_get_manufacturer_name) {
719 bt_ag_info_t* ag_info = __bt_create_ag_info();
721 _bt_ag_agent_get_manufacturer_name(ag_info);
723 __bt_destroy_ag_info(ag_info);
726 TEST(BluetoothAGAgent_test, _bt_ag_agent_get_imsi) {
727 bt_ag_info_t* ag_info = __bt_create_ag_info();
729 _bt_ag_agent_get_imsi(ag_info);
731 __bt_destroy_ag_info(ag_info);
734 TEST(BluetoothAGAgent_test, _bt_ag_agent_get_creg_status) {
735 bt_ag_info_t* ag_info = __bt_create_ag_info();
737 _bt_ag_agent_get_creg_status(ag_info);
739 __bt_destroy_ag_info(ag_info);
742 TEST(BluetoothAGAgent_test, _bt_ag_agent_get_revision_information) {
743 bt_ag_info_t* ag_info = __bt_create_ag_info();
745 _bt_ag_agent_get_revision_information(ag_info);
747 __bt_destroy_ag_info(ag_info);
750 #ifdef TIZEN_FEATURE_BT_MEDIA_ENHANCE
751 TEST(BluetoothAGAgent_test, _bt_ag_agent_check_transport_state) {
752 bt_ag_info_t* ag_info = __bt_create_ag_info();
754 _bt_ag_agent_check_transport_state(ag_info);
756 __bt_destroy_ag_info(ag_info);
760 int main(int argc, char **argv) {
761 InitGoogleTest(&argc, argv);
763 return RUN_ALL_TESTS();