[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor/release-0.4.3] Fix allocation counting in clean_v2_descs_as_dir test.



commit f9bb49d870045fa6e1a2570a65f0583066d8359d
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
Date:   Wed Aug 12 14:25:46 2020 -0400

    Fix allocation counting in clean_v2_descs_as_dir test.
    
    Without this fix, running this test on its own would fail.
    
    Fixes bug 40099. Bugfix on ade5005853c17b3 in 0.2.8.1-alpha.
---
 changes/bug40099          | 4 ++++
 src/test/test_rendcache.c | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/changes/bug40099 b/changes/bug40099
new file mode 100644
index 0000000000..278ede2023
--- /dev/null
+++ b/changes/bug40099
@@ -0,0 +1,4 @@
+  o Minor bugfixes (tests):
+    - Fix the behavior of the rend_cache/clean_v2_descs_as_dir when run on
+      its own.  Previously, it would exit with an error.
+      Fixes bug 40099; bugfix on 0.2.8.1-alpha.
diff --git a/src/test/test_rendcache.c b/src/test/test_rendcache.c
index 4f544cf21c..93f9f82953 100644
--- a/src/test/test_rendcache.c
+++ b/src/test/test_rendcache.c
@@ -1101,6 +1101,7 @@ test_rend_cache_clean_v2_descs_as_dir(void *data)
   desc->timestamp = now;
   desc->pk = pk_generate(0);
   e->parsed = desc;
+  rend_cache_increment_allocation(rend_cache_entry_allocation(e));
   digestmap_set(rend_cache_v2_dir, key, e);
 
   /* Set the cutoff to minus 10 seconds. */
@@ -1250,4 +1251,3 @@ struct testcase_t rend_cache_tests[] = {
     test_rend_cache_validate_intro_point_failure, 0, NULL, NULL },
   END_OF_TESTCASES
 };
-



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits