From 5023c62efdd5749f3edcaa3055cd17ba8a05af13 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Wed, 17 Oct 2018 01:18:05 +0900 Subject: test: add one more test for prioq_remove() This adds a testcase for e6e637a11a6c62eff31d36f5fc4b49c2a10c7ea8. --- src/test/test-prioq.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/test/test-prioq.c b/src/test/test-prioq.c index b2ee70bca6..a93d37d460 100644 --- a/src/test/test-prioq.c +++ b/src/test/test-prioq.c @@ -16,7 +16,7 @@ static int unsigned_compare(const unsigned *a, const unsigned *b) { static void test_unsigned(void) { _cleanup_(prioq_freep) Prioq *q = NULL; - unsigned buffer[SET_SIZE], i, u; + unsigned buffer[SET_SIZE], i, u, n; srand(0); @@ -26,6 +26,9 @@ static void test_unsigned(void) { u = (unsigned) rand(); buffer[i] = u; assert_se(prioq_put(q, UINT_TO_PTR(u), NULL) >= 0); + + n = prioq_size(q); + assert_se(prioq_remove(q, UINT_TO_PTR(u), &n) == 0); } typesafe_qsort(buffer, ELEMENTSOF(buffer), unsigned_compare); -- cgit v1.2.3