diff options
author | Nick Mathewson <nickm@torproject.org> | 2018-09-11 13:16:49 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-09-11 13:16:49 -0400 |
commit | 75ad1a1f2fca79dd2e48cfe1416d21a2b82b76b6 (patch) | |
tree | 2f87d32ba68747d178e2cbc24627af8bcb08f289 /src/test/test_protover.c | |
parent | 042a9fd8b008ad004c2a11ed18298b5cd3b60a37 (diff) | |
parent | 6c0e7a9e1a43db307244c16b4290b292c035fa63 (diff) | |
download | tor-75ad1a1f2fca79dd2e48cfe1416d21a2b82b76b6.tar.gz tor-75ad1a1f2fca79dd2e48cfe1416d21a2b82b76b6.zip |
Merge remote-tracking branch 'onionk/doublevote1'
Diffstat (limited to 'src/test/test_protover.c')
-rw-r--r-- | src/test/test_protover.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/test/test_protover.c b/src/test/test_protover.c index ac8e98250e..38bc02f1d7 100644 --- a/src/test/test_protover.c +++ b/src/test/test_protover.c @@ -167,6 +167,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"); |