summaryrefslogtreecommitdiff
path: root/src/or/circuitbuild.c
diff options
context:
space:
mode:
authorTaylor Yu <catalyst@torproject.org>2017-03-28 17:34:54 -0400
committerNick Mathewson <nickm@torproject.org>2017-04-03 11:58:11 -0400
commit1e8e8a4e943c171420ae3e90cbd37227780823ed (patch)
treec6ab448ec5f357ededdc679c250b0fbef331856f /src/or/circuitbuild.c
parente79f90c7f031b8a7825574f865c77d7034b93a16 (diff)
downloadtor-1e8e8a4e943c171420ae3e90cbd37227780823ed.tar.gz
tor-1e8e8a4e943c171420ae3e90cbd37227780823ed.zip
Add tests for new_route_len()
Diffstat (limited to 'src/or/circuitbuild.c')
-rw-r--r--src/or/circuitbuild.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c
index f08e2ee6af..5277e10a2c 100644
--- a/src/or/circuitbuild.c
+++ b/src/or/circuitbuild.c
@@ -73,7 +73,6 @@ static int circuit_deliver_create_cell(circuit_t *circ,
static int onion_pick_cpath_exit(origin_circuit_t *circ, extend_info_t *exit);
static crypt_path_t *onion_next_hop_in_cpath(crypt_path_t *cpath);
static int onion_extend_cpath(origin_circuit_t *circ);
-static int count_acceptable_nodes(smartlist_t *routers);
static int onion_append_hop(crypt_path_t **head_ptr, extend_info_t *choice);
/** This function tries to get a channel to the specified endpoint,
@@ -1552,7 +1551,7 @@ onionskin_answer(or_circuit_t *circ,
* If the routerlist <b>nodes</b> doesn't have enough routers
* to handle the desired path length, return -1.
*/
-static int
+STATIC int
new_route_len(uint8_t purpose, extend_info_t *exit_ei, smartlist_t *nodes)
{
int num_acceptable_routers;
@@ -2188,8 +2187,8 @@ circuit_extend_to_new_exit(origin_circuit_t *circ, extend_info_t *exit_ei)
/** Return the number of routers in <b>routers</b> that are currently up
* and available for building circuits through.
*/
-static int
-count_acceptable_nodes(smartlist_t *nodes)
+MOCK_IMPL(STATIC int,
+count_acceptable_nodes, (smartlist_t *nodes))
{
int num=0;