Add comments for line/function coverage analysis 41/71141/3 accepted/tizen/common/20160714.152719 accepted/tizen/ivi/20160714.053927 accepted/tizen/mobile/20160714.053907 accepted/tizen/tv/20160714.053911 accepted/tizen/wearable/20160714.053919 submit/accepted/tizen_common/20160714.001558 submit/tizen/20160714.000744
authorpr.jung <pr.jung@samsung.com>
Tue, 24 May 2016 07:54:42 +0000 (16:54 +0900)
committerpr.jung <pr.jung@samsung.com>
Wed, 13 Jul 2016 07:56:15 +0000 (16:56 +0900)
- Remove system error, not called callback, not used function and logs.
- Drops the exclusion reason for Logs

Change-Id: I978869726e64a2c1d14a23e7a871ebd6b67ee0c5
Signed-off-by: pr.jung <pr.jung@samsung.com>
12 files changed:
src/battery.c
src/callback.c
src/common.h
src/cpu.c
src/dbus.c
src/device.c
src/display.c
src/haptic.c
src/ir.c
src/led.c
src/memory.c
src/power.c

index f1f5217..81bfa70 100644 (file)
@@ -55,7 +55,7 @@ int device_battery_get_percent(int *percent)
        if (ret == -ENOTSUP)
                ret = 0;
        else if (ret < 0)
-               return errno_to_device_error(ret);
+               return errno_to_device_error(ret); //LCOV_EXCL_LINE System Error
 
        *percent = ret;
        return DEVICE_ERROR_NONE;
