aboutsummaryrefslogtreecommitdiff
path: root/src/test/test_rendcache.c
diff options
context:
space:
mode:
authorteor (Tim Wilson-Brown) <teor2345@gmail.com>2015-12-01 10:50:14 +1100
committerteor (Tim Wilson-Brown) <teor2345@gmail.com>2015-12-01 10:50:14 +1100
commit7ff18cc1b64e4a119ec3b46102c897f3ca7107f8 (patch)
tree132343ab98bc910146d471fb05882905b3cd8ac9 /src/test/test_rendcache.c
parent0a701e537778ac9da31049f4efebf7cb2bf9c285 (diff)
downloadtor-7ff18cc1b64e4a119ec3b46102c897f3ca7107f8.tar.gz
tor-7ff18cc1b64e4a119ec3b46102c897f3ca7107f8.zip
Avoid relying on malloc internals in test_rend_cache_purge.
Closes ticket 17724. Bug fix on ade5005853c1 and 5e9f2384cf0f, not in any released version of Tor. Patch by "teor".
Diffstat (limited to 'src/test/test_rendcache.c')
-rw-r--r--src/test/test_rendcache.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/test/test_rendcache.c b/src/test/test_rendcache.c
index 11f11147cb..92adf01273 100644
--- a/src/test/test_rendcache.c
+++ b/src/test/test_rendcache.c
@@ -1024,24 +1024,22 @@ test_rend_cache_entry_free(void *data)
static void
test_rend_cache_purge(void *data)
{
- strmap_t *our_rend_cache;
-
(void)data;
// Deals with a NULL rend_cache
rend_cache_purge();
tt_assert(rend_cache);
- tt_int_op(strmap_size(rend_cache), OP_EQ, 0);
+ tt_assert(strmap_size(rend_cache) == 0);
// Deals with existing rend_cache
rend_cache_free_all();
rend_cache_init();
+ tt_assert(rend_cache);
+ tt_assert(strmap_size(rend_cache) == 0);
- our_rend_cache = rend_cache;
rend_cache_purge();
tt_assert(rend_cache);
tt_assert(strmap_size(rend_cache) == 0);
- tt_assert(rend_cache == our_rend_cache);
done:
rend_cache_free_all();