Exclude System error and callback for line coverage 09/178309/5
authorpr.jung <pr.jung@samsung.com>
Wed, 9 May 2018 08:10:43 +0000 (17:10 +0900)
committerHyotaek Shim <hyotaek.shim@samsung.com>
Wed, 9 May 2018 10:42:33 +0000 (19:42 +0900)
Change-Id: Ib8537c2617053ec47fd7252428c42114c7a71568
Signed-off-by: pr.jung <pr.jung@samsung.com>
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
src/common.c
src/dbus.c
src/haptic.c
src/power.c

index c6fd0a1..c73c9c9 100644 (file)
@@ -65,9 +65,11 @@ int config_parse(const char *file_name, int cb(struct parse_result *result,
                        return 0;
                }
 
+//LCOV_EXCL_START System Error
                _E("Failed to open file %s", file_name);
                ret = -EIO;
                goto error;
+//LCOV_EXCL_STOP
        }
 
        /* parsing line by line */
@@ -144,18 +146,18 @@ tizen_profile_t _get_tizen_profile()
                break;
        case 'w':
        case 'W':
-               profile = TIZEN_PROFILE_WEARABLE;
-               break;
+               profile = TIZEN_PROFILE_WEARABLE; //LCOV_EXCL_LINE
+               break; //LCOV_EXCL_LINE
        case 't':
        case 'T':
-               profile = TIZEN_PROFILE_TV;
-               break;
+               profile = TIZEN_PROFILE_TV; //LCOV_EXCL_LINE
+               break; //LCOV_EXCL_LINE
        case 'i':
        case 'I':
-               profile = TIZEN_PROFILE_IVI;
-               break;
+               profile = TIZEN_PROFILE_IVI; //LCOV_EXCL_LINE
+               break; //LCOV_EXCL_LINE
        default: // common or unknown ==> ALL ARE COMMON.
-               profile = TIZEN_PROFILE_COMMON;
+               profile = TIZEN_PROFILE_COMMON; //LCOV_EXCL_LINE
        }
        free(profileName);
 
index 4f84fcc..8934432 100644 (file)
@@ -144,6 +144,7 @@ static struct proxy_node *find_matched_proxy_node(const char *dest,
        return NULL;
 }
 
+//LCOV_EXCL_START Not called Callback
 static void on_name_vanished(GDBusConnection *connection,
                const gchar *name,
                gpointer user_data)
@@ -167,6 +168,7 @@ static void on_name_vanished(GDBusConnection *connection,
        }
        pthread_mutex_unlock(&dmutex);
 }
+//LCOV_EXCL_STOP
 
 static GDBusProxy *get_proxy_from_proxy_pool(const char *dest,
                const char *path,
@@ -218,12 +220,14 @@ static GDBusProxy *get_proxy_from_proxy_pool(const char *dest,
 
        node = malloc(sizeof(struct proxy_node));
        if (!node) {
+//LCOV_EXCL_START System Error
                g_object_unref(proxy);
                if (err)
                        g_set_error(err, G_IO_ERROR,
                                        G_IO_ERROR_FAILED,
                                        "Cannot allocate proxy_node memory");
                return NULL;
+//LCOV_EXCL_STOP
        }
 
        node->proxy = proxy;
@@ -483,6 +487,7 @@ int dbus_method_async_with_reply(const char *dest, const char *path,
        return 0;
 }
 
+//LCOV_EXCL_START Not called Callback
 static void haptic_signal_callback(GDBusConnection *conn,
                const gchar *sender,
                const gchar *path,
@@ -507,6 +512,7 @@ static void haptic_signal_callback(GDBusConnection *conn,
 
        restart_callback();
 }
+//LCOV_EXCL_STOP
 
 int register_signal_handler(void)
 {
@@ -539,7 +545,7 @@ int register_signal_handler(void)
 
        g_object_unref(conn);
        if (haptic_id == 0) {
-               _E("Failed to subscrive bus signal");
+               _E("Failed to subscrive bus signal"); //LCOV_EXCL_LINE System Error
                return -EPERM;
        }
 
index 10704b5..b5a0ecd 100644 (file)
@@ -74,6 +74,7 @@ int device_haptic_get_count(int *device_number)
        return DEVICE_ERROR_NONE;
 }
 
+//LCOV_EXCL_START Not called Callback
 void restart_callback(void)
 {
        dd_list *elem;
@@ -96,6 +97,7 @@ void restart_callback(void)
        }
 
 }
+//LCOV_EXCL_STOP
 
 int device_haptic_open(int device_index, haptic_device_h *device_handle)
 {
@@ -138,7 +140,7 @@ int device_haptic_open(int device_index, haptic_device_h *device_handle)
        if (!found) {
                handle = (struct haptic_handle *)malloc(sizeof(struct haptic_handle));
                if (!handle) {
-                       _E("Failed to malloc");
+                       _E("Failed to malloc"); //LCOV_EXCL_LINE System Error
                        return DEVICE_ERROR_OPERATION_FAILED;
                }
 
@@ -150,7 +152,7 @@ int device_haptic_open(int device_index, haptic_device_h *device_handle)
        if (DD_LIST_LENGTH(handle_list) == 1) {
                ret = register_signal_handler();
                if (ret < 0)
-                       _E("Faild to register signal handler");
+                       _E("Faild to register signal handler"); //LCOV_EXCL_LINE
        }
 
        return DEVICE_ERROR_NONE;
@@ -193,7 +195,7 @@ int device_haptic_close(haptic_device_h device_handle)
        if (DD_LIST_LENGTH(handle_list) == 0) {
                ret = unregister_signal_handler();
                if (ret < 0)
-                       _E("Failed to unregister signal handler");
+                       _E("Failed to unregister signal handler"); //LCOV_EXCL_LINE
        }
 
        return DEVICE_ERROR_NONE;
index d3f6393..a7fd936 100755 (executable)
@@ -125,6 +125,7 @@ static void remove_padding_timeout(void)
        }
 }
 
+//LCOV_EXCL_START Callback function
 static void notice_lock_expired_done(void *data, GVariant *result, GError *err)
 {
        int val, ret;
@@ -160,14 +161,18 @@ static void notice_lock_expired_done(void *data, GVariant *result, GError *err)
                        _E("Failed to release power(CPU) (%d)", ret);
        }
 }
+//LCOV_EXCL_STOP
 
+//LCOV_EXCL_START Callback function
 static char *get_new_request_id(pid_t pid)
 {
        char id[64];
        snprintf(id, sizeof(id), "%d_%lu", pid, time(NULL));
        return strdup(id);
 }
+//LCOV_EXCL_STOP
 
+//LCOV_EXCL_START Callback function
 static int notice_power_lock_expired(void)
 {
        int ret;
@@ -203,7 +208,9 @@ static int notice_power_lock_expired(void)
 
        return 0;
 }
+//LCOV_EXCL_STOP
 
+//LCOV_EXCL_START Callback function
 static gboolean padding_timeout_expired(gpointer data)
 {
        int ret, ref;
@@ -247,7 +254,9 @@ out:
 
        return G_SOURCE_REMOVE;
 }
+//LCOV_EXCL_STOP
 
+//LCOV_EXCL_START Callback function
 static void add_padding_timeout(void)
 {
        guint id;
@@ -263,7 +272,9 @@ static void add_padding_timeout(void)
        else
                _E("Failed to add timeout for padding time");
 }
+//LCOV_EXCL_STOP
 
+//LCOV_EXCL_START Callback function
 static gboolean off_lock_timeout_expired(gpointer data)
 {
        int ret, ref;
@@ -290,6 +301,7 @@ static gboolean off_lock_timeout_expired(gpointer data)
 out:
        return G_SOURCE_CONTINUE;
 }
+//LCOV_EXCL_STOP
 
 static void add_off_lock_timeout(void)
 {
@@ -475,7 +487,7 @@ int device_power_wakeup(bool dim)
        return device_display_change_state(DISPLAY_STATE_NORMAL);
 }
 
-//LCOV_EXCL_START Not available to test(Reboot during TCT)
+//LCOV_EXCL_START Not available to test (Reboot during TCT)
 int device_power_reboot(const char *reason)
 {
        char *arr[2];
@@ -532,5 +544,5 @@ static void __CONSTRUCTOR__ power_init(void)
 
        ret = config_parse(POWER_CONF, power_load_config, NULL);
        if (ret < 0)
-               _E("Failed to load config file (%d)", ret);
+               _E("Failed to load config file (%d)", ret); //LCOV_EXCL_LINE
 }