diff options
author | Nick Mathewson <nickm@torproject.org> | 2019-04-26 10:36:49 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2019-04-26 10:36:49 -0400 |
commit | 1d44ac9acd6264141615b5fce6d537544dc6f52e (patch) | |
tree | d945147e0593271bcc77a34f048c937cb3087b9b /src/test | |
parent | efeb101b968fe6604ff97604afe527a36b94cfc9 (diff) | |
download | tor-1d44ac9acd6264141615b5fce6d537544dc6f52e.tar.gz tor-1d44ac9acd6264141615b5fce6d537544dc6f52e.zip |
Make nodelist_get_list() return a const pointer.
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/test_circuitbuild.c | 2 | ||||
-rw-r--r-- | src/test/test_controller.c | 2 | ||||
-rw-r--r-- | src/test/test_entrynodes.c | 2 | ||||
-rw-r--r-- | src/test/test_helpers.c | 2 | ||||
-rw-r--r-- | src/test/test_hs_common.c | 2 | ||||
-rw-r--r-- | src/test/test_routerset.c | 8 |
6 files changed, 9 insertions, 9 deletions
diff --git a/src/test/test_circuitbuild.c b/src/test/test_circuitbuild.c index 27f2cd1ca5..47218a559a 100644 --- a/src/test/test_circuitbuild.c +++ b/src/test/test_circuitbuild.c @@ -21,7 +21,7 @@ static smartlist_t dummy_nodes; static extend_info_t dummy_ei; static int -mock_count_acceptable_nodes(smartlist_t *nodes, int direct) +mock_count_acceptable_nodes(const smartlist_t *nodes, int direct) { (void)nodes; diff --git a/src/test/test_controller.c b/src/test/test_controller.c index f3af6d2ec0..00e2fb33cc 100644 --- a/src/test/test_controller.c +++ b/src/test/test_controller.c @@ -1546,7 +1546,7 @@ test_current_time(void *arg) static size_t n_nodelist_get_list = 0; static smartlist_t *nodes = NULL; -static smartlist_t * +static const smartlist_t * mock_nodelist_get_list(void) { n_nodelist_get_list++; diff --git a/src/test/test_entrynodes.c b/src/test/test_entrynodes.c index 729795b674..bdf057bb50 100644 --- a/src/test/test_entrynodes.c +++ b/src/test/test_entrynodes.c @@ -67,7 +67,7 @@ static networkstatus_t *dummy_consensus = NULL; static smartlist_t *big_fake_net_nodes = NULL; -static smartlist_t * +static const smartlist_t * bfn_mock_nodelist_get_list(void) { return big_fake_net_nodes; diff --git a/src/test/test_helpers.c b/src/test/test_helpers.c index 13de1e154b..489c257761 100644 --- a/src/test/test_helpers.c +++ b/src/test/test_helpers.c @@ -78,7 +78,7 @@ helper_setup_fake_routerlist(void) { int retval; routerlist_t *our_routerlist = NULL; - smartlist_t *our_nodelist = NULL; + const smartlist_t *our_nodelist = NULL; /* Read the file that contains our test descriptors. */ diff --git a/src/test/test_hs_common.c b/src/test/test_hs_common.c index eb7f3bfbb0..bb41f1f870 100644 --- a/src/test/test_hs_common.c +++ b/src/test/test_hs_common.c @@ -275,7 +275,7 @@ test_start_time_of_next_time_period(void *arg) static void cleanup_nodelist(void) { - smartlist_t *nodelist = nodelist_get_list(); + const smartlist_t *nodelist = nodelist_get_list(); SMARTLIST_FOREACH_BEGIN(nodelist, node_t *, node) { tor_free(node->md); node->md = NULL; diff --git a/src/test/test_routerset.c b/src/test/test_routerset.c index c45f0e1595..cc73e6c20a 100644 --- a/src/test/test_routerset.c +++ b/src/test/test_routerset.c @@ -1765,7 +1765,7 @@ NS(node_get_by_nickname)(const char *nickname, unsigned flags) * Structural test for routerset_get_all_nodes, when the nodelist has no nodes. */ -NS_DECL(smartlist_t *, nodelist_get_list, (void)); +NS_DECL(const smartlist_t *, nodelist_get_list, (void)); static smartlist_t *NS(mock_smartlist); @@ -1795,7 +1795,7 @@ NS(test_main)(void *arg) ; } -smartlist_t * +const smartlist_t * NS(nodelist_get_list)(void) { CALLED(nodelist_get_list)++; @@ -1811,7 +1811,7 @@ NS(nodelist_get_list)(void) * the running_only flag is set, but the nodes are not running. */ -NS_DECL(smartlist_t *, nodelist_get_list, (void)); +NS_DECL(const smartlist_t *, nodelist_get_list, (void)); static smartlist_t *NS(mock_smartlist); static node_t NS(mock_node); @@ -1844,7 +1844,7 @@ NS(test_main)(void *arg) ; } -smartlist_t * +const smartlist_t * NS(nodelist_get_list)(void) { CALLED(nodelist_get_list)++; |