feedback: Add lcov exception code to exclude vibration feature funcs 48/298148/1 accepted/tizen/unified/20230904.165043
authorYunhee Seo <yuni.seo@samsung.com>
Fri, 1 Sep 2023 08:03:46 +0000 (17:03 +0900)
committerYunhee Seo <yuni.seo@samsung.com>
Fri, 1 Sep 2023 08:11:31 +0000 (17:11 +0900)
Add line coverage exception.
Vibration feature is not supported from the line coverage test environment.
Thus, function and codes releated to vibration feature are excluded from the line coverage.

Change-Id: Idf2374f1891f450b572007e611e6f231cb3c51fd
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
src/devices.c
src/vibrator.c

index 4c5efd3..1dc8252 100644 (file)
@@ -74,6 +74,7 @@ void devices_exit(void)
        }
 }
 
+//LCOV_EXCL_START
 int devices_play(int pattern, bool always)
 {
        GList *elem;
@@ -96,6 +97,7 @@ int devices_play(int pattern, bool always)
 
        return prev;
 }
+//LCOV_EXCL_STOP
 
 //LCOV_EXCL_START
 int devices_play_soundpath(int pattern, const char *soundpath, bool always)
@@ -131,6 +133,7 @@ int devices_play_soundpath(int pattern, const char *soundpath, bool always)
 }
 //LCOV_EXCL_STOP
 
+//LCOV_EXCL_START
 int devices_stop(void)
 {
        GList *elem;
@@ -144,3 +147,4 @@ int devices_stop(void)
 
        return ret;
 }
+//LCOV_EXCL_STOP
index f25f584..49aa661 100644 (file)
@@ -57,6 +57,7 @@ static int vibstatus;
 static unsigned int v_handle;
 static int current_theme_index = 0;
 
+//LCOV_EXCL_START
 static inline char *trim_str(char *s)
 {
        char *t;
@@ -70,12 +71,16 @@ static inline char *trim_str(char *s)
        *t = 0;
        return s;
 }
+//LCOV_EXCL_STOP
 
+//LCOV_EXCL_START
 inline int is_vibration_mode(void)
 {
        return vibstatus;
 }
+//LCOV_EXCL_STOP
 
+//LCOV_EXCL_START
 static int haptic_open(void)
 {
        int ret_dbus, reply;
@@ -86,7 +91,9 @@ static int haptic_open(void)
                return ret_dbus;
        return reply;
 }
+//LCOV_EXCL_STOP
 
+//LCOV_EXCL_START
 static int haptic_close(unsigned int handle)
 {
        int ret_dbus, reply;
@@ -97,7 +104,9 @@ static int haptic_close(unsigned int handle)
                return ret_dbus;
        return reply;
 }
+//LCOV_EXCL_STOP
 
+//LCOV_EXCL_START
 static int haptic_is_supported(const char *pattern)
 {
        int ret_dbus, reply;
@@ -108,7 +117,9 @@ static int haptic_is_supported(const char *pattern)
                return ret_dbus;
        return reply;
 }
+//LCOV_EXCL_STOP
 
+//LCOV_EXCL_START
 static int haptic_vibrate_effect(unsigned int handle,
                                                                const char *pattern,
                                                                int feedback,
@@ -122,7 +133,9 @@ static int haptic_vibrate_effect(unsigned int handle,
                return ret_dbus;
        return reply;
 }
+//LCOV_EXCL_STOP
 
+//LCOV_EXCL_START
 static int haptic_vibrate_stop(unsigned int handle)
 {
        int ret_dbus, reply;
@@ -133,13 +146,17 @@ static int haptic_vibrate_stop(unsigned int handle)
                return ret_dbus;
        return reply;
 }
+//LCOV_EXCL_STOP
 
+//LCOV_EXCL_START
 static int get_priority(feedback_pattern_e pattern)
 {
        if (profile->get_priority)
                return profile->get_priority(pattern);
        return PRIORITY_MIDDLE;
 }
+//LCOV_EXCL_STOP
+
 //LCOV_EXCL_START callback
 static void feedback_vibstatus_cb(keynode_t *key, void* data)
 {
@@ -147,11 +164,14 @@ static void feedback_vibstatus_cb(keynode_t *key, void* data)
 }
 //LCOV_EXCL_STOP
 
+//LCOV_EXCL_START
 static void feedback_vibration_theme_changed_cb(keynode_t *key, void* data)
 {
        current_theme_index = vconf_keynode_get_int(key) - 1;
 }
+//LCOV_EXCL_STOP
 
+//LCOV_EXCL_START
 static void vibrator_init(void)
 {
        int ret_val;
@@ -192,8 +212,9 @@ static void vibrator_init(void)
        if (ret_val != 0)
                _W("Add watch for VCONFKEY_SETAPPL_ACCESSIBILITY_VIBRATION_FEEDBACK_THEME failed");
 }
+//LCOV_EXCL_STOP
 
-
+//LCOV_EXCL_START
 static void vibrator_exit(void)
 {
        int ret;
@@ -212,7 +233,9 @@ static void vibrator_exit(void)
        if (ret != 0)
                _W("Remove watch for VCONFKEY_SETAPPL_ACCESSIBILITY_VIBRATION_FEEDBACK_THEME failed");
 }
+//LCOV_EXCL_STOP
 
+//LCOV_EXCL_START
 static int vibrator_play(feedback_pattern_e pattern, bool always)
 {
        char *temp;
@@ -291,7 +314,9 @@ check_pattern:
        free(temp);
        return 0;
 }
+//LCOV_EXCL_STOP
 
+//LCOV_EXCL_START
 static int vibrator_stop(void)
 {
        int ret;
@@ -316,7 +341,9 @@ static int vibrator_stop(void)
 
        return 0;
 }
+//LCOV_EXCL_STOP
 
+//LCOV_EXCL_START
 static int vibrator_is_supported(int pattern, bool *supported)
 {
        char *temp;
@@ -367,6 +394,7 @@ static int vibrator_is_supported(int pattern, bool *supported)
        *supported = ret;
        return 0;
 }
+//LCOV_EXCL_STOP
 
 //LCOV_EXCL_START Not Supported Feature
 static int vibrator_get_path(feedback_pattern_e pattern, char *buf, unsigned int buflen)