Add comment for excluding coverage 26/236926/1
authorYunmi Ha <yunmi.ha@samsung.com>
Tue, 23 Jun 2020 09:12:56 +0000 (18:12 +0900)
committerYunmi Ha <yunmi.ha@samsung.com>
Tue, 23 Jun 2020 09:13:52 +0000 (18:13 +0900)
Change-Id: Id59d34e563352c4f0aa48d4adfd20a3dbb847231
Signed-off-by: Yunmi Ha <yunmi.ha@samsung.com>
src/check.c
src/feedback.c
src/parser.c
src/sound.c
src/vibrator.c

index 32f4576..cdcd46a 100644 (file)
@@ -17,7 +17,6 @@
 
 
 #include <stdio.h>
-#include <stdlib.h>
 #include <vconf.h>
 #include <system_info.h>
 #include <sys/stat.h>
index 08d1653..ef978f4 100644 (file)
@@ -58,7 +58,7 @@ API int feedback_initialize(void)
        pthread_mutex_lock(&fmutex);
        if (!profile) {
                _E("there is no valid profile module."); //LCOV_EXCL_LINE
-               pthread_mutex_unlock(&fmutex);
+               pthread_mutex_unlock(&fmutex); //LCOV_EXCL_LINE System Error
                return FEEDBACK_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE System Error
        }
 
@@ -275,7 +275,7 @@ API int feedback_is_supported_pattern(feedback_type_e type, feedback_pattern_e p
        dev = find_device(type);
        if (!dev) {
                _E("Not supported device : type(%s)", profile->str_type[type]); //LCOV_EXCL_LINE
-               return FEEDBACK_ERROR_NOT_SUPPORTED;
+               return FEEDBACK_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
        }
 
        err = dev->is_supported(check_pattern(type, pattern, __func__), &supported);
index 4387943..17af305 100644 (file)
@@ -16,7 +16,6 @@
  */
 
 #include <stdio.h>
-#include <stdlib.h>
 #include <errno.h>
 
 #include "parser.h"
index 2d64bba..5cde3c7 100644 (file)
@@ -17,7 +17,6 @@
 
 
 #include <stdio.h>
-#include <stdlib.h>
 #include <stdbool.h>
 #include <string.h>
 #include <unistd.h>
@@ -131,19 +130,19 @@ static void sound_init(void)
 
        if (vconf_get_bool(VCONFKEY_SETAPPL_SOUND_STATUS_BOOL, &sndstatus) < 0) {
                _D("fail to get sound status, will work as turning off"); //LCOV_EXCL_LINE
-               sndstatus = 0;
+               sndstatus = 0; //LCOV_EXCL_LINE
        }
 
        /* add watch for status value */
        ret = vconf_notify_key_changed(VCONFKEY_SETAPPL_SOUND_STATUS_BOOL, feedback_sndstatus_cb, NULL);
        if (ret != 0)
-               _W("Add watch for VCONFKEY_SETAPPL_SOUND_STATUS_BOOL failed");
+               _W("Add watch for VCONFKEY_SETAPPL_SOUND_STATUS_BOOL failed"); //LCOV_EXCL_LINE
        ret = vconf_notify_key_changed(VCONFKEY_SETAPPL_TOUCH_SOUNDS_BOOL, feedback_touch_sndstatus_cb, NULL);
        if (ret != 0)
-               _W("Add watch for VCONFKEY_SETAPPL_TOUCH_SOUNDS_BOOL failed");
+               _W("Add watch for VCONFKEY_SETAPPL_TOUCH_SOUNDS_BOOL failed"); //LCOV_EXCL_LINE
        ret = vconf_notify_key_changed(VCONFKEY_SETAPPL_BUTTON_SOUNDS_BOOL, feedback_keytone_sndstatus_cb, NULL);
        if (ret != 0)
-               _W("Add watch for VCONFKEY_SETAPPL_BUTTON_SOUNDS_BOOL failed");
+               _W("Add watch for VCONFKEY_SETAPPL_BUTTON_SOUNDS_BOOL failed"); //LCOV_EXCL_LINE
 }
 
 static void sound_exit(void)
@@ -153,14 +152,14 @@ static void sound_exit(void)
        /* remove watch */
        ret = vconf_ignore_key_changed(VCONFKEY_SETAPPL_SOUND_STATUS_BOOL, feedback_sndstatus_cb);
        if (ret != 0)
-               _W("Remove watch for VCONFKEY_SETAPPL_SOUND_STATUS_BOOL failed");
+               _W("Remove watch for VCONFKEY_SETAPPL_SOUND_STATUS_BOOL failed"); //LCOV_EXCL_LINE
 
        ret = vconf_ignore_key_changed(VCONFKEY_SETAPPL_TOUCH_SOUNDS_BOOL, feedback_touch_sndstatus_cb);
        if (ret != 0)
-               _W("Remove watch for VCONFKEY_SETAPPL_TOUCH_SOUNDS_BOOL failed");
+               _W("Remove watch for VCONFKEY_SETAPPL_TOUCH_SOUNDS_BOOL failed"); //LCOV_EXCL_LINE
        ret = vconf_ignore_key_changed(VCONFKEY_SETAPPL_BUTTON_SOUNDS_BOOL, feedback_keytone_sndstatus_cb);
        if (ret != 0)
-               _W("Remove watch for VCONFKEY_SETAPPL_BUTTON_SOUNDS_BOOL failed");
+               _W("Remove watch for VCONFKEY_SETAPPL_BUTTON_SOUNDS_BOOL failed"); //LCOV_EXCL_LINE
 
        /* free sound data */
        feedback_free_config(&sound_info);
@@ -173,7 +172,7 @@ static void play_completed(int id, void *data)
 
        ret = sound_manager_destroy_stream_information(stream_info);
        if (ret != SOUND_MANAGER_ERROR_NONE)
-               _E("Failed to set session to play sound(%d)", ret);
+               _E("Failed to set session to play sound(%d)", ret); //LCOV_EXCL_LINE
 }
 
 static int sound_play(feedback_pattern_e pattern, bool always)
@@ -186,7 +185,7 @@ static int sound_play(feedback_pattern_e pattern, bool always)
 
        if (vconf_get_bool(VCONFKEY_SETAPPL_SOUND_STATUS_BOOL, &sndstatus) < 0) {
                _D("fail to get sound status, will work as turning off"); //LCOV_EXCL_LINE
-               sndstatus = 0;
+               sndstatus = 0; //LCOV_EXCL_LINE
        }
 
        if (always) {
@@ -328,7 +327,7 @@ static int sound_is_supported(feedback_pattern_e pattern, bool *supported)
 
        if (!supported) {
                _E("Invalid parameter : supported(NULL)"); //LCOV_EXCL_LINE
-               return -EINVAL;
+               return -EINVAL; //LCOV_EXCL_LINE
        }
 
        /* get sound file path */
@@ -355,8 +354,8 @@ static int sound_stop(void)
                _D("stop success!");
                return 0;
        }
-       _E("mm_sound_stop_keysound() returned error(%d)", ret);
-       return ret;
+       _E("mm_sound_stop_keysound() returned error(%d)", ret); //LCOV_EXCL_LINE
+       return ret; //LCOV_EXCL_LINE
 }
 
 //LCOV_EXCL_START Not used function
index 3735f6d..06ee0a7 100644 (file)
@@ -17,7 +17,6 @@
 
 
 #include <stdio.h>
-#include <stdlib.h>
 #include <stdbool.h>
 #include <string.h>
 #include <errno.h>
@@ -120,11 +119,12 @@ static int get_priority(feedback_pattern_e pattern)
                return profile->get_priority(pattern);
        return PRIORITY_MIDDLE;
 }
-
+//LCOV_EXCL_START callback
 static void feedback_vibstatus_cb(keynode_t *key, void* data)
 {
        vibstatus = vconf_keynode_get_bool(key);
 }
+//LCOV_EXCL_STOP
 
 static void vibrator_init(void)
 {
@@ -132,12 +132,12 @@ static void vibrator_init(void)
        bool haptic_avail;
 
        ret = system_info_get_platform_bool(VIBRATION_FEATURE, &haptic_avail);
-       if (ret < 0) {
-               v_handle = -ENOTSUP;
-               return;
+       if (ret < 0) { //LCOV_EXCL_LINE
+               v_handle = -ENOTSUP; //LCOV_EXCL_LINE
+               return; //LCOV_EXCL_LINE
        } else if (ret == 0 && !haptic_avail) {
-               v_handle = -ENOTSUP;
-               return;
+               v_handle = -ENOTSUP; //LCOV_EXCL_LINE
+               return; //LCOV_EXCL_LINE
        }
 
        /* Vibration Init */
@@ -158,7 +158,7 @@ static void vibrator_init(void)
 
        ret = vconf_notify_key_changed(VCONFKEY_SETAPPL_VIBRATION_STATUS_BOOL, feedback_vibstatus_cb, NULL);
        if (ret != 0)
-               _W("Add watch for VCONFKEY_SETAPPL_VIBRATION_STATUS_BOOL failed");
+               _W("Add watch for VCONFKEY_SETAPPL_VIBRATION_STATUS_BOOL failed"); //LCOV_EXCL_LINE
 }
 
 
@@ -175,7 +175,7 @@ static void vibrator_exit(void)
 
        ret = vconf_ignore_key_changed(VCONFKEY_SETAPPL_VIBRATION_STATUS_BOOL, feedback_vibstatus_cb);
        if (ret != 0)
-               _W("Remove watch for VCONFKEY_SETAPPL_VIBRATION_STATUS_BOOL failed");
+               _W("Remove watch for VCONFKEY_SETAPPL_VIBRATION_STATUS_BOOL failed"); //LCOV_EXCL_LINE
 }
 
 static int vibrator_play(feedback_pattern_e pattern, bool always)
@@ -197,7 +197,7 @@ static int vibrator_play(feedback_pattern_e pattern, bool always)
 
        if (vconf_get_bool(VCONFKEY_SETAPPL_VIBRATION_STATUS_BOOL, &vibstatus) < 0) {
                _D("fail to get vibration status, will work as turning off"); //LCOV_EXCL_LINE
-               vibstatus = 0;
+               vibstatus = 0; //LCOV_EXCL_LINE
        }
 
        if (always) {
@@ -237,7 +237,7 @@ check_pattern:
        if (!data) {
                free(temp);
                _E("Not supported vibration pattern"); //LCOV_EXCL_LINE
-               return -ENOTSUP;
+               return -ENOTSUP; //LCOV_EXCL_LINE
        }
 
        _D("pattern : %s", data);
@@ -246,10 +246,10 @@ check_pattern:
 
        if (ret < 0) {
                _E("fail to play vibration"); //LCOV_EXCL_LINE
-               free(temp);
-               if (ret == -ECOMM || ret == -ENOTSUP)
+               free(temp); //LCOV_EXCL_LINE
+               if (ret == -ECOMM || ret == -ENOTSUP) //LCOV_EXCL_LINE
                        return ret; //LCOV_EXCL_LINE System Error
-               return -EPERM;
+               return -EPERM; //LCOV_EXCL_LINE
        }
 
        _D("Play success! Data is %s", data);
@@ -274,9 +274,9 @@ static int vibrator_stop(void)
        ret = haptic_vibrate_stop(v_handle);
        if (ret < 0) {
                _E("haptic_vibrate_stop is failed"); //LCOV_EXCL_LINE
-               if (ret == -ECOMM)
+               if (ret == -ECOMM) //LCOV_EXCL_LINE
                        return ret; //LCOV_EXCL_LINE System Error
-               return -EPERM;
+               return -EPERM; //LCOV_EXCL_LINE
        }
 
        return 0;
@@ -290,7 +290,7 @@ static int vibrator_is_supported(int pattern, bool *supported)
 
        if (!supported) {
                _E("Invalid parameter : supported(NULL)"); //LCOV_EXCL_LINE
-               return -EINVAL;
+               return -EINVAL; //LCOV_EXCL_LINE
        }
 
        if ((int)v_handle <= 0) {
@@ -300,7 +300,7 @@ static int vibrator_is_supported(int pattern, bool *supported)
                }
                _E("Not supported vibration"); //LCOV_EXCL_LINE
                *supported = false; //LCOV_EXCL_LINE System Error
-               return v_handle;
+               return v_handle; //LCOV_EXCL_LINE
        }
 
        if (pattern <= FEEDBACK_PATTERN_NONE ||
@@ -314,18 +314,18 @@ static int vibrator_is_supported(int pattern, bool *supported)
        temp = strdup(profile->str_pattern(pattern));
        data = trim_str(temp);
        if (!data) {
-               free(temp);
-               *supported = false;
-               return 0;
+               free(temp); //LCOV_EXCL_LINE
+               *supported = false; //LCOV_EXCL_LINE
+               return 0; //LCOV_EXCL_LINE
        }
 
        ret = haptic_is_supported(data);
        free(temp);
        if (ret < 0) {
                _E("fail to get support information"); //LCOV_EXCL_LINE
-               if (ret == -ECOMM)
-                       return ret;
-               return -EPERM;
+               if (ret == -ECOMM) //LCOV_EXCL_LINE
+                       return ret; //LCOV_EXCL_LINE
+               return -EPERM; //LCOV_EXCL_LINE
        }
 
        _D("is_supported : %d", ret);