aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-11-09 09:30:43 -0500
committerNick Mathewson <nickm@torproject.org>2017-11-09 09:30:43 -0500
commit6ea3db6fa776e2b2b9d3f4da377a6ceaea0a323f (patch)
tree82b35bf2168b5c0bae3abf4250b135ca5cd2160f
parentaa9688a4ad4d7ab30d633610fea155a4251d5c5e (diff)
downloadtor-6ea3db6fa776e2b2b9d3f4da377a6ceaea0a323f.tar.gz
tor-6ea3db6fa776e2b2b9d3f4da377a6ceaea0a323f.zip
Fix unit test behavior: we need to be in STATE_LIVE.
-rw-r--r--src/test/test_routerlist.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/test/test_routerlist.c b/src/test/test_routerlist.c
index 05d0820d83..fd29e8f172 100644
--- a/src/test/test_routerlist.c
+++ b/src/test/test_routerlist.c
@@ -5,11 +5,12 @@
#include <math.h>
#include <time.h>
+#define CONNECTION_PRIVATE
+#define DIRECTORY_PRIVATE
#define DIRVOTE_PRIVATE
#define ENTRYNODES_PRIVATE
-#define DIRECTORY_PRIVATE
+#define HIBERNATE_PRIVATE
#define NETWORKSTATUS_PRIVATE
-#define CONNECTION_PRIVATE
#define ROUTERLIST_PRIVATE
#define TOR_UNIT_TESTING
#include "or.h"
@@ -20,6 +21,7 @@
#include "directory.h"
#include "dirvote.h"
#include "entrynodes.h"
+#include "hibernate.h"
#include "microdesc.h"
#include "networkstatus.h"
#include "nodelist.h"
@@ -453,6 +455,8 @@ test_directory_guard_fetch_with_no_dirinfo(void *arg)
(void) arg;
+ hibernate_set_state_for_testing_(HIBERNATE_STATE_LIVE);
+
/* Initialize the SRV subsystem */
MOCK(get_my_v3_authority_cert, get_my_v3_authority_cert_m);
mock_cert = authority_cert_parse_from_string(AUTHORITY_CERT_1, NULL);