[tor-commits] [tor/master] Make tor_libevent_get_base() mockable

nickm at torproject.org nickm at torproject.org
Fri Nov 28 03:58:33 UTC 2014


commit 5a07fb96f2a4072bd9ee31a887ac0c790fdaf6c4
Author: Andrea Shepard <andrea at torproject.org>
Date:   Thu Jan 23 20:54:50 2014 -0800

    Make tor_libevent_get_base() mockable
---
 src/common/compat_libevent.c |    4 ++--
 src/common/compat_libevent.h |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/common/compat_libevent.c b/src/common/compat_libevent.c
index 74b54bb..6b2241a 100644
--- a/src/common/compat_libevent.c
+++ b/src/common/compat_libevent.c
@@ -280,8 +280,8 @@ tor_libevent_initialize(tor_libevent_cfg *torcfg)
 }
 
 /** Return the current Libevent event base that we're set up to use. */
-struct event_base *
-tor_libevent_get_base(void)
+MOCK_IMPL(struct event_base *,
+tor_libevent_get_base, (void))
 {
   return the_event_base;
 }
diff --git a/src/common/compat_libevent.h b/src/common/compat_libevent.h
index 9ee7b49..45d007f 100644
--- a/src/common/compat_libevent.h
+++ b/src/common/compat_libevent.h
@@ -72,7 +72,7 @@ typedef struct tor_libevent_cfg {
 } tor_libevent_cfg;
 
 void tor_libevent_initialize(tor_libevent_cfg *cfg);
-struct event_base *tor_libevent_get_base(void);
+MOCK_DECL(struct event_base *, tor_libevent_get_base, (void));
 const char *tor_libevent_get_method(void);
 void tor_check_libevent_version(const char *m, int server,
                                 const char **badness_out);





More information about the tor-commits mailing list