Commit 169b2846 authored by Chris Müller's avatar Chris Müller

Add tests for general lists.

parent b46d39d0
#include "unittest.h"
#include <assert.h>
#include "structures/list.h"
#include "structures/stack.h"
#include "structures/queue.h"
......@@ -90,8 +91,24 @@ test_queue(const_pointer data)
}
static void
test_list(const_pointer data)
{
int items[] = { 1, 2, 3, 4, 5 };
struct CryList* list = cry_list_new();
assert(cry_list_size(list) == 0);
assert(cry_list_head(list) == 0);
assert(cry_list_tail(list) == 0);
cry_list_free(list, 0);
}
cry_test_structures(void)
{
cry_unittest_run("structures.stack", test_stack, 0, 10);
cry_unittest_run("structures.queue", test_queue, 0, 10);
cry_unittest_run("structures.list", test_list, 0, 10);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment