Branch Coverage

libeio/etp.c
Criterion Covered Total %
branch 49 72 68.0


line true false branch
99 1 0 if (buf->len < len)
238 180 20 for (pri = 0; pri < ETP_NUM_PRI; ++pri)
250 35 118 if (q->qe[pri])
266 108 134 if (!q->size)
271 530 0 for (pri = ETP_NUM_PRI; pri--; )
275 134 396 if (req)
277 108 26 if (!(q->qs[pri] = (ETP_REQ *)req->next))
357 73 70 if (ecb_expect_true (req))
360 0 70 if (ts.tv_sec == 1) /* no request, but timeout detected, let's quit */
371 70 0 if (pool->idle <= pool->max_idle)
377 0 0 if (!ts.tv_sec)
380 0 0 if (X_COND_TIMEDWAIT (pool->reqwait, pool->reqlock, ts) == ETIMEDOUT)
391 0 73 if (ecb_expect_false (req->type == ETP_TYPE_QUIT))
400 45 27 if (!reqq_push (&pool->res_queue, req))
430 21 0 if (xthread_create (&wrk->tid, etp_proc, (void *)wrk))
447 2 189 if (ecb_expect_true (etp_nthreads (pool) >= pool->wanted))
451 168 21 if (ecb_expect_true (0 <= (int)etp_nthreads (pool) + (int)etp_npending (pool) - (int)etp_nreqs (pool)))
487 0 38 if (maxtime)
499 61 38 if (ecb_expect_true (req))
503 42 19 if (!pool->res_queue.size)
509 38 61 if (ecb_expect_false (!req))
516 6 55 if (ecb_expect_false (req->type == ETP_TYPE_GROUP && req->size))
5 1 if (ecb_expect_false (req->type == ETP_TYPE_GROUP && req->size))
524 0 56 if (ecb_expect_false (res))
528 0 56 if (ecb_expect_false (maxreqs && !--maxreqs))
0 0 if (ecb_expect_false (maxreqs && !--maxreqs))
531 0 56 if (maxtime)
535 0 0 if (etp_tvdiff (&tv_start, &tv_now) >= maxtime)
558 1 3 for (grp = grp->grp_first; grp; grp = grp->grp_next)
567 0 81 if (ecb_expect_false (req->pri < ETP_PRI_MIN - ETP_PRI_MIN)) req->pri = ETP_PRI_MIN - ETP_PRI_MIN;
568 0 81 if (ecb_expect_false (req->pri > ETP_PRI_MAX - ETP_PRI_MIN)) req->pri = ETP_PRI_MAX - ETP_PRI_MIN;
570 6 75 if (ecb_expect_false (req->type == ETP_TYPE_GROUP))
581 6 0 if (!reqq_push (&pool->res_queue, req))
634 10 6 if (pool->wanted < threads)
641 1 0 if (pool->wanted > threads)
644 0 1 while (pool->started > pool->wanted)