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

[tor-commits] [tor/release-0.4.0] Bug 29500: Start monotime at 1000 nsec.



commit b027b06dbbbfcac6be91a9a89bda0b0949bd8b7d
Author: Mike Perry <mikeperry-git@xxxxxxxxxxxxxx>
Date:   Mon Mar 4 21:54:19 2019 +0000

    Bug 29500: Start monotime at 1000 nsec.
    
    Hopefully this will stop monotime_absolute_usec() from returning 0 on some
    platforms in the tests.
---
 src/test/test_circuitpadding.c | 36 ++++++++++++++++++------------------
 1 file changed, 18 insertions(+), 18 deletions(-)

diff --git a/src/test/test_circuitpadding.c b/src/test/test_circuitpadding.c
index 077529a0d..cd150b064 100644
--- a/src/test/test_circuitpadding.c
+++ b/src/test/test_circuitpadding.c
@@ -300,9 +300,9 @@ test_circuitpadding_rtt(void *arg)
 
   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;
+  monotime_set_mock_time_nsec(1000*TOR_NSEC_PER_USEC);
+  monotime_coarse_set_mock_time_nsec(1000*TOR_NSEC_PER_USEC);
+  curr_mocked_time = 1000*TOR_NSEC_PER_USEC;
 
   timers_initialize();
   circpad_machines_init();
@@ -990,9 +990,9 @@ test_circuitpadding_tokens(void *arg)
 
   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;
+  monotime_set_mock_time_nsec(1000*TOR_NSEC_PER_USEC);
+  monotime_coarse_set_mock_time_nsec(1000*TOR_NSEC_PER_USEC);
+  curr_mocked_time = 1000*TOR_NSEC_PER_USEC;
 
   timers_initialize();
 
@@ -1254,9 +1254,9 @@ test_circuitpadding_wronghop(void *arg)
 
   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;
+  monotime_set_mock_time_nsec(1000*TOR_NSEC_PER_USEC);
+  monotime_coarse_set_mock_time_nsec(1000*TOR_NSEC_PER_USEC);
+  curr_mocked_time = 1000*TOR_NSEC_PER_USEC;
 
   timers_initialize();
   circpad_machines_init();
@@ -1441,9 +1441,9 @@ test_circuitpadding_negotiation(void *arg)
 
   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;
+  monotime_set_mock_time_nsec(1000*TOR_NSEC_PER_USEC);
+  monotime_coarse_set_mock_time_nsec(1000*TOR_NSEC_PER_USEC);
+  curr_mocked_time = 1000*TOR_NSEC_PER_USEC;
 
   timers_initialize();
   circpad_machines_init();
@@ -1716,9 +1716,9 @@ test_circuitpadding_conditions(void *arg)
 
   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;
+  monotime_set_mock_time_nsec(1000*TOR_NSEC_PER_USEC);
+  monotime_coarse_set_mock_time_nsec(1000*TOR_NSEC_PER_USEC);
+  curr_mocked_time = 1000*TOR_NSEC_PER_USEC;
 
   timers_initialize();
   helper_create_conditional_machines();
@@ -2261,9 +2261,9 @@ test_circuitpadding_global_rate_limiting(void *arg)
 
   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;
+  monotime_set_mock_time_nsec(1000*TOR_NSEC_PER_USEC);
+  monotime_coarse_set_mock_time_nsec(1000*TOR_NSEC_PER_USEC);
+  curr_mocked_time = 1000*TOR_NSEC_PER_USEC;
   timers_initialize();
 
   client_side = (circuit_t *)origin_circuit_new();



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