aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2013-06-12 10:01:10 -0400
committerNick Mathewson <nickm@torproject.org>2013-06-12 10:01:10 -0400
commita64d062c958eed643e3bb0802269af12f9eabcb7 (patch)
tree30411ddcd192616ee8082f2cf05f1f1131281204 /src/test
parent8c88c75966f834a39786deec6106361f3937563e (diff)
parent3bdc4e5feee7059344f61d8d7362c77fafc5c8a8 (diff)
downloadtor-a64d062c958eed643e3bb0802269af12f9eabcb7.tar.gz
tor-a64d062c958eed643e3bb0802269af12f9eabcb7.zip
Merge remote-tracking branch 'origin/maint-0.2.4'
Diffstat (limited to 'src/test')
-rw-r--r--src/test/test_microdesc.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/test/test_microdesc.c b/src/test/test_microdesc.c
index 4bc9fa7263..a8171a325c 100644
--- a/src/test/test_microdesc.c
+++ b/src/test/test_microdesc.c
@@ -208,11 +208,25 @@ test_md_cache(void *data)
md3 = NULL; /* it's history now! */
/* rebuild again, make sure it stays gone. */
- microdesc_cache_rebuild(mc, 1);
+ tt_int_op(microdesc_cache_rebuild(mc, 1), ==, 0);
tt_ptr_op(md1, ==, microdesc_cache_lookup_by_digest256(mc, d1));
tt_ptr_op(md2, ==, microdesc_cache_lookup_by_digest256(mc, d2));
tt_ptr_op(NULL, ==, microdesc_cache_lookup_by_digest256(mc, d3));
+ /* Re-add md3, and make sure we can rebuild the cache. */
+ added = microdescs_add_to_cache(mc, test_md3_noannotation, NULL,
+ SAVED_NOWHERE, 0, time3, NULL);
+ tt_int_op(1, ==, smartlist_len(added));
+ md3 = smartlist_get(added, 0);
+ smartlist_free(added);
+ added = NULL;
+ tt_int_op(md1->saved_location, ==, SAVED_IN_CACHE);
+ tt_int_op(md2->saved_location, ==, SAVED_IN_CACHE);
+ tt_int_op(md3->saved_location, ==, SAVED_IN_JOURNAL);
+
+ tt_int_op(microdesc_cache_rebuild(mc, 1), ==, 0);
+ tt_int_op(md3->saved_location, ==, SAVED_IN_CACHE);
+
done:
if (options)
tor_free(options->DataDirectory);