aboutsummaryrefslogtreecommitdiff
path: root/src/test/test_dir.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-09-15 16:40:11 -0400
committerNick Mathewson <nickm@torproject.org>2017-09-15 16:40:11 -0400
commit76c33f7ff46df47df0cc880595c4d943d50f019b (patch)
tree11448ec9afd6990160ce6212c020d3c2630448d6 /src/test/test_dir.c
parentc1deabd3b0c9e2701696afc80ac8392f0efda2c7 (diff)
parenta28e239b171c1a69fd32b6583bca0559f7116445 (diff)
downloadtor-76c33f7ff46df47df0cc880595c4d943d50f019b.tar.gz
tor-76c33f7ff46df47df0cc880595c4d943d50f019b.zip
Merge branch 'scan-build-032'
Diffstat (limited to 'src/test/test_dir.c')
-rw-r--r--src/test/test_dir.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/test/test_dir.c b/src/test/test_dir.c
index 81ba5f66c4..2d48cfc3c4 100644
--- a/src/test/test_dir.c
+++ b/src/test/test_dir.c
@@ -2252,6 +2252,7 @@ test_dir_networkstatus_compute_bw_weights_v10(void *arg)
tt_i64_op(G+M+E+D, OP_EQ, T);
ret = networkstatus_compute_bw_weights_v10(chunks, G, M, E, D, T,
weight_scale);
+ tt_assert(ret);
tt_str_op(smartlist_get(chunks, 0), OP_EQ, "bandwidth-weights Wbd=883 Wbe=0 "
"Wbg=3673 Wbm=10000 Wdb=10000 Web=10000 Wed=8233 Wee=10000 Weg=8233 "
"Wem=10000 Wgb=10000 Wgd=883 Wgg=6327 Wgm=6327 Wmb=10000 Wmd=883 Wme=0 "
@@ -2268,6 +2269,7 @@ test_dir_networkstatus_compute_bw_weights_v10(void *arg)
tt_i64_op(G+M+E+D, OP_EQ, T);
ret = networkstatus_compute_bw_weights_v10(chunks, G, M, E, D, T,
weight_scale);
+ tt_assert(ret);
tt_str_op(smartlist_get(chunks, 0), OP_EQ, "bandwidth-weights Wbd=0 Wbe=0 "
"Wbg=4194 Wbm=10000 Wdb=10000 Web=10000 Wed=10000 Wee=10000 Weg=10000 "
"Wem=10000 Wgb=10000 Wgd=0 Wgg=5806 Wgm=5806 Wmb=10000 Wmd=0 Wme=0 "
@@ -2284,6 +2286,7 @@ test_dir_networkstatus_compute_bw_weights_v10(void *arg)
tt_i64_op(G+M+E+D, OP_EQ, T);
ret = networkstatus_compute_bw_weights_v10(chunks, G, M, E, D, T,
weight_scale);
+ tt_assert(ret);
tt_str_op(smartlist_get(chunks, 0), OP_EQ, "bandwidth-weights Wbd=317 "
"Wbe=5938 Wbg=0 Wbm=10000 Wdb=10000 Web=10000 Wed=9366 Wee=4061 "
"Weg=9366 Wem=4061 Wgb=10000 Wgd=317 Wgg=10000 Wgm=10000 Wmb=10000 "
@@ -2304,6 +2307,7 @@ test_dir_networkstatus_compute_bw_weights_v10(void *arg)
"Wbe=0 Wbg=0 Wbm=10000 Wdb=10000 Web=10000 Wed=3333 Wee=10000 Weg=3333 "
"Wem=10000 Wgb=10000 Wgd=3333 Wgg=10000 Wgm=10000 Wmb=10000 Wmd=3333 "
"Wme=0 Wmg=0 Wmm=10000\n");
+ tt_assert(ret);
done:
SMARTLIST_FOREACH(chunks, char *, cp, tor_free(cp));
@@ -3366,7 +3370,7 @@ mock_get_options(void)
static void
reset_routerstatus(routerstatus_t *rs,
const char *hex_identity_digest,
- int32_t ipv4_addr)
+ uint32_t ipv4_addr)
{
memset(rs, 0, sizeof(routerstatus_t));
base16_decode(rs->identity_digest, sizeof(rs->identity_digest),