[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor/master] Merge branch 'bug29500_040_monoinit_revert' into bug29500_master_monoinit



commit e992c5e4bc4b14a1998b41773f1926d133bb7ad3
Merge: 1779878f9 593b33608
Author: teor <teor@xxxxxxxxxxxxxx>
Date:   Fri Apr 5 12:24:20 2019 +1000

    Merge branch 'bug29500_040_monoinit_revert' into bug29500_master_monoinit
    
    Apply data structure changes between 0.4.0 and 0.4.1.

 changes/bug29500               |  3 ++
 src/core/or/circuitpadding.c   |  3 +-
 src/test/test_circuitpadding.c | 70 +++++++++++++++++++++++++++---------------
 3 files changed, 50 insertions(+), 26 deletions(-)

diff --cc src/test/test_circuitpadding.c
index 3ae1860c2,22fa817cd..3289c866c
--- a/src/test/test_circuitpadding.c
+++ b/src/test/test_circuitpadding.c
@@@ -989,7 -970,8 +997,8 @@@ voi
  test_circuitpadding_tokens(void *arg)
  {
    const circpad_state_t *state;
 -  circpad_machine_state_t *mi;
 +  circpad_machine_runtime_t *mi;
+   int64_t actual_mocked_monotime_start;
    (void)arg;
  
    /** Test plan:
@@@ -1017,13 -999,11 +1026,14 @@@
  
    monotime_init();
    monotime_enable_test_mocking();
-   monotime_set_mock_time_nsec(1*TOR_NSEC_PER_USEC);
-   monotime_coarse_set_mock_time_nsec(1*TOR_NSEC_PER_USEC);
-   curr_mocked_time = 1*TOR_NSEC_PER_USEC;
+   actual_mocked_monotime_start = MONOTIME_MOCK_START;
+   monotime_set_mock_time_nsec(actual_mocked_monotime_start);
+   monotime_coarse_set_mock_time_nsec(actual_mocked_monotime_start);
+   curr_mocked_time = actual_mocked_monotime_start;
  
 +  /* This is needed so that we are not considered to be dormant */
 +  note_user_activity(20);
 +
    timers_initialize();
  
    helper_create_basic_machine();
@@@ -1136,8 -1114,10 +1145,9 @@@
  
    /* 2.c. Bin 0 */
    {
-     tt_int_op(mi->histogram[0], OP_EQ, 1);
+     tt_int_op(mi->histogram[0], OP_EQ, 0);
+     mi->histogram[0] = 1;
 -    circpad_machine_remove_higher_token(mi,
 -         state->start_usec/2);
 +    circpad_machine_remove_higher_token(mi, state->histogram_edges[0]/2);
      tt_int_op(mi->histogram[0], OP_EQ, 0);
    }
  
@@@ -1749,13 -1731,11 +1764,14 @@@ test_circuitpadding_conditions(void *ar
  
    monotime_init();
    monotime_enable_test_mocking();
-   monotime_set_mock_time_nsec(1*TOR_NSEC_PER_USEC);
-   monotime_coarse_set_mock_time_nsec(1*TOR_NSEC_PER_USEC);
-   curr_mocked_time = 1*TOR_NSEC_PER_USEC;
+   actual_mocked_monotime_start = MONOTIME_MOCK_START;
+   monotime_set_mock_time_nsec(actual_mocked_monotime_start);
+   monotime_coarse_set_mock_time_nsec(actual_mocked_monotime_start);
+   curr_mocked_time = actual_mocked_monotime_start;
  
 +  /* This is needed so that we are not considered to be dormant */
 +  note_user_activity(20);
 +
    timers_initialize();
    helper_create_conditional_machines();
  
@@@ -2286,8 -2266,9 +2304,9 @@@ test_circuitpadding_global_rate_limitin
  {
    (void) arg;
    bool retval;
 -  circpad_machine_state_t *mi;
 +  circpad_machine_runtime_t *mi;
    int i;
+   int64_t actual_mocked_monotime_start;
  
    /* Ignore machine transitions for the purposes of this function, we only
     * really care about padding counts */



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits