diff options
author | David Goulet <dgoulet@torproject.org> | 2017-09-22 11:33:50 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2017-09-25 11:11:30 -0400 |
commit | ef2a449cceceb777126119d20c15cda707c17d61 (patch) | |
tree | 149e76c9a0d6b0a2637c79a6014d00b4bc3eadf5 /src/test/test_scheduler.c | |
parent | 230a33679814f3074c0ba43e42dc7b38b5342c10 (diff) | |
download | tor-ef2a449cceceb777126119d20c15cda707c17d61.tar.gz tor-ef2a449cceceb777126119d20c15cda707c17d61.zip |
sched: Make KISTSchedRunInterval non negative
Fixes #23539.
Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/test/test_scheduler.c')
-rw-r--r-- | src/test/test_scheduler.c | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/src/test/test_scheduler.c b/src/test/test_scheduler.c index 51bedb3f9c..d679d7cfe1 100644 --- a/src/test/test_scheduler.c +++ b/src/test/test_scheduler.c @@ -84,7 +84,7 @@ mock_vanilla_networkstatus_get_param( (void)max_val; // only support KISTSchedRunInterval right now tor_assert(strcmp(param_name, "KISTSchedRunInterval")==0); - return -1; + return 0; } static int32_t @@ -628,7 +628,7 @@ test_scheduler_loop_vanilla(void *arg) MOCK(get_options, mock_get_options); clear_options(); set_scheduler_options(SCHEDULER_VANILLA); - mocked_options.KISTSchedRunInterval = -1; + mocked_options.KISTSchedRunInterval = 0; /* Set up libevent and scheduler */ @@ -932,14 +932,6 @@ test_scheduler_can_use_kist(void *arg) int res_should, res_freq; MOCK(get_options, mock_get_options); - /* Test force disabling of KIST */ - clear_options(); - mocked_options.KISTSchedRunInterval = -1; - res_should = scheduler_can_use_kist(); - res_freq = kist_scheduler_run_interval(NULL); - tt_int_op(res_should, ==, 0); - tt_int_op(res_freq, ==, -1); - /* Test force enabling of KIST */ clear_options(); mocked_options.KISTSchedRunInterval = 1234; @@ -985,7 +977,7 @@ test_scheduler_can_use_kist(void *arg) res_should = scheduler_can_use_kist(); res_freq = kist_scheduler_run_interval(NULL); tt_int_op(res_should, ==, 0); - tt_int_op(res_freq, ==, -1); + tt_int_op(res_freq, ==, 0); UNMOCK(networkstatus_get_param); done: |