aboutsummaryrefslogtreecommitdiff
path: root/src/test/test_consdiffmgr.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-04-25 15:36:13 -0400
committerNick Mathewson <nickm@torproject.org>2017-04-27 21:40:46 -0400
commit1e1581a24ea11b93b1fdf33a11ce07b8d2772c75 (patch)
tree41ea7b95600360c2710247d4b0fc1894d41ee036 /src/test/test_consdiffmgr.c
parenta1172b6774bc95ff951ac58051ea42bc0a62e32b (diff)
downloadtor-1e1581a24ea11b93b1fdf33a11ce07b8d2772c75.tar.gz
tor-1e1581a24ea11b93b1fdf33a11ce07b8d2772c75.zip
Pre-compress consensus diffs with supported consensus methods.
Diffstat (limited to 'src/test/test_consdiffmgr.c')
-rw-r--r--src/test/test_consdiffmgr.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/test/test_consdiffmgr.c b/src/test/test_consdiffmgr.c
index b3fa3886f1..31ce6ce901 100644
--- a/src/test/test_consdiffmgr.c
+++ b/src/test/test_consdiffmgr.c
@@ -141,7 +141,8 @@ lookup_diff_from(consensus_cache_entry_t **out,
uint8_t digest[DIGEST256_LEN];
crypto_digest256((char*)digest, str1, strlen(str1), DIGEST_SHA3_256);
return consdiffmgr_find_diff_from(out, flav,
- DIGEST_SHA3_256, digest, sizeof(digest));
+ DIGEST_SHA3_256, digest, sizeof(digest),
+ NO_METHOD);
}
static int
@@ -373,7 +374,8 @@ test_consdiffmgr_make_diffs(void *arg)
tt_int_op(1, OP_EQ, smartlist_len(fake_cpuworker_queue));
diff_status = consdiffmgr_find_diff_from(&diff, FLAV_MICRODESC,
DIGEST_SHA3_256,
- md_ns_sha3, DIGEST256_LEN);
+ md_ns_sha3, DIGEST256_LEN,
+ NO_METHOD);
tt_int_op(CONSDIFF_IN_PROGRESS, OP_EQ, diff_status);
// Now run that process and get the diff.
@@ -384,7 +386,8 @@ test_consdiffmgr_make_diffs(void *arg)
// At this point we should be able to get that diff.
diff_status = consdiffmgr_find_diff_from(&diff, FLAV_MICRODESC,
DIGEST_SHA3_256,
- md_ns_sha3, DIGEST256_LEN);
+ md_ns_sha3, DIGEST256_LEN,
+ NO_METHOD);
tt_int_op(CONSDIFF_AVAILABLE, OP_EQ, diff_status);
tt_assert(diff);
@@ -757,7 +760,7 @@ test_consdiffmgr_cleanup_old_diffs(void *arg)
/* Now add an even-more-recent consensus; this should make all previous
* diffs deletable */
tt_int_op(0, OP_EQ, consdiffmgr_add_consensus(md_body[3], md_ns[3]));
- tt_int_op(2, OP_EQ, consdiffmgr_cleanup());
+ tt_int_op(2 * n_diff_compression_methods(), OP_EQ, consdiffmgr_cleanup());
tt_int_op(CONSDIFF_NOT_FOUND, OP_EQ,
lookup_diff_from(&ent, FLAV_MICRODESC, md_body[0]));