r15961@catbus: nickm | 2007-10-19 12:40:15 -0400

Learn the difference between "mismatched vote digest" and "mismatched vote times": the latter is more informative.


svn:r12049
This commit is contained in:
Nick Mathewson
2007-10-19 16:41:32 +00:00
parent 53f9fe7dc5
commit 24317c75a9
4 changed files with 34 additions and 10 deletions
+4 -3
View File
@@ -2757,6 +2757,7 @@ test_v3_networkstatus(void)
networkstatus_vote_t *con2, *con3;
char *detached_text1, *detached_text2;
ns_detached_signatures_t *dsig1, *dsig2;
const char *msg=NULL;
/* Compute the other two signed consensuses. */
smartlist_shuffle(votes);
consensus_text2 = networkstatus_compute_consensus(votes, 3,
@@ -2799,7 +2800,7 @@ test_v3_networkstatus(void)
/* Try adding it to con2. */
detached_text2 = networkstatus_get_detached_signatures(con2);
test_eq(1, networkstatus_add_detached_signatures(con2, dsig1));
test_eq(1, networkstatus_add_detached_signatures(con2, dsig1, &msg));
tor_free(detached_text2);
detached_text2 = networkstatus_get_detached_signatures(con2);
//printf("\n<%s>\n", detached_text2);
@@ -2816,10 +2817,10 @@ test_v3_networkstatus(void)
test_eq(2, smartlist_len(dsig2->signatures));
/* Try adding to con2 twice; verify that nothing changes. */
test_eq(0, networkstatus_add_detached_signatures(con2, dsig1));
test_eq(0, networkstatus_add_detached_signatures(con2, dsig1, &msg));
/* Add to con. */
test_eq(2, networkstatus_add_detached_signatures(con, dsig2));
test_eq(2, networkstatus_add_detached_signatures(con, dsig2, &msg));
/* Check signatures */
test_assert(!networkstatus_check_voter_signature(con,
smartlist_get(con->voters, 0),