test: page_insert
This commit is contained in:
@@ -18,11 +18,22 @@ test_create_returns_non_null(void)
|
||||
printf(" OK: page_create(42) returns non-NULL\n");
|
||||
}
|
||||
|
||||
static void
|
||||
test_insert_returns_slot_id(void)
|
||||
{
|
||||
Page * p = page_create(4);
|
||||
int slot_id = page_insert(p, "Hallo", 5);
|
||||
assert(slot_id == 0);
|
||||
page_free(p);
|
||||
printf(" OK: Insert\n");
|
||||
}
|
||||
|
||||
int
|
||||
main(void)
|
||||
{
|
||||
printf("=== test_page ===\n");
|
||||
test_create_returns_non_null();
|
||||
test_insert_returns_slot_id();
|
||||
printf("All tests passed.\n");
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user