summaryrefslogtreecommitdiff
path: root/src/test/test_connection.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/test_connection.c')
-rw-r--r--src/test/test_connection.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/test/test_connection.c b/src/test/test_connection.c
index f6e08fdf1f..c5ef92931d 100644
--- a/src/test/test_connection.c
+++ b/src/test/test_connection.c
@@ -182,14 +182,13 @@ test_conn_get_basic_teardown(const struct testcase_t *tc, void *arg)
conn->linked_conn->write_event = NULL;
}
- connection_free(conn->linked_conn);
- conn->linked_conn = NULL;
-
- conn->linked_conn->linked_conn = NULL;
if (!conn->linked_conn->marked_for_close) {
connection_close_immediate(conn->linked_conn);
connection_mark_for_close(conn->linked_conn);
}
+ conn->linked_conn->linked_conn = NULL;
+ connection_free(conn->linked_conn);
+ conn->linked_conn = NULL;
}
/* We didn't set the events up properly, so we can't use event_del() in
@@ -231,9 +230,10 @@ test_conn_get_rend_setup(const struct testcase_t *tc)
/* TODO: use directory_initiate_command_rend() to do this - maybe? */
conn->rend_data = tor_malloc_zero(sizeof(rend_data_t));
+ tor_assert(strlen(TEST_CONN_REND_ADDR) == REND_SERVICE_ID_LEN_BASE32);
memcpy(conn->rend_data->onion_address,
TEST_CONN_REND_ADDR,
- REND_SERVICE_ADDRESS_LEN+1);
+ REND_SERVICE_ID_LEN_BASE32+1);
conn->rend_data->hsdirs_fp = smartlist_new();
conn->base_.purpose = TEST_CONN_REND_PURPOSE;