mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2025-02-26 07:31:33 +01:00
Add test to verify that unused pointers are NULL.
The smartlist code takes great care to set all unused pointers inside the smartlist memory to NULL. Check if this is also the case after modifying the smartlist multiple times. Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
This commit is contained in:
parent
9ae267538c
commit
5a0c857996
1 changed files with 1 additions and 0 deletions
|
@ -1006,6 +1006,7 @@ test_container_smartlist_remove(void *arg)
|
||||||
tt_ptr_op(smartlist_get(sl, 1), OP_EQ, &array[2]);
|
tt_ptr_op(smartlist_get(sl, 1), OP_EQ, &array[2]);
|
||||||
tt_ptr_op(smartlist_get(sl, 2), OP_EQ, &array[1]);
|
tt_ptr_op(smartlist_get(sl, 2), OP_EQ, &array[1]);
|
||||||
tt_ptr_op(smartlist_get(sl, 3), OP_EQ, &array[2]);
|
tt_ptr_op(smartlist_get(sl, 3), OP_EQ, &array[2]);
|
||||||
|
tt_ptr_op(sl->list[4], OP_EQ, NULL);
|
||||||
|
|
||||||
done:
|
done:
|
||||||
smartlist_free(sl);
|
smartlist_free(sl);
|
||||||
|
|
Loading…
Add table
Reference in a new issue