diff options
author | David Goulet <dgoulet@torproject.org> | 2018-04-18 14:50:07 -0400 |
---|---|---|
committer | David Goulet <dgoulet@torproject.org> | 2018-04-23 10:57:28 -0400 |
commit | 665e23c59a370157c5e3526e29590798b1933ed5 (patch) | |
tree | 4ce21647615c9439d648ddc7fb582bbe33a247a6 /src/or | |
parent | 87cb9ce90088bbe3e677804eca7c1ffa4f63a1cb (diff) | |
download | tor-665e23c59a370157c5e3526e29590798b1933ed5.tar.gz tor-665e23c59a370157c5e3526e29590798b1933ed5.zip |
test: Add periodic events unit tests
Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/or')
-rw-r--r-- | src/or/main.c | 4 | ||||
-rw-r--r-- | src/or/main.h | 5 |
2 files changed, 7 insertions, 2 deletions
diff --git a/src/or/main.c b/src/or/main.c index 0a796c0fae..595246bfcd 100644 --- a/src/or/main.c +++ b/src/or/main.c @@ -1351,7 +1351,7 @@ CALLBACK(write_stats_file); /* Now we declare an array of periodic_event_item_t for each periodic event */ #define CALLBACK(name, r) PERIODIC_EVENT(name, r) -static periodic_event_item_t periodic_events[] = { +STATIC periodic_event_item_t periodic_events[] = { /* Everyone needs to run those. */ CALLBACK(add_entropy, PERIODIC_EVENT_ROLE_ALL), CALLBACK(check_expired_networkstatus, PERIODIC_EVENT_ROLE_ALL), @@ -1440,7 +1440,7 @@ find_periodic_event(const char *name) /** Return a bitmask of the roles this tor instance is configured for using * the given options. */ -static int +STATIC int get_my_roles(const or_options_t *options) { tor_assert(options); diff --git a/src/or/main.h b/src/or/main.h index 5220b13216..57ac8573a6 100644 --- a/src/or/main.h +++ b/src/or/main.h @@ -98,8 +98,13 @@ STATIC void init_connection_lists(void); STATIC void close_closeable_connections(void); STATIC void initialize_periodic_events(void); STATIC void teardown_periodic_events(void); +STATIC int get_my_roles(const or_options_t *options); #ifdef TOR_UNIT_TESTS extern smartlist_t *connection_array; + +/* We need the periodic_event_item_t definition. */ +#include "periodic.h" +extern periodic_event_item_t periodic_events[]; #endif #endif /* defined(MAIN_PRIVATE) */ |