Browse Source

Make tor_libevent_get_base() mockable

Andrea Shepard 10 years ago
parent
commit
5a07fb96f2
2 changed files with 3 additions and 3 deletions
  1. 2 2
      src/common/compat_libevent.c
  2. 1 1
      src/common/compat_libevent.h

+ 2 - 2
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;
 }

+ 1 - 1
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);