Skip to content

Commit

Permalink
add test for new empty list elements
Browse files Browse the repository at this point in the history
  • Loading branch information
Fredrik Widlund committed Sep 4, 2019
1 parent d30eb95 commit 82a8585
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/list.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,11 @@ void unit()
assert_int_equal(*(int *) list_front(&l), 1);
list_clear(&l, NULL);

p = list_insert(list_front(&l), NULL, sizeof (int));
*p = 42;
assert_int_equal(*(int *) list_front(&l), 42);
list_clear(&l, NULL);

list_insert(list_previous(list_front(&l)), (int[]){1}, sizeof (int));
assert_int_equal(*(int *) list_front(&l), 1);
list_erase(list_back(&l), NULL);
Expand Down

0 comments on commit 82a8585

Please sign in to comment.