diff options
author | Yunmi Ha <yunmi.ha@samsung.com> | 2021-01-04 15:38:38 +0900 |
---|---|---|
committer | Yunmi Ha <yunmi.ha@samsung.com> | 2021-01-04 15:54:15 +0900 |
commit | 1611e1cf7c5d8610273f5383512dacd3bddab764 (patch) | |
tree | ceeb9e80ad097893bcf5b3cfcb76de2d8e4f7625 | |
parent | 03278318c1acb353b3fb16ad79d096a62f8faf40 (diff) | |
download | libsvi-1611e1cf7c5d8610273f5383512dacd3bddab764.tar.gz libsvi-1611e1cf7c5d8610273f5383512dacd3bddab764.tar.bz2 libsvi-1611e1cf7c5d8610273f5383512dacd3bddab764.zip |
Add excluding line for coverage test
Change-Id: Iad097870ae8fe1dc47f2441ba97976a1a28fc038
Signed-off-by: Yunmi Ha <yunmi.ha@samsung.com>
-rw-r--r-- | src/check.c | 18 | ||||
-rw-r--r-- | src/feedback.c | 52 | ||||
-rw-r--r-- | src/sound.c | 20 | ||||
-rw-r--r-- | src/vibrator.c | 8 |
4 files changed, 50 insertions, 48 deletions
diff --git a/src/check.c b/src/check.c index 0cad32f..364c8f3 100644 --- a/src/check.c +++ b/src/check.c @@ -935,7 +935,7 @@ static void profile_init(void) prof = get_profile(); if (prof == PROFILE_COMMON) - return; + return; //LCOV_EXCL_LINE else if (prof == PROFILE_MOBILE) { if (vconf_get_bool(VCONFKEY_SETAPPL_SOUND_LOCK_BOOL, &lock_sndstatus) < 0) _W("VCONFKEY_SETAPPL_SOUND_LOCK_BOOL ==> FAIL!!"); //LCOV_EXCL_LINE @@ -979,28 +979,28 @@ static void profile_init(void) path = vconf_get_str(VCONFKEY_SETAPPL_NOTI_MSG_RINGTONE_PATH_STR); if (path) { if (stat(path, &st) < 0) { - free(path); - path = vconf_get_str(VCONFKEY_SETAPPL_NOTI_RINGTONE_DEFAULT_PATH_STR); + free(path); //LCOV_EXCL_LINE + path = vconf_get_str(VCONFKEY_SETAPPL_NOTI_RINGTONE_DEFAULT_PATH_STR); //LCOV_EXCL_LINE } if (path) { snprintf(snd_noti_path, PATH_MAX, "%s", path); free(path); } } else - snprintf(snd_noti_path, PATH_MAX, "NULL"); + snprintf(snd_noti_path, PATH_MAX, "NULL"); //LCOV_EXCL_LINE path = vconf_get_str(VCONFKEY_SETAPPL_CALL_RINGTONE_PATH_STR); if (path) { if (stat(path, &st) < 0) { - free(path); - path = vconf_get_str(VCONFKEY_SETAPPL_CALL_RINGTONE_DEFAULT_PATH_STR); + free(path); //LCOV_EXCL_LINE + path = vconf_get_str(VCONFKEY_SETAPPL_CALL_RINGTONE_DEFAULT_PATH_STR); //LCOV_EXCL_LINE } if (path) { snprintf(snd_call_path, PATH_MAX, "%s", path); free(path); } } else - snprintf(snd_call_path, PATH_MAX, "NULL"); + snprintf(snd_call_path, PATH_MAX, "NULL"); //LCOV_EXCL_LINE if (vconf_get_int(VCONFKEY_SETAPPL_CALL_VIBRATION_PATTERN_INT, &vib_call_index) < 0) _W("VCONFKEY_SETAPPL_SETAPPL_CALL_VIBRATION_PATTERN_INT ==> FAIL!!"); //LCOV_EXCL_LINE @@ -1657,12 +1657,12 @@ static bool mobile_get_always_off_case(int type, int pattern) /* check if the state of voice recorder is recording */ if (vconf_get_int(VCONFKEY_RECORDER_STATE, &ret) < 0) { _W("fail to get media sound status, status will be zero"); //LCOV_EXCL_LINE - ret = 0; + ret = 0; //LCOV_EXCL_LINE } if (CHECK_SOUND(type) && ret == VCONFKEY_RECORDER_STATE_RECORDING) { _D("voice recording status is RECORDING"); //LCOV_EXCL_LINE - return true; + return true; //LCOV_EXCL_LINE } switch (pattern) { diff --git a/src/feedback.c b/src/feedback.c index 83febea..3660d6b 100644 --- a/src/feedback.c +++ b/src/feedback.c @@ -128,7 +128,7 @@ static feedback_pattern_e check_pattern(feedback_type_e type, feedback_pattern_e bool result = false; if (type < FEEDBACK_TYPE_NONE || type >= FEEDBACK_TYPE_END) - type = FEEDBACK_TYPE_NONE; + type = FEEDBACK_TYPE_NONE; //LCOV_EXCL_LINE /* if you need to switch pattern */ if (profile->get_switched_pattern) @@ -173,9 +173,9 @@ API int feedback_play(feedback_pattern_e pattern) * this function regards as success. */ if (err == -ENOTSUP) - return FEEDBACK_ERROR_NOT_SUPPORTED; + return FEEDBACK_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE else if (err < 0) - return FEEDBACK_ERROR_OPERATION_FAILED; + return FEEDBACK_ERROR_OPERATION_FAILED; //LCOV_EXCL_LINE return FEEDBACK_ERROR_NONE; } @@ -188,7 +188,7 @@ API int feedback_play_type(feedback_type_e type, feedback_pattern_e pattern) /* check initialize */ pthread_mutex_lock(&fmutex); if (!init_cnt) { - _E("Not initialized"); //LCOV_EXCL_LINE + _E("Not initialized"); pthread_mutex_unlock(&fmutex); return FEEDBACK_ERROR_NOT_INITIALIZED; } @@ -196,30 +196,30 @@ API int feedback_play_type(feedback_type_e type, feedback_pattern_e pattern) if (type <= FEEDBACK_TYPE_NONE || type >= profile->max_type) { - _E("Invalid parameter : type(%d)", type); - return FEEDBACK_ERROR_INVALID_PARAMETER; + _E("Invalid parameter : type(%d)", type); //LCOV_EXCL_LINE + return FEEDBACK_ERROR_INVALID_PARAMETER; //LCOV_EXCL_LINE } if (pattern <= FEEDBACK_PATTERN_NONE || pattern >= profile->max_pattern) { - _E("Invalid parameter : pattern(%d)", pattern); - return FEEDBACK_ERROR_INVALID_PARAMETER; + _E("Invalid parameter : pattern(%d)", pattern); //LCOV_EXCL_LINE + return FEEDBACK_ERROR_INVALID_PARAMETER; //LCOV_EXCL_LINE } /* play proper device */ 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->play(check_pattern(type, pattern, __func__), false); if (err == -ENOTSUP) - return FEEDBACK_ERROR_NOT_SUPPORTED; + return FEEDBACK_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE else if (err == -ECOMM || err == -EACCES) - return FEEDBACK_ERROR_PERMISSION_DENIED; + return FEEDBACK_ERROR_PERMISSION_DENIED; //LCOV_EXCL_LINE else if (err < 0) - return FEEDBACK_ERROR_OPERATION_FAILED; + return FEEDBACK_ERROR_OPERATION_FAILED; //LCOV_EXCL_LINE return FEEDBACK_ERROR_NONE; } @@ -240,11 +240,11 @@ API int feedback_stop(void) /* stop all device */ err = devices_stop(); if (err == -ENOTSUP) - return FEEDBACK_ERROR_NOT_SUPPORTED; + return FEEDBACK_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE else if (err == -ECOMM || err == -EACCES) - return FEEDBACK_ERROR_PERMISSION_DENIED; + return FEEDBACK_ERROR_PERMISSION_DENIED; //LCOV_EXCL_LINE else if (err < 0) - return FEEDBACK_ERROR_OPERATION_FAILED; + return FEEDBACK_ERROR_OPERATION_FAILED; //LCOV_EXCL_LINE return FEEDBACK_ERROR_NONE; } @@ -295,7 +295,7 @@ API int feedback_is_supported_pattern(feedback_type_e type, feedback_pattern_e p return FEEDBACK_ERROR_PERMISSION_DENIED; //LCOV_EXCL_LINE System Error else if (err < 0) { _E("fail to invoke is_supported() : pattern(%d)", pattern); //LCOV_EXCL_LINE - return FEEDBACK_ERROR_OPERATION_FAILED; + return FEEDBACK_ERROR_OPERATION_FAILED; //LCOV_EXCL_LINE } *status = supported; @@ -372,7 +372,7 @@ API int feedback_play_internal(feedback_pattern_internal_e internal_pattern) if (err == -ENOTSUP) return FEEDBACK_ERROR_NOT_SUPPORTED; else if (err < 0) - return FEEDBACK_ERROR_OPERATION_FAILED; + return FEEDBACK_ERROR_OPERATION_FAILED; //LCOV_EXCL_LINE return FEEDBACK_ERROR_NONE; } @@ -408,16 +408,16 @@ API int feedback_play_type_internal(feedback_type_e type, feedback_pattern_inter 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 } _D("request type %s with pattern %s(%d)", profile->str_type[type], profile->str_pattern(pattern), pattern); err = dev->play(check_pattern(type, pattern, __func__), true); if (err == -ENOTSUP) - return FEEDBACK_ERROR_NOT_SUPPORTED; + return FEEDBACK_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE else if (err == -ECOMM || err == -EACCES) - return FEEDBACK_ERROR_PERMISSION_DENIED; + return FEEDBACK_ERROR_PERMISSION_DENIED; //LCOV_EXCL_LINE else if (err < 0) - return FEEDBACK_ERROR_OPERATION_FAILED; + return FEEDBACK_ERROR_OPERATION_FAILED; //LCOV_EXCL_LINE return FEEDBACK_ERROR_NONE; } @@ -458,7 +458,7 @@ API int feedback_play_soundpath_internal(feedback_pattern_internal_e internal_pa if (err == -ENOTSUP) return FEEDBACK_ERROR_NOT_SUPPORTED; else if (err < 0) - return FEEDBACK_ERROR_OPERATION_FAILED; + return FEEDBACK_ERROR_OPERATION_FAILED; //LCOV_EXCL_LINE return FEEDBACK_ERROR_NONE; } @@ -499,7 +499,7 @@ API int feedback_play_type_soundpath_internal(feedback_type_e type, feedback_pat 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 } _D("request type %s with pattern(%s), soundpath(%s)", profile->str_type[type], profile->str_pattern(pattern), soundpath?soundpath:"NULL"); if (type == FEEDBACK_TYPE_SOUND) { @@ -515,11 +515,11 @@ API int feedback_play_type_soundpath_internal(feedback_type_e type, feedback_pat } if (err == -ENOTSUP) - return FEEDBACK_ERROR_NOT_SUPPORTED; + return FEEDBACK_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE else if (err == -ECOMM || err == -EACCES) - return FEEDBACK_ERROR_PERMISSION_DENIED; + return FEEDBACK_ERROR_PERMISSION_DENIED; //LCOV_EXCL_LINE else if (err < 0) - return FEEDBACK_ERROR_OPERATION_FAILED; + return FEEDBACK_ERROR_OPERATION_FAILED; //LCOV_EXCL_LINE return FEEDBACK_ERROR_NONE; } diff --git a/src/sound.c b/src/sound.c index 5cde3c7..5ec708f 100644 --- a/src/sound.c +++ b/src/sound.c @@ -165,6 +165,7 @@ static void sound_exit(void) feedback_free_config(&sound_info); } +//LCOV_EXCL_START static void play_completed(int id, void *data) { int ret; @@ -174,6 +175,7 @@ static void play_completed(int id, void *data) if (ret != SOUND_MANAGER_ERROR_NONE) _E("Failed to set session to play sound(%d)", ret); //LCOV_EXCL_LINE } +//LCOV_EXCL_STOP static int sound_play(feedback_pattern_e pattern, bool always) { @@ -219,7 +221,7 @@ check_pattern: NULL, NULL, &stream_info); if (ret != SOUND_MANAGER_ERROR_NONE) { _E("Failed to set session to play sound(%d)", ret); //LCOV_EXCL_LINE - return -ENOENT; + return -ENOENT; //LCOV_EXCL_LINE } do { ret = wav_player_start_new(path, stream_info, play_completed, stream_info, NULL); @@ -228,7 +230,7 @@ check_pattern: return 0; } _E("Failed to play sound file (%d, %s)", ret, path); //LCOV_EXCL_LINE - } while (retry--); + } while (retry--); //LCOV_EXCL_LINE } else { do { if (profile->get_strength_type) @@ -242,7 +244,7 @@ check_pattern: return 0; } _E("mm_sound_play_keysound() returned error(%d)", ret); //LCOV_EXCL_LINE - } while (retry--); + } while (retry--); //LCOV_EXCL_LINE } return -EPERM; } @@ -255,16 +257,16 @@ static int sound_play_path(feedback_pattern_e pattern, const char *soundpath, bo int level; if (!soundpath || stat(soundpath, &buf)) { - if (!soundpath) + if (!soundpath) //LCOV_EXCL_LINE _E("Not supported sound pattern(pattern %d)", pattern); //LCOV_EXCL_LINE else _E("Not supported sound pattern(soundpath %s of pattern %s)", soundpath, profile->str_pattern(pattern)); //LCOV_EXCL_LINE - return -ENOTSUP; + return -ENOTSUP; //LCOV_EXCL_LINE } 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) { @@ -297,10 +299,10 @@ check_pattern: ret = wav_player_start_new(soundpath, stream_info, play_completed, stream_info, NULL); if (ret == WAV_PLAYER_ERROR_NONE) { _D("Wav Play success! SND filename is %s", soundpath); //LCOV_EXCL_LINE - return 0; + return 0; //LCOV_EXCL_LINE } _E("Failed to play sound file (%d, %s)", ret, soundpath); //LCOV_EXCL_LINE - } while (retry--); + } while (retry--); //LCOV_EXCL_LINE } else { do { if (profile->get_strength_type) @@ -314,7 +316,7 @@ check_pattern: return 0; } _E("mm_sound_play_keysound(\'%s\') returned error(%d)", soundpath, ret); //LCOV_EXCL_LINE - } while (retry--); + } while (retry--); //LCOV_EXCL_LINE } return -EPERM; } diff --git a/src/vibrator.c b/src/vibrator.c index ea5de75..a12a40a 100644 --- a/src/vibrator.c +++ b/src/vibrator.c @@ -221,7 +221,7 @@ check_pattern: if (pattern <= FEEDBACK_PATTERN_NONE || pattern >= profile->max_pattern) { _E("Not supported vibration pattern"); //LCOV_EXCL_LINE - return -ENOTSUP; + return -ENOTSUP; //LCOV_EXCL_LINE } if (profile->get_strength_type) @@ -235,7 +235,7 @@ check_pattern: temp = strdup(profile->str_pattern(converted_pattern)); data = trim_str(temp); if (!data) { - free(temp); + free(temp); //LCOV_EXCL_LINE _E("Not supported vibration pattern"); //LCOV_EXCL_LINE return -ENOTSUP; //LCOV_EXCL_LINE } @@ -306,8 +306,8 @@ static int vibrator_is_supported(int pattern, bool *supported) if (pattern <= FEEDBACK_PATTERN_NONE || pattern >= profile->max_pattern) { _E("Not supported vibration pattern"); //LCOV_EXCL_LINE - *supported = false; - return 0; + *supported = false; //LCOV_EXCL_LINE + return 0; //LCOV_EXCL_LINE } /* get vibration data */ |