summaryrefslogtreecommitdiff
path: root/src/or/test.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2009-09-14 23:39:08 -0400
committerNick Mathewson <nickm@torproject.org>2009-09-14 23:39:08 -0400
commit56c6d78520a98fb643e67b80b9192a2875f95e29 (patch)
treeb4cfcdd84c2f41eab6ca30885d9612c3cfeecf28 /src/or/test.c
parentd9872cc67632d6c1f81e0a81fc50a62198f1b35d (diff)
downloadtor-56c6d78520a98fb643e67b80b9192a2875f95e29.tar.gz
tor-56c6d78520a98fb643e67b80b9192a2875f95e29.zip
Parameter access function, with unit tests.
Diffstat (limited to 'src/or/test.c')
-rw-r--r--src/or/test.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/or/test.c b/src/or/test.c
index 338195fd25..f2cc7cc1f3 100644
--- a/src/or/test.c
+++ b/src/or/test.c
@@ -3381,6 +3381,9 @@ test_dirutil_param_voting(void)
"abcd=20 c=60 cw=500 x-yz=-9 zzzzz=101", NULL, 0, 0);
smartlist_split_string(vote4.net_params,
"ab=900 abcd=200 c=1 cw=51 x-yz=100", NULL, 0, 0);
+ test_eq(100, networkstatus_get_param(&vote4, "x-yz", 50));
+ test_eq(222, networkstatus_get_param(&vote4, "foobar", 222));
+
smartlist_add(votes, &vote1);
smartlist_add(votes, &vote2);
smartlist_add(votes, &vote3);