aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-10-31 12:14:21 -0400
committerNick Mathewson <nickm@torproject.org>2017-10-31 12:14:21 -0400
commit3d93ec3ef418b13b1f8ae90436429e1941540f0f (patch)
treefba7668737b568917c0c7cca239aa3cdb3686c9a /src/test
parent7c59c751b05ff1195538d2d4bd8cb4ff8ea1885e (diff)
parent5dbcd48f0ee2f57557f6bcce6ee3ec11a76727e4 (diff)
downloadtor-3d93ec3ef418b13b1f8ae90436429e1941540f0f.tar.gz
tor-3d93ec3ef418b13b1f8ae90436429e1941540f0f.zip
Merge branch 'bug23762_032_02_squashed' into maint-0.3.2
Diffstat (limited to 'src/test')
-rw-r--r--src/test/test_channelpadding.c12
-rw-r--r--src/test/test_entryconn.c5
2 files changed, 11 insertions, 6 deletions
diff --git a/src/test/test_channelpadding.c b/src/test/test_channelpadding.c
index d54c9cc52c..d5713688a0 100644
--- a/src/test/test_channelpadding.c
+++ b/src/test/test_channelpadding.c
@@ -193,7 +193,8 @@ static void
setup_mock_network(void)
{
routerstatus_t *relay;
- connection_array = smartlist_new();
+ if (!connection_array)
+ connection_array = smartlist_new();
relay1_relay2 = (channel_t*)new_fake_channeltls(2);
relay1_relay2->write_cell = mock_channel_write_cell_relay1;
@@ -280,7 +281,8 @@ test_channelpadding_timers(void *arg)
tor_libevent_postfork();
- connection_array = smartlist_new();
+ if (!connection_array)
+ connection_array = smartlist_new();
monotime_init();
monotime_enable_test_mocking();
@@ -570,7 +572,8 @@ test_channelpadding_consensus(void *arg)
monotime_coarse_set_mock_time_nsec(1);
timers_initialize();
- connection_array = smartlist_new();
+ if (!connection_array)
+ connection_array = smartlist_new();
chan = (channel_t*)new_fake_channeltls(0);
channel_timestamp_active(chan);
@@ -928,7 +931,8 @@ test_channelpadding_decide_to_pad_channel(void *arg)
*/
channel_t *chan;
int64_t new_time;
- connection_array = smartlist_new();
+ if (!connection_array)
+ connection_array = smartlist_new();
(void)arg;
tor_libevent_postfork();
diff --git a/src/test/test_entryconn.c b/src/test/test_entryconn.c
index 86c0c3dca4..c29b1a7126 100644
--- a/src/test/test_entryconn.c
+++ b/src/test/test_entryconn.c
@@ -790,8 +790,9 @@ test_entryconn_rewrite_onion_v3(void *arg)
retval = connection_ap_handshake_rewrite_and_attach(conn, NULL, NULL);
tt_int_op(retval, OP_EQ, 0);
- /* Check connection state after rewrite */
- tt_int_op(ENTRY_TO_CONN(conn)->state, OP_EQ, AP_CONN_STATE_CIRCUIT_WAIT);
+ /* Check connection state after rewrite. It should be in waiting for
+ * descriptor state. */
+ tt_int_op(ENTRY_TO_CONN(conn)->state, OP_EQ, AP_CONN_STATE_RENDDESC_WAIT);
/* check that the address got rewritten */
tt_str_op(conn->socks_request->address, OP_EQ,
"25njqamcweflpvkl73j4szahhihoc4xt3ktcgjnpaingr5yhkenl5sid");