From dfb96281565e232d1dcff70a49de9b6b8498a83d Mon Sep 17 00:00:00 2001 From: "pr.jung" Date: Fri, 11 May 2018 16:49:44 +0900 Subject: Patch for line coverage Change-Id: I8152acfad4385fa91e074d90b2e58610e0b500c4 Signed-off-by: pr.jung --- src/check.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/src/check.c b/src/check.c index 198cf78..fe5df86 100644 --- a/src/check.c +++ b/src/check.c @@ -276,10 +276,12 @@ static profile_e get_profile(void) len = strlen(profile) + 1; if (!strncmp(PROFILE_MOBILE_STRING, profile, len)) set = PROFILE_MOBILE; +//LCOV_EXCL_START else if (!strncmp(PROFILE_WEARABLE_STRING, profile, len)) set = PROFILE_WEARABLE; else set = PROFILE_COMMON; +//LCOV_EXCL_STOP free(profile); return set; @@ -296,10 +298,12 @@ static char *profile_get_name() if (prof == PROFILE_MOBILE) profile_name = PROFILE_MOBILE_STRING; +//LCOV_EXCL_START else if (prof == PROFILE_WEARABLE) profile_name = PROFILE_WEARABLE_STRING; else profile_name = PROFILE_COMMON_STRING; +//LCOV_EXCL_STOP return profile_name; } @@ -313,10 +317,12 @@ static int profile_get_num_of_pattern() if (prof == PROFILE_MOBILE) return ARR_SIZE(mobile_str_pattern); +//LCOV_EXCL_START else if (prof == PROFILE_WEARABLE) return ARR_SIZE(wearable_str_pattern); else return ARR_SIZE(common_str_pattern); +//LCOV_EXCL_STOP } static const char *profile_str_pattern(int pattern) @@ -331,6 +337,7 @@ static const char *profile_str_pattern(int pattern) if (pattern == mobile_str_pattern[i].id) return mobile_str_pattern[i].string; } +//LCOV_EXCL_START } else if (prof == PROFILE_WEARABLE) { for (i = 0; i < profile_get_num_of_pattern(); i++) { if (pattern == wearable_str_pattern[i].id) @@ -342,6 +349,7 @@ static const char *profile_str_pattern(int pattern) return common_str_pattern[i].string; } } +//LCOV_EXCL_STOP return ""; } @@ -360,6 +368,7 @@ static int profile_get_pattern_enum(char *pattern) if (!strncmp(pattern, mobile_str_pattern[i].string, len)) return mobile_str_pattern[i].id; } +//LCOV_EXCL_START } else if (prof == PROFILE_WEARABLE) { for (i = 0; i < profile_get_num_of_pattern(); i++) { if (!strncmp(pattern, wearable_str_pattern[i].string, len)) @@ -371,6 +380,7 @@ static int profile_get_pattern_enum(char *pattern) return common_str_pattern[i].id; } } +//LCOV_EXCL_STOP return -1; } @@ -568,10 +578,12 @@ static bool profile_is_notification_type(int pattern) if (prof == PROFILE_MOBILE) return mobile_is_notification_type(pattern); +//LCOV_EXCL_START else if (prof == PROFILE_WEARABLE) return wearable_is_notification_type(pattern); else return false; +//LCOV_EXCL_STOP } static int mobile_get_priority(int pattern) @@ -654,6 +666,7 @@ static bool mobile_get_always_alert_case(int type, int pattern) return false; } +//LCOV_EXCL_START static bool wearable_get_always_alert_case(int type, int pattern) { if (CHECK_SOUND(type)) { @@ -712,7 +725,9 @@ static bool wearable_get_always_alert_case(int type, int pattern) } return false; } +//LCOV_EXCL_STOP +//LCOV_EXCL_START static bool common_get_always_alert_case(int type, int pattern) { switch (pattern) { @@ -728,6 +743,7 @@ static bool common_get_always_alert_case(int type, int pattern) } return false; } +//LCOV_EXCL_STOP static bool profile_get_always_alert_case(int type, int pattern) { @@ -737,10 +753,12 @@ static bool profile_get_always_alert_case(int type, int pattern) if (prof == PROFILE_MOBILE) return mobile_get_always_alert_case(type, pattern); +//LCOV_EXCL_START else if (prof == PROFILE_WEARABLE) return wearable_get_always_alert_case(type, pattern); else return common_get_always_alert_case(type, pattern); +//LCOV_EXCL_STOP } static bool mobile_get_always_off_case(int type, int pattern) @@ -781,6 +799,7 @@ static bool mobile_get_always_off_case(int type, int pattern) return false; } +//LCOV_EXCL_START static bool wearable_is_system_type(int pattern) { switch (pattern) { @@ -834,7 +853,9 @@ static bool wearable_get_always_off_case(int type, int pattern) } return false; } +//LCOV_EXCL_STOP +//LCOV_EXCL_START static bool common_get_always_off_case(int type, int pattern) { switch (pattern) { @@ -852,6 +873,7 @@ static bool common_get_always_off_case(int type, int pattern) } return false; } +//LCOV_EXCL_STOP static bool profile_get_always_off_case(int type, int pattern) { @@ -861,10 +883,12 @@ static bool profile_get_always_off_case(int type, int pattern) if (prof == PROFILE_MOBILE) return mobile_get_always_off_case(type, pattern); +//LCOV_EXCL_START else if (prof == PROFILE_WEARABLE) return wearable_get_always_off_case(type, pattern); else return common_get_always_off_case(type, pattern); +//LCOV_EXCL_STOP } static int mobile_get_strength_type(int type, int pattern) @@ -891,6 +915,7 @@ static int mobile_get_strength_type(int type, int pattern) return -EINVAL; } +//LCOV_EXCL_START static int wearable_get_strength_type(int type, int pattern) { if (CHECK_SOUND(type)) { @@ -918,7 +943,9 @@ static int wearable_get_strength_type(int type, int pattern) } return -EINVAL; } +//LCOV_EXCL_STOP +//LCOV_EXCL_START static int common_get_strength_type(int type, int pattern) { if (CHECK_SOUND(type)) { @@ -936,6 +963,7 @@ static int common_get_strength_type(int type, int pattern) return -EINVAL; } +//LCOV_EXCL_STOP static int profile_get_strength_type(int type, int pattern) { @@ -945,10 +973,12 @@ static int profile_get_strength_type(int type, int pattern) if (prof == PROFILE_MOBILE) return mobile_get_strength_type(type, pattern); +//LCOV_EXCL_START else if (prof == PROFILE_WEARABLE) return wearable_get_strength_type(type, pattern); else return common_get_strength_type(type, pattern); +//LCOV_EXCL_STOP } static const struct profile_ops feedback_profile_ops = { -- cgit v1.2.3