diff options
author | Tobias Stoeckmann <tobias@stoeckmann.org> | 2019-04-13 16:54:05 +0200 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2019-04-15 14:46:26 -0400 |
commit | 5a0c8579964aa1d27dd9be35afda5e7226c31fb4 (patch) | |
tree | 79edf7fd6a672c648f0c85276f0221289bd8a3d2 /src/test/test_containers.c | |
parent | 9ae267538ce09569ecdba88d5fb1381ec197bb54 (diff) | |
download | tor-5a0c8579964aa1d27dd9be35afda5e7226c31fb4.tar.gz tor-5a0c8579964aa1d27dd9be35afda5e7226c31fb4.zip |
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>
Diffstat (limited to 'src/test/test_containers.c')
-rw-r--r-- | src/test/test_containers.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/test/test_containers.c b/src/test/test_containers.c index 7892a08853..ad272eeaf5 100644 --- a/src/test/test_containers.c +++ b/src/test/test_containers.c @@ -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, 2), OP_EQ, &array[1]); tt_ptr_op(smartlist_get(sl, 3), OP_EQ, &array[2]); + tt_ptr_op(sl->list[4], OP_EQ, NULL); done: smartlist_free(sl); |