tests: deal with some unreachable cases 94/199094/1
authorMichal Bloch <m.bloch@samsung.com>
Fri, 1 Feb 2019 15:55:12 +0000 (16:55 +0100)
committerMichal Bloch <m.bloch@samsung.com>
Fri, 1 Feb 2019 15:59:12 +0000 (16:59 +0100)
Change-Id: Ib0d09e5c70fd16a0a3856bfb56214273984641cf
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
src/shared/logprint.c
src/shared/queued_entry.c

index a3dab60..2f6cd00 100644 (file)
@@ -95,7 +95,7 @@ static FilterInfo *filterinfo_new(const char *tag, log_priority pri, bool prefix
                p_ret->type = FILTER_TID;
                p_ret->tid = tid;
        } else {
-               assert(false);
+               assert(false); // LCOV_EXCL_LINE
        }
 
        return p_ret;
@@ -112,9 +112,8 @@ static FilterInfo *filterinfo_clone(FilterInfo *p_info)
                return filterinfo_new(NULL, 0, false, false, p_info->pid, FILTERINFO_TID_NONE);
        case FILTER_TID:
                return filterinfo_new(NULL, 0, false, false, FILTERINFO_PID_NONE, p_info->tid);
-       default:
-               assert(false);
-               return NULL;
+
+       default: assert(false); // LCOV_EXCL_LINE
        }
 }
 
@@ -126,8 +125,7 @@ static FilterInfo *filterinfo_clone(FilterInfo *p_info)
  */
 static void filterinfo_free(FilterInfo *p_info)
 {
-       if (p_info == NULL)
-               return;
+       assert(p_info);
 
        if (p_info->type == FILTER_TAG_AND_PRIO) {
                free(p_info->tnp.tag);
@@ -260,8 +258,8 @@ bool log_should_print_line(log_format *p_format, const struct logger_entry *entr
                        if (entry->tid == p_curFilter->tid)
                                return true;
                        break;
-               default:
-                       assert(false);
+
+               default: assert(false); // LCOV_EXCL_LINE
                }
 
        }
@@ -610,8 +608,7 @@ enum sorting_order get_format_sorting(const log_format *format)
        case FORMAT_RECV_REALTIME:
                return SORT_RECV_REAL;
 
-       default:
-               assert(false);
+       default: assert(false); // LCOV_EXCL_LINE
        }
 }
 
index 4bc851a..1def14a 100644 (file)
@@ -419,8 +419,8 @@ void extract_timestamp(const struct logger_entry *le, enum sorting_order stamp_t
                ts->tv_sec = le->sec_recv_real;
                ts->tv_nsec = le->nsec_recv_real;
                break;
-       default:
-               assert(false);
+
+       default: assert(false); // LCOV_EXCL_LINE
        }
 }
 
@@ -435,8 +435,7 @@ clockid_t get_proper_clock(enum sorting_order sort_by)
        case SORT_RECV_REAL:
                return CLOCK_REALTIME;
 
-       default:
-               assert(false);
+       default: assert(false); // LCOV_EXCL_LINE
        }
 }