aboutsummaryrefslogtreecommitdiff
path: root/src/test/test_channelpadding.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-05-08 15:34:37 -0400
committerNick Mathewson <nickm@torproject.org>2017-05-08 15:34:37 -0400
commit4d6c79d1de5e242c000f28a71c706734d1a2da0b (patch)
tree65630c986788b35029d2345a0942e15a8fff2803 /src/test/test_channelpadding.c
parentfb97f76e71ab06abe4b4927f743f6683e7aaedab (diff)
downloadtor-4d6c79d1de5e242c000f28a71c706734d1a2da0b.tar.gz
tor-4d6c79d1de5e242c000f28a71c706734d1a2da0b.zip
Fix some clang-i386 warnings in master.
Diffstat (limited to 'src/test/test_channelpadding.c')
-rw-r--r--src/test/test_channelpadding.c54
1 files changed, 27 insertions, 27 deletions
diff --git a/src/test/test_channelpadding.c b/src/test/test_channelpadding.c
index 8ea0f17c7d..68d5c5858a 100644
--- a/src/test/test_channelpadding.c
+++ b/src/test/test_channelpadding.c
@@ -409,9 +409,9 @@ test_channelpadding_consensus(void *arg)
tt_int_op(decision, OP_EQ, CHANNELPADDING_WONTPAD);
tt_assert(!chan->pending_padding_callback);
val = channelpadding_get_netflow_inactive_timeout_ms(chan);
- tt_int_op(val, OP_EQ, 0);
+ tt_i64_op(val, OP_EQ, 0);
val = channelpadding_compute_time_until_pad_for_netflow(chan);
- tt_int_op(val, OP_EQ, -2);
+ tt_i64_op(val, OP_EQ, -2);
/* Test 2: Negotiation can't re-enable consensus-disabled padding */
channelpadding_send_enable_command(chan, 100, 200);
@@ -420,9 +420,9 @@ test_channelpadding_consensus(void *arg)
tt_int_op(decision, OP_EQ, CHANNELPADDING_WONTPAD);
tt_assert(!chan->pending_padding_callback);
val = channelpadding_get_netflow_inactive_timeout_ms(chan);
- tt_int_op(val, OP_EQ, 0);
+ tt_i64_op(val, OP_EQ, 0);
val = channelpadding_compute_time_until_pad_for_netflow(chan);
- tt_int_op(val, OP_EQ, -2);
+ tt_i64_op(val, OP_EQ, -2);
tt_assert(!chan->next_padding_time_ms);
smartlist_clear(current_md_consensus->net_params);
@@ -441,10 +441,10 @@ test_channelpadding_consensus(void *arg)
tt_assert(chan->pending_padding_callback);
tt_int_op(tried_to_write_cell, OP_EQ, 0);
val = channelpadding_get_netflow_inactive_timeout_ms(chan);
- tt_int_op(val, OP_GE, 100);
- tt_int_op(val, OP_LE, 200);
+ tt_i64_op(val, OP_GE, 100);
+ tt_i64_op(val, OP_LE, 200);
val = channelpadding_compute_time_until_pad_for_netflow(chan);
- tt_int_op(val, OP_LE, 200);
+ tt_i64_op(val, OP_LE, 200);
// Wait for the timer
event_base_loop(tor_libevent_get_base(), 0);
@@ -464,10 +464,10 @@ test_channelpadding_consensus(void *arg)
tt_int_op(decision, OP_EQ, CHANNELPADDING_PADLATER);
tt_assert(!chan->pending_padding_callback);
val = channelpadding_get_netflow_inactive_timeout_ms(chan);
- tt_int_op(val, OP_GE, 1500);
- tt_int_op(val, OP_LE, 4500);
+ tt_i64_op(val, OP_GE, 1500);
+ tt_i64_op(val, OP_LE, 4500);
val = channelpadding_compute_time_until_pad_for_netflow(chan);
- tt_int_op(val, OP_LE, 4500);
+ tt_i64_op(val, OP_LE, 4500);
/* Test 4: Relay-to-relay padding can be enabled/disabled in consensus */
/* Make this channel a relay's channel */
@@ -488,10 +488,10 @@ test_channelpadding_consensus(void *arg)
tt_int_op(decision, OP_EQ, CHANNELPADDING_PADLATER);
tt_assert(!chan->pending_padding_callback);
val = channelpadding_get_netflow_inactive_timeout_ms(chan);
- tt_int_op(val, OP_GE, 1500);
- tt_int_op(val, OP_LE, 4500);
+ tt_i64_op(val, OP_GE, 1500);
+ tt_i64_op(val, OP_LE, 4500);
val = channelpadding_compute_time_until_pad_for_netflow(chan);
- tt_int_op(val, OP_LE, 4500);
+ tt_i64_op(val, OP_LE, 4500);
/* Test 5: If we disable padding before channel usage, does that work? */
smartlist_add(current_md_consensus->net_params,
@@ -504,15 +504,15 @@ test_channelpadding_consensus(void *arg)
/* Test 6: Can we control circ and TLS conn lifetime from the consensus? */
val = channelpadding_get_channel_idle_timeout(NULL, 0);
- tt_int_op(val, OP_GE, 180);
- tt_int_op(val, OP_LE, 180+90);
+ tt_i64_op(val, OP_GE, 180);
+ tt_i64_op(val, OP_LE, 180+90);
val = channelpadding_get_channel_idle_timeout(chan, 0);
- tt_int_op(val, OP_GE, 180);
- tt_int_op(val, OP_LE, 180+90);
+ tt_i64_op(val, OP_GE, 180);
+ tt_i64_op(val, OP_LE, 180+90);
options->ReducedConnectionPadding = 1;
val = channelpadding_get_channel_idle_timeout(chan, 0);
- tt_int_op(val, OP_GE, 180/2);
- tt_int_op(val, OP_LE, (180+90)/2);
+ tt_i64_op(val, OP_GE, 180/2);
+ tt_i64_op(val, OP_LE, (180+90)/2);
options->ReducedConnectionPadding = 0;
options->ORPort_set = 1;
@@ -520,26 +520,26 @@ test_channelpadding_consensus(void *arg)
(void*)"nf_conntimeout_relays=600");
channelpadding_new_consensus_params(current_md_consensus);
val = channelpadding_get_channel_idle_timeout(chan, 1);
- tt_int_op(val, OP_GE, 450);
- tt_int_op(val, OP_LE, 750);
+ tt_i64_op(val, OP_GE, 450);
+ tt_i64_op(val, OP_LE, 750);
val = channelpadding_get_circuits_available_timeout();
- tt_int_op(val, OP_GE, 30*60);
- tt_int_op(val, OP_LE, 30*60*2);
+ tt_i64_op(val, OP_GE, 30*60);
+ tt_i64_op(val, OP_LE, 30*60*2);
options->ReducedConnectionPadding = 1;
smartlist_add(current_md_consensus->net_params,
(void*)"nf_conntimeout_clients=600");
channelpadding_new_consensus_params(current_md_consensus);
val = channelpadding_get_circuits_available_timeout();
- tt_int_op(val, OP_GE, 600/2);
- tt_int_op(val, OP_LE, 600*2/2);
+ tt_i64_op(val, OP_GE, 600/2);
+ tt_i64_op(val, OP_LE, 600*2/2);
options->ReducedConnectionPadding = 0;
options->CircuitsAvailableTimeout = 24*60*60;
val = channelpadding_get_circuits_available_timeout();
- tt_int_op(val, OP_GE, 24*60*60);
- tt_int_op(val, OP_LE, 24*60*60*2);
+ tt_i64_op(val, OP_GE, 24*60*60);
+ tt_i64_op(val, OP_LE, 24*60*60*2);
done:
free_fake_channeltls((channel_tls_t*)chan);