summaryrefslogtreecommitdiff
path: root/src/or/transports.c
diff options
context:
space:
mode:
authorIsis Lovecruft <isis@torproject.org>2018-03-05 20:43:26 +0000
committerIsis Lovecruft <isis@torproject.org>2018-04-09 19:32:46 +0000
commitc2c5b13e5d8a77eeee36028940175f182fda1ec9 (patch)
treefc648e2f5f9f82f443dd705dc1ac02f71cdd900e /src/or/transports.c
parent54e25ab124b4ebb50f1577483ac5c08f67e8b114 (diff)
downloadtor-c2c5b13e5d8a77eeee36028940175f182fda1ec9.tar.gz
tor-c2c5b13e5d8a77eeee36028940175f182fda1ec9.zip
test: Add testing module and some unittests for bridges.c.
This roughly doubles our test coverage of the bridges.c module. * ADD new testing module, .../src/test/test_bridges.c. * CHANGE a few function declarations from `static` to `STATIC`. * CHANGE one function in transports.c, transport_get_by_name(), to be mockable. * CLOSES #25425: https://bugs.torproject.org/25425
Diffstat (limited to 'src/or/transports.c')
-rw-r--r--src/or/transports.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/or/transports.c b/src/or/transports.c
index b08dcd1613..fb6c29de7e 100644
--- a/src/or/transports.c
+++ b/src/or/transports.c
@@ -135,7 +135,7 @@ static smartlist_t *transport_list = NULL;
/** Returns a transport_t struct for a transport proxy supporting the
protocol <b>name</b> listening at <b>addr</b>:<b>port</b> using
SOCKS version <b>socks_ver</b>. */
-static transport_t *
+STATIC transport_t *
transport_new(const tor_addr_t *addr, uint16_t port,
const char *name, int socks_ver,
const char *extra_info_args)
@@ -222,8 +222,8 @@ transport_copy(const transport_t *transport)
/** Returns the transport in our transport list that has the name <b>name</b>.
* Else returns NULL. */
-transport_t *
-transport_get_by_name(const char *name)
+MOCK_IMPL(transport_t *,
+transport_get_by_name,(const char *name))
{
tor_assert(name);