[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [tor/master] Make connection_or_connect() mockable
commit 3b080230e9fda4befda17739d202b9bc59006add
Author: Andrea Shepard <andrea@xxxxxxxxxxxxxx>
Date: Thu Jan 23 04:54:44 2014 -0800
Make connection_or_connect() mockable
---
src/or/connection_or.c | 8 ++++----
src/or/connection_or.h | 7 ++++---
2 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/src/or/connection_or.c b/src/or/connection_or.c
index 445335b..52f417d 100644
--- a/src/or/connection_or.c
+++ b/src/or/connection_or.c
@@ -1174,10 +1174,10 @@ connection_or_notify_error(or_connection_t *conn,
*
* Return the launched conn, or NULL if it failed.
*/
-or_connection_t *
-connection_or_connect(const tor_addr_t *_addr, uint16_t port,
- const char *id_digest,
- channel_tls_t *chan)
+
+MOCK_IMPL(or_connection_t *,
+connection_or_connect, (const tor_addr_t *_addr, uint16_t port,
+ const char *id_digest, channel_tls_t *chan))
{
or_connection_t *conn;
const or_options_t *options = get_options();
diff --git a/src/or/connection_or.h b/src/or/connection_or.h
index 7b46d7d..c922fb5 100644
--- a/src/or/connection_or.h
+++ b/src/or/connection_or.h
@@ -37,9 +37,10 @@ void connection_or_connect_failed(or_connection_t *conn,
int reason, const char *msg);
void connection_or_notify_error(or_connection_t *conn,
int reason, const char *msg);
-or_connection_t *connection_or_connect(const tor_addr_t *addr, uint16_t port,
- const char *id_digest,
- channel_tls_t *chan);
+MOCK_DECL(or_connection_t *,
+ connection_or_connect,
+ (const tor_addr_t *addr, uint16_t port,
+ const char *id_digest, channel_tls_t *chan));
void connection_or_close_normally(or_connection_t *orconn, int flush);
void connection_or_close_for_error(or_connection_t *orconn, int flush);
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits