aboutsummaryrefslogtreecommitdiff
path: root/src/or/scheduler.c
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2017-09-14 15:26:12 -0400
committerDavid Goulet <dgoulet@torproject.org>2017-09-15 11:40:59 -0400
commit0d0b677b6427573b87736da00e638911fac7ef7d (patch)
treee0065d70d22f5dfdc83b4f3cb08a69cc53c1b1a5 /src/or/scheduler.c
parent734dbfa590baf560741f0754bd81c07dfb829485 (diff)
downloadtor-0d0b677b6427573b87736da00e638911fac7ef7d.tar.gz
tor-0d0b677b6427573b87736da00e638911fac7ef7d.zip
test: Fix unit tests with latest scheduler changes
Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/or/scheduler.c')
-rw-r--r--src/or/scheduler.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/or/scheduler.c b/src/or/scheduler.c
index af4d9e5f6b..acb6801ab4 100644
--- a/src/or/scheduler.c
+++ b/src/or/scheduler.c
@@ -273,6 +273,16 @@ select_scheduler(void)
{
const char *chosen_sched_type = NULL;
+#ifdef TOR_UNIT_TESTS
+ /* This is hella annoying to set in the options for every test that passes
+ * through the scheduler and there are many so if we don't explicitely have
+ * a list of types set, just put the vanilla one. */
+ if (get_options()->SchedulerTypes_ == NULL) {
+ the_scheduler = get_vanilla_scheduler();
+ return;
+ }
+#endif
+
/* This list is ordered that is first entry has the first priority. Thus, as
* soon as we find a scheduler type that we can use, we use it and stop. */
SMARTLIST_FOREACH_BEGIN(get_options()->SchedulerTypes_, int *, type) {