more queue tests
This commit is contained in:
parent
def79a810b
commit
7074e89fd0
1 changed files with 10 additions and 3 deletions
|
@ -58,9 +58,16 @@ void * consumer_thread(void * args)
|
||||||
START_TEST (test_queue)
|
START_TEST (test_queue)
|
||||||
{
|
{
|
||||||
queue * q = queue_new();
|
queue * q = queue_new();
|
||||||
queue_push(q, (void*) 1);
|
|
||||||
int i = (int) queue_pop(q);
|
for (short i = 0 ; i < 100 ; i++ ) {
|
||||||
ck_assert_int_eq(i, 1);
|
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
|
END_TEST
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue