summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2016-12-16 12:23:46 -0500
committerNick Mathewson <nickm@torproject.org>2016-12-16 12:23:46 -0500
commit698ed75e1a4b55936e412a476b2f4880cd7b2fa7 (patch)
treead4166d22796d33d62ddf293d2321b864a3e6e3d
parent23c09b6bc2897ada21de220c48799f01171dcdf4 (diff)
downloadtor-698ed75e1a4b55936e412a476b2f4880cd7b2fa7.tar.gz
tor-698ed75e1a4b55936e412a476b2f4880cd7b2fa7.zip
Resolve some coverity complaints in test_entrynodes.c
-rw-r--r--src/test/test_entrynodes.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/test/test_entrynodes.c b/src/test/test_entrynodes.c
index 68161138a3..30c93397ec 100644
--- a/src/test/test_entrynodes.c
+++ b/src/test/test_entrynodes.c
@@ -1792,8 +1792,9 @@ test_entry_guard_expand_sample(void *arg)
tt_int_op(num_reachable_filtered_guards(gs, NULL), OP_LE,
DFLT_MIN_FILTERED_SAMPLE_SIZE);
/* but we definitely didn't exceed the sample maximum. */
+ const int n_guards = 271 / 2;
tt_int_op(smartlist_len(gs->sampled_entry_guards), OP_LE,
- (int)((271 / 2) * .3));
+ (int)(n_guards * .3));
done:
guard_selection_free(gs);
@@ -2909,6 +2910,7 @@ test_entry_guard_select_and_cancel(void *arg)
for (i = 0; i < N_PRIMARY; ++i) {
r = entry_guard_pick_for_circuit(gs, GUARD_USAGE_TRAFFIC, NULL,
&node, &guard);
+ tt_int_op(r, OP_EQ, 0);
tt_int_op(guard->state, OP_EQ, GUARD_CIRC_STATE_USABLE_ON_COMPLETION);
g = entry_guard_handle_get(guard->guard);
tt_int_op(g->is_primary, OP_EQ, 1);
@@ -3047,7 +3049,7 @@ upgrade_circuits_cleanup(const struct testcase_t *testcase, void *ptr)
circuit_free(TO_CIRCUIT(data->circ1));
circuit_free(TO_CIRCUIT(data->circ2));
tor_free(data);
- return big_fake_network_cleanup(testcase, ptr);
+ return big_fake_network_cleanup(testcase, NULL);
}
static void