diff options
author | teor <teor@torproject.org> | 2019-03-22 13:10:47 +1000 |
---|---|---|
committer | teor <teor@torproject.org> | 2019-03-22 13:10:47 +1000 |
commit | 15900ab70fe2dc4d40f974ba49ba35421e7fcf1f (patch) | |
tree | 8c6b44d082573aafdac9adf53b497257e000aacd /src/test/test_circuitpadding.c | |
parent | 938d97cb0d4acfdd1ea57ec0a3094bcc2101f13d (diff) | |
parent | 57291602532bfe55060668293130b0aac1fd702e (diff) | |
download | tor-15900ab70fe2dc4d40f974ba49ba35421e7fcf1f.tar.gz tor-15900ab70fe2dc4d40f974ba49ba35421e7fcf1f.zip |
Merge remote-tracking branch 'tor-github/pr/819'
Diffstat (limited to 'src/test/test_circuitpadding.c')
-rw-r--r-- | src/test/test_circuitpadding.c | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/src/test/test_circuitpadding.c b/src/test/test_circuitpadding.c index aaf7875a13..3ae1860c24 100644 --- a/src/test/test_circuitpadding.c +++ b/src/test/test_circuitpadding.c @@ -17,6 +17,7 @@ #include "core/or/circuitlist.h" #include "core/or/circuitbuild.h" #include "core/or/circuitpadding.h" +#include "core/mainloop/netstatus.h" #include "core/crypto/relay_crypto.h" #include "core/or/protover.h" #include "feature/nodelist/nodelist.h" @@ -491,7 +492,7 @@ helper_create_machine_with_big_histogram(circpad_removal_t removal_strategy) } static circpad_decision_t -circpad_machine_schedule_padding_mock(circpad_machine_state_t *mi) +circpad_machine_schedule_padding_mock(circpad_machine_runtime_t *mi) { (void)mi; return 0; @@ -507,7 +508,7 @@ mock_monotime_absolute_usec(void) static void test_circuitpadding_token_removal_higher(void *arg) { - circpad_machine_state_t *mi; + circpad_machine_runtime_t *mi; (void)arg; /* Mock it up */ @@ -612,7 +613,7 @@ test_circuitpadding_token_removal_higher(void *arg) static void test_circuitpadding_token_removal_lower(void *arg) { - circpad_machine_state_t *mi; + circpad_machine_runtime_t *mi; (void)arg; /* Mock it up */ @@ -710,7 +711,7 @@ test_circuitpadding_token_removal_lower(void *arg) static void test_circuitpadding_closest_token_removal(void *arg) { - circpad_machine_state_t *mi; + circpad_machine_runtime_t *mi; (void)arg; /* Mock it up */ @@ -816,7 +817,7 @@ test_circuitpadding_closest_token_removal(void *arg) static void test_circuitpadding_closest_token_removal_usec(void *arg) { - circpad_machine_state_t *mi; + circpad_machine_runtime_t *mi; (void)arg; /* Mock it up */ @@ -927,7 +928,7 @@ test_circuitpadding_closest_token_removal_usec(void *arg) static void test_circuitpadding_token_removal_exact(void *arg) { - circpad_machine_state_t *mi; + circpad_machine_runtime_t *mi; (void)arg; /* Mock it up */ @@ -988,7 +989,7 @@ void test_circuitpadding_tokens(void *arg) { const circpad_state_t *state; - circpad_machine_state_t *mi; + circpad_machine_runtime_t *mi; (void)arg; /** Test plan: @@ -1020,6 +1021,9 @@ test_circuitpadding_tokens(void *arg) monotime_coarse_set_mock_time_nsec(1*TOR_NSEC_PER_USEC); curr_mocked_time = 1*TOR_NSEC_PER_USEC; + /* This is needed so that we are not considered to be dormant */ + note_user_activity(20); + timers_initialize(); helper_create_basic_machine(); @@ -1749,6 +1753,9 @@ test_circuitpadding_conditions(void *arg) monotime_coarse_set_mock_time_nsec(1*TOR_NSEC_PER_USEC); curr_mocked_time = 1*TOR_NSEC_PER_USEC; + /* This is needed so that we are not considered to be dormant */ + note_user_activity(20); + timers_initialize(); helper_create_conditional_machines(); @@ -2152,7 +2159,7 @@ helper_circpad_circ_distribution_machine_setup(int min, int max) static void test_circuitpadding_sample_distribution(void *arg) { - circpad_machine_state_t *mi; + circpad_machine_runtime_t *mi; int n_samples; int n_states; @@ -2196,7 +2203,7 @@ test_circuitpadding_sample_distribution(void *arg) } static circpad_decision_t -circpad_machine_spec_transition_mock(circpad_machine_state_t *mi, +circpad_machine_spec_transition_mock(circpad_machine_runtime_t *mi, circpad_event_t event) { (void) mi; @@ -2211,7 +2218,7 @@ test_circuitpadding_machine_rate_limiting(void *arg) { (void) arg; bool retval; - circpad_machine_state_t *mi; + circpad_machine_runtime_t *mi; int i; /* Ignore machine transitions for the purposes of this function, we only @@ -2279,7 +2286,7 @@ test_circuitpadding_global_rate_limiting(void *arg) { (void) arg; bool retval; - circpad_machine_state_t *mi; + circpad_machine_runtime_t *mi; int i; /* Ignore machine transitions for the purposes of this function, we only |