test: add one more test for prioq_remove()

This adds a testcase for e6e637a11a.
This commit is contained in:
Yu Watanabe
2018-10-17 01:18:10 +09:00
parent 0cb3b295ec
commit 5023c62efd
+4 -1
View File
@@ -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);