* @brief Unit-tests setup
*/
-#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include <unistd.h>
#include <glib.h>
+#include <sys/time.h>
/* ag-agent header files */
#include "bluetooth-ag-agent.h"
#include "bluetooth-ag-handler.h"
-using ::testing::EmptyTestEventListener;
-using ::testing::InitGoogleTest;
-using ::testing::Test;
-using ::testing::TestCase;
-using ::testing::TestEventListeners;
-using ::testing::TestInfo;
-using ::testing::TestPartResult;
-using ::testing::UnitTest;
+/* hid-agent header files */
+#include "bluetooth-hid-agent.h"
+#include "bluetooth-hid-manager.h"
+
+/* ipsp-agent header files */
+#include "bluetooth-ipsp-agent.h"
+
+/* map-agent header files */
+#include "bluetooth_map_agent.h"
+#include "bluetooth_map_email.h"
+#include "bluetooth_map_sms.h"
+
+/* pb-agent header files */
+#include "bluetooth_pb_vcard.h"
static GMainLoop *mainloop = NULL;
+
+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);
+}
+
+/* Functions for ag-agent */
static bt_ag_info_t* __bt_create_ag_info(void)
{
bt_ag_info_t *bt_ag_info = g_new0(bt_ag_info_t, 1);
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();
int ret = BT_HFP_AGENT_ERROR_NONE;
bt_ag_info_t* ag_info = __bt_create_ag_info();
+ /* Negative test case : no device is connected */
ret = _bt_ag_send_response(ag_info, HFP_STATE_MNGR_ERR_NONE);
- ASSERT_TRUE(ret == BT_HFP_AGENT_ERROR_NONE);
+ ASSERT_TRUE(ret != BT_HFP_AGENT_ERROR_NONE);
+ /* Negative test case : no device is connected */
ret = _bt_ag_send_response(ag_info, HFP_STATE_MNGR_ERR_NO_NETWORK_SERVICE);
- ASSERT_TRUE(ret == BT_HFP_AGENT_ERROR_NONE);
+ ASSERT_TRUE(ret != BT_HFP_AGENT_ERROR_NONE);
+ /* Negative test case : no device is connected */
ret = _bt_ag_send_response(ag_info, HFP_STATE_MNGR_ERR_AG_FAILURE);
- ASSERT_TRUE(ret == BT_HFP_AGENT_ERROR_NONE);
+ ASSERT_TRUE(ret != BT_HFP_AGENT_ERROR_NONE);
ag_info->slc->is_cme_enabled = TRUE;
+ /* Negative test case : no device is connected */
ret = _bt_ag_send_response(ag_info, HFP_STATE_MNGR_ERR_NO_NETWORK_SERVICE);
- ASSERT_TRUE(ret == BT_HFP_AGENT_ERROR_NONE);
+ ASSERT_TRUE(ret != BT_HFP_AGENT_ERROR_NONE);
__bt_destroy_ag_info(ag_info);
}
bt_ag_info_t* ag_info = __bt_create_ag_info();
int ret = BT_HFP_AGENT_ERROR_NONE;
+ /* Negative test case */
+ ret = _bt_ag_agent_dial_num(NULL, 0);
+ ASSERT_TRUE(ret == BT_HFP_AGENT_ERROR_INVALID_PARAM);
+
ret = _bt_ag_agent_dial_num("01012345678", 0);
ASSERT_TRUE(ret == BT_HFP_AGENT_ERROR_NONE);
bt_ag_info_t* ag_info = __bt_create_ag_info();
int ret = BT_HFP_AGENT_ERROR_NONE;
+ /* Negative test case : No contact info */
ret = _bt_ag_agent_dial_last_num(ag_info);
- ASSERT_TRUE(ret == BT_HFP_AGENT_ERROR_NONE);
+ ASSERT_TRUE(ret != BT_HFP_AGENT_ERROR_NONE);
__bt_destroy_ag_info(ag_info);
}
const char *cmd2 = "AT+CGSN";
int ret = BT_HFP_AGENT_ERROR_NONE;
+ /* Negative test case */
ret = _bt_hfp_get_equipment_identity(ag_info, cmd1);
- ASSERT_TRUE(ret == BT_HFP_AGENT_ERROR_NONE);
+ 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);
const char *cmd2 = "AT+CGMM";
int ret = BT_HFP_AGENT_ERROR_NONE;
+ /* Negative test case : No device connected */
ret = _bt_hfp_get_model_information(ag_info, cmd1);
- ASSERT_TRUE(ret == BT_HFP_AGENT_ERROR_NONE);
+ 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);
const char *cmd2 = "AT+CGMI";
int ret = BT_HFP_AGENT_ERROR_NONE;
+ /* Negative test case */
ret = _bt_hfp_get_device_manufacturer(ag_info, cmd1);
- ASSERT_TRUE(ret == BT_HFP_AGENT_ERROR_NONE);
+ 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);
const char *cmd2 = "AT+CGMR";
int ret = BT_HFP_AGENT_ERROR_NONE;
+ /* Negative test case : No device connected */
ret = _bt_hfp_get_revision_information(ag_info, cmd1);
- ASSERT_TRUE(ret == BT_HFP_AGENT_ERROR_NONE);
+ 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);
}
#endif
+/* Functions for hid-agent */
+TEST(BluetoothHIDAgent_test, _bt_hid_disconnect_profile) {
+ bt_hid_agent_error_t ret = BT_HID_AGENT_ERROR_NONE;
+
+ /* Negative test case : no device is connected */
+ ret = _bt_hid_disconnect_profile();
+ ASSERT_TRUE(ret == BT_HID_AGENT_ERROR_INTERNAL);
+}
+
+TEST(BluetoothHIDAgent_test, _bt_hid_set_profile_state) {
+ _bt_hid_set_profile_state(BT_HID_STATE_CONNECTING);
+
+ _bt_hid_set_profile_state(BT_HID_STATE_CONNECTED);
+
+ _bt_hid_set_profile_state(BT_HID_STATE_UNAVAILABLE);
+}
+
+TEST(BluetoothHIDAgent_test, _bt_hid_get_profile_state) {
+ bt_hid_state_t state;
+
+ state = _bt_hid_get_profile_state();
+ ASSERT_TRUE(state >= BT_HID_STATE_UNAVAILABLE && state <= BT_HID_STATE_DISCONNECTING);
+}
+
+TEST(BluetoothHIDAgent_test, _bt_hid_register_application) {
+ bt_hid_agent_error_t ret = BT_HID_AGENT_ERROR_NONE;
+
+ /* Negative test case */
+ ret = _bt_hid_register_application(TRUE, NULL);
+ ASSERT_TRUE(ret == BT_HID_AGENT_ERROR_INVALID_PARAM);
+
+ ret = _bt_hid_register_application(TRUE, "Sender");
+ ASSERT_TRUE(ret == BT_HID_AGENT_ERROR_NONE);
+
+ /* Negative test case */
+ ret = _bt_hid_register_application(TRUE, "Sender");
+ ASSERT_TRUE(ret == BT_HID_AGENT_ERROR_ALREADY_EXIST);
+
+ ret = _bt_hid_register_application(FALSE, "Sender");
+ ASSERT_TRUE(ret == BT_HID_AGENT_ERROR_NONE);
+
+ /* Negative test case */
+ ret = _bt_hid_register_application(FALSE, "Sender");
+ ASSERT_TRUE(ret == BT_HID_AGENT_ERROR_NOT_AVAILABLE);
+}
+
+TEST(BluetoothHIDAgent_test, _bt_hid_get_sender_list) {
+ const GSList *senders;
+ bt_hid_agent_error_t ret = BT_HID_AGENT_ERROR_NONE;
+
+ ret = _bt_hid_register_application(TRUE, "Sender");
+ ASSERT_TRUE(ret == BT_HID_AGENT_ERROR_NONE);
+
+ senders = _bt_hid_get_sender_list();
+ ASSERT_TRUE(senders != NULL);
+
+ ret = _bt_hid_register_application(FALSE, "Sender");
+ ASSERT_TRUE(ret == BT_HID_AGENT_ERROR_NONE);
+}
+
+/* Functions for ipsp-agent */
+TEST(BluetoothIPSPAgent_test, _bt_ipsp_register_dbus) {
+ gboolean ret = FALSE;
+
+ ret = _bt_ipsp_register_dbus();
+ ASSERT_TRUE(ret == TRUE);
+}
+
+TEST(BluetoothIPSPAgent_test, _bt_ipsp_unregister_dbus) {
+ _bt_ipsp_unregister_dbus();
+}
+
+TEST(BluetoothIPSPAgent_test, _bt_ipsp_gdbus_deinit_proxys) {
+ _bt_ipsp_gdbus_deinit_proxys();
+}
+
+/* Functions for map-agent */
+static message_info_t* __bt_create_msg_info(void)
+{
+ message_info_t *bt_msg_info = g_new0(message_info_t, 1);
+
+ bt_msg_info->handle = g_strdup("1");
+ bt_msg_info->subject = g_strdup("subject");
+ bt_msg_info->datetime = g_strdup("datetime");
+ bt_msg_info->sender_name = g_strdup("sender_name");
+ bt_msg_info->sender_addressing = g_strdup("sender_addressing");
+ bt_msg_info->replyto_addressing = g_strdup("replyto_addressing");
+ bt_msg_info->recipient_name = g_strdup("recipient_name");
+ bt_msg_info->recipient_addressing = g_strdup("recipient_addressing");
+ bt_msg_info->type = g_strdup("type");
+ bt_msg_info->reception_status = g_strdup("reception_status");
+ bt_msg_info->size = g_strdup("size");
+ bt_msg_info->attachment_size = g_strdup("attachment_size");
+
+ return bt_msg_info;
+}
+
+TEST(BluetoothMAPAgent_test, _bt_mns_client_event_notify) {
+ _bt_mns_client_event_notify("MessageShift", 0,
+ "TELECOM/MSG/DELETED", "/opt/usr", "EMAIL");
+
+}
+
+TEST(BluetoothMAPAgent_test, _bt_update_id) {
+ int ret = 0;
+
+ /* Negative test case */
+ ret = _bt_update_id(0, -1, -1);
+ ASSERT_TRUE(ret == -1);
+}
+
+TEST(BluetoothMAPAgent_test, _bt_validate_msg_data) {
+ gboolean ret = FALSE;
+ message_info_t *bt_msg_info = __bt_create_msg_info();
+
+ /* Negative test case */
+ ret = _bt_validate_msg_data(NULL);
+ ASSERT_TRUE(ret == FALSE);
+
+ ret = _bt_validate_msg_data(bt_msg_info);
+ ASSERT_TRUE(ret == TRUE);
+
+ _bt_message_info_free(bt_msg_info);
+}
+
+TEST(BluetoothMAPAgent_test, _bt_message_info_free) {
+ message_info_t *bt_msg_info = __bt_create_msg_info();
+
+ _bt_message_info_free(bt_msg_info);
+}
+
+TEST(BluetoothMAPAgent_test, _get_msg_timestamp) {
+ time_t cur_time = 0;
+ struct tm new_time;
+ struct timeval tv = {0, };
+ char msg_datetime[16] = {0, };
+
+ gettimeofday(&tv, NULL);
+ cur_time = tv.tv_sec;
+
+ _get_msg_timestamp(&cur_time, msg_datetime);
+}
+
+TEST(BluetoothMAPAgent_test, _bt_add_id) {
+ guint64 map_id;
+
+ map_id = _bt_add_id(-1, BT_MAP_ID_EMAIL);
+ ASSERT_TRUE(map_id == 1);
+}
+
+TEST(BluetoothMAPAgent_test, _bt_validate_uid) {
+ guint64 map_id;
+
+ map_id = _bt_validate_uid(-1, BT_MAP_ID_EMAIL);
+ ASSERT_TRUE(map_id == 1);
+}
+
+TEST(BluetoothMAPAgent_test, is_mns_connected) {
+ gboolean ret = FALSE;
+
+ /* Negative test case */
+ ret = is_mns_connected();
+ ASSERT_TRUE(ret == FALSE);
+}
+
+TEST(BluetoothMAPAgent_test, _bt_verify_read_status) {
+ gboolean ret = FALSE;
+ message_info_t *bt_msg_info = __bt_create_msg_info();
+
+ ret = _bt_verify_read_status(bt_msg_info, FILTER_READ_STATUS_ALL);
+ _bt_message_info_free(bt_msg_info);
+ ASSERT_TRUE(ret == TRUE);
+
+ bt_msg_info = __bt_create_msg_info();
+
+ ret = _bt_verify_read_status(bt_msg_info, FILTER_READ_STATUS_READ);
+ _bt_message_info_free(bt_msg_info);
+ ASSERT_TRUE(ret == FALSE);
+}
+
+TEST(BluetoothMAPAgent_test, _bt_verify_sender) {
+ gboolean ret = FALSE;
+ message_info_t *bt_msg_info = __bt_create_msg_info();
+
+ /* Negative test case */
+ ret = _bt_verify_sender(bt_msg_info, NULL);
+ _bt_message_info_free(bt_msg_info);
+ ASSERT_TRUE(ret == TRUE);
+
+ bt_msg_info = __bt_create_msg_info();
+
+ ret = _bt_verify_sender(bt_msg_info, "*");
+ _bt_message_info_free(bt_msg_info);
+ ASSERT_TRUE(ret == TRUE);
+
+ bt_msg_info = __bt_create_msg_info();
+
+ ret = _bt_verify_sender(bt_msg_info, "sender");
+ _bt_message_info_free(bt_msg_info);
+ ASSERT_TRUE(ret == TRUE);
+
+ bt_msg_info = __bt_create_msg_info();
+
+ /* Negative test case */
+ ret = _bt_verify_sender(bt_msg_info, "negative");
+ _bt_message_info_free(bt_msg_info);
+ ASSERT_TRUE(ret == FALSE);
+}
+
+TEST(BluetoothMAPAgent_test, _bt_verify_receiver) {
+ gboolean ret = FALSE;
+ message_info_t *bt_msg_info = __bt_create_msg_info();
+
+ /* Negative test case */
+ ret = _bt_verify_receiver(bt_msg_info, NULL);
+ _bt_message_info_free(bt_msg_info);
+ ASSERT_TRUE(ret == TRUE);
+
+ bt_msg_info = __bt_create_msg_info();
+
+ ret = _bt_verify_receiver(bt_msg_info, "*");
+ _bt_message_info_free(bt_msg_info);
+ ASSERT_TRUE(ret == TRUE);
+
+ bt_msg_info = __bt_create_msg_info();
+
+ ret = _bt_verify_receiver(bt_msg_info, "receiver");
+ _bt_message_info_free(bt_msg_info);
+ ASSERT_TRUE(ret == FALSE);
+
+ bt_msg_info = __bt_create_msg_info();
+
+ /* Negative test case */
+ ret = _bt_verify_receiver(bt_msg_info, "negative");
+ _bt_message_info_free(bt_msg_info);
+ ASSERT_TRUE(ret == FALSE);
+}
+
+TEST(BluetoothMAPAgent_test, _bt_verify_time) {
+ gboolean ret = FALSE;
+ map_msg_filter_t filter = { 0, };
+ message_info_t *bt_msg_info = __bt_create_msg_info();
+
+ ret = _bt_verify_time(bt_msg_info, &filter);
+ _bt_message_info_free(bt_msg_info);
+ ASSERT_TRUE(ret == FALSE);
+}
+
+TEST(BluetoothMAPAgent_test, _bt_filter_priority) {
+ gboolean ret = FALSE;
+ map_msg_filter_t filter = { 0, };
+ message_info_t *bt_msg_info = __bt_create_msg_info();
+
+ ret = _bt_filter_priority(bt_msg_info, FILTER_PRIORITY_ALL);
+ _bt_message_info_free(bt_msg_info);
+ ASSERT_TRUE(ret == TRUE);
+
+ bt_msg_info = __bt_create_msg_info();
+
+ ret = _bt_filter_priority(bt_msg_info, FILTER_PRIORITY_HIGH);
+ _bt_message_info_free(bt_msg_info);
+ ASSERT_TRUE(ret == FALSE);
+}
+
+TEST(BluetoothMAPAgent_test, _bt_map_start_email_service) {
+ gboolean ret = FALSE;
+
+ /* Negative test case */
+ ret = _bt_map_start_email_service();
+ ASSERT_TRUE(ret == FALSE);
+}
+
+TEST(BluetoothMAPAgent_test, _bt_map_stop_email_service) {
+ gboolean ret = FALSE;
+
+ ret = _bt_map_stop_email_service();
+ ASSERT_TRUE(ret == TRUE);
+}
+
+TEST(BluetoothMAPAgent_test, _bt_map_email_get_supported_folders) {
+ gboolean ret = FALSE;
+ gboolean folders_supported[FOLDER_COUNT][MSG_TYPES] = { {FALSE, FALSE}, };
+
+ /* Negative test case */
+ ret = _bt_map_email_get_supported_folders(folders_supported);
+ ASSERT_TRUE(ret == FALSE);
+}
+
+TEST(BluetoothMAPAgent_test, _bt_map_update_mailbox) {
+ gboolean ret = FALSE;
+
+ /* Negative test case */
+ ret = _bt_map_update_mailbox("/tmp");
+ ASSERT_TRUE(ret == FALSE);
+}
+
+TEST(BluetoothMAPAgent_test, _bt_map_set_email_read_status) {
+ gboolean ret = FALSE;
+
+ /* Negative test case */
+ ret = _bt_map_set_email_read_status(-1, 0);
+ ASSERT_TRUE(ret == FALSE);
+}
+
+TEST(BluetoothMAPAgent_test, _bt_map_set_email_delete_status) {
+ gboolean ret = FALSE;
+
+ /* Negative test case */
+ ret = _bt_map_set_email_delete_status(-1, 0);
+ ASSERT_TRUE(ret == FALSE);
+}
+
+TEST(BluetoothMAPAgent_test, _bt_map_get_email_message) {
+ gboolean ret = FALSE;
+ gchar *bmseg = NULL;
+
+ /* Negative test case */
+ ret = _bt_map_get_email_message(-1, FALSE, TRUE, TRUE, &bmseg);
+ ASSERT_TRUE(ret == FALSE);
+}
+
+TEST(BluetoothMAPAgent_test, _bt_map_start_sms_service) {
+ gboolean ret = FALSE;
+
+ ret = _bt_map_start_sms_service();
+ ASSERT_TRUE(ret == TRUE);
+}
+
+TEST(BluetoothMAPAgent_test, _bt_map_stop_sms_service) {
+ gboolean ret = FALSE;
+ gchar *bmseg = NULL;
+
+ /* Negative test case */
+ _bt_map_stop_sms_service();
+ ASSERT_TRUE(ret == FALSE);
+}
+
+TEST(BluetoothMAPAgent_test, _bt_map_sms_get_supported_folders) {
+ gboolean ret = FALSE;
+ gboolean folders_supported[FOLDER_COUNT][MSG_TYPES] = { {FALSE, FALSE}, };
+
+ /* Negative test case */
+ ret = _bt_map_sms_get_supported_folders(folders_supported);
+ ASSERT_TRUE(ret == FALSE);
+}
+
+TEST(BluetoothMAPAgent_test, _bt_map_get_sms_message) {
+ gboolean ret = FALSE;
+ gchar *bmseg = NULL;
+
+ /* Negative test case */
+ ret = _bt_map_get_sms_message(-1, FALSE, TRUE, TRUE, &bmseg);
+ ASSERT_TRUE(ret == FALSE);
+}
+
+TEST(BluetoothMAPAgent_test, _bt_map_set_sms_delete_status) {
+ gboolean ret = FALSE;
+
+ /* Negative test case */
+ ret = _bt_map_set_sms_delete_status(-1, 0);
+ ASSERT_TRUE(ret == FALSE);
+}
+
+TEST(BluetoothMAPAgent_test, _bt_map_sms_set_read_status) {
+ gboolean ret = FALSE;
+
+ /* Negative test case */
+ ret = _bt_map_sms_set_read_status(-1, 0);
+ ASSERT_TRUE(ret == FALSE);
+}
+
+/* Functions for pb-agent */
+TEST(BluetoothPBAgent_test, _bluetooth_get_contact_addressbook) {
+ int ret = PBAP_ADDRESSBOOK_PHONE;
+
+ ret = _bluetooth_get_contact_addressbook(1);
+ ASSERT_TRUE(ret == PBAP_ADDRESSBOOK_PHONE);
+}
+
+TEST(BluetoothPBAgent_test, _bluetooth_pb_vcard_contact) {
+ gchar *str = NULL;
+
+ /* Negative test case */
+ str = _bluetooth_pb_vcard_contact(0, VCARD_PHOTO, VCARD_FORMAT_2_1);
+ ASSERT_TRUE(str == NULL);
+
+ /* Negative test case */
+ str = _bluetooth_pb_vcard_contact(1, VCARD_PHOTO, VCARD_FORMAT_3_0);
+ ASSERT_TRUE(str == NULL);
+}
+
+TEST(BluetoothPBAgent_test, _bluetooth_pb_vcard_contact_owner) {
+ gchar *str = NULL;
+ const char *number = "01012345678";
+
+ str = _bluetooth_pb_vcard_contact_owner(number, VCARD_PHOTO, VCARD_FORMAT_2_1);
+ ASSERT_TRUE(str != NULL);
+ g_free(str);
+
+ str = _bluetooth_pb_vcard_contact_owner(number, VCARD_PHOTO, VCARD_FORMAT_3_0);
+ ASSERT_TRUE(str != NULL);
+ g_free(str);
+}
+
+TEST(BluetoothPBAgent_test, _bluetooth_pb_vcard_call) {
+ gchar *str = NULL;
+ const char *attr = "DIALED";
+
+ /* Negative test case */
+ str = _bluetooth_pb_vcard_call(1, VCARD_PHOTO, VCARD_FORMAT_2_1, NULL);
+ ASSERT_TRUE(str == NULL);
+
+ str = _bluetooth_pb_vcard_call(1, VCARD_PHOTO, VCARD_FORMAT_2_1, attr);
+ ASSERT_TRUE(str != NULL);
+
+ g_free(str);
+}
+
+TEST(BluetoothPBAgent_test, _bluetooth_pb_fn_from_person_id) {
+ gchar *str = NULL;
+
+ /* Negative test case */
+ str = _bluetooth_pb_fn_from_person_id(1);
+ ASSERT_TRUE(str == NULL);
+}
+
+TEST(BluetoothPBAgent_test, _bluetooth_pb_name_from_person_id) {
+ gchar *str = NULL;
+
+ /* Negative test case */
+ str = _bluetooth_pb_name_from_person_id(1);
+ ASSERT_TRUE(str == NULL);
+}
+
+TEST(BluetoothPBAgent_test, _bluetooth_pb_number_from_person_id) {
+ gchar *str = NULL;
+
+ /* Negative test case */
+ str = _bluetooth_pb_number_from_person_id(1);
+ ASSERT_TRUE(str == NULL);
+}
+
+TEST(BluetoothPBAgent_test, _bluetooth_pb_fn_from_phonelog_id) {
+ gchar *str = NULL;
+
+ str = _bluetooth_pb_fn_from_phonelog_id(1);
+ ASSERT_TRUE(str != NULL);
+
+ g_free(str);
+}
+
+TEST(BluetoothPBAgent_test, _bluetooth_pb_name_from_phonelog_id) {
+ gchar *str = NULL;
+
+ str = _bluetooth_pb_name_from_phonelog_id(1);
+ ASSERT_TRUE(str != NULL);
+
+ g_free(str);
+}
+
+TEST(BluetoothPBAgent_test, _bluetooth_pb_number_from_phonelog_id) {
+ gchar *str = NULL;
+
+ /* Negative test case */
+ str = _bluetooth_pb_number_from_phonelog_id(1);
+ ASSERT_TRUE(str == NULL);
+}
+
+TEST(BluetoothPBAgent_test, _bluetooth_pb_owner_name) {
+ gchar *name = NULL;
+
+ /* Negative test case */
+ name = _bluetooth_pb_owner_name();
+ ASSERT_TRUE(name != NULL);
+ g_free(name);
+}
+
+TEST(BluetoothPBAgent_test, _bt_is_sim_addressbook) {
+ bool ret = true;
+ const char *address_book = "http://tizen.org/addressbook/sim1";
+
+ ret = _bt_is_sim_addressbook(address_book);
+ ASSERT_TRUE(ret == true);
+}
+
int main(int argc, char **argv) {
- InitGoogleTest(&argc, argv);
+ testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}