f669110923f9e6121eef4b3ef1b64d438fc12a93
[platform/core/connectivity/bluetooth-agent.git] / unittest / bluetooth-agent_test.cpp
1 /*
2  * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
3  *
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
7  *
8  *        http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16 /**
17  * @file        bluetooth-agent_test.cpp
18  * @author      abc
19  * @version     1.0
20  * @brief       Unit-tests setup
21  */
22
23 #include <gmock/gmock.h>
24 #include <gtest/gtest.h>
25 #include <unistd.h>
26 #include <glib.h>
27
28 /* ag-agent header files */
29 #include "bluetooth-ag-agent.h"
30 #include "bluetooth-ag-handler.h"
31
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;
40
41 static GMainLoop *mainloop = NULL;
42
43 static bt_ag_info_t* __bt_create_ag_info(void)
44 {
45         bt_ag_info_t *bt_ag_info = g_new0(bt_ag_info_t, 1);
46
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";
54
55         bt_ag_info->remote_addr = g_strdup("00:1C:43:2B:1A:E5");
56
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;
61
62         return bt_ag_info;
63 }
64
65 static void __bt_destroy_ag_info(bt_ag_info_t *ag_info)
66 {
67         if (ag_info == NULL)
68                 return;
69
70         g_free(ag_info->remote_addr);
71         g_free(ag_info->slc);
72
73         g_free(ag_info);
74 }
75
76 static gboolean timeout_func(gpointer data)
77 {
78     g_main_loop_quit((GMainLoop *)data);
79     return FALSE;
80 }
81
82 static void wait_for_async(void)
83 {
84     int timeout_id = 0;
85     mainloop = g_main_loop_new(NULL, FALSE);
86
87     timeout_id = g_timeout_add(2000, timeout_func, mainloop);
88     g_main_loop_run(mainloop);
89     g_source_remove(timeout_id);
90 }
91
92
93 TEST(BluetoothAGAgent_test, _bt_ag_slconn_complete) {
94         bt_ag_info_t* ag_info = __bt_create_ag_info();
95
96         _bt_ag_slconn_complete(ag_info);
97
98         /* Need to wait 2 sec for invoking callback */
99         wait_for_async();
100
101         __bt_destroy_ag_info(ag_info);
102 }
103
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();
107
108         ret = _bt_ag_send_response(ag_info, HFP_STATE_MNGR_ERR_NONE);
109         ASSERT_TRUE(ret == BT_HFP_AGENT_ERROR_NONE);
110
111         ret = _bt_ag_send_response(ag_info, HFP_STATE_MNGR_ERR_NO_NETWORK_SERVICE);
112         ASSERT_TRUE(ret == BT_HFP_AGENT_ERROR_NONE);
113
114         ret = _bt_ag_send_response(ag_info, HFP_STATE_MNGR_ERR_AG_FAILURE);
115         ASSERT_TRUE(ret == BT_HFP_AGENT_ERROR_NONE);
116
117         ag_info->slc->is_cme_enabled = TRUE;
118
119         ret = _bt_ag_send_response(ag_info, HFP_STATE_MNGR_ERR_NO_NETWORK_SERVICE);
120         ASSERT_TRUE(ret == BT_HFP_AGENT_ERROR_NONE);
121
122         __bt_destroy_ag_info(ag_info);
123 }
124
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();
128
129         _bt_hfp_call_hold_request(cmd, ag_info);
130
131         __bt_destroy_ag_info(ag_info);
132 }
133
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();
137
138         _bt_hfp_key_press_request(cmd, ag_info);
139
140         __bt_destroy_ag_info(ag_info);
141 }
142
143 TEST(BluetoothAGAgent_test, _bt_hfp_terminate_call_request) {
144         bt_ag_info_t* ag_info = __bt_create_ag_info();
145
146         _bt_hfp_terminate_call_request(ag_info);
147
148         __bt_destroy_ag_info(ag_info);
149 }
150
151 TEST(BluetoothAGAgent_test, _bt_hfp_answer_call_request) {
152         bt_ag_info_t* ag_info = __bt_create_ag_info();
153
154         _bt_hfp_answer_call_request(ag_info);
155
156         __bt_destroy_ag_info(ag_info);
157 }
158
159 TEST(BluetoothAGAgent_test, _bt_hfp_update_event_request) {
160         bt_ag_info_t* ag_info = __bt_create_ag_info();
161
162         _bt_hfp_update_event_request(0, ag_info);
163
164         _bt_hfp_update_event_request(1, ag_info);
165
166         __bt_destroy_ag_info(ag_info);
167 }
168
169 TEST(BluetoothAGAgent_test, _bt_hfp_response_and_hold_request) {
170         bt_ag_info_t* ag_info = __bt_create_ag_info();
171
172         _bt_hfp_response_and_hold_request(ag_info);
173
174         __bt_destroy_ag_info(ag_info);
175 }
176
177 TEST(BluetoothAGAgent_test, _bt_hfp_last_dialed_number_request) {
178         bt_ag_info_t* ag_info = __bt_create_ag_info();
179
180         _bt_hfp_last_dialed_number_request(ag_info);
181
182         __bt_destroy_ag_info(ag_info);
183 }
184
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";
191
192         _bt_hfp_dial_number_request(number1, ag_info);
193
194         _bt_hfp_dial_number_request(number2, ag_info);
195
196         _bt_hfp_dial_number_request(number3, ag_info);
197
198         _bt_hfp_dial_number_request(number4, ag_info);
199
200         __bt_destroy_ag_info(ag_info);
201 }
202
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';
206
207         _bt_hfp_channel_dtmf_request(tone, ag_info);
208
209         __bt_destroy_ag_info(ag_info);
210 }
211
212 TEST(BluetoothAGAgent_test, _bt_hfp_subscriber_number_request) {
213         bt_ag_info_t* ag_info = __bt_create_ag_info();
214
215         _bt_hfp_subscriber_number_request(ag_info);
216
217         __bt_destroy_ag_info(ag_info);
218 }
219
220 TEST(BluetoothAGAgent_test, _bt_hfp_get_operator_selection_request) {
221         bt_ag_info_t* ag_info = __bt_create_ag_info();
222
223         _bt_hfp_get_operator_selection_request(ag_info);
224
225         __bt_destroy_ag_info(ag_info);
226 }
227
228 TEST(BluetoothAGAgent_test, _bt_hfp_noise_red_and_echo_cancel_request) {
229         bt_ag_info_t* ag_info = __bt_create_ag_info();
230
231         _bt_hfp_noise_red_and_echo_cancel_request(TRUE, ag_info);
232
233         _bt_hfp_noise_red_and_echo_cancel_request(FALSE, ag_info);
234
235         __bt_destroy_ag_info(ag_info);
236 }
237
238 TEST(BluetoothAGAgent_test, _bt_hfp_voice_dial_request) {
239         bt_ag_info_t* ag_info = __bt_create_ag_info();
240
241         _bt_hfp_voice_dial_request(TRUE, ag_info);
242
243         _bt_hfp_voice_dial_request(FALSE, ag_info);
244
245         __bt_destroy_ag_info(ag_info);
246 }
247
248 TEST(BluetoothAGAgent_test, _bt_hfp_set_indicators) {
249         bt_ag_info_t* ag_info = __bt_create_ag_info();
250
251         const char *cmd = "AT+BIA=call";
252
253         _bt_hfp_set_indicators(cmd, ag_info);
254
255         __bt_destroy_ag_info(ag_info);
256 }
257
258 TEST(BluetoothAGAgent_test, _bt_hfp_select_phonebook_memory_status) {
259         bt_ag_info_t* ag_info = __bt_create_ag_info();
260
261         _bt_hfp_select_phonebook_memory_status(ag_info);
262
263         __bt_destroy_ag_info(ag_info);
264 }
265
266 TEST(BluetoothAGAgent_test, _bt_hfp_select_phonebook_memory_list) {
267         bt_ag_info_t* ag_info = __bt_create_ag_info();
268
269         _bt_hfp_select_phonebook_memory_list(ag_info);
270
271         __bt_destroy_ag_info(ag_info);
272 }
273
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";
277
278         _bt_hfp_select_phonebook_memory(ag_info, pb_path);
279
280         __bt_destroy_ag_info(ag_info);
281 }
282
283 TEST(BluetoothAGAgent_test, _bt_hfp_read_phonebook_entries_list) {
284         bt_ag_info_t* ag_info = __bt_create_ag_info();
285
286         _bt_hfp_read_phonebook_entries_list(ag_info);
287
288         __bt_destroy_ag_info(ag_info);
289 }
290
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";
294
295         _bt_hfp_read_phonebook_entries(ag_info, cmd);
296
297         __bt_destroy_ag_info(ag_info);
298 }
299
300 TEST(BluetoothAGAgent_test, _bt_hfp_find_phonebook_entries_status) {
301         bt_ag_info_t* ag_info = __bt_create_ag_info();
302
303         _bt_hfp_find_phonebook_entries_status(ag_info);
304
305         __bt_destroy_ag_info(ag_info);
306 }
307
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";
311
312         _bt_hfp_find_phonebook_entries(ag_info, cmd);
313
314         __bt_destroy_ag_info(ag_info);
315 }
316
317 TEST(BluetoothAGAgent_test, _bt_hfp_get_character_set) {
318         bt_ag_info_t* ag_info = __bt_create_ag_info();
319
320         _bt_hfp_get_character_set(ag_info);
321
322         __bt_destroy_ag_info(ag_info);
323 }
324
325 TEST(BluetoothAGAgent_test, _bt_hfp_list_supported_character) {
326         bt_ag_info_t* ag_info = __bt_create_ag_info();
327
328         _bt_hfp_list_supported_character(ag_info);
329
330         __bt_destroy_ag_info(ag_info);
331 }
332
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\"";
336
337         _bt_hfp_set_character_set(ag_info, cmd);
338
339         __bt_destroy_ag_info(ag_info);
340 }
341
342 TEST(BluetoothAGAgent_test, _bt_hfp_get_battery_property) {
343         bt_ag_info_t* ag_info = __bt_create_ag_info();
344
345         _bt_hfp_get_battery_property(ag_info);
346
347         __bt_destroy_ag_info(ag_info);
348 }
349
350 TEST(BluetoothAGAgent_test, _bt_hfp_signal_quality_reply) {
351         bt_ag_info_t* ag_info = __bt_create_ag_info();
352
353         _bt_hfp_signal_quality_reply(1, 1, ag_info);
354
355         __bt_destroy_ag_info(ag_info);
356 }
357
358 TEST(BluetoothAGAgent_test, _bt_hfp_battery_property_reply) {
359         bt_ag_info_t* ag_info = __bt_create_ag_info();
360
361         _bt_hfp_battery_property_reply(ag_info, 1, 1);
362
363         __bt_destroy_ag_info(ag_info);
364 }
365
366 TEST(BluetoothAGAgent_test, _bt_hfp_operator_reply) {
367         bt_ag_info_t* ag_info = __bt_create_ag_info();
368
369         _bt_hfp_operator_reply("Tizen", ag_info);
370
371         __bt_destroy_ag_info(ag_info);
372 }
373
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;
377
378         ret = _bt_ag_agent_dial_num("01012345678", 0);
379         ASSERT_TRUE(ret == BT_HFP_AGENT_ERROR_NONE);
380
381         __bt_destroy_ag_info(ag_info);
382 }
383
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;
387
388         ret = _bt_ag_agent_dial_last_num(ag_info);
389         ASSERT_TRUE(ret == BT_HFP_AGENT_ERROR_NONE);
390
391         __bt_destroy_ag_info(ag_info);
392 }
393
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;
397
398         ret = _bt_ag_agent_get_signal_quality(ag_info);
399         ASSERT_TRUE(ret == TRUE);
400
401         __bt_destroy_ag_info(ag_info);
402 }
403
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;
407
408         ret = _bt_ag_agent_get_battery_status(ag_info);
409         ASSERT_TRUE(ret == TRUE);
410
411         __bt_destroy_ag_info(ag_info);
412 }
413
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;
417
418         ret = _bt_ag_agent_get_operator_name(ag_info);
419         ASSERT_TRUE(ret == TRUE);
420
421         __bt_destroy_ag_info(ag_info);
422 }
423
424 TEST(BluetoothAGAgent_test, _bt_hfp_agent_nrec_status) {
425         bt_ag_info_t* ag_info = __bt_create_ag_info();
426         gboolean ret = FALSE;
427
428         ret = _bt_hfp_agent_nrec_status(TRUE, ag_info);
429         ASSERT_TRUE(ret == TRUE);
430
431         ret = _bt_hfp_agent_nrec_status(FALSE, ag_info);
432         ASSERT_TRUE(ret == TRUE);
433
434         __bt_destroy_ag_info(ag_info);
435 }
436
437 TEST(BluetoothAGAgent_test, _bt_ag_agent_voice_dial) {
438         bt_ag_info_t* ag_info = __bt_create_ag_info();
439         gboolean ret = FALSE;
440
441         ret = _bt_ag_agent_voice_dial(FALSE);
442         ASSERT_TRUE(ret == TRUE);
443
444         __bt_destroy_ag_info(ag_info);
445 }
446
447 TEST(BluetoothAGAgent_test, _bt_list_current_calls) {
448         bt_ag_info_t* ag_info = __bt_create_ag_info();
449
450         _bt_list_current_calls(ag_info);
451
452         __bt_destroy_ag_info(ag_info);
453 }
454
455 TEST(BluetoothAGAgent_test, _bt_get_activity_status) {
456         bt_ag_info_t* ag_info = __bt_create_ag_info();
457
458         _bt_get_activity_status(ag_info);
459
460         __bt_destroy_ag_info(ag_info);
461 }
462
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";
467         int ret = 0;
468
469         ret = _bt_hfp_set_property_name(property1, operator_name);
470         ASSERT_TRUE(ret == 1);
471
472         ret = _bt_hfp_set_property_name(property2, operator_name);
473         ASSERT_TRUE(ret == 1);
474 }
475
476 TEST(BluetoothAGAgent_test, _bt_hfp_get_imei_number_reply) {
477         bt_ag_info_t* ag_info = __bt_create_ag_info();
478
479         _bt_hfp_get_imei_number_reply("1234", ag_info);
480
481         __bt_destroy_ag_info(ag_info);
482 }
483
484 TEST(BluetoothAGAgent_test, _bt_hfp_get_model_info_reply) {
485         bt_ag_info_t* ag_info = __bt_create_ag_info();
486
487         _bt_hfp_get_model_info_reply("Tizen", ag_info);
488
489         __bt_destroy_ag_info(ag_info);
490 }
491
492 TEST(BluetoothAGAgent_test, _bt_hfp_get_device_manufacturer_reply) {
493         bt_ag_info_t* ag_info = __bt_create_ag_info();
494
495         _bt_hfp_get_device_manufacturer_reply("Tizen", ag_info);
496
497         __bt_destroy_ag_info(ag_info);
498 }
499
500 TEST(BluetoothAGAgent_test, _bt_hfp_get_revision_info_reply) {
501         bt_ag_info_t* ag_info = __bt_create_ag_info();
502
503         _bt_hfp_get_revision_info_reply("5.0", ag_info);
504
505         __bt_destroy_ag_info(ag_info);
506 }
507
508 TEST(BluetoothAGAgent_test, _bt_hfp_device_disconnected) {
509         bt_ag_info_t* ag_info = __bt_create_ag_info();
510
511         _bt_hfp_device_disconnected(ag_info);
512
513         __bt_destroy_ag_info(ag_info);
514 }
515
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;
521
522         ret = _bt_hfp_get_equipment_identity(ag_info, cmd1);
523         ASSERT_TRUE(ret == BT_HFP_AGENT_ERROR_NONE);
524
525         ret = _bt_hfp_get_equipment_identity(ag_info, cmd2);
526         ASSERT_TRUE(ret == BT_HFP_AGENT_ERROR_NONE);
527
528         __bt_destroy_ag_info(ag_info);
529 }
530
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;
536
537         ret = _bt_hfp_get_model_information(ag_info, cmd1);
538         ASSERT_TRUE(ret == BT_HFP_AGENT_ERROR_NONE);
539
540         ret = _bt_hfp_get_model_information(ag_info, cmd2);
541         ASSERT_TRUE(ret == BT_HFP_AGENT_ERROR_NONE);
542
543         __bt_destroy_ag_info(ag_info);
544 }
545
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;
551
552         ret = _bt_hfp_get_device_manufacturer(ag_info, cmd1);
553         ASSERT_TRUE(ret == BT_HFP_AGENT_ERROR_NONE);
554
555         ret = _bt_hfp_get_device_manufacturer(ag_info, cmd2);
556         ASSERT_TRUE(ret == BT_HFP_AGENT_ERROR_NONE);
557
558         __bt_destroy_ag_info(ag_info);
559 }
560
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;
566
567         ret = _bt_hfp_get_imsi(ag_info, cmd1);
568         ASSERT_TRUE(ret == BT_HFP_AGENT_ERROR_NONE);
569
570         ret = _bt_hfp_get_imsi(ag_info, cmd2);
571         ASSERT_TRUE(ret == BT_HFP_AGENT_ERROR_NONE);
572
573         __bt_destroy_ag_info(ag_info);
574 }
575
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;
582
583         ret = _bt_hfp_get_creg_status(ag_info, cmd1);
584         ASSERT_TRUE(ret == BT_HFP_AGENT_ERROR_NONE);
585
586         ret = _bt_hfp_get_creg_status(ag_info, cmd2);
587         ASSERT_TRUE(ret == BT_HFP_AGENT_ERROR_NONE);
588
589         ret = _bt_hfp_get_creg_status(ag_info, cmd3);
590         ASSERT_TRUE(ret == BT_HFP_AGENT_ERROR_NONE);
591
592         __bt_destroy_ag_info(ag_info);
593 }
594
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;
600
601         ret = _bt_hfp_get_revision_information(ag_info, cmd1);
602         ASSERT_TRUE(ret == BT_HFP_AGENT_ERROR_NONE);
603
604         ret = _bt_hfp_get_revision_information(ag_info, cmd2);
605         ASSERT_TRUE(ret == BT_HFP_AGENT_ERROR_NONE);
606
607         __bt_destroy_ag_info(ag_info);
608 }
609
610 TEST(BluetoothAGAgent_test, _bt_hfp_get_equipment_identity_req) {
611         bt_ag_info_t* ag_info = __bt_create_ag_info();
612
613         _bt_hfp_get_equipment_identity_req(ag_info);
614
615         __bt_destroy_ag_info(ag_info);
616 }
617
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;
625
626         _bt_hfp_initialize_telephony_manager(ag_features);
627
628         _bt_hfp_deinitialize_telephony_manager();
629 }
630
631 TEST(BluetoothAGAgent_test, _bt_hfp_get_model_info_req) {
632         bt_ag_info_t* ag_info = __bt_create_ag_info();
633
634         _bt_hfp_get_model_info_req(ag_info);
635
636         __bt_destroy_ag_info(ag_info);
637 }
638
639 TEST(BluetoothAGAgent_test, _bt_hfp_get_device_manufacturer_req) {
640         bt_ag_info_t* ag_info = __bt_create_ag_info();
641
642         _bt_hfp_get_device_manufacturer_req(ag_info);
643
644         __bt_destroy_ag_info(ag_info);
645 }
646
647 TEST(BluetoothAGAgent_test, _bt_hfp_get_imsi_req) {
648         bt_ag_info_t* ag_info = __bt_create_ag_info();
649
650         _bt_hfp_get_imsi_req(ag_info);
651
652         __bt_destroy_ag_info(ag_info);
653 }
654
655 TEST(BluetoothAGAgent_test, _bt_hfp_get_creg_status_req) {
656         bt_ag_info_t* ag_info = __bt_create_ag_info();
657
658         _bt_hfp_get_creg_status_req(ag_info);
659
660         __bt_destroy_ag_info(ag_info);
661 }
662
663 TEST(BluetoothAGAgent_test, _bt_hfp_get_revision_info_req) {
664         bt_ag_info_t* ag_info = __bt_create_ag_info();
665
666         _bt_hfp_get_revision_info_req(ag_info);
667
668         __bt_destroy_ag_info(ag_info);
669 }
670
671 TEST(BluetoothAGAgent_test, _bt_hfp_is_call_exist) {
672         gboolean ret = FALSE;
673
674         ret = _bt_hfp_is_call_exist();
675 }
676
677 TEST(BluetoothAGAgent_test, _bt_hfp_release_all_calls_by_sender) {
678         const char *sender = "sender";
679
680         _bt_hfp_release_all_calls_by_sender(sender);
681 }
682
683 TEST(BluetoothAGAgent_test, _bt_hfp_get_imsi_reply) {
684         bt_ag_info_t* ag_info = __bt_create_ag_info();
685
686         _bt_hfp_get_imsi_reply(NULL, NULL, NULL, ag_info);
687
688         _bt_hfp_get_imsi_reply("mmc", "mnc", "msin", ag_info);
689
690         __bt_destroy_ag_info(ag_info);
691 }
692
693 TEST(BluetoothAGAgent_test, _bt_hfp_get_creg_status_reply) {
694         bt_ag_info_t* ag_info = __bt_create_ag_info();
695
696         _bt_hfp_get_creg_status_reply(1, 0, ag_info);
697
698         __bt_destroy_ag_info(ag_info);
699 }
700
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";
704
705         _bt_hfp_vendor_cmd_request(cmd, ag_info);
706
707         __bt_destroy_ag_info(ag_info);
708 }
709
710 TEST(BluetoothAGAgent_test, _bt_ag_agent_get_model_name) {
711         bt_ag_info_t* ag_info = __bt_create_ag_info();
712
713         _bt_ag_agent_get_model_name(ag_info);
714
715         __bt_destroy_ag_info(ag_info);
716 }
717
718 TEST(BluetoothAGAgent_test, _bt_ag_agent_get_manufacturer_name) {
719         bt_ag_info_t* ag_info = __bt_create_ag_info();
720
721         _bt_ag_agent_get_manufacturer_name(ag_info);
722
723         __bt_destroy_ag_info(ag_info);
724 }
725
726 TEST(BluetoothAGAgent_test, _bt_ag_agent_get_imsi) {
727         bt_ag_info_t* ag_info = __bt_create_ag_info();
728
729         _bt_ag_agent_get_imsi(ag_info);
730
731         __bt_destroy_ag_info(ag_info);
732 }
733
734 TEST(BluetoothAGAgent_test, _bt_ag_agent_get_creg_status) {
735         bt_ag_info_t* ag_info = __bt_create_ag_info();
736
737         _bt_ag_agent_get_creg_status(ag_info);
738
739         __bt_destroy_ag_info(ag_info);
740 }
741
742 TEST(BluetoothAGAgent_test, _bt_ag_agent_get_revision_information) {
743         bt_ag_info_t* ag_info = __bt_create_ag_info();
744
745         _bt_ag_agent_get_revision_information(ag_info);
746
747         __bt_destroy_ag_info(ag_info);
748 }
749
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();
753
754         _bt_ag_agent_check_transport_state(ag_info);
755
756         __bt_destroy_ag_info(ag_info);
757 }
758 #endif
759
760 int main(int argc, char **argv) {
761   InitGoogleTest(&argc, argv);
762
763   return RUN_ALL_TESTS();
764 }