Branch Coverage

ulib/clock.c
Criterion Covered Total %
branch 47 70 67.1


line true false branch
45 0 54171 if (a->len != b->len)
47 454 54171 for (i=0 ; i
48 0 454 if(a->path[i] != b->path[i])
82 7 23 if (state_fd >= 0)
103 0 54171 if ((longer = persistNE(&global_persist, &thread_persist))) {
105 0 0 if (state_fd >= 0)
110 106 54065 if (state_fd == STATEFD_UNTRIED) {
112 103 3 if (lstat((char*)thread_persist.path, &statbuf) < 0) { /* this covers EINTR too.. ugh */
113 103 0 if (errno == ENOENT)
118 1 2 else if ((statbuf.st_mode & S_IFMT) == S_IFLNK)
123 0 2 if (state_fd < 0 && errno == ENOENT)
0 0 if (state_fd < 0 && errno == ENOENT)
125 2 0 else if (state_fd >= 0) {
128 2 0 if ((lstat((char*)thread_persist.path, &statbuf) == 0) && ((statbuf.st_mode & S_IFMT) != S_IFLNK))
2 0 if ((lstat((char*)thread_persist.path, &statbuf) == 0) && ((statbuf.st_mode & S_IFMT) != S_IFLNK))
131 0 2 if (!state_f) {
141 2 54169 if (state_fd >= 0) {
148 1 1 if (fscanf(state_f, "clock: %04x tv: %lu %lu adj: %d\n", &cl, &tv1, &tv2, &a) == 4) {
161 54151 20 if ((tv.tv_sec == last.tv_sec) && (tv.tv_usec == last.tv_usec)) {
1785 52366 if ((tv.tv_sec == last.tv_sec) && (tv.tv_usec == last.tv_usec)) {
163 0 1785 if (++adjustment >= MAX_ADJUSTMENT) {
170 52366 20 if (((tv.tv_sec == last.tv_sec) && (tv.tv_usec < last.tv_usec)) || (tv.tv_sec < last.tv_sec))
52366 0 if (((tv.tv_sec == last.tv_sec) && (tv.tv_usec < last.tv_usec)) || (tv.tv_sec < last.tv_sec))
0 52386 if (((tv.tv_sec == last.tv_sec) && (tv.tv_usec < last.tv_usec)) || (tv.tv_sec < last.tv_sec))
180 54169 2 if ((clock_reg - prev_reg) >= defer_100ns) {
181 101 54068 if (state_fd == STATEFD_CREATEOK) {
183 0 101 if ((lstat((char*)thread_persist.path, &statbuf) == 0) && ((statbuf.st_mode & S_IFMT) == S_IFLNK))
0 0 if ((lstat((char*)thread_persist.path, &statbuf) == 0) && ((statbuf.st_mode & S_IFMT) == S_IFLNK))
189 95 6 if (state_fd < 0)
192 6 95 if (state_fd >= 0) {
195 6 0 if ((lstat((char*)thread_persist.path, &statbuf) == 0) && ((statbuf.st_mode & S_IFMT) != S_IFLNK))
6 0 if ((lstat((char*)thread_persist.path, &statbuf) == 0) && ((statbuf.st_mode & S_IFMT) != S_IFLNK))
198 0 6 if (!state_f) {
208 8 54161 if (state_fd > 0) {
215 0 8 if (ftruncate(state_fd, len) < 0) {