]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Avoid relying on malloc internals in test_rend_cache_purge.
authorteor (Tim Wilson-Brown) <teor2345@gmail.com>
Mon, 30 Nov 2015 23:50:14 +0000 (10:50 +1100)
committerteor (Tim Wilson-Brown) <teor2345@gmail.com>
Mon, 30 Nov 2015 23:50:14 +0000 (10:50 +1100)
Closes ticket 17724. Bug fix on ade5005853c1 and 5e9f2384cf0f,
not in any released version of Tor. Patch by "teor".

changes/bug17724 [new file with mode: 0644]
src/test/test_rendcache.c

diff --git a/changes/bug17724 b/changes/bug17724
new file mode 100644 (file)
index 0000000..7ace99e
--- /dev/null
@@ -0,0 +1,4 @@
+  o Minor bug fixes (unit tests, hidden services):
+    - 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".
index 11f11147cb32d01df05226274044c3268d49f75d..92adf0127394d2e0de68b88d2c1069b7b5e16a0e 100644 (file)
@@ -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();