aboutsummaryrefslogtreecommitdiff
path: root/src/test/test_shared_random.c
diff options
context:
space:
mode:
authorGeorge Kadianakis <desnacked@riseup.net>2016-05-13 13:42:33 -0400
committerDavid Goulet <dgoulet@torproject.org>2016-07-01 14:01:41 -0400
commitedea0441477cf7f1293ce848abf59b3f1033b28a (patch)
treebb51c26be081a4f1a4879c4a1b1f39047d87907f /src/test/test_shared_random.c
parent545b77e2f8fac6cf5909bb6b69b52d9cb4f8f397 (diff)
downloadtor-edea0441477cf7f1293ce848abf59b3f1033b28a.tar.gz
tor-edea0441477cf7f1293ce848abf59b3f1033b28a.zip
prop250: Sort smartlist before you get most frequent SRV.
Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/test/test_shared_random.c')
-rw-r--r--src/test/test_shared_random.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/test/test_shared_random.c b/src/test/test_shared_random.c
index fbb4414534..5a9c123d2a 100644
--- a/src/test/test_shared_random.c
+++ b/src/test/test_shared_random.c
@@ -844,7 +844,7 @@ test_sr_get_majority_srv_from_votes(void *arg)
{ /* Now put in 8 more votes. Let SRV_1 have majority. */
int i;
/* Now 7 votes believe in SRV_1 */
- for (i = 0; i < 6; i++) {
+ for (i = 0; i < 3; i++) {
networkstatus_t *vote = get_test_vote_with_curr_srv(SRV_1);
smartlist_add(votes, vote);
}
@@ -853,6 +853,10 @@ test_sr_get_majority_srv_from_votes(void *arg)
networkstatus_t *vote = get_test_vote_with_curr_srv(SRV_2);
smartlist_add(votes, vote);
}
+ for (i = 0; i < 3; i++) {
+ networkstatus_t *vote = get_test_vote_with_curr_srv(SRV_1);
+ smartlist_add(votes, vote);
+ }
tt_int_op(smartlist_len(votes), ==, 9);
}