[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [tor/master] Make tor_addr_lookup() mockable.
commit f23ec14d62f82ee424b7aef9ff1c2253c3dd2b10
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
Date: Tue Jan 3 10:11:15 2017 -0500
Make tor_addr_lookup() mockable.
---
src/common/address.c | 4 ++--
src/common/address.h | 3 ++-
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/common/address.c b/src/common/address.c
index a5dbae4..2693239 100644
--- a/src/common/address.c
+++ b/src/common/address.c
@@ -237,8 +237,8 @@ tor_addr_make_null(tor_addr_t *a, sa_family_t family)
*
* Return 0 on success, -1 on failure; 1 on transient failure.
*/
-int
-tor_addr_lookup(const char *name, uint16_t family, tor_addr_t *addr)
+MOCK_IMPL(int,
+tor_addr_lookup,(const char *name, uint16_t family, tor_addr_t *addr))
{
/* Perhaps eventually this should be replaced by a tor_getaddrinfo or
* something.
diff --git a/src/common/address.h b/src/common/address.h
index 41daf01..0dc6eda 100644
--- a/src/common/address.h
+++ b/src/common/address.h
@@ -190,7 +190,8 @@ tor_addr_eq_ipv4h(const tor_addr_t *a, uint32_t u)
*/
#define TOR_ADDR_BUF_LEN 48
-int tor_addr_lookup(const char *name, uint16_t family, tor_addr_t *addr_out);
+MOCK_DECL(int, tor_addr_lookup,(const char *name, uint16_t family,
+ tor_addr_t *addr_out));
char *tor_addr_to_str_dup(const tor_addr_t *addr) ATTR_MALLOC;
/** Wrapper function of fmt_addr_impl(). It does not decorate IPv6
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits