summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorrl1987 <rl1987@sdf.lonestar.org>2018-06-03 13:34:24 +0300
committerNick Mathewson <nickm@torproject.org>2018-06-20 07:49:41 -0400
commit7bb3777dfbfe796fa4e430b18fd2ddfbba85b743 (patch)
tree50da6a7a54de333ea2da24a204ad22fa7e8e8378 /src/test
parentac1747e47fc8a8486df3844045238f72bd4985fe (diff)
downloadtor-7bb3777dfbfe796fa4e430b18fd2ddfbba85b743.tar.gz
tor-7bb3777dfbfe796fa4e430b18fd2ddfbba85b743.zip
Refrain from accessing empty smartlist in test_bridges_clear_bridge_list
Just check that smartlist length is zero instead
Diffstat (limited to 'src/test')
-rw-r--r--src/test/test_bridges.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/test/test_bridges.c b/src/test/test_bridges.c
index c4a4cacd98..c44f791e0d 100644
--- a/src/test/test_bridges.c
+++ b/src/test/test_bridges.c
@@ -140,7 +140,6 @@ test_bridges_clear_bridge_list(void *arg)
const smartlist_t *bridgelist;
const smartlist_t *bridgelist_after;
const bridge_info_t *bridge;
- const bridge_info_t *bridge_after;
helper_add_bridges_to_bridgelist(arg);
bridgelist = bridge_list_get();
@@ -152,10 +151,7 @@ test_bridges_clear_bridge_list(void *arg)
clear_bridge_list();
bridgelist_after = bridge_list_get();
tt_ptr_op(bridgelist_after, OP_NE, NULL);
-
- bridge_after = smartlist_get(bridgelist, 0);
- // There now shouldn't be a first bridge
- tt_ptr_op(bridge_after, OP_EQ, NULL);
+ tt_int_op(smartlist_len(bridgelist_after), OP_EQ, 0);
done:
return;