Exclude coverage for map-agent
[platform/core/connectivity/bluetooth-agent.git] / map-agent / bluetooth_map_agent.c
index 3560a22..978a6e7 100644 (file)
@@ -177,6 +177,7 @@ static GVariant *__bt_map_set_delete_status(char *handle, gboolean delete_status
 static void __bt_map_noti_registration(char *remote_addr, gboolean status);
 static void __bt_map_destroy_agent(void);
 
+/* LCOV_EXCL_START */
 /* Create GError from error code and error message */
 static GError *__bt_map_error(int error_code, char *error_message)
 {
@@ -390,13 +391,14 @@ static GDBusConnection *__bt_map_get_gdbus_connection(void)
        FN_END;
        return map_dbus_conn;
 }
+/* LCOV_EXCL_STOP */
 
 gboolean is_mns_connected(void)
 {
        if (!g_mns_proxy)
                return FALSE;
        else
-               return TRUE;
+               return TRUE; /* LCOV_EXCL_LINE */
 }
 
 guint64 _bt_validate_uid(int uid, int msg_type)
@@ -413,7 +415,7 @@ guint64 _bt_validate_uid(int uid, int msg_type)
                        return info->map_id;
                }
 
-               list = g_slist_next(list);
+               list = g_slist_next(list); /* LCOV_EXCL_LINE */
        }
 
        FN_END;
@@ -448,6 +450,7 @@ guint64 _bt_add_id(int uid, int msg_type)
        return map_id;
 }
 
+/* LCOV_EXCL_START */
 static struct id_info *__bt_get_id(guint64 map_id)
 {
        FN_START;
@@ -485,6 +488,7 @@ static struct id_info *__bt_get_uid(gchar *handle)
        FN_END;
        return handle_info;
 }
+/* LCOV_EXCL_STOP */
 
 int _bt_update_id(guint64 map_id, int new_uid, int msg_type)
 {
@@ -493,6 +497,7 @@ int _bt_update_id(guint64 map_id, int new_uid, int msg_type)
        GSList *list = id_list;
 
        while (list) {
+               /* LCOV_EXCL_START */
                info = list->data;
 
                if (info->map_id == map_id) {
@@ -502,12 +507,14 @@ int _bt_update_id(guint64 map_id, int new_uid, int msg_type)
                }
 
                list = g_slist_next(list);
+               /* LCOV_EXCL_STOP */
        }
 
        FN_END;
        return -1;
 }
 
+/* LCOV_EXCL_START */
 static void __bt_remove_list(GSList *id_list)
 {
        FN_START;
@@ -518,6 +525,7 @@ static void __bt_remove_list(GSList *id_list)
        g_slist_free_full(id_list, g_free);
        FN_END;
 }
+/* LCOV_EXCL_STOP */
 
 gboolean _bt_verify_sender(message_info_t *msg_info, char *sender)
 {
@@ -588,6 +596,7 @@ void _get_msg_timestamp(time_t *ltime, char *timestamp)
        FN_END;
 }
 
+/* LCOV_EXCL_START */
 time_t _get_time_t_from_timestamp(char *timestamp)
 {
        struct tm local_time;
@@ -623,6 +632,7 @@ time_t _get_time_t_from_timestamp(char *timestamp)
        int_time = mktime(&local_time);
        return int_time;
 }
+/* LCOV_EXCL_STOP */
 
 gboolean _bt_verify_time(message_info_t *msg_info, map_msg_filter_t *filter)
 {
@@ -660,6 +670,7 @@ gboolean _bt_verify_time(message_info_t *msg_info, map_msg_filter_t *filter)
        dest |= npi & 0x0F;             \
 }
 
+/* LCOV_EXCL_START */
 static int __bt_ascii_to_upper(int ch)
 {
        return (('a' <= (ch) && (ch) <= 'z') ? ((ch) - ('a'-'A')) : (ch));
@@ -882,6 +893,7 @@ static void __bt_get_sms_sca(TapiHandle *handle, int result, void *data,
        g_sca_info->DialNumLen = scaInfo->DialNumLen;
        FN_END;
 }
+/* LCOV_EXCL_STOP */
 
 void _bt_message_info_free(gpointer data)
 {
@@ -903,6 +915,7 @@ void _bt_message_info_free(gpointer data)
        FN_END;
 }
 
+/* LCOV_EXCL_START */
 static gboolean __bluetooth_map_start_service()
 {
        FN_START;
@@ -917,6 +930,7 @@ static gboolean __bluetooth_map_start_service()
        FN_END;
        return FALSE;
 }
+/* LCOV_EXCL_STOP */
 
 static gboolean __bt_validate_utf8(char **text)
 {
@@ -924,8 +938,10 @@ static gboolean __bt_validate_utf8(char **text)
        if (g_utf8_validate(*text, -1, NULL))
                return TRUE;
 
+       /* LCOV_EXCL_START */
        FN_END;
        return FALSE;
+       /* LCOV_EXCL_STOP */
 }
 
 gboolean _bt_validate_msg_data(message_info_t *msg_info)
@@ -940,6 +956,7 @@ gboolean _bt_validate_msg_data(message_info_t *msg_info)
        if (msg_info->sender_name)
                return __bt_validate_utf8(&msg_info->sender_name);
 
+       /* LCOV_EXCL_START */
        if (msg_info->sender_addressing)
                return __bt_validate_utf8(&msg_info->sender_addressing);
 
@@ -954,8 +971,10 @@ gboolean _bt_validate_msg_data(message_info_t *msg_info)
 
        FN_END;
        return TRUE;
+       /* LCOV_EXCL_STOP */
 }
 
+/* LCOV_EXCL_START */
 static void __bt_mns_client_connect(char *address)
 {
        FN_START;
@@ -1060,6 +1079,7 @@ static void __bt_mns_client_disconnect()
        g_variant_unref(value);
        FN_END;
 }
+/* LCOV_EXCL_STOP */
 
 void _bt_mns_client_event_notify(gchar *event, guint64 handle,
                                        gchar *folder, gchar *old_folder,
@@ -1076,6 +1096,7 @@ void _bt_mns_client_event_notify(gchar *event, guint64 handle,
                return;
        }
 
+       /* LCOV_EXCL_START */
        connection = __bt_map_get_gdbus_connection();
        if (connection == NULL) {
                DBG("Could not get GDBus Connection");
@@ -1111,8 +1132,10 @@ void _bt_mns_client_event_notify(gchar *event, guint64 handle,
        g_variant_unref(value);
        g_object_unref(mns_proxy);
        FN_END;
+       /* LCOV_EXCL_STOP */
 }
 
+/* LCOV_EXCL_START */
 static gchar *__bt_get_map_folder(int folder)
 {
        switch (folder) {
@@ -1594,3 +1617,4 @@ int main(void)
        FN_END;
        return EXIT_FAILURE;
 }
+/* LCOV_EXCL_STOP */