Branch Coverage

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


line true false branch
45 0 2160171 if (a->len != b->len)
47 366 2160171 for (i=0 ; i
48 0 366 if(a->path[i] != b->path[i])
82 7 23 if (state_fd >= 0)
103 0 2160171 if ((longer = persistNE(&global_persist, &thread_persist))) {
105 0 0 if (state_fd >= 0)
110 130 2160041 if (state_fd == STATEFD_UNTRIED) {
112 127 3 if (lstat((char*)thread_persist.path, &statbuf) < 0) { /* this covers EINTR too.. ugh */
113 127 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 2160169 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 2160155 16 if ((tv.tv_sec == last.tv_sec) && (tv.tv_usec == last.tv_usec)) {
316589 1843566 if ((tv.tv_sec == last.tv_sec) && (tv.tv_usec == last.tv_usec)) {
163 0 316589 if (++adjustment >= MAX_ADJUSTMENT) {
170 1843566 16 if (((tv.tv_sec == last.tv_sec) && (tv.tv_usec < last.tv_usec)) || (tv.tv_sec < last.tv_sec))
1843566 0 if (((tv.tv_sec == last.tv_sec) && (tv.tv_usec < last.tv_usec)) || (tv.tv_sec < last.tv_sec))
0 1843582 if (((tv.tv_sec == last.tv_sec) && (tv.tv_usec < last.tv_usec)) || (tv.tv_sec < last.tv_sec))
180 2160169 2 if ((clock_reg - prev_reg) >= defer_100ns) {
181 125 2160044 if (state_fd == STATEFD_CREATEOK) {
183 0 125 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 119 6 if (state_fd < 0)
192 6 119 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 2160161 if (state_fd > 0) {
215 0 8 if (ftruncate(state_fd, len) < 0) {