[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [tor/master] test/protover: add double-voting test
commit 6c0e7a9e1a43db307244c16b4290b292c035fa63
Author: cypherpunks <cypherpunks@xxxxxxxxxxxxxx>
Date: Sat Aug 18 18:15:59 2018 +0000
test/protover: add double-voting test
---
src/test/test_protover.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/test/test_protover.c b/src/test/test_protover.c
index 92ead3ca3..17d620ca7 100644
--- a/src/test/test_protover.c
+++ b/src/test/test_protover.c
@@ -144,6 +144,14 @@ test_protover_vote(void *arg)
tt_str_op(result, OP_EQ, "");
tor_free(result);
+ /* Don't count double-voting. */
+ smartlist_clear(lst);
+ smartlist_add(lst, (void*) "Foo=1 Foo=1");
+ smartlist_add(lst, (void*) "Bar=1-2,2-3");
+ result = protover_compute_vote(lst, 2);
+ tt_str_op(result, OP_EQ, "");
+ tor_free(result);
+
/* Bad votes: the result must be empty */
smartlist_clear(lst);
smartlist_add(lst, (void*) "Faux=10-5");
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits