diff options
author | Isis Lovecruft <isis@torproject.org> | 2018-03-05 20:43:26 +0000 |
---|---|---|
committer | Isis Lovecruft <isis@torproject.org> | 2018-04-09 19:32:46 +0000 |
commit | c2c5b13e5d8a77eeee36028940175f182fda1ec9 (patch) | |
tree | fc648e2f5f9f82f443dd705dc1ac02f71cdd900e /src/or/transports.h | |
parent | 54e25ab124b4ebb50f1577483ac5c08f67e8b114 (diff) | |
download | tor-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.h')
-rw-r--r-- | src/or/transports.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/or/transports.h b/src/or/transports.h index 1b2786472c..022b926a03 100644 --- a/src/or/transports.h +++ b/src/or/transports.h @@ -38,7 +38,7 @@ MOCK_DECL(int, transport_add_from_config, void transport_free_(transport_t *transport); #define transport_free(tr) FREE_AND_NULL(transport_t, transport_free_, (tr)) -transport_t *transport_get_by_name(const char *name); +MOCK_DECL(transport_t*, transport_get_by_name, (const char *name)); MOCK_DECL(void, pt_kickstart_proxy, (const smartlist_t *transport_list, char **proxy_argv, @@ -113,6 +113,9 @@ typedef struct { smartlist_t *transports; } managed_proxy_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); STATIC int parse_cmethod_line(const char *line, managed_proxy_t *mp); STATIC int parse_smethod_line(const char *line, managed_proxy_t *mp); |