ck_ring: Unit test coverage for ck_ring_trydequeue.

ck_pring
Samy Al Bahra 12 years ago
parent 849f938973
commit 3f0a90813a

@ -82,7 +82,11 @@ test_spmc(void *c)
struct entry *o; struct entry *o;
/* Keep trying until we encounter at least one node. */ /* Keep trying until we encounter at least one node. */
while (ck_ring_dequeue_spmc(&ring_spmc, &o) == false); if (j & 1) {
while (ck_ring_dequeue_spmc(&ring_spmc, &o) == false);
} else {
while (ck_ring_trydequeue_spmc(&ring_spmc, &o) == false);
}
observed++; observed++;
if (o->value < 0 if (o->value < 0

@ -83,7 +83,13 @@ test_spmc(void *c)
struct entry o; struct entry o;
/* Keep trying until we encounter at least one node. */ /* Keep trying until we encounter at least one node. */
while (CK_RING_DEQUEUE_SPMC(spmc_ring, &ring_spmc, &o) == false); if (j & 1) {
while (CK_RING_DEQUEUE_SPMC(spmc_ring,
&ring_spmc, &o) == false);
} else {
while (CK_RING_TRYDEQUEUE_SPMC(spmc_ring,
&ring_spmc, &o) == false);
}
observed++; observed++;
if (o.value < 0 if (o.value < 0

Loading…
Cancel
Save