Add lcov comment 52/153052/3
authorSeungha Son <seungha.son@samsung.com>
Thu, 28 Sep 2017 00:48:54 +0000 (09:48 +0900)
committerSeungha Son <seungha.son@samsung.com>
Thu, 28 Sep 2017 03:25:26 +0000 (12:25 +0900)
Signed-off-by: Seungha Son <seungha.son@samsung.com>
Change-Id: Ib4353e4a49ac753c43a3fc6fca08b9a3d87f8996

src/notification.c
src/notification_db.c
src/notification_internal.c
src/notification_ipc.c
src/notification_noti.c
src/notification_setting.c
src/notification_setting_service.c
src/notification_shared_file.c
src/notification_viewer.c

index c8b8f3a..0d5ed57 100755 (executable)
@@ -1154,17 +1154,23 @@ EXPORT_API int notification_get_launch_option(notification_h noti,
                        if (ret == APP_CONTROL_ERROR_NONE) {
                                *app_control = app_control_new;
                        } else {
+                               /* LCOV_EXCL_START */
                                app_control_destroy(app_control_new);
                                NOTIFICATION_ERR("Failed to import app control from bundle[%d]", ret);
                                return NOTIFICATION_ERROR_IO_ERROR;
+                               /* LCOV_EXCL_STOP */
                        }
                } else {
+                       /* LCOV_EXCL_START */
                        NOTIFICATION_ERR("Failed to create app control[%d]", ret);
                        return NOTIFICATION_ERROR_IO_ERROR;
+                       /* LCOV_EXCL_STOP */
                }
        } else {
+               /* LCOV_EXCL_START */
                NOTIFICATION_ERR("Failed to get execute option[%d]", ret);
                return ret;
+               /* LCOV_EXCL_STOP */
        }
 
        return NOTIFICATION_ERROR_NONE;
@@ -1216,34 +1222,42 @@ EXPORT_API int notification_get_event_handler(notification_h noti, notification_
 
        if (event_type < NOTIFICATION_EVENT_TYPE_CLICK_ON_BUTTON_1
                || event_type > NOTIFICATION_EVENT_TYPE_MAX) {
+               /* LCOV_EXCL_START */
                NOTIFICATION_ERR("Invalid event type");
                err = NOTIFICATION_ERROR_INVALID_PARAMETER;
                goto out;
+               /* LCOV_EXCL_STOP */
        }
 
        b = noti->b_event_handler[event_type];
        if (b == NULL) {
+               /* LCOV_EXCL_START */
                NOTIFICATION_ERR("No event handler");
                err = NOTIFICATION_ERROR_NOT_EXIST_ID;
                goto out;
+               /* LCOV_EXCL_STOP */
        }
 
        err = app_control_create(&app_control_new);
        if (err != APP_CONTROL_ERROR_NONE || app_control_new == NULL) {
+               /* LCOV_EXCL_START */
                NOTIFICATION_ERR("Failted to create app_control[%d]", err);
                err = NOTIFICATION_ERROR_IO_ERROR;
                goto out;
+               /* LCOV_EXCL_STOP */
        }
 
        err = app_control_import_from_bundle(app_control_new, b);
        if (err == APP_CONTROL_ERROR_NONE) {
                *event_handler = app_control_new;
        } else {
+               /* LCOV_EXCL_START */
                app_control_destroy(app_control_new);
                app_control_new = NULL;
                NOTIFICATION_ERR("Failed to import app control from bundle[%d]", err);
                err = NOTIFICATION_ERROR_IO_ERROR;
                goto out;
+               /* LCOV_EXCL_STOP */
        }
 
 out:
@@ -1451,9 +1465,11 @@ static notification_h _notification_create(notification_type_e type)
 
        noti = (notification_h)calloc(1, sizeof(struct _notification));
        if (noti == NULL) {
+               /* LCOV_EXCL_START */
                NOTIFICATION_ERR("Failed to alloc memory");
                set_last_result(NOTIFICATION_ERROR_OUT_OF_MEMORY);
                return NULL;
+               /* LCOV_EXCL_STOP */
        }
 
        noti->type = type;
@@ -1506,16 +1522,20 @@ static notification_h _notification_create(notification_type_e type)
 
                err = package_info_create(pkg_id, &package_info);
                if (err != PACKAGE_MANAGER_ERROR_NONE || package_info == NULL) {
+                       /* LCOV_EXCL_START */
                        NOTIFICATION_WARN("Failed to create package_info err[%d] pkg_id[%s]",
                                        err, pkg_id);
                        goto out;
+                       /* LCOV_EXCL_STOP */
                }
 
                err = package_info_get_root_path(package_info, &app_root_path);
                if (err != PACKAGE_MANAGER_ERROR_NONE || app_root_path == NULL) {
+                       /* LCOV_EXCL_START */
                        NOTIFICATION_WARN("Failed to get root path err[%d] path[%p]",
                                        err, app_root_path);
                        goto out;
+                       /* LCOV_EXCL_STOP */
                }
 
                snprintf(locale_directory, PATH_MAX, "%s/res/locale", app_root_path);
@@ -1572,8 +1592,10 @@ EXPORT_API int notification_clone(notification_h noti, notification_h *clone)
 
        new_noti = (notification_h) calloc(1, sizeof(struct _notification));
        if (new_noti == NULL) {
+               /* LCOV_EXCL_START */
                NOTIFICATION_ERR("Failed to alloc memory");
                return NOTIFICATION_ERROR_OUT_OF_MEMORY;
+               /* LCOV_EXCL_STOP */
        }
 
        new_noti->type = noti->type;
@@ -1893,9 +1915,11 @@ EXPORT_API notification_h notification_create_from_template(const char *template
 
        noti = (notification_h)calloc(1, sizeof(struct _notification));
        if (noti == NULL) {
+               /* LCOV_EXCL_START */
                NOTIFICATION_ERR("Failed to alloc memory");
                set_last_result(NOTIFICATION_ERROR_OUT_OF_MEMORY);
                return NULL;
+               /* LCOV_EXCL_STOP */
        }
 
        ret = notification_ipc_request_create_from_template(noti, template_name);
index fdc20ed..19ee070 100755 (executable)
@@ -71,8 +71,10 @@ sqlite3 *notification_db_open(const char *dbfile)
 
        ret = access(dbfile, R_OK | W_OK);
        if (ret != 0) {
+               /* LCOV_EXCL_START */
                set_last_result(NOTIFICATION_ERROR_FROM_DB);
                return NULL;
+               /* LCOV_EXCL_STOP */
        }
 
        ret = sqlite3_open_v2(dbfile, &db, SQLITE_OPEN_READWRITE, NULL);
index 16020c0..0519daa 100755 (executable)
@@ -165,6 +165,7 @@ void notification_call_event_handler_cb(notification_h noti, int event_type)
        info->cb(noti, event_type, info->userdata);
 }
 
+/* LCOV_EXCL_START */
 void notification_delete_event_handler_cb(int priv_id)
 {
        GList *delete_list;
@@ -189,6 +190,7 @@ void notification_delete_event_handler_cb(int priv_id)
        if (__noti_event_cb_list == NULL)
                notification_ipc_event_monitor_fini();
 }
+/* LCOV_EXCL_STOP */
 
 EXPORT_API int notification_add_deferred_task(
                void (*deferred_task_cb)(void *data), void *user_data)
@@ -226,8 +228,10 @@ EXPORT_API int notification_resister_changed_cb_for_uid(
 
        noti_cb_info_new = (notification_cb_info_s *)malloc(sizeof(notification_cb_info_s));
        if (noti_cb_info_new == NULL) {
+               /* LCOV_EXCL_START */
                NOTIFICATION_ERR("Failed to alloc memory");
                return NOTIFICATION_ERROR_OUT_OF_MEMORY;
+               /* LCOV_EXCL_STOP */
        }
 
        noti_cb_info_new->cb_type = NOTIFICATION_CB_NORMAL;
@@ -1184,8 +1188,10 @@ EXPORT_API int notification_register_detailed_changed_cb_for_uid(
 
        noti_cb_info_new = (notification_cb_info_s *)malloc(sizeof(notification_cb_info_s));
        if (noti_cb_info_new == NULL) {
+               /* LCOV_EXCL_START */
                NOTIFICATION_ERR("Failed to alloc memory");
                return NOTIFICATION_ERROR_OUT_OF_MEMORY;
+               /* LCOV_EXCL_STOP */
        }
 
        noti_cb_info_new->cb_type = NOTIFICATION_CB_DETAILED;
@@ -1357,6 +1363,7 @@ static GList *__copy_private_file(notification_h noti)
        return file_list;
 }
 
+/* LCOV_EXCL_START */
 static void __remove_private_file(gpointer data, gpointer user_data)
 {
        GFile *src = NULL;
@@ -1368,6 +1375,7 @@ static void __remove_private_file(gpointer data, gpointer user_data)
                g_object_unref(src);
        }
 }
+/* LCOV_EXCL_STOP */
 
 EXPORT_API int notification_post_for_uid(notification_h noti, uid_t uid)
 {
@@ -1499,9 +1507,11 @@ EXPORT_API notification_h notification_create_from_package_template(const char *
 
        noti = (notification_h)calloc(1, sizeof(struct _notification));
        if (noti == NULL) {
+               /* LCOV_EXCL_START */
                NOTIFICATION_ERR("Failed to alloc memory");
                set_last_result(NOTIFICATION_ERROR_OUT_OF_MEMORY);
                return NULL;
+               /* LCOV_EXCL_STOP */
        }
 
        ret = notification_ipc_request_create_from_package_template(noti, app_id, template_name);
@@ -1670,8 +1680,10 @@ EXPORT_API int notification_post_with_event_cb_for_uid(notification_h noti, even
        } else {
                info = (notification_event_cb_info_s *)malloc(sizeof(notification_cb_info_s));
                if (info == NULL) {
+                       /* LCOV_EXCL_START */
                        NOTIFICATION_ERR("Failed to alloc memory");
                        return NOTIFICATION_ERROR_OUT_OF_MEMORY;
+                       /* LCOV_EXCL_STOP */
                }
                info->priv_id = priv_id;
                info->cb = cb;
@@ -1863,23 +1875,29 @@ EXPORT_API int notification_set_extension_event_handler(notification_h noti,
 
        err = app_control_export_as_bundle(event_handler, &app_control_bundle);
        if (err != APP_CONTROL_ERROR_NONE) {
+               /* LCOV_EXCL_START */
                NOTIFICATION_ERR("Failed to export app_control to bundle [%d]", err);
                ret = NOTIFICATION_ERROR_IO_ERROR;
                goto out;
+               /* LCOV_EXCL_STOP */
        }
 
        err = bundle_encode(app_control_bundle, &b_raw, &len);
        if (err != BUNDLE_ERROR_NONE) {
+               /* LCOV_EXCL_START */
                NOTIFICATION_ERR("Failed to encode bundle [%d]", err);
                ret = NOTIFICATION_ERROR_IO_ERROR;
                goto out;
+               /* LCOV_EXCL_STOP */
        }
 
        err = bundle_add_str(noti->args, key, (const char *)b_raw);
        if (err != BUNDLE_ERROR_NONE) {
+               /* LCOV_EXCL_START */
                NOTIFICATION_ERR("Failed to add str to bundle [%d]", err);
                ret = NOTIFICATION_ERROR_IO_ERROR;
                goto out;
+               /* LCOV_EXCL_STOP */
        }
 
 out:
@@ -1923,24 +1941,30 @@ EXPORT_API int notification_get_extension_event_handler(notification_h noti,
 
        app_control_bundle = _create_bundle_from_bundle_raw((bundle_raw *)ret_str);
        if (app_control_bundle == NULL) {
+               /* LCOV_EXCL_START */
                NOTIFICATION_ERR("Failed to create bundle");
                return NOTIFICATION_ERROR_IO_ERROR;
+               /* LCOV_EXCL_STOP */
        }
 
        err = app_control_create(&ret_app_control);
        if (err != APP_CONTROL_ERROR_NONE) {
+               /* LCOV_EXCL_START */
                NOTIFICATION_ERR("Failed to create app control [%d]", err);
                ret = NOTIFICATION_ERROR_IO_ERROR;
                goto out;
+               /* LCOV_EXCL_STOP */
        }
 
        err = app_control_import_from_bundle(ret_app_control, app_control_bundle);
        if (err != APP_CONTROL_ERROR_NONE) {
+               /* LCOV_EXCL_START */
                NOTIFICATION_ERR("Failed to import app control from bundle [%d]",
                                err);
                app_control_destroy(ret_app_control);
                ret = NOTIFICATION_ERROR_IO_ERROR;
                goto out;
+               /* LCOV_EXCL_STOP */
        }
 
        *event_handler = ret_app_control;
index 026310d..7c82c29 100755 (executable)
@@ -105,12 +105,14 @@ static void __provider_appeared_cb(GDBusConnection *connection,
        notification_reset_event_handler_list();
 }
 
+/* LCOV_EXCL_START */
 static void __provider_vanished_cb(GDBusConnection *connection,
                                   const gchar *name,
                                   gpointer user_data)
 {
        NOTIFICATION_INFO("name [%s]", name);
 }
+/* LCOV_EXCL_STOP */
 
 static int _dbus_init()
 {
@@ -120,12 +122,14 @@ static int _dbus_init()
                _gdbus_conn = g_bus_get_sync(G_BUS_TYPE_SYSTEM, NULL, &error);
 
                if (_gdbus_conn == NULL) {
+                       /* LCOV_EXCL_START */
                        if (error != NULL) {
                                NOTIFICATION_ERR("Failed to get dbus[%s]",
                                                error->message);
                                g_error_free(error);
                        }
                        return NOTIFICATION_ERROR_IO_ERROR;
+                       /* LCOV_EXCL_STOP */
                }
                _bus_name = g_dbus_connection_get_unique_name(_gdbus_conn);
                NOTIFICATION_INFO("Connected bus name[%s]", _bus_name);
@@ -320,8 +324,10 @@ static notification_op *_ipc_create_op(notification_op_type_e type,
 
        op_list = (notification_op *)malloc(sizeof(notification_op) * num_op);
        if (op_list == NULL) {
+               /* LCOV_EXCL_START */
                NOTIFICATION_ERR("Failed to alloc memory");
                return NULL;
+               /* LCOV_EXCL_STOP */
        }
 
        memset(op_list, 0x0, sizeof(notification_op) * num_op);
@@ -544,8 +550,10 @@ static void _send_event(GVariant *parameters)
 
        noti = notification_create(NOTIFICATION_TYPE_NOTI);
        if (noti == NULL) {
+               /* LCOV_EXCL_START */
                NOTIFICATION_ERR("Failed to create notification handle");
                return;
+               /* LCOV_EXCL_STOP */
        }
 
        g_variant_get(parameters, "(vi)", &coupled_body, &event_type);
@@ -564,6 +572,7 @@ static void _send_event(GVariant *parameters)
        notification_free(noti);
 }
 
+/* LCOV_EXCL_START */
 static void _delete_event(GVariant *parameters)
 {
        int priv_id;
@@ -571,6 +580,7 @@ static void _delete_event(GVariant *parameters)
        g_variant_get(parameters, "(i)", &priv_id);
        notification_delete_event_handler_cb(priv_id);
 }
+/* LCOV_EXCL_STOP */
 
 static void _handle_noti_event_handler_notify(GDBusConnection *connection,
                const gchar     *sender_name,
@@ -608,8 +618,10 @@ static int _dbus_event_handler_signal_init(void)
 
                NOTIFICATION_DBG("subscribe id[%d]", id);
                if (id == 0) {
+                       /* LCOV_EXCL_START */
                        ret = NOTIFICATION_ERROR_IO_ERROR;
                        NOTIFICATION_ERR("Failed to subscribe connection signal");
+                       /* LCOV_EXCL_STOP */
                } else {
                        event_monitor_id = id;
                }
@@ -724,8 +736,10 @@ static void _send_message_with_reply_async_cb(GDBusConnection *connection,
        result_cb_item *cb_item = (result_cb_item *)user_data;
 
        if (cb_item == NULL) {
+               /* LCOV_EXCL_START */
                NOTIFICATION_ERR("Failed to get a callback item");
                return;
+               /* LCOV_EXCL_START */
        }
 
        reply = g_dbus_connection_send_message_with_reply_finish(
@@ -821,8 +835,10 @@ int notification_ipc_request_insert(notification_h noti, int *priv_id)
 
        result = _dbus_init();
        if (result != NOTIFICATION_ERROR_NONE) {
+               /* LCOV_EXCL_START */
                NOTIFICATION_ERR("Failed to init dbus connection[%d]", result);
                return result;
+               /* LCOV_EXCL_STOP */
        }
 
        result = notification_get_event_flag(noti, &event_flag);
@@ -958,8 +974,10 @@ int notification_ipc_request_refresh(uid_t uid)
 
        result = _dbus_init();
        if (result != NOTIFICATION_ERROR_NONE) {
+               /* LCOV_EXCL_START */
                NOTIFICATION_ERR("Failed to init dbus connection[%d]", result);
                return result;
+               /* LCOV_EXCL_STOP */
        }
 
        body = g_variant_new("(i)", uid);
@@ -982,8 +1000,10 @@ int notification_ipc_request_delete_single(notification_type_e type, char *app_i
 
        result = _dbus_init();
        if (result != NOTIFICATION_ERROR_NONE) {
+               /* LCOV_EXCL_START */
                NOTIFICATION_ERR("Failed to init dbus connection[%d]", result);
                return result;
+               /* LCOV_EXCL_STOP */
        }
 
        body = g_variant_new("(sii)", app_id, priv_id, uid);
@@ -1011,8 +1031,10 @@ int notification_ipc_request_delete_multiple(notification_type_e type, char *app
 
        result = _dbus_init();
        if (result != NOTIFICATION_ERROR_NONE) {
+               /* LCOV_EXCL_START */
                NOTIFICATION_ERR("Failed to init dbus connection[%d]", result);
                return result;
+               /* LCOV_EXCL_STOP */
        }
 
        if (!app_id)
@@ -1044,8 +1066,10 @@ int notification_ipc_request_load_noti_by_tag(notification_h noti, const char *a
 
        result = _dbus_init();
        if (result != NOTIFICATION_ERROR_NONE) {
+               /* LCOV_EXCL_START */
                NOTIFICATION_ERR("Failed to init dbus connection[%d]", result);
                return result;
+               /* LCOV_EXCL_STOP */
        }
 
        body = g_variant_new("(ssi)", app_id, tag, uid);
@@ -1155,8 +1179,10 @@ int notification_ipc_request_load_noti_grouping_list(notification_type_e type, i
 
        result = _dbus_init();
        if (result != NOTIFICATION_ERROR_NONE) {
+               /* LCOV_EXCL_START */
                NOTIFICATION_ERR("Failed to init dbus connection[%d]", result);
                return result;
+               /* LCOV_EXCL_STOP */
        }
 
        body = g_variant_new("(iii)", type, count, uid);
@@ -1169,10 +1195,12 @@ int notification_ipc_request_load_noti_grouping_list(notification_type_e type, i
                while (g_variant_iter_loop(iter, "(v)", &iter_body)) {
                        noti = notification_create(NOTIFICATION_TYPE_NOTI);
                        if (!noti) {
+                               /* LCOV_EXCL_START */
                                result = NOTIFICATION_ERROR_OUT_OF_MEMORY;
                                NOTIFICATION_ERR("failed to create a notification");
                                notification_free_list(*list);
                                break;
+                               /* LCOV_EXCL_STOP */
                        }
                        g_variant_get(iter_body, "(v)", &noti_body);
                        notification_ipc_make_noti_from_gvariant(noti, noti_body);
@@ -1258,8 +1286,10 @@ int notification_ipc_request_get_setting_array(
 
        result = _dbus_init();
        if (result != NOTIFICATION_ERROR_NONE) {
+               /* LCOV_EXCL_START */
                NOTIFICATION_ERR("Failed to init dbus connection[%d]", result);
                return result;
+               /* LCOV_EXCL_STOP */
        }
 
        result = _send_sync_noti(g_variant_new("(i)", uid), &reply, "get_setting_array");
@@ -1271,10 +1301,12 @@ int notification_ipc_request_get_setting_array(
                NOTIFICATION_DBG("get setting arr cnt: %d", setting_cnt);
                result_setting_array = (struct notification_setting *)malloc(sizeof(struct notification_setting) * setting_cnt);
                if (result_setting_array == NULL) {
+                       /* LCOV_EXCL_START */
                        NOTIFICATION_ERR("malloc failed");
                        g_object_unref(reply);
                        g_variant_iter_free(iter);
                        return NOTIFICATION_ERROR_OUT_OF_MEMORY;
+                       /* LCOV_EXCL_STOP */
                }
 
                setting_idx = 0;
@@ -1321,10 +1353,12 @@ int notification_ipc_request_get_setting_by_app_id(
 
                result_setting = (struct notification_setting *)malloc(sizeof(struct notification_setting));
                if (result_setting == NULL) {
+                       /* LCOV_EXCL_START */
                        NOTIFICATION_ERR("malloc failed");
                        g_object_unref(reply);
                        g_variant_unref(body);
                        return NOTIFICATION_ERROR_OUT_OF_MEMORY;
+                       /* LCOV_EXCL_STOP */
                }
                notification_ipc_make_setting_from_gvariant(result_setting, setting_body);
 
@@ -1353,8 +1387,10 @@ int notification_ipc_request_load_system_setting(notification_system_setting_h *
 
        result = _dbus_init();
        if (result != NOTIFICATION_ERROR_NONE) {
+               /* LCOV_EXCL_START */
                NOTIFICATION_ERR("Failed to init dbus connection[%d]", result);
                return result;
+               /* LCOV_EXCL_STOP */
        }
 
        result = _send_sync_noti(g_variant_new("(i)", uid), &reply, "load_system_setting");
@@ -1364,9 +1400,11 @@ int notification_ipc_request_load_system_setting(notification_system_setting_h *
 
                result_setting = (struct notification_system_setting *)calloc(1, sizeof(struct notification_system_setting));
                if (result_setting == NULL) {
+                       /* LCOV_EXCL_START */
                        NOTIFICATION_ERR("malloc failed");
                        result = NOTIFICATION_ERROR_OUT_OF_MEMORY;
                        goto out;
+                       /* LCOV_EXCL_STOP */
                }
 
                notification_ipc_make_system_setting_from_gvariant(result_setting, setting_body);
@@ -1379,8 +1417,10 @@ int notification_ipc_request_load_system_setting(notification_system_setting_h *
                        while (g_variant_iter_loop(iter, "(v)", &iter_body)) {
                                dnd_allow_exception = (dnd_allow_exception_h)calloc(1, sizeof(struct notification_system_setting_dnd_allow_exception));
                                if (dnd_allow_exception == NULL) {
+                                       /* LCOV_EXCL_START */
                                        result = NOTIFICATION_ERROR_OUT_OF_MEMORY;
                                        goto out;
+                                       /* LCOV_EXCL_STOP */
                                }
 
                                notification_ipc_make_dnd_allow_exception_from_gvariant(dnd_allow_exception, iter_body);
@@ -1412,8 +1452,10 @@ int notification_ipc_update_setting(notification_setting_h setting, uid_t uid)
 
        result = _dbus_init();
        if (result != NOTIFICATION_ERROR_NONE) {
+               /* LCOV_EXCL_START */
                NOTIFICATION_ERR("Failed to init dbus connection[%d]", result);
                return result;
+               /* LCOV_EXCL_STOP */
        }
 
        body = g_variant_new("(ssiiiiii)",
@@ -1445,8 +1487,10 @@ int notification_ipc_update_system_setting(notification_system_setting_h system_
 
        result = _dbus_init();
        if (result != NOTIFICATION_ERROR_NONE) {
+               /* LCOV_EXCL_START */
                NOTIFICATION_ERR("Failed to init dbus connection[%d]", result);
                return result;
+               /* LCOV_EXCL_STOP */
        }
 
        body = g_variant_new("(iiiiiiiiii)",
@@ -1491,8 +1535,10 @@ int notification_ipc_request_save_as_template(notification_h noti, const char *t
 
        result = _dbus_init();
        if (result != NOTIFICATION_ERROR_NONE) {
+               /* LCOV_EXCL_START */
                NOTIFICATION_ERR("Failed to init dbus connection[%d]", result);
                return result;
+               /* LCOV_EXCL_STOP */
        }
 
        body = notification_ipc_make_gvariant_from_noti(noti, false);
@@ -1520,8 +1566,10 @@ int notification_ipc_request_create_from_template(notification_h noti, const cha
 
        result = _dbus_init();
        if (result != NOTIFICATION_ERROR_NONE) {
+               /* LCOV_EXCL_START */
                NOTIFICATION_ERR("Failed to init dbus connection[%d]", result);
                return result;
+               /* LCOV_EXCL_STOP */
        }
 
        body = g_variant_new("(s)", template_name);
@@ -1554,8 +1602,10 @@ int notification_ipc_request_create_from_package_template(notification_h noti, c
 
        result = _dbus_init();
        if (result != NOTIFICATION_ERROR_NONE) {
+               /* LCOV_EXCL_START */
                NOTIFICATION_ERR("Failed to init dbus connection[%d]", result);
                return result;
+               /* LCOV_EXCL_STOP */
        }
 
        body = g_variant_new("(ss)", app_id, template_name);
@@ -1596,8 +1646,10 @@ int notification_ipc_get_noti_block_state(const char *app_id, int *do_not_distur
 
        ret = _dbus_init();
        if (ret != NOTIFICATION_ERROR_NONE) {
+               /* LCOV_EXCL_START */
                NOTIFICATION_ERR("Failed to init dbus connection[%d]", ret);
                return ret;
+               /* LCOV_EXCL_STOP */
        }
 
        body = g_variant_new("(si)", app_id, uid);
@@ -1630,8 +1682,10 @@ int notification_ipc_send_event(notification_h noti, int event_type, int priv_id
 
        ret = _dbus_init();
        if (ret != NOTIFICATION_ERROR_NONE) {
+               /* LCOV_EXCL_START */
                NOTIFICATION_ERR("Failed to init dbus connection[%d]", ret);
                return ret;
+               /* LCOV_EXCL_STOP */
        }
 
        if (priv_id > 0) {
@@ -1663,8 +1717,10 @@ int notification_ipc_check_event_receiver(int priv_id, bool *available)
 
        ret = _dbus_init();
        if (ret != NOTIFICATION_ERROR_NONE) {
+               /* LCOV_EXCL_START */
                NOTIFICATION_ERR("Failed to init dbus connection[%d]", ret);
                return ret;
+               /* LCOV_EXCL_STOP */
        }
 
        ret = _send_sync_noti(g_variant_new("(i)", priv_id), &reply, "check_event_receiver");
@@ -1681,6 +1737,7 @@ int notification_ipc_check_event_receiver(int priv_id, bool *available)
        return ret;
 }
 
+/* LCOV_EXCL_START */
 void notification_ipc_reset_event_handler(int priv_id)
 {
        int ret;
@@ -1697,6 +1754,7 @@ void notification_ipc_reset_event_handler(int priv_id)
        if (reply)
                g_object_unref(reply);
 }
+/* LCOV_EXCL_STOP */
 
 EXPORT_API GVariant *notification_ipc_make_gvariant_from_noti(notification_h noti, bool translate)
 {
@@ -1939,8 +1997,10 @@ static gboolean _variant_to_int_dict(GHashTable **dict, GVariant *variant)
        while (g_variant_iter_next(&iter, "{iv}", &key, &value)) {
                hash_key = (int *)calloc(sizeof(int), 1);
                if (hash_key == NULL) {
+                       /* LCOV_EXCL_START */
                        g_hash_table_unref(*dict);
                        return FALSE;
+                       /* LCOV_EXCL_STOP */
                }
                *hash_key = key;
                g_hash_table_insert(*dict, (gpointer)hash_key, value);
@@ -2418,6 +2478,7 @@ int notification_ipc_monitor_fini(void)
        return  _ipc_monitor_deregister();
 }
 
+/* LCOV_EXCL_START */
 void notification_ipc_event_monitor_fini(void)
 {
        if (event_monitor_id == 0)
@@ -2426,3 +2487,4 @@ void notification_ipc_event_monitor_fini(void)
        g_dbus_connection_signal_unsubscribe(_gdbus_conn, event_monitor_id);
        event_monitor_id = 0;
 }
+/* LCOV_EXCL_STOP */
index 52e85ea..da57e72 100755 (executable)
@@ -143,17 +143,21 @@ static int _notification_noti_check_priv_id(notification_h noti, sqlite3 *db)
                                "WHERE caller_app_id = %Q AND priv_id = %d",
                                noti->caller_app_id, noti->priv_id);
        if (query == NULL) {
-               NOTIFICATION_ERR("Failed to alloc query"); /* LCOV_EXCL_LINE */
+               /* LCOV_EXCL_START */
+               NOTIFICATION_ERR("Failed to alloc query");
                ret = NOTIFICATION_ERROR_OUT_OF_MEMORY;
                goto err;
+               /* LCOV_EXCL_STOP */
        }
 
        ret = sqlite3_prepare_v2(db, query, strlen(query), &stmt, NULL);
        if (ret != SQLITE_OK) {
+               /* LCOV_EXCL_START */
                NOTIFICATION_ERR("Failed to sqlite3_prepare_v2 Failed [%d][%s]",
                                ret, sqlite3_errmsg(db));
                ret = NOTIFICATION_ERROR_FROM_DB;
                goto err;
+               /* LCOV_EXCL_STOP */
        }
 
        ret = sqlite3_step(stmt);
@@ -189,17 +193,21 @@ static int _notification_noti_get_internal_group_id_by_priv_id(const char *app_i
                                "WHERE caller_app_id = %Q AND priv_id = %d",
                                app_id, priv_id);
        if (query == NULL) {
+               /* LCOV_EXCL_START */
                NOTIFICATION_ERR("Failed to alloc query"); /* LCOV_EXCL_LINE */
                ret = NOTIFICATION_ERROR_OUT_OF_MEMORY;
                goto err;
+               /* LCOV_EXCL_STOP */
        }
 
        ret = sqlite3_prepare_v2(db, query, strlen(query), &stmt, NULL);
        if (ret != SQLITE_OK) {
+               /* LCOV_EXCL_START */
                NOTIFICATION_ERR("sqlite3_prepare_v2 Failed [%d][%s]", ret,
                                sqlite3_errmsg(db));
                ret = NOTIFICATION_ERROR_FROM_DB;
                goto err;
+               /* LCOV_EXCL_STOP */
        }
 
        ret = sqlite3_step(stmt);
@@ -569,16 +577,20 @@ static int _get_notification(char *query_where, notification_h noti)
        query = sqlite3_mprintf("SELECT %s FROM %s",
                                NOTI_LIST_DB_ATTRIBUTES_SELECT, query_where);
        if (query == NULL) {
+               /* LCOV_EXCL_START */
                ret = NOTIFICATION_ERROR_OUT_OF_MEMORY;
                goto err;
+               /* LCOV_EXCL_STOP */
        }
 
        ret = sqlite3_prepare_v2(db, query, -1, &stmt, NULL);
        if (ret != SQLITE_OK) {
+               /* LCOV_EXCL_START */
                NOTIFICATION_ERR("sqlite3_prepare_v2 failed [%d][%s]", ret,
                                sqlite3_errmsg(db));
                ret = NOTIFICATION_ERROR_FROM_DB;
                goto err;
+               /* LCOV_EXCL_STOP */
        }
 
        ret = sqlite3_step(stmt);
@@ -619,23 +631,29 @@ static int _get_notification_list(char *query_where, notification_list_h *list,
        query = sqlite3_mprintf("SELECT %s FROM %s",
                                NOTI_LIST_DB_ATTRIBUTES_SELECT, query_where);
        if (query == NULL) {
+               /* LCOV_EXCL_START */
                ret = NOTIFICATION_ERROR_OUT_OF_MEMORY;
                goto err;
+               /* LCOV_EXCL_STOP */
        }
 
        ret = sqlite3_prepare_v2(db, query, -1, &stmt, NULL);
        if (ret != SQLITE_OK) {
+               /* LCOV_EXCL_START */
                NOTIFICATION_ERR("sqlite3_prepare_v2 failed [%d][%s]", ret,
                                sqlite3_errmsg(db));
                ret = NOTIFICATION_ERROR_FROM_DB;
                goto err;
+               /* LCOV_EXCL_STOP */
        }
 
        while (sqlite3_step(stmt) == SQLITE_ROW) {
                noti = (notification_h)calloc(1, sizeof(struct _notification));
                if (noti == NULL) {
+                       /* LCOV_EXCL_START */
                        ret = NOTIFICATION_ERROR_OUT_OF_MEMORY;
                        goto err;
+                       /* LCOV_EXCL_STOP */
                }
 
                __notification_noti_populate_from_stmt(stmt, noti);
@@ -974,17 +992,21 @@ EXPORT_API int notification_noti_insert(notification_h noti)
        query = sqlite3_mprintf("INSERT INTO noti_list (%s) VALUES (%s)",
                        NOTI_LIST_DB_ATTRIBUTES_INSERT, NOTI_LIST_INSERT_VALUES);
        if (query == NULL) {
+               /* LCOV_EXCL_START */
                NOTIFICATION_ERR("sqlite3_mprintf Failed");
                ret = NOTIFICATION_ERROR_OUT_OF_MEMORY;
                goto err;
+               /* LCOV_EXCL_STOP */
        }
 
        ret = sqlite3_prepare_v2(db, query, -1, &stmt, NULL);
        if (ret != SQLITE_OK) {
+               /* LCOV_EXCL_START */
                NOTIFICATION_ERR("sqlite3_prepare_v2 Failed [%d][%s]", ret,
                                 sqlite3_errmsg(db));
                ret = NOTIFICATION_ERROR_FROM_DB;
                goto err;
+               /* LCOV_EXCL_STOP */
        }
 
        ret = _create_insertion_query(db, noti, stmt, NULL);
@@ -1025,8 +1047,10 @@ EXPORT_API int notification_noti_get_by_priv_id(notification_h noti, int priv_id
 
        query_where = sqlite3_mprintf("noti_list WHERE priv_id = %d", priv_id);
        if (query_where == NULL) {
+               /* LCOV_EXCL_START */
                ret = NOTIFICATION_ERROR_OUT_OF_MEMORY;
                goto err;
+               /* LCOV_EXCL_STOP */
        }
 
        ret = _get_notification(query_where, noti);
@@ -1052,8 +1076,10 @@ EXPORT_API int notification_noti_get_by_tag(notification_h noti, char *app_id, c
        query_where = sqlite3_mprintf("noti_list WHERE caller_app_id = %Q "
                        "AND tag = %Q AND uid = %d", app_id, tag, uid);
        if (query_where == NULL) {
+               /* LCOV_EXCL_START */
                ret = NOTIFICATION_ERROR_OUT_OF_MEMORY;
                goto err;
+               /* LCOV_EXCL_STOP */
        }
 
        ret = _get_notification(query_where, noti);
@@ -1106,16 +1132,20 @@ EXPORT_API int notification_noti_update(notification_h noti)
        query = sqlite3_mprintf("UPDATE noti_list SET %s WHERE priv_id = %d ",
                                NOTI_LIST_DB_ATTRIBUTES_UPDATE, noti->priv_id);
        if (query == NULL) {
+               /* LCOV_EXCL_START */
                ret = NOTIFICATION_ERROR_OUT_OF_MEMORY;
                goto err;
+               /* LCOV_EXCL_STOP */
        }
 
        ret = sqlite3_prepare_v2(db, query, -1, &stmt, NULL);
        if (ret != SQLITE_OK) {
+               /* LCOV_EXCL_START */
                NOTIFICATION_ERR("sqlite3_prepare_v2 Failed [%d][%s]", ret,
                                 sqlite3_errmsg(db));
                ret = NOTIFICATION_ERROR_FROM_DB;
                goto err;
+               /* LCOV_EXCL_STOP */
        }
 
        ret = _create_update_query(db, noti, stmt);
@@ -1172,8 +1202,10 @@ EXPORT_API int notification_noti_delete_all(notification_type_e type,
                        query_where = sqlite3_mprintf("WHERE type = %d "
                                                "AND uid = %d", type, uid);
                        if (query_where == NULL) {
+                               /* LCOV_EXCL_START */
                                ret = NOTIFICATION_ERROR_OUT_OF_MEMORY;
                                goto err;
+                               /* LCOV_EXCL_STOP */
                        }
                }
        } else {
@@ -1186,8 +1218,10 @@ EXPORT_API int notification_noti_delete_all(notification_type_e type,
                                                app_id, type, uid);
 
                if (query_where == NULL) {
+                       /* LCOV_EXCL_START */
                        ret = NOTIFICATION_ERROR_OUT_OF_MEMORY;
                        goto err;
+                       /* LCOV_EXCL_STOP */
                }
        }
 
@@ -1199,17 +1233,21 @@ EXPORT_API int notification_noti_delete_all(notification_type_e type,
 
                query = sqlite3_mprintf("SELECT priv_id FROM noti_list %s ", query_where);
                if (query == NULL) {
+                       /* LCOV_EXCL_START */
                        ret = NOTIFICATION_ERROR_OUT_OF_MEMORY;
                        goto err;
+                       /* LCOV_EXCL_STOP */
                }
 
                ret = sqlite3_prepare_v2(db, query, strlen(query), &stmt, NULL);
                if (ret != SQLITE_OK) {
+                       /* LCOV_EXCL_START */
                        NOTIFICATION_ERR("Failed to sqlite3_prepare_V2 [%d][%s]",
                                        ret, sqlite3_errmsg(db));
 
                        ret = NOTIFICATION_ERROR_FROM_DB;
                        goto err;
+                       /* LCOV_EXCL_STOP */
                }
 
                while (sqlite3_step(stmt) == SQLITE_ROW) {
@@ -1220,6 +1258,7 @@ EXPORT_API int notification_noti_delete_all(notification_type_e type,
                                if (tmp) {
                                        *list_deleted_rowid = tmp;
                                } else {
+                                       /* LCOV_EXCL_START */
                                        NOTIFICATION_ERR("Failed to realloc memory [%s]", strerror_r(errno, err_buf, sizeof(err_buf)));
                                        /*!
                                         * \TODO
@@ -1229,6 +1268,7 @@ EXPORT_API int notification_noti_delete_all(notification_type_e type,
                                        *list_deleted_rowid = NULL;
                                        ret = NOTIFICATION_ERROR_OUT_OF_MEMORY;
                                        goto err;
+                                       /* LCOV_EXCL_STOP */
                                }
                        }
                        *((*list_deleted_rowid) + data_cnt) = sqlite3_column_int(stmt, 0);
@@ -1242,8 +1282,10 @@ EXPORT_API int notification_noti_delete_all(notification_type_e type,
                                if (i % NOTI_BURST_DELETE_UNIT == 0 && i != 0) {
                                        query = sqlite3_mprintf("%s WHERE priv_id in (%s)", query_base, query_where);
                                        if (query == NULL) {
+                                               /* LCOV_EXCL_START */
                                                ret = NOTIFICATION_ERROR_OUT_OF_MEMORY;
                                                goto err;
+                                               /* LCOV_EXCL_STOP */
                                        }
                                        ret_tmp = notification_db_exec(db, query, NULL);
                                        query_where[0] = '\0';
@@ -1253,16 +1295,20 @@ EXPORT_API int notification_noti_delete_all(notification_type_e type,
                                snprintf(buf, sizeof(buf) - 1, "%s%d", (i % NOTI_BURST_DELETE_UNIT == 0) ? "" : ",", *((*list_deleted_rowid) + i));
                                query_where = sqlite3_mprintf("%s%s", query_where, buf);
                                if (query_where == NULL) {
+                                       /* LCOV_EXCL_START */
                                        ret = NOTIFICATION_ERROR_OUT_OF_MEMORY;
                                        goto err;
+                                       /* LCOV_EXCL_STOP */
                                }
                        }
 
                        if ((i <= NOTI_BURST_DELETE_UNIT) || ((i % NOTI_BURST_DELETE_UNIT) > 0)) {
                                query = sqlite3_mprintf("%s WHERE priv_id in (%s)", query_base, query_where);
                                if (query == NULL) {
+                                       /* LCOV_EXCL_START */
                                        ret = NOTIFICATION_ERROR_OUT_OF_MEMORY;
                                        goto err;
+                                       /* LCOV_EXCL_STOP */
                                }
 
                                ret_tmp = notification_db_exec(db, query, NULL);
@@ -1280,8 +1326,10 @@ EXPORT_API int notification_noti_delete_all(notification_type_e type,
                /* Make main query */
                query = sqlite3_mprintf("%s %s", query_base, query_where);
                if (query == NULL) {
+                       /* LCOV_EXCL_START */
                        ret = NOTIFICATION_ERROR_OUT_OF_MEMORY;
                        goto err;
+                       /* LCOV_EXCL_STOP */
                }
 
                ret = notification_db_exec(db, query, num_deleted);
@@ -1357,8 +1405,10 @@ EXPORT_API int notification_noti_delete_by_priv_id_get_changes(const char *app_i
                                "AND priv_id = %d AND uid = %d",
                                app_id, priv_id, uid);
        if (query == NULL) {
+               /* LCOV_EXCL_START */
                ret = NOTIFICATION_ERROR_OUT_OF_MEMORY;
                goto err;
+               /* LCOV_EXCL_STOP */
        }
 
        ret = notification_db_exec(db, query, num_changes);
@@ -1545,16 +1595,20 @@ EXPORT_API int notification_noti_get_grouping_list(notification_type_e type,
        if (uid != NOTIFICATION_GLOBAL_UID) {
                query_uid = sqlite3_mprintf(" AND uid = %d ", uid);
                if (query_uid == NULL) {
+                       /* LCOV_EXCL_START */
                        ret = NOTIFICATION_ERROR_OUT_OF_MEMORY;
                        goto err;
+                       /* LCOV_EXCL_STOP */
                }
        }
 
        query = sqlite3_mprintf("noti_list WHERE 1 > 0 %s %s "
                        "ORDER BY rowid DESC, time DESC", query_where, query_uid);
        if (query == NULL) {
+               /* LCOV_EXCL_START */
                ret = NOTIFICATION_ERROR_OUT_OF_MEMORY;
                goto err;
+               /* LCOV_EXCL_STOP */
        }
 
        ret = _get_notification_list(query, list, count);
@@ -1620,15 +1674,19 @@ EXPORT_API int notification_noti_get_detail_list(const char *app_id,
        }
 
        if (query_where == NULL) {
+               /* LCOV_EXCL_START */
                ret = NOTIFICATION_ERROR_OUT_OF_MEMORY;
                goto err;
+               /* LCOV_EXCL_STOP */
        }
 
        query = sqlite3_mprintf("noti_list %s ORDER BY rowid DESC, time DESC",
                        query_where);
        if (query == NULL) {
+               /* LCOV_EXCL_START */
                ret = NOTIFICATION_ERROR_OUT_OF_MEMORY;
                goto err;
+               /* LCOV_EXCL_STOP */
        }
 
        ret = _get_notification_list(query, list, count);
@@ -1666,15 +1724,19 @@ EXPORT_API int notification_noti_check_tag(notification_h noti)
                        NOTIFICATION_CHECK_STR(noti->caller_app_id),
                        NOTIFICATION_CHECK_STR(noti->tag));
        if (query == NULL) {
+               /* LCOV_EXCL_START */
                ret = NOTIFICATION_ERROR_OUT_OF_MEMORY;
                goto err;
+               /* LCOV_EXCL_STOP */
        }
 
        ret = sqlite3_prepare_v2(db, query, strlen(query), &stmt, NULL);
        if (ret != SQLITE_OK) {
+               /* LCOV_EXCL_START */
                NOTIFICATION_ERR("Failed to sqlite3_prepare_v2[%d][%s]",
                                ret, sqlite3_errmsg(db));
                goto err;
+               /* LCOV_EXCL_STOP */
        }
 
        ret = sqlite3_step(stmt);
@@ -1723,16 +1785,20 @@ EXPORT_API int notification_noti_check_count_for_template(notification_h noti, i
                                "WHERE caller_app_id = %Q",
                                NOTIFICATION_CHECK_STR(noti->caller_app_id));
        if (query == NULL) {
+               /* LCOV_EXCL_START */
                ret = NOTIFICATION_ERROR_OUT_OF_MEMORY;
                goto err;
+               /* LCOV_EXCL_STOP */
        }
 
        ret = sqlite3_prepare_v2(db, query, strlen(query), &stmt, NULL);
        if (ret != SQLITE_OK) {
+               /* LCOV_EXCL_START */
                NOTIFICATION_ERR("Failed to sqlite3_prepare_v2[%d][%s]",
                                ret, sqlite3_errmsg(db));
                ret = NOTIFICATION_ERROR_FROM_DB;
                goto err;
+               /* LCOV_EXCL_STOP */
        }
 
        ret = sqlite3_step(stmt);
@@ -1783,16 +1849,20 @@ EXPORT_API int notification_noti_add_template(notification_h noti, char *templat
                                NOTI_LIST_INSERT_VALUES,
                                template_name);
        if (query == NULL) {
+               /* LCOV_EXCL_START */
                ret = NOTIFICATION_ERROR_OUT_OF_MEMORY;
                goto err;
+               /* LCOV_EXCL_STOP */
        }
 
        ret = sqlite3_prepare_v2(db, query, -1, &stmt, NULL);
        if (ret != SQLITE_OK) {
+               /* LCOV_EXCL_START */
                NOTIFICATION_ERR("Failed to sqlite3_prepare_v2[%d][%s]",
                                ret, sqlite3_errmsg(db));
                ret = NOTIFICATION_ERROR_FROM_DB;
                goto err;
+               /* LCOV_EXCL_STOP */
        }
 
        ret = _create_insertion_query(db, noti, stmt, &idx);
@@ -1859,8 +1929,10 @@ EXPORT_API int notification_noti_delete_template(const char *pkg_id)
        query = sqlite3_mprintf("DELETE FROM noti_template WHERE pkg_id = %Q",
                                NOTIFICATION_CHECK_STR(pkg_id));
        if (query == NULL) {
+               /* LCOV_EXCL_START */
                ret = NOTIFICATION_ERROR_OUT_OF_MEMORY;
                goto err;
+               /* LCOV_EXCL_STOP */
        }
 
        ret = notification_db_exec(db, query, NULL);
index 33e4c5a..4e8c62b 100755 (executable)
@@ -340,10 +340,12 @@ static bool _is_package_in_setting_table(sqlite3 *db, const char *package_name,
        }
 
        if (sql_ret != SQLITE_OK && sql_ret != SQLITE_ROW) {
+               /* LCOV_EXCL_START */
                NOTIFICATION_ERR("sqlite3_step failed [%d][%s]", sql_ret,
                                sqlite3_errmsg(db));
                err = false;
                goto out;
+               /* LCOV_EXCL_STOP */
        }
 
 out:
@@ -369,17 +371,21 @@ static int _foreach_app_info_callback(const pkgmgrinfo_appinfo_h handle,
 
        ret = pkgmgrinfo_appinfo_get_appid(handle, &app_id);
        if (ret != PACKAGE_MANAGER_ERROR_NONE) {
+               /* LCOV_EXCL_START */
                NOTIFICATION_ERR("Failed to get appid from pkgmgrinfo [%d]",
                                ret);
                err = false;
                goto out;
+               /* LCOV_EXCL_STOP */
        }
 
        ret = pkgmgrinfo_appinfo_get_pkgname(handle, &package_name);
        if (ret != PACKAGE_MANAGER_ERROR_NONE) {
+               /* LCOV_EXCL_START */
                NOTIFICATION_ERR("Failed to get pkgname from pkgmgrinfo[%d]",
                                ret);
                goto out;
+               /* LCOV_EXCL_STOP */
        }
 
        if (_is_package_in_setting_table(db, package_name, app_id, info->uid) == true) {
@@ -424,31 +430,39 @@ static int _foreach_package_info_callback(const pkgmgrinfo_pkginfo_h package_inf
 
        pkgmgr_ret = pkgmgrinfo_pkginfo_get_pkgname(package_info, &package_name);
        if (pkgmgr_ret != PACKAGE_MANAGER_ERROR_NONE) {
+               /* LCOV_EXCL_START */
                NOTIFICATION_ERR("Failed to get pkgname from pkgmgrinfo[%d]", pkgmgr_ret);
                err = false;
                goto out;
+               /* LCOV_EXCL_STOP */
        }
 
        pkgmgr_ret = pkgmgrinfo_appinfo_filter_create(&handle);
        if (pkgmgr_ret != PMINFO_R_OK) {
+               /* LCOV_EXCL_START */
                NOTIFICATION_ERR("Failed to create appinofo[%d]",
                                        pkgmgr_ret);
                err = false;
                goto out;
+               /* LCOV_EXCL_STOP */
        }
 
        pkgmgr_ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_PACKAGE, package_name);
        if (pkgmgr_ret != PMINFO_R_OK) {
+               /* LCOV_EXCL_START */
                NOTIFICATION_ERR("Failed to add string to appinfo[%d]", pkgmgr_ret);
                err = false;
                goto out;
+               /* LCOV_EXCL_STOP */
        }
 
        pkgmgr_ret = pkgmgrinfo_appinfo_usr_filter_foreach_appinfo(handle, _foreach_app_info_callback, info, info->uid);
        if (pkgmgr_ret != PMINFO_R_OK) {
+               /* LCOV_EXCL_START */
                NOTIFICATION_ERR("Failed to iterate appinfo[%d]", pkgmgr_ret);
                err = false;
                goto out;
+               /* LCOV_EXCL_STOP */
        }
 
 out:
@@ -472,32 +486,40 @@ static int _install_and_update_package(const char *package_name, uid_t uid)
 
        pkgmgr_ret = pkgmgrinfo_pkginfo_filter_create(&handle);
        if (pkgmgr_ret != PMINFO_R_OK) {
+               /* LCOV_EXCL_START */
                NOTIFICATION_ERR("Failed to create pkginfo_filter[%d]", pkgmgr_ret);
                err = NOTIFICATION_ERROR_FROM_DB;
                goto out;
+               /* LCOV_EXCL_STOP */
        }
 
        pkgmgr_ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_PRIVILEGE, NOTIFICATION_PRIVILEGE);
        if (pkgmgr_ret != PMINFO_R_OK) {
+               /* LCOV_EXCL_START */
                NOTIFICATION_ERR("Failed to add string to pkginfo_filter[%d]", pkgmgr_ret);
                err = NOTIFICATION_ERROR_FROM_DB;
                goto out;
+               /* LCOV_EXCL_STOP */
        }
 
        pkgmgr_ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_ID, package_name);
        if (pkgmgr_ret != PMINFO_R_OK) {
+               /* LCOV_EXCL_START */
                NOTIFICATION_ERR("Failed to add string to pkginfo_filter[%d]", pkgmgr_ret);
                err = NOTIFICATION_ERROR_FROM_DB;
                goto out;
+               /* LCOV_EXCL_STOP */
        }
 
        info.db = db;
        info.uid = uid;
        pkgmgr_ret = pkgmgrinfo_pkginfo_usr_filter_foreach_pkginfo(handle, _foreach_package_info_callback, &info, uid);
        if (pkgmgr_ret != PMINFO_R_OK) {
+               /* LCOV_EXCL_START */
                NOTIFICATION_ERR("Failed to iterate pkginfo[%d]", pkgmgr_ret);
                err = NOTIFICATION_ERROR_FROM_DB;
                goto out;
+               /* LCOV_EXCL_STOP */
        }
 
 out:
@@ -568,25 +590,31 @@ EXPORT_API int notification_setting_refresh_setting_table(uid_t uid)
 
        pkgmgr_ret = pkgmgrinfo_pkginfo_filter_create(&filter);
        if (pkgmgr_ret != PMINFO_R_OK) {
+               /* LCOV_EXCL_START */
                NOTIFICATION_ERR("Failed to create pkginfo_filter[%d]", pkgmgr_ret);
                err = NOTIFICATION_ERROR_FROM_DB;
                goto out;
+               /* LCOV_EXCL_STOP */
        }
 
        pkgmgr_ret = pkgmgrinfo_pkginfo_filter_add_string(filter, PMINFO_PKGINFO_PROP_PACKAGE_PRIVILEGE, NOTIFICATION_PRIVILEGE);
        if (pkgmgr_ret != PMINFO_R_OK) {
+               /* LCOV_EXCL_START */
                NOTIFICATION_ERR("Failed to add string to pkginfo_filter[%d]", pkgmgr_ret);
                err = NOTIFICATION_ERROR_FROM_DB;
                goto out;
+               /* LCOV_EXCL_STOP */
        }
 
        info.db = db;
        info.uid = uid;
        pkgmgr_ret = pkgmgrinfo_pkginfo_usr_filter_foreach_pkginfo(filter, _foreach_package_info_callback, &info, uid);
        if (pkgmgr_ret != PMINFO_R_OK) {
+               /* LCOV_EXCL_START */
                NOTIFICATION_ERR("Failed to foreach pkginfo[%d]", pkgmgr_ret);
                err = NOTIFICATION_ERROR_FROM_DB;
                goto out;
+               /* LCOV_EXCL_STOP */
        }
 
 out:
@@ -908,6 +936,7 @@ static gint _noti_dnd_cb_compare(gconstpointer a, gconstpointer b)
        return 1;
 }
 
+/* LCOV_EXCL_START */
 void notification_call_dnd_changed_cb_for_uid(int do_not_disturb, uid_t uid)
 {
        GList *noti_dnd_cb_list = NULL;
@@ -931,6 +960,7 @@ void notification_call_dnd_changed_cb_for_uid(int do_not_disturb, uid_t uid)
                        dnd_data->callback(dnd_data->user_data, do_not_disturb);
        }
 }
+/* LCOV_EXCL_STOP */
 
 EXPORT_API int notification_register_system_setting_dnd_changed_cb_for_uid(dnd_changed_cb callback, void *user_data, uid_t uid)
 {
index 58d747c..0b05ec4 100755 (executable)
@@ -118,21 +118,25 @@ int noti_setting_service_get_setting_by_app_id(const char *app_id, notification_
                        NOTIFICATION_SETTING_DB_ATTRIBUTES, NOTIFICATION_SETTING_DB_TABLE,
                        app_id, uid);
        if (query == NULL) {
-               NOTIFICATION_ERR("Failed to alloc query"); /* LCOV_EXCL_LINE */
+               /* LCOV_EXCL_START */
+               NOTIFICATION_ERR("Failed to alloc query");
                ret = NOTIFICATION_ERROR_OUT_OF_MEMORY;
                goto out;
+               /* LCOV_EXCL_STOP */
        }
 
        sql_ret = sqlite3_get_table(db, query, &query_result, &row_count, &column_count, NULL);
        if (sql_ret != SQLITE_OK && sql_ret != -1) {
+               /* LCOV_EXCL_START */
                NOTIFICATION_ERR("sqlite3_get_table failed [%d][%s]", sql_ret,
-                               query); /* LCOV_EXCL_LINE */
+                               query);
                ret = NOTIFICATION_ERROR_FROM_DB;
                goto out;
+               /* LCOV_EXCL_STOP */
        }
 
        if (!row_count) {
-               NOTIFICATION_DBG("No setting found for [%s]", app_id); /* LCOV_EXCL_LINE */
+               NOTIFICATION_DBG("No setting found for [%s]", app_id);
                ret = NOTIFICATION_ERROR_NOT_EXIST_ID;
                goto out;
        }
@@ -142,9 +146,11 @@ int noti_setting_service_get_setting_by_app_id(const char *app_id, notification_
        row_count = 1;
 
        if (!(result_setting_array = (struct notification_setting *)malloc(sizeof(struct notification_setting) * row_count))) {
-               NOTIFICATION_ERR("Failed to alloc memory"); /* LCOV_EXCL_LINE */
+               /* LCOV_EXCL_START */
+               NOTIFICATION_ERR("Failed to alloc memory");
                ret = NOTIFICATION_ERROR_OUT_OF_MEMORY;
                goto out;
+               /* LCOV_EXCL_STOP */
        }
 
        col_index = column_count;
@@ -201,17 +207,21 @@ int noti_setting_get_setting_array(notification_setting_h *setting_array, int *c
                                "app_id ", NOTIFICATION_SETTING_DB_ATTRIBUTES,
                                NOTIFICATION_SETTING_DB_TABLE, uid, 0);
        if (query == NULL) {
+               /* LCOV_EXCL_START */
                NOTIFICATION_ERR("Failed to alloc query"); /* LCOV_EXCL_LINE */
                ret = NOTIFICATION_ERROR_OUT_OF_MEMORY;
                goto out;
+               /* LCOV_EXCL_STOP */
        }
 
        sql_ret = sqlite3_get_table(db, query, &query_result, &row_count, &column_count, NULL);
        if (sql_ret != SQLITE_OK && sql_ret != -1) {
+               /* LCOV_EXCL_START */
                NOTIFICATION_ERR("Failed to get db table [%d][%s]",
                        sql_ret, query); /* LCOV_EXCL_LINE */
                ret = NOTIFICATION_ERROR_FROM_DB;
                goto out;
+               /* LCOV_EXCL_STOP */
        }
 
        if (!row_count) {
@@ -223,9 +233,11 @@ int noti_setting_get_setting_array(notification_setting_h *setting_array, int *c
        NOTIFICATION_DBG("row_count[%d] column_count[%d]", row_count, column_count);
 
        if (!(result_setting_array = (struct notification_setting *)malloc(sizeof(struct notification_setting) * row_count))) {
+               /* LCOV_EXCL_START */
                NOTIFICATION_ERR("Failed to alloc memory"); /* LCOV_EXCL_LINE */
                ret = NOTIFICATION_ERROR_OUT_OF_MEMORY;
                goto out;
+               /* LCOV_EXCL_STOP */
        }
 
        col_index = column_count;
@@ -284,25 +296,31 @@ int noti_system_setting_load_system_setting(notification_system_setting_h *syste
                        NOTIFICATION_SYSTEM_SETTING_DB_ATTRIBUTES,
                        NOTIFICATION_SYSTEM_SETTING_DB_TABLE, uid);
        if (query == NULL) {
+               /* LCOV_EXCL_START */
                NOTIFICATION_ERR("Failed to alloc query"); /* LCOV_EXCL_LINE */
                ret = NOTIFICATION_ERROR_OUT_OF_MEMORY;
                goto out;
+               /* LCOV_EXCL_STOP */
        }
 
        sql_ret = sqlite3_get_table(db, query, &query_result, &row_count, &column_count, NULL);
        if (sql_ret != SQLITE_OK && sql_ret != -1) {
+               /* LCOV_EXCL_START */
                NOTIFICATION_ERR("Failed to get db table [%d][%s]", sql_ret, query); /* LCOV_EXCL_LINE */
                ret = NOTIFICATION_ERROR_FROM_DB;
                goto out;
+               /* LCOV_EXCL_STOP */
        }
 
        NOTIFICATION_DBG("row_count [%d] column_count [%d]", row_count, column_count);
 
        result_system_setting = (struct notification_system_setting *)malloc(sizeof(struct notification_system_setting));
        if (result_system_setting == NULL) {
+               /* LCOV_EXCL_START */
                NOTIFICATION_ERR("Failed to alloc memory"); /* LCOV_EXCL_LINE */
                ret = NOTIFICATION_ERROR_OUT_OF_MEMORY;
                goto out;
+               /* LCOV_EXCL_STOP */
        }
 
        /* no system setting record. allow everyting */
@@ -377,8 +395,10 @@ int notification_setting_db_update(const char *package_name, const char *app_id,
                        pop_up_notification, lock_screen_content_level, app_id,
                        package_name, uid);
        if (query == NULL) {
+               /* LCOV_EXCL_START */
                ret = NOTIFICATION_ERROR_OUT_OF_MEMORY;
                goto out;
+               /* LCOV_EXCL_STOP */
        }
 
        ret = notification_db_exec(db, query, NULL);
@@ -418,8 +438,10 @@ int notification_setting_db_update_system_setting(int do_not_disturb, int visibi
                        dnd_start_min, dnd_end_hour, dnd_end_min,
                        lock_screen_content_level);
        if (query == NULL) {
+               /* LCOV_EXCL_START */
                ret = NOTIFICATION_ERROR_OUT_OF_MEMORY;
                goto out;
+               /* LCOV_EXCL_STOP */
        }
 
        ret = notification_db_exec(db, query, &num_changes);
@@ -456,9 +478,11 @@ int notification_setting_db_update_do_not_disturb(int do_not_disturb, uid_t uid)
                                NOTIFICATION_SYSTEM_SETTING_DB_TABLE,
                                do_not_disturb, uid);
        if (query == NULL) {
+               /* LCOV_EXCL_START */
                NOTIFICATION_ERR("Failed to alloc query"); /* LCOV_EXCL_LINE */
                ret = NOTIFICATION_ERROR_OUT_OF_MEMORY;
                goto out;
+               /* LCOV_EXCL_STOP */
        }
 
        ret = notification_db_exec(db, query, NULL);
@@ -495,15 +519,19 @@ int notification_system_setting_get_dnd_schedule_enabled_uid(uid_t **uids, int *
                                "WHERE dnd_schedule_enabled = 1",
                                NOTIFICATION_SYSTEM_SETTING_DB_TABLE);
        if (query == NULL) {
+               /* LCOV_EXCL_START */
                ret = NOTIFICATION_ERROR_OUT_OF_MEMORY;
                goto out;
+               /* LCOV_EXCL_STOP */
        }
 
        ret = sqlite3_get_table(db, query, &query_result, &row_count, &column_count, NULL);
        if (ret != SQLITE_OK && ret != -1) {
+               /* LCOV_EXCL_START */
                NOTIFICATION_ERR("Failed to get DB table [%d][%s]", ret, query);        /* LCOV_EXCL_LINE */
                ret = NOTIFICATION_ERROR_FROM_DB;
                goto out;
+               /* LCOV_EXCL_STOP */
        }
 
        if (row_count == 0) {
@@ -513,9 +541,11 @@ int notification_system_setting_get_dnd_schedule_enabled_uid(uid_t **uids, int *
        }
 
        if (!(result_uids = (uid_t *)malloc(sizeof(int) * row_count))) {
+               /* LCOV_EXCL_START */
                NOTIFICATION_ERR("Failed to alloc memory");
                ret = NOTIFICATION_ERROR_OUT_OF_MEMORY;
                goto out;
+               /* LCOV_EXCL_STOP */
        }
 
        column_index = column_count;
@@ -569,25 +599,31 @@ int notification_get_dnd_and_allow_to_notify(const char *app_id,
                                NOTIFICATION_SETTING_DB_TABLE, app_id,
                                uid, tzplatform_getuid(TZ_SYS_GLOBALAPP_USER));
        if (query_setting == NULL) {
+               /* LCOV_EXCL_START */
                NOTIFICATION_ERR("Failed to alloc memory");
                ret = NOTIFICATION_ERROR_OUT_OF_MEMORY;
                goto out;
+               /* LCOV_EXCL_STOP */
        }
 
        query_system_setting = sqlite3_mprintf("SELECT do_not_disturb FROM %s "
                                        "WHERE uid = %d",
                                        NOTIFICATION_SYSTEM_SETTING_DB_TABLE, uid);
        if (query_system_setting == NULL) {
+               /* LCOV_EXCL_START */
                NOTIFICATION_ERR("Failed to alloc memory");
                ret = NOTIFICATION_ERROR_OUT_OF_MEMORY;
                goto out;
+               /* LCOV_EXCL_STOP */
        }
 
        sql_ret = sqlite3_get_table(db, query_setting, &query_setting_result, &row_count, &col_count, NULL);
        if (sql_ret != SQLITE_OK && sql_ret != -1) {
+               /* LCOV_EXCL_START */
                NOTIFICATION_ERR("Failed to get DB table [%d][%s]", sql_ret, query_setting);
                ret = NOTIFICATION_ERROR_FROM_DB;
                goto out;
+               /* LCOV_EXCL_STOP */
        }
 
        if (row_count == 0) {
@@ -602,9 +638,11 @@ int notification_get_dnd_and_allow_to_notify(const char *app_id,
 
        sql_ret = sqlite3_get_table(db, query_system_setting, &query_system_setting_result, &row_count, &col_count, NULL);
        if (sql_ret != SQLITE_OK && sql_ret != -1) {
+               /* LCOV_EXCL_START */
                NOTIFICATION_ERR("Failed to get DB table [%d][%s]", sql_ret, query_setting);
                ret = NOTIFICATION_ERROR_FROM_DB;
                goto out;
+               /* LCOV_EXCL_STOP */
        }
 
        if (row_count == 0) {
@@ -660,16 +698,20 @@ EXPORT_API int notification_system_setting_load_dnd_allow_exception(dnd_allow_ex
        query = sqlite3_mprintf("SELECT type, value FROM %s WHERE uid = %d",
                        NOTIFICATION_DND_ALLOW_EXCEPTION, uid);
        if (query == NULL) {
-               NOTIFICATION_ERR("Failed to alloc memory"); /* LCOV_EXCL_LINE */
+               /* LCOV_EXCL_START */
+               NOTIFICATION_ERR("Failed to alloc memory");
                ret = NOTIFICATION_ERROR_OUT_OF_MEMORY;
                goto out;
+               /* LCOV_EXCL_STOP */
        }
 
        sql_ret = sqlite3_get_table(db, query, &query_result, &row_count, &column_count, NULL);
        if (sql_ret != SQLITE_OK && sql_ret != -1) {
+               /* LCOV_EXCL_START */
                NOTIFICATION_ERR("Failed to get DB table [%d][%s]", sql_ret, query); /* LCOV_EXCL_LINE */
                ret = NOTIFICATION_ERROR_FROM_DB;
                goto out;
+               /* LCOV_EXCL_STOP */
        }
 
        if (!row_count) {
@@ -723,9 +765,11 @@ int notification_system_setting_update_dnd_allow_exception(int type, int value,
                                NOTIFICATION_DND_ALLOW_EXCEPTION,
                                uid, type, value);
        if (query == NULL) {
-               NOTIFICATION_ERR("Failed to alloc memory"); /* LCOV_EXCL_LINE */
+               /* LCOV_EXCL_START */
+               NOTIFICATION_ERR("Failed to alloc memory");
                ret = NOTIFICATION_ERROR_OUT_OF_MEMORY;
                goto out;
+               /* LCOV_EXCL_STOP */
        }
 
        ret = notification_db_exec(db, query, &num_changes);
@@ -763,22 +807,28 @@ int noti_system_setting_get_do_not_disturb(int *do_not_disturb, uid_t uid)
        query = sqlite3_mprintf("SELECT do_not_disturb FROM %s WHERE uid = %d",
                                NOTIFICATION_SYSTEM_SETTING_DB_TABLE, uid);
        if (query == NULL) {
+               /* LCOV_EXCL_START */
                NOTIFICATION_ERR("Failed to alloc memory");
                ret = NOTIFICATION_ERROR_OUT_OF_MEMORY;
                goto out;
+               /* LCOV_EXCL_STOP */
        }
 
        ret = sqlite3_get_table(db, query, &query_result, &row_count, &col_count, NULL);
        if (ret != SQLITE_OK && ret != -1) {
+               /* LCOV_EXCL_START */
                NOTIFICATION_ERR("Failed to get DB table [%d][%s]", ret, query);
                ret = NOTIFICATION_ERROR_FROM_DB;
                goto out;
+               /* LCOV_EXCL_STOP */
        }
 
        col_index = col_count;
        if (row_count == 0) {
+               /* LCOV_EXCL_START */
                NOTIFICATION_ERR("No system setting found");
                ret = NOTIFICATION_ERROR_INVALID_PARAMETER;
+               /* LCOV_EXCL_STOP */
        } else {
                if (_get_table_field_data_int(query_result, (int *)do_not_disturb, col_index++) == false)
                        ret = NOTIFICATION_ERROR_FROM_DB;
index eef21a7..a00de13 100755 (executable)
@@ -82,6 +82,7 @@ static bool __make_sharing_dir(const char *dir)
        if (access(dir, R_OK) != 0) {
                noti_dir = g_file_new_for_path(dir);
                if (g_file_make_directory(noti_dir, NULL, &g_err) == false) {
+                       /* LCOV_EXCL_START */
                        if (g_err) {
                                NOTIFICATION_ERR("Failed to make sharing dir[%s]",
                                        g_err->message);
@@ -89,6 +90,7 @@ static bool __make_sharing_dir(const char *dir)
                        }
                        g_object_unref(noti_dir);
                        return false;
+                       /* LCOV_EXCL_STOP */
                }
                g_object_unref(noti_dir);
        }
@@ -148,6 +150,7 @@ static const char *__last_index_of(const char *path, const char *search)
 }
 
 /* Check path that include res directory */
+/* LCOV_EXCL_START */
 static bool __is_private_file(const char *smack_label, const char *pkg_id)
 {
        const char *smack_index;
@@ -162,6 +165,7 @@ static bool __is_private_file(const char *smack_label, const char *pkg_id)
 
        return ret;
 }
+/* LCOV_EXCL_STOP */
 
 static bool __is_RO_file(const char *smack_label)
 {
@@ -189,9 +193,11 @@ int notification_copy_private_file(const char* src_path,
 
        dst = g_file_new_for_path(dst_path);
        if (dst == NULL) {
+               /* LCOV_EXCL_START */
                NOTIFICATION_ERR("dst path is wrong [%s]", dst_path);
                ret = NOTIFICATION_ERROR_IO_ERROR;
                goto out;
+               /* LCOV_EXCL_STOP */
        }
 
        if (g_file_query_exists(dst, NULL) == true) {
@@ -202,12 +208,15 @@ int notification_copy_private_file(const char* src_path,
 
        src = g_file_new_for_path(src_path);
        if (src == NULL) {
+               /* LCOV_EXCL_START */
                NOTIFICATION_ERR("src path is wrong [%s]", src_path);
                ret = NOTIFICATION_ERROR_IO_ERROR;
                goto out;
+               /* LCOV_EXCL_STOP */
        }
 
        if (!g_file_copy(src, dst, G_FILE_COPY_NOFOLLOW_SYMLINKS,
+               /* LCOV_EXCL_START */
                        NULL, NULL, NULL, &g_err)) {
                if (g_err) {
                        NOTIFICATION_ERR(
@@ -217,6 +226,7 @@ int notification_copy_private_file(const char* src_path,
                }
                ret = NOTIFICATION_ERROR_IO_ERROR;
                goto out;
+               /* LCOV_EXCL_STOP */
        }
 
        ut.modtime = time(NULL);
@@ -245,6 +255,7 @@ static void __free_file_info(gpointer data)
        }
 }
 
+/* LCOV_EXCL_START */
 static void __free_req_info(gpointer data)
 {
        sharing_req_data_s * info = (sharing_req_data_s *)data;
@@ -262,6 +273,7 @@ static void __free_req_info(gpointer data)
 
        free(info);
 }
+/* LCOV_EXCL_STOP */
 
 static char **__convert_list_to_array(GList *list, int *length)
 {
@@ -298,6 +310,7 @@ static gint __comp_str(gconstpointer a, gconstpointer b)
        return strcmp(new_file, file);
 }
 
+/* LCOV_EXCL_START */
 static gint __comp_file_info(gconstpointer a, gconstpointer b)
 {
        sharing_file_info_s *file = (sharing_file_info_s *)a;
@@ -308,7 +321,9 @@ static gint __comp_file_info(gconstpointer a, gconstpointer b)
 
        return strcmp(new_file->dst_path, file->dst_path);
 }
+/* LCOV_EXCL_STOP */
 
+/* LCOV_EXCL_START */
 static gint __comp_dst_path(gconstpointer a, gconstpointer b)
 {
        sharing_file_info_s *info = (sharing_file_info_s *)a;
@@ -319,6 +334,7 @@ static gint __comp_dst_path(gconstpointer a, gconstpointer b)
 
        return strcmp(info->dst_path, path);
 }
+/* LCOV_EXCL_STOP */
 
 static sharing_file_info_s * __dup_file_info(sharing_file_info_s *src)
 {
@@ -870,18 +886,22 @@ int __set_sharing_for_new_file(sharing_req_data_s *req_data,
        ret = security_manager_private_sharing_req_set_owner_appid(handle,
                                        req_data->app_id);
        if (ret != SECURITY_MANAGER_SUCCESS) {
+               /* LCOV_EXCL_START */
                NOTIFICATION_ERR("Failed to set owner appid[%s][%d]",
                                req_data->app_id, ret);
                ret = NOTIFICATION_ERROR_IO_ERROR;
                goto out;
+               /* LCOV_EXCL_STOP */
        }
 
        ret = security_manager_private_sharing_req_add_paths(handle,
                                                (const char **)path_array, len);
        if (ret != SECURITY_MANAGER_SUCCESS) {
+               /* LCOV_EXCL_START */
                NOTIFICATION_ERR("Failed to add paths [%d]", ret);
                ret = NOTIFICATION_ERROR_IO_ERROR;
                goto out;
+               /* LCOV_EXCL_STOP */
        }
 
        if (is_overlapping == true) {
@@ -890,17 +910,21 @@ int __set_sharing_for_new_file(sharing_req_data_s *req_data,
                        ret = security_manager_private_sharing_req_set_target_appid(
                                                        handle, (const char *)iter->data);
                        if (ret != SECURITY_MANAGER_SUCCESS) {
+                               /* LCOV_EXCL_START */
                                NOTIFICATION_ERR("Failed to set target appid [%s]",
                                        (const char *)iter->data);
                                ret = NOTIFICATION_ERROR_IO_ERROR;
                                goto out;
+                               /* LCOV_EXCL_STOP */
                        }
 
                        ret = security_manager_private_sharing_drop(handle);
                        if (ret != SECURITY_MANAGER_SUCCESS) {
+                               /* LCOV_EXCL_START */
                                NOTIFICATION_ERR("Failed to drop [%d]", ret);
                                ret = NOTIFICATION_ERROR_IO_ERROR;
                                goto out;
+                               /* LCOV_EXCL_STOP */
                        }
                }
        }
@@ -910,17 +934,21 @@ int __set_sharing_for_new_file(sharing_req_data_s *req_data,
                ret = security_manager_private_sharing_req_set_target_appid(handle,
                                                        (const char *)iter->data);
                if (ret != SECURITY_MANAGER_SUCCESS) {
-                               NOTIFICATION_ERR("Failed to set target appid [%s]",
-                                       (const char *)iter->data);
-                               ret = NOTIFICATION_ERROR_IO_ERROR;
-                               goto out;
+                       /* LCOV_EXCL_START */
+                       NOTIFICATION_ERR("Failed to set target appid [%s]",
+                               (const char *)iter->data);
+                       ret = NOTIFICATION_ERROR_IO_ERROR;
+                       goto out;
+                       /* LCOV_EXCL_STOP */
                }
 
                ret = security_manager_private_sharing_apply(handle);
                if (ret != SECURITY_MANAGER_SUCCESS) {
+                       /* LCOV_EXCL_START */
                        NOTIFICATION_ERR("Failed to apply PS [%d]", ret);
                        ret = NOTIFICATION_ERROR_IO_ERROR;
                        goto out;
+                       /* LCOV_EXCL_STOP */
                }
        }
 
index 52d7f9b..9247375 100644 (file)
@@ -36,6 +36,7 @@ EXPORT_API int notification_get_default_viewer(const char *path, char **default_
                return -1;
        }
 
+       /* LCOV_EXCL_START */
        dict = iniparser_load(path);
        if (!dict) {
                NOTIFICATION_ERR("can't load file");
@@ -49,8 +50,10 @@ EXPORT_API int notification_get_default_viewer(const char *path, char **default_
        iniparser_freedict(dict);
 
        return 0;
+       /* LCOV_EXCL_STOP */
 }
 
+/* LCOV_EXCL_START */
 EXPORT_API int notification_launch_default_viewer(const char *default_viewer, int priv_id, uid_t uid)
 {
        int ret;
@@ -97,3 +100,4 @@ out:
 
        return ret;
 }
+/* LCOV_EXCL_STOP */