diff options
author | David Goulet <dgoulet@torproject.org> | 2023-01-19 09:38:21 -0500 |
---|---|---|
committer | David Goulet <dgoulet@torproject.org> | 2023-01-19 11:18:02 -0500 |
commit | d02d2a4338bdade748b334ec01abac0cdaf76563 (patch) | |
tree | 82fecd873501390758cca735144c8693e4dfbd85 /src/test | |
parent | 49f10c5130770bd490826873f9d80f1cb42d74e2 (diff) | |
download | tor-d02d2a4338bdade748b334ec01abac0cdaf76563.tar.gz tor-d02d2a4338bdade748b334ec01abac0cdaf76563.zip |
Fix compiler warnings about unused variables
Fixes #40743
Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/bench.c | 1 | ||||
-rw-r--r-- | src/test/test_channel.c | 25 |
2 files changed, 16 insertions, 10 deletions
diff --git a/src/test/bench.c b/src/test/bench.c index a76ea67eb8..a76e600cfa 100644 --- a/src/test/bench.c +++ b/src/test/bench.c @@ -380,6 +380,7 @@ bench_rand_len(int len) uint32_t t=0; for (i = 0; i < N; ++i) { t += tor_weak_random(&weak); + (void) t; } end = perftime(); printf("weak_rand(4): %f nsec.\n", NANOCOUNT(start,end,N)); diff --git a/src/test/test_channel.c b/src/test/test_channel.c index a74d69fefc..a6f403a25c 100644 --- a/src/test/test_channel.c +++ b/src/test/test_channel.c @@ -1264,8 +1264,9 @@ test_channel_duplicates(void *arg) /* Try a flat call with channel nor connections. */ channel_check_for_duplicates(); expect_log_msg_containing( - "Found 0 connections to 0 relays. Found 0 current canonical " - "connections, in 0 of which we were a non-canonical peer. " + "Found 0 connections to authorities, 0 connections to 0 relays. " + "Found 0 current canonical connections, " + "in 0 of which we were a non-canonical peer. " "0 relays had more than 1 connection, 0 had more than 2, and " "0 had more than 4 connections."); @@ -1285,8 +1286,9 @@ test_channel_duplicates(void *arg) /* No relay has been associated with this channel. */ channel_check_for_duplicates(); expect_log_msg_containing( - "Found 0 connections to 0 relays. Found 0 current canonical " - "connections, in 0 of which we were a non-canonical peer. " + "Found 0 connections to authorities, 0 connections to 0 relays. " + "Found 0 current canonical connections, " + "in 0 of which we were a non-canonical peer. " "0 relays had more than 1 connection, 0 had more than 2, and " "0 had more than 4 connections."); @@ -1299,24 +1301,27 @@ test_channel_duplicates(void *arg) chan->state = CHANNEL_STATE_CLOSING; channel_check_for_duplicates(); expect_log_msg_containing( - "Found 0 connections to 0 relays. Found 0 current canonical " - "connections, in 0 of which we were a non-canonical peer. " + "Found 0 connections to authorities, 0 connections to 0 relays. " + "Found 0 current canonical connections, " + "in 0 of which we were a non-canonical peer. " "0 relays had more than 1 connection, 0 had more than 2, and " "0 had more than 4 connections."); chan->state = CHANNEL_STATE_OPEN; channel_check_for_duplicates(); expect_log_msg_containing( - "Found 1 connections to 1 relays. Found 0 current canonical " - "connections, in 0 of which we were a non-canonical peer. " + "Found 0 connections to authorities, 1 connections to 1 relays. " + "Found 0 current canonical connections, " + "in 0 of which we were a non-canonical peer. " "0 relays had more than 1 connection, 0 had more than 2, and " "0 had more than 4 connections."); test_chan_should_be_canonical = 1; channel_check_for_duplicates(); expect_log_msg_containing( - "Found 1 connections to 1 relays. Found 1 current canonical " - "connections, in 1 of which we were a non-canonical peer. " + "Found 0 connections to authorities, 1 connections to 1 relays. " + "Found 1 current canonical connections, " + "in 1 of which we were a non-canonical peer. " "0 relays had more than 1 connection, 0 had more than 2, and " "0 had more than 4 connections."); teardown_capture_of_logs(); |