From 85c4b50b6f2de280906fdf23bf1da8452562aa97 Mon Sep 17 00:00:00 2001 From: Patrick Pelissier Date: Sun, 8 Nov 2020 00:57:47 +0100 Subject: [PATCH] Improve coverage of prioriy queue. --- tests/test-mprioqueue.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/test-mprioqueue.c b/tests/test-mprioqueue.c index ec1c946f..5c43478c 100644 --- a/tests/test-mprioqueue.c +++ b/tests/test-mprioqueue.c @@ -101,6 +101,17 @@ static void test2(void) assert (x == i); } + assert (int_pqueue_size(p) == 0); + for(int i = -100; i < 100; i++) { + int_pqueue_push(p, i); + } + assert (int_pqueue_size(p) == 200); + for(int i = -100; i < 100; i++) { + bool b = int_pqueue_erase(p, i); + assert (b); + } + assert (int_pqueue_size(p) == 0); + int_pqueue_clear(p); }