From 7074e89fd0135c5cf3eea791829860cfba93d002 Mon Sep 17 00:00:00 2001 From: c9s Date: Sat, 24 May 2014 10:27:47 +0800 Subject: [PATCH] more queue tests --- tests/check_queue.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/tests/check_queue.c b/tests/check_queue.c index 8c8aaeb..ee2f138 100644 --- a/tests/check_queue.c +++ b/tests/check_queue.c @@ -58,9 +58,16 @@ void * consumer_thread(void * args) START_TEST (test_queue) { queue * q = queue_new(); - queue_push(q, (void*) 1); - int i = (int) queue_pop(q); - ck_assert_int_eq(i, 1); + + for (short i = 0 ; i < 100 ; i++ ) { + queue_push(q, (void*) i); + } + + for (short i = 0 ; i < 100 ; i++ ) { + short v = (short) queue_pop(q); + ck_assert_int_eq(i, v); + } + queue_free(q); } END_TEST