diff options
author | Nick Mathewson <nickm@torproject.org> | 2016-05-19 16:04:56 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2016-05-19 16:04:56 -0400 |
commit | 33841a60303ce8febf8180829a868dcc43924d77 (patch) | |
tree | b6659106946214140b2d7f2582f5ee869d5c140e /src/test | |
parent | 0d6f293e0e5ca7ae57347d8879a6ba7805a2cac3 (diff) | |
parent | 2d21f03cdcf759e434b5f82abe9bd285c37004ff (diff) | |
download | tor-33841a60303ce8febf8180829a868dcc43924d77.tar.gz tor-33841a60303ce8febf8180829a868dcc43924d77.zip |
Merge remote-tracking branch 'teor/fix18809-warnings' into maint-0.2.8
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/test_connection.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/src/test/test_connection.c b/src/test/test_connection.c index 5aa7964ab6..bf95b0b59f 100644 --- a/src/test/test_connection.c +++ b/src/test/test_connection.c @@ -652,12 +652,8 @@ test_conn_download_status(void *arg) { dir_connection_t *conn = NULL; dir_connection_t *conn2 = NULL; - dir_connection_t *conn3 = NULL; dir_connection_t *conn4 = NULL; connection_t *ap_conn = NULL; - connection_t *ap_conn2 = NULL; - /* we never create an ap_conn for conn3 */ - connection_t *ap_conn4 = NULL; consensus_flavor_t usable_flavor = (consensus_flavor_t)arg; @@ -760,7 +756,8 @@ test_conn_download_status(void *arg) conn->base_.state = TEST_CONN_STATE; /* more connections, all not downloading */ - conn3 = test_conn_download_status_add_a_connection(res); + /* ignore the return value, it's free'd using the connection list */ + (void)test_conn_download_status_add_a_connection(res); tt_assert(networkstatus_consensus_is_already_downloading(res) == 0); tt_assert(networkstatus_consensus_is_already_downloading(other_res) == 0); tt_assert(connection_dir_count_by_purpose_and_resource( @@ -784,8 +781,9 @@ test_conn_download_status(void *arg) /* more connections, two downloading (should never happen, but needs * to be tested for completeness) */ conn2->base_.state = TEST_CONN_DL_STATE; - ap_conn2 = test_conn_get_linked_connection(TO_CONN(conn2), - TEST_CONN_ATTACHED_STATE); + /* ignore the return value, it's free'd using the connection list */ + (void)test_conn_get_linked_connection(TO_CONN(conn2), + TEST_CONN_ATTACHED_STATE); tt_assert(networkstatus_consensus_is_already_downloading(res) == 1); tt_assert(networkstatus_consensus_is_already_downloading(other_res) == 0); tt_assert(connection_dir_count_by_purpose_and_resource( @@ -823,8 +821,9 @@ test_conn_download_status(void *arg) * cache directory documents), both flavors downloading */ conn4->base_.state = TEST_CONN_DL_STATE; - ap_conn4 = test_conn_get_linked_connection(TO_CONN(conn4), - TEST_CONN_ATTACHED_STATE); + /* ignore the return value, it's free'd using the connection list */ + (void)test_conn_get_linked_connection(TO_CONN(conn4), + TEST_CONN_ATTACHED_STATE); tt_assert(networkstatus_consensus_is_already_downloading(res) == 1); tt_assert(networkstatus_consensus_is_already_downloading(other_res) == 1); tt_assert(connection_dir_count_by_purpose_and_resource( @@ -833,10 +832,9 @@ test_conn_download_status(void *arg) tt_assert(connection_dir_count_by_purpose_and_resource( TEST_CONN_RSRC_PURPOSE, other_res) == 1); - conn4->base_.state = TEST_CONN_STATE; done: - /* the teardown function removes all the connections */; + /* the teardown function removes all the connections in the global list*/; } #define CONNECTION_TESTCASE(name, fork, setup) \ |