aboutsummaryrefslogtreecommitdiff
path: root/src/or
diff options
context:
space:
mode:
authorGeorge Kadianakis <desnacked@riseup.net>2018-01-25 16:38:59 -0500
committerDavid Goulet <dgoulet@torproject.org>2018-01-30 09:18:16 -0500
commitc3c2b55decc80028728780422fe2766ec6517246 (patch)
treecc6f71e2e52d5f06395a2ac9ad8274b431558e78 /src/or
parent82de4ea900c5d3513214b127421890595343bfaa (diff)
downloadtor-c3c2b55decc80028728780422fe2766ec6517246.tar.gz
tor-c3c2b55decc80028728780422fe2766ec6517246.zip
test: Add unit tests for the DoS subsystem
Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/or')
-rw-r--r--src/or/channel.c4
-rw-r--r--src/or/channel.h3
2 files changed, 4 insertions, 3 deletions
diff --git a/src/or/channel.c b/src/or/channel.c
index fdd3f81e81..54e10666d2 100644
--- a/src/or/channel.c
+++ b/src/or/channel.c
@@ -3845,8 +3845,8 @@ channel_get_canonical_remote_descr(channel_t *chan)
* supports this operation, and return 1. Return 0 if the underlying transport
* doesn't let us do this.
*/
-int
-channel_get_addr_if_possible(channel_t *chan, tor_addr_t *addr_out)
+MOCK_IMPL(int,
+channel_get_addr_if_possible,(channel_t *chan, tor_addr_t *addr_out))
{
tor_assert(chan);
tor_assert(addr_out);
diff --git a/src/or/channel.h b/src/or/channel.h
index a711b56d44..bcd345e8d2 100644
--- a/src/or/channel.h
+++ b/src/or/channel.h
@@ -550,7 +550,8 @@ MOCK_DECL(void, channel_dump_statistics, (channel_t *chan, int severity));
void channel_dump_transport_statistics(channel_t *chan, int severity);
const char * channel_get_actual_remote_descr(channel_t *chan);
const char * channel_get_actual_remote_address(channel_t *chan);
-int channel_get_addr_if_possible(channel_t *chan, tor_addr_t *addr_out);
+MOCK_DECL(int, channel_get_addr_if_possible, (channel_t *chan,
+ tor_addr_t *addr_out));
const char * channel_get_canonical_remote_descr(channel_t *chan);
int channel_has_queued_writes(channel_t *chan);
int channel_is_bad_for_new_circs(channel_t *chan);