index 8958be4..55ee461 100644 (file)
@@ -39,6 +39,7 @@ struct device_cb_info {
 static dd_list *device_cb_list[DEVICE_CALLBACK_MAX];
 static int flash_sigid;
 
+//LCOV_EXCL_START Not called Callback
 static void battery_capacity_cb(keynode_t *key, void *data)
 {
        static device_callback_e type = DEVICE_CALLBACK_BATTERY_CAPACITY;
@@ -52,7 +53,9 @@ static void battery_capacity_cb(keynode_t *key, void *data)
        DD_LIST_FOREACH(device_cb_list[type], elem, cb_info)
                cb_info->cb(type, (void*)val, cb_info->data);
 }
+//LCOV_EXCL_STOP
 
+//LCOV_EXCL_START Not called Callback
 static void battery_charging_cb(keynode_t *key, void *data)
 {
        static device_callback_e type = DEVICE_CALLBACK_BATTERY_CHARGING;
@@ -66,7 +69,9 @@ static void battery_charging_cb(keynode_t *key, void *data)
        DD_LIST_FOREACH(device_cb_list[type], elem, cb_info)
                cb_info->cb(type, (void*)val, cb_info->data);
 }
+//LCOV_EXCL_STOP
 
+//LCOV_EXCL_START Not called Callback
 static void battery_level_cb(keynode_t *key, void *data)
 {
        static device_callback_e type = DEVICE_CALLBACK_BATTERY_LEVEL;
@@ -93,7 +98,9 @@ static void battery_level_cb(keynode_t *key, void *data)
        DD_LIST_FOREACH(device_cb_list[type], elem, cb_info)
                cb_info->cb(type, (void*)status, cb_info->data);
 }
+//LCOV_EXCL_STOP
 
+//LCOV_EXCL_START Not called Callback
 static void display_changed_cb(keynode_t *key, void *data)
 {
        static device_callback_e type = DEVICE_CALLBACK_DISPLAY_STATE;
@@ -119,7 +126,9 @@ static void display_changed_cb(keynode_t *key, void *data)
        DD_LIST_FOREACH(device_cb_list[type], elem, cb_info)
                cb_info->cb(type, (void*)state, cb_info->data);
 }
+//LCOV_EXCL_STOP
 
+//LCOV_EXCL_START Not called Callback
 static void flash_state_cb(GDBusConnection *conn,
                const gchar *sender,
                const gchar *object,
@@ -147,6 +156,7 @@ static void flash_state_cb(GDBusConnection *conn,
        DD_LIST_FOREACH(device_cb_list[type], elem, cb_info)
                cb_info->cb(type, (void*)val, cb_info->data);
 }
+//LCOV_EXCL_STOP
 
 static int register_signal(const char *bus_name,
                const char *object_path,
@@ -165,8 +175,8 @@ static int register_signal(const char *bus_name,
 
        conn = g_bus_get_sync(G_BUS_TYPE_SYSTEM, NULL, &err);
        if (!conn) {
-               _E("fail to get dbus connection : %s", err->message);
-               g_clear_error(&err);
+               _E("fail to get dbus connection : %s", err->message); //LCOV_EXCL_LINE
+               g_clear_error(&err); //LCOV_EXCL_LINE System Error
                return -EPERM;
        }
 
@@ -182,7 +192,7 @@ static int register_signal(const char *bus_name,
                        NULL,
                        NULL);
        if (id == 0) {
-               _E("fail to connect %s signal", signal);
+               _E("fail to connect %s signal", signal); //LCOV_EXCL_LINE
                return -EPERM;
        }
 
@@ -202,8 +212,8 @@ static int unregister_signal(int *sig_id)
 
        conn = g_bus_get_sync(G_BUS_TYPE_SYSTEM, NULL, &err);
        if (!conn) {
-               _E("fail to get dbus connection : %s", err->message);
-               g_clear_error(&err);
+               _E("fail to get dbus connection : %s", err->message); //LCOV_EXCL_LINE
+               g_clear_error(&err); //LCOV_EXCL_LINE System Error
                return -EPERM;
        }
 
index b4d398a..5eaeed2 100644 (file)
@@ -42,7 +42,7 @@ static inline int errno_to_device_error(int err)
                return DEVICE_ERROR_NONE;
        case -EACCES:
        case -EPERM:
-               return DEVICE_ERROR_PERMISSION_DENIED;
+               return DEVICE_ERROR_PERMISSION_DENIED; //LCOV_EXCL_LINE System Error
        case -EBUSY:
                return DEVICE_ERROR_RESOURCE_BUSY;
        case -ENOTSUP:
index 4077db9..c4444e6 100644 (file)
--- a/src/cpu.c
+++ b/src/cpu.c
@@ -29,7 +29,7 @@
 #define PROC_SCALING_CUR_FREQ                  "/sys/devices/system/cpu/cpu%d/cpufreq/scaling_cur_freq"
 #define PROC_SCALING_MAX_FREQ                  "/sys/devices/system/cpu/cpu%d/cpufreq/scaling_max_freq"
 
-
+//LCOV_EXCL_START Not used function
 int device_cpu_get_count(int *cpu_cnt)
 {
        FILE *fp;
@@ -169,3 +169,4 @@ int device_cpu_get_max_freq(int cpu, unsigned int *max_freq)
        *max_freq = max;
        return DEVICE_ERROR_NONE;
 }
+//LCOV_EXCL_STOP Not used function
index e109293..dcfde8d 100644 (file)
@@ -32,6 +32,7 @@ struct pending_call_data {
        void *data;
 };
 
+//LCOV_EXCL_START System Error
 static int g_dbus_error_to_errno(int code)
 {
        /**
@@ -46,6 +47,7 @@ static int g_dbus_error_to_errno(int code)
                return -ENOTSUP;
        return -ECOMM;
 }
+//LCOV_EXCL_STOP
 
 static GVariant *append_g_variant(const char *sig, char *param[])
 {
@@ -115,11 +117,13 @@ int dbus_method_sync(const char *dest, const char *path,
 
        conn = g_bus_get_sync(G_BUS_TYPE_SYSTEM, NULL, &err);
        if (!conn) {
+//LCOV_EXCL_START System Error
                _E("g_bus_get_sync error : %s-%s (%d-%s)",
                                interface, method, err->code, err->message);
                result = g_dbus_error_to_errno(err->code);
                g_clear_error(&err);
                return result;
+//LCOV_EXCL_STOP
        }
 
        proxy = g_dbus_proxy_new_sync(conn,
@@ -131,11 +135,13 @@ int dbus_method_sync(const char *dest, const char *path,
                        NULL,      /* GCancellable */
                        &err);
        if (!proxy) {
+//LCOV_EXCL_START System Error
                _E("g_dbus_proxy_new_sync error : %s-%s (%d-%s)",
                                interface, method, err->code, err->message);
                result = g_dbus_error_to_errno(err->code);
                g_clear_error(&err);
                return result;
+//LCOV_EXCL_STOP
        }
 
        output = g_dbus_proxy_call_sync(proxy,
@@ -146,6 +152,7 @@ int dbus_method_sync(const char *dest, const char *path,
                        NULL,                         /* GCancellable */
                        &err);
        if (!output) {
+//LCOV_EXCL_START System Error
                if (!err) {
                        _E("g_dbus_proxy_call_sync error : %s-%s",
                                        interface, method);
@@ -158,6 +165,7 @@ int dbus_method_sync(const char *dest, const char *path,
                g_clear_error(&err);
                g_object_unref(proxy);
                return result;
+//LCOV_EXCL_STOP
        }
 
        /* get output value */
@@ -186,11 +194,13 @@ int dbus_method_sync_with_reply(const char *dest,
 
        conn = g_bus_get_sync(G_BUS_TYPE_SYSTEM, NULL, &err);
        if (!conn) {
+//LCOV_EXCL_START System Error
                _E("g_bus_get_sync error : %s-%s (%d-%s)",
                                interface, method, err->code, err->message);
                result = g_dbus_error_to_errno(err->code);
                g_clear_error(&err);
                return result;
+//LCOV_EXCL_STOP
        }
 
        proxy = g_dbus_proxy_new_sync(conn,
@@ -202,11 +212,13 @@ int dbus_method_sync_with_reply(const char *dest,
                        NULL,      /* GCancellable */
                        &err);
        if (!proxy) {
+//LCOV_EXCL_START System Error
                _E("g_dbus_proxy_new_sync error : %s-%s (%d-%s)",
                                interface, method, err->code, err->message);
                result = g_dbus_error_to_errno(err->code);
                g_clear_error(&err);
                return result;
+//LCOV_EXCL_STOP
        }
 
        output = g_dbus_proxy_call_sync(proxy,
@@ -218,6 +230,7 @@ int dbus_method_sync_with_reply(const char *dest,
                        &err);
        if (!output) {
                if (!err) {
+//LCOV_EXCL_START System Error
                        _E("g_dbus_proxy_call_sync error : %s-%s",
                                        interface, method);
                        g_object_unref(proxy);
@@ -229,6 +242,7 @@ int dbus_method_sync_with_reply(const char *dest,
                g_clear_error(&err);
                g_object_unref(proxy);
                return result;
+//LCOV_EXCL_STOP
        }
 
        g_object_unref(proxy);
@@ -249,7 +263,7 @@ static void cb_pending(GDBusProxy *proxy,
                        res, /* GAsyncResult */
                        &err);
        if (!output)
-               _E("g_dbus_proxy_call_finish error : %d-%s",
+               _E("g_dbus_proxy_call_finish error : %d-%s", //LCOV_EXCL_LINE
                                err->code, err->message);
 
        if (data && data->func)
@@ -257,7 +271,9 @@ static void cb_pending(GDBusProxy *proxy,
        free(data);
 
        if (err)
+//LCOV_EXCL_START System Error
                g_clear_error(&err);
+//LCOV_EXCL_STOP
        if (output)
                g_variant_unref(output);
        g_object_unref(proxy);
@@ -280,11 +296,13 @@ int dbus_method_async_with_reply(const char *dest, const char *path,
 
        conn = g_bus_get_sync(G_BUS_TYPE_SYSTEM, NULL, &err);
        if (!conn) {
+//LCOV_EXCL_START System Error
                _E("g_bus_get_sync error : %s-%s (%d-%s)",
                                interface, method, err->code, err->message);
                result = g_dbus_error_to_errno(err->code);
                g_clear_error(&err);
                return result;
+//LCOV_EXCL_STOP
        }
 
        proxy = g_dbus_proxy_new_sync(conn,
@@ -296,16 +314,18 @@ int dbus_method_async_with_reply(const char *dest, const char *path,
                        NULL,      /* GCancellable */
                        &err);
        if (!proxy) {
+//LCOV_EXCL_START System Error
                _E("g_dbus_proxy_new_sync error : %s-%s (%d-%s)",
                                interface, method, err->code, err->message);
                result = g_dbus_error_to_errno(err->code);
                g_clear_error(&err);
                return result;
+//LCOV_EXCL_STOP
        }
 
        pdata = malloc(sizeof(struct pending_call_data));
        if (!pdata) {
-               _E("malloc error : %s-%s",
+               _E("malloc error : %s-%s", //LCOV_EXCL_LINE
                                interface, method);
                return -ENOMEM;
        }
index fb80bad..e9abdd9 100644 (file)
@@ -33,6 +33,7 @@
                }       \
        } while (0)
 
+//LCOV_EXCL_START
 int device_get_display_numbers(int* device_number)
 {
        return device_display_get_numbers(device_number);
@@ -223,3 +224,4 @@ int device_battery_warning_unset_cb(void)
 
        return DEVICE_ERROR_NONE;
 }
+//LCOV_EXCL_STOP
index 23bf350..bdca5ae 100644 (file)
@@ -87,7 +87,7 @@ int device_display_get_max_brightness(int display_index, int *max_brightness)
 
        if (display_cnt < 0) {
                ret = device_display_get_numbers(&display_cnt);
-               if (ret != DEVICE_ERROR_NONE)
+               if (ret != DEVICE_ERROR_NONE) //LCOV_EXCL_LINE System Error
                        return ret;
        }
 
@@ -119,7 +119,7 @@ int device_display_get_brightness(int display_index, int *brightness)
 
        if (display_cnt < 0) {
                ret = device_display_get_numbers(&display_cnt);
-               if (ret != DEVICE_ERROR_NONE)
+               if (ret != DEVICE_ERROR_NONE) //LCOV_EXCL_LINE System Error
                        return ret;
        }
 
@@ -144,7 +144,7 @@ int device_display_set_brightness(int display_index, int brightness)
 
        if (display_cnt < 0) {
                ret = device_display_get_numbers(&display_cnt);
-               if (ret != DEVICE_ERROR_NONE)
+               if (ret != DEVICE_ERROR_NONE) //LCOV_EXCL_LINE System Error
                        return ret;
        }
 
index 2e08d54..b510ffd 100644 (file)
@@ -59,7 +59,7 @@ int device_haptic_get_count(int *device_number)
        if (ret == -ENOTSUP)
                ret = 0;
        else if (ret < 0)
-               return errno_to_device_error(ret);
+               return errno_to_device_error(ret); //LCOV_EXCL_LINE System Error
 
        *device_number = ret;
        return DEVICE_ERROR_NONE;
@@ -89,7 +89,7 @@ int device_haptic_open(int device_index, haptic_device_h *device_handle)
                        VIBRATOR_PATH_HAPTIC, VIBRATOR_INTERFACE_HAPTIC,
                        METHOD_OPEN_DEVICE, "i", arr);
        if (ret < 0)
-               return errno_to_device_error(ret);
+               return errno_to_device_error(ret); //LCOV_EXCL_LINE System Error
 
        *device_handle = (haptic_device_h)ret;
        return DEVICE_ERROR_NONE;
@@ -112,7 +112,7 @@ int device_haptic_close(haptic_device_h device_handle)
                        VIBRATOR_PATH_HAPTIC, VIBRATOR_INTERFACE_HAPTIC,
                        METHOD_CLOSE_DEVICE, "u", arr);
        if (ret < 0)
-               return errno_to_device_error(ret);
+               return errno_to_device_error(ret); //LCOV_EXCL_LINE System Error
 
        return DEVICE_ERROR_NONE;
 }
@@ -151,7 +151,7 @@ int device_haptic_vibrate(haptic_device_h device_handle, int duration, int feedb
                        VIBRATOR_PATH_HAPTIC, VIBRATOR_INTERFACE_HAPTIC,
                        METHOD_VIBRATE_MONOTONE, "uiii", arr);
        if (ret < 0)
-               return errno_to_device_error(ret);
+               return errno_to_device_error(ret); //LCOV_EXCL_LINE System Error
 
        if (effect_handle)
                *effect_handle = (haptic_effect_h)ret;
@@ -177,7 +177,7 @@ int device_haptic_stop(haptic_device_h device_handle, haptic_effect_h effect_han
                        VIBRATOR_PATH_HAPTIC, VIBRATOR_INTERFACE_HAPTIC,
                        METHOD_STOP_DEVICE, "u", arr);
        if (ret < 0)
-               return errno_to_device_error(ret);
+               return errno_to_device_error(ret); //LCOV_EXCL_LINE System Error
 
        return DEVICE_ERROR_NONE;
 }
index 5b744cb..8675605 100644 (file)
--- a/src/ir.c
+++ b/src/ir.c
@@ -48,10 +48,12 @@ int device_ir_is_available(bool *available)
                        DEVICED_INTERFACE_IR, METHOD_IS_AVAILABLE,
                        NULL, NULL);
 
+//LCOV_EXCL_START System Error
        if (!ret) {
                *available = false;
                return DEVICE_ERROR_OPERATION_FAILED;
        }
+//LCOV_EXCL_STOP
 
        *available = ir_avail;
        return DEVICE_ERROR_NONE;
@@ -72,14 +74,14 @@ int device_ir_transmit(int carrier_frequency, int *pattern, int size)
                        _E("IR is not supported or IR operation failed");
                        return ret;
                }
-               _E("IR is not supported");
+               _E("IR is not supported"); //LCOV_EXCL_LINE
                return DEVICE_ERROR_OPERATION_FAILED;
        }
 
        if (!pattern)
                return DEVICE_ERROR_INVALID_PARAMETER;
        if (size <= 0) {
-               _E("IR pattern size is invalid");
+               _E("IR pattern size is invalid"); //LCOV_EXCL_LINE
                return DEVICE_ERROR_INVALID_PARAMETER;
        }
 
@@ -95,8 +97,10 @@ int device_ir_transmit(int carrier_frequency, int *pattern, int size)
                        DEVICED_INTERFACE_IR, METHOD_TRANSMIT,
                        "ai", arr);
 
+//LCOV_EXCL_START System Error
        if (ret < 0)
                return DEVICE_ERROR_OPERATION_FAILED;
+//LCOV_EXCL_STOP
 
        return DEVICE_ERROR_NONE;
 }
index fd97551..bb388e7 100644 (file)
--- a/src/led.c
+++ b/src/led.c
@@ -64,7 +64,7 @@ int device_flash_get_max_brightness(int *max_brightness)
                        DEVICED_PATH_LED, DEVICED_INTERFACE_LED,
                        METHOD_GET_MAX_BRIGHTNESS, NULL, NULL);
        if (ret < 0)
-               return errno_to_device_error(ret);
+               return errno_to_device_error(ret); //LCOV_EXCL_LINE System Error
 
        *max_brightness = ret;
        return DEVICE_ERROR_NONE;
@@ -84,7 +84,7 @@ int device_flash_get_brightness(int *brightness)
                        DEVICED_PATH_LED, DEVICED_INTERFACE_LED,
                        METHOD_GET_BRIGHTNESS, NULL, NULL);
        if (ret < 0)
-               return errno_to_device_error(ret);
+               return errno_to_device_error(ret); //LCOV_EXCL_LINE System Error
 
        *brightness = ret;
        return DEVICE_ERROR_NONE;
@@ -117,7 +117,7 @@ int device_flash_set_brightness(int brightness)
                        DEVICED_PATH_LED, DEVICED_INTERFACE_LED,
                        METHOD_SET_BRIGHTNESS, "ii", arr);
        if (ret < 0)
-               return errno_to_device_error(ret);
+               return errno_to_device_error(ret); //LCOV_EXCL_LINE System Error
 
        return DEVICE_ERROR_NONE;
 }
@@ -163,8 +163,10 @@ int device_led_stop_custom(void)
        ret = dbus_method_sync(DEVICED_BUS_NAME,
                        DEVICED_PATH_LED, DEVICED_INTERFACE_LED,
                        METHOD_STOP_CUSTOM, NULL, NULL);
+//LCOV_EXCL_START System Error
        if (ret < 0)
                return errno_to_device_error(ret);
+//LCOV_EXCL_STOP
 
        return DEVICE_ERROR_NONE;
 }
index b4f42a0..bd88eaa 100644 (file)
@@ -48,6 +48,7 @@ static const char *_mi_str[] = {
        [_MI_SHMEM] = "Shmem",
 };
 
+//LCOV_EXCL_START Not used function
 static inline int _get_idx(const char *name)
 {
        int i;
@@ -134,3 +135,4 @@ int device_memory_get_available(unsigned int *avail_mem)
        *avail_mem = mi.l[_MI_FREE] + mi.l[_MI_BUF] + mi.l[_MI_CACHED] + mi.l[_MI_SWAP] - mi.l[_MI_SHMEM];
        return DEVICE_ERROR_NONE;
 }
+//EXCL_LCOV_STOP
index edb9bb4..38b771f 100644 (file)
@@ -80,7 +80,7 @@ static void lock_cb(void *data, GVariant *result, GError *err)
        int ret;
 
        if (!result) {
-               _E("no message : %s", err->message);
+               _E("no message : %s", err->message); //LCOV_EXCL_LINE
                return;
        }
 
@@ -131,7 +131,7 @@ static void unlock_cb(void *data, GVariant *result, GError *err)
        int ret;
 
        if (!result) {
-               _E("no message : %s", err->message);
+               _E("no message : %s", err->message); //LCOV_EXCL_LINE
                return;
        }
 
@@ -213,6 +213,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)
 int device_power_reboot(const char *reason)
 {
        char *arr[1];
@@ -228,3 +229,4 @@ int device_power_reboot(const char *reason)
                        METHOD_REBOOT, "s", arr);
        return errno_to_device_error(ret);
 }
+//LCOV_EXCL_STOP