aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-05-11 07:25:22 -0400
committerNick Mathewson <nickm@torproject.org>2017-05-11 07:25:22 -0400
commit38003f43503dede563e01e8ddc08be8999b35815 (patch)
tree602b320998ad386bef4f41aca7aaa22ff50bf1a8 /src
parent466e27feaebf0bb7a1c906b733a0da2328b21330 (diff)
parent2bf4263800f4ee14e2e4cd4015b2b6c46c25c845 (diff)
downloadtor-38003f43503dede563e01e8ddc08be8999b35815.tar.gz
tor-38003f43503dede563e01e8ddc08be8999b35815.zip
Merge remote-tracking branch 'argonblue/bug22221'
Diffstat (limited to 'src')
-rw-r--r--src/test/test_channelpadding.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/test/test_channelpadding.c b/src/test/test_channelpadding.c
index ae6abe4bcd..0a70184f86 100644
--- a/src/test/test_channelpadding.c
+++ b/src/test/test_channelpadding.c
@@ -287,22 +287,22 @@ test_channelpadding_timers(void *arg)
tt_int_op(tried_to_write_cell, OP_EQ, 0);
}
- /* This loop should add timers to our existing lists in a weak
- * pseudorandom pattern. It ensures that the lists can grow with multiple
- * timers in them. */
- for (; i < CHANNELS_TO_TEST/2; i++) {
- chans[i]->next_padding_time_ms = monotime_coarse_absolute_msec() + 10 +
- i*3 % CHANNELPADDING_MAX_TIMERS;
+ /* This loop should add timers to the first position in the timerslot
+ * array, since its timeout is before all other timers. */
+ for (; i < CHANNELS_TO_TEST/3; i++) {
+ chans[i]->next_padding_time_ms = monotime_coarse_absolute_msec() + 1;
decision = channelpadding_decide_to_pad_channel(chans[i]);
tt_int_op(decision, OP_EQ, CHANNELPADDING_PADDING_SCHEDULED);
tt_assert(chans[i]->pending_padding_callback);
tt_int_op(tried_to_write_cell, OP_EQ, 0);
}
- /* This loop should add timers to the first position in the timerslot
- * array, since its timeout is before all other timers. */
- for (; i < CHANNELS_TO_TEST/3; i++) {
- chans[i]->next_padding_time_ms = monotime_coarse_absolute_msec() + 1;
+ /* This loop should add timers to our existing lists in a weak
+ * pseudorandom pattern. It ensures that the lists can grow with multiple
+ * timers in them. */
+ for (; i < CHANNELS_TO_TEST/2; i++) {
+ chans[i]->next_padding_time_ms = monotime_coarse_absolute_msec() + 10 +
+ i*3 % CHANNELPADDING_MAX_TIMERS;
decision = channelpadding_decide_to_pad_channel(chans[i]);
tt_int_op(decision, OP_EQ, CHANNELPADDING_PADDING_SCHEDULED);
tt_assert(chans[i]->pending_padding_callback);