diff options
author | David Goulet <dgoulet@torproject.org> | 2020-07-14 13:07:53 -0400 |
---|---|---|
committer | David Goulet <dgoulet@torproject.org> | 2020-07-20 14:54:13 -0400 |
commit | 4a41761101bc4bd3614ae309f436015b9c4799da (patch) | |
tree | 26524992179fb626ec1752a87ec1a2e67e399b20 /src/feature | |
parent | 75a2e7fcb7092790c81db91861f526208612fa2a (diff) | |
download | tor-4a41761101bc4bd3614ae309f436015b9c4799da.tar.gz tor-4a41761101bc4bd3614ae309f436015b9c4799da.zip |
test: Move unit tests to new find address interface
Remove use of router_pick_published_address() and use
relay_find_addr_to_publish instead.
Related to #40025
Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/feature')
-rw-r--r-- | src/feature/relay/relay_find_addr.c | 6 | ||||
-rw-r--r-- | src/feature/relay/relay_find_addr.h | 5 |
2 files changed, 6 insertions, 5 deletions
diff --git a/src/feature/relay/relay_find_addr.c b/src/feature/relay/relay_find_addr.c index d685145934..840896f23b 100644 --- a/src/feature/relay/relay_find_addr.c +++ b/src/feature/relay/relay_find_addr.c @@ -179,9 +179,9 @@ router_new_address_suggestion(const char *suggestion, * Return true on success and addr_out contains the address to use for the * given family. On failure to find the address, false is returned and * addr_out is set to an AF_UNSPEC address. */ -bool -relay_find_addr_to_publish(const or_options_t *options, int family, - bool cache_only, tor_addr_t *addr_out) +MOCK_IMPL(bool, +relay_find_addr_to_publish, (const or_options_t *options, int family, + bool cache_only, tor_addr_t *addr_out)) { tor_assert(options); tor_assert(addr_out); diff --git a/src/feature/relay/relay_find_addr.h b/src/feature/relay/relay_find_addr.h index 399ac8dc44..ad147686a5 100644 --- a/src/feature/relay/relay_find_addr.h +++ b/src/feature/relay/relay_find_addr.h @@ -19,8 +19,9 @@ void relay_address_new_suggestion(const tor_addr_t *suggested_addr, const tor_addr_t *peer_addr, const char *identity_digest); -bool relay_find_addr_to_publish(const or_options_t *options, int family, - bool cache_only, tor_addr_t *addr_out); +MOCK_DECL(bool, relay_find_addr_to_publish, + (const or_options_t *options, int family, bool cache_only, + tor_addr_t *addr_out)); bool relay_has_address_set(int family); |