aboutsummaryrefslogtreecommitdiff
path: root/src/test/test_relay.c
diff options
context:
space:
mode:
authorAndrea Shepard <andrea@torproject.org>2014-09-23 07:22:26 -0700
committerAndrea Shepard <andrea@torproject.org>2014-09-30 23:15:43 -0700
commit4d20c427b4874a3cb97e4567e4ae54830c5a79be (patch)
treed19522d755df4b1e46610d3cabb61e9e411ac4da /src/test/test_relay.c
parentfaea058baabec9eeb180a0e1812ca7857f3894e0 (diff)
downloadtor-4d20c427b4874a3cb97e4567e4ae54830c5a79be.tar.gz
tor-4d20c427b4874a3cb97e4567e4ae54830c5a79be.zip
Update test_relay.c for recent test suite changes and --enable-mempools support
Diffstat (limited to 'src/test/test_relay.c')
-rw-r--r--src/test/test_relay.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/test/test_relay.c b/src/test/test_relay.c
index 6b9cb33ca3..6907597705 100644
--- a/src/test/test_relay.c
+++ b/src/test/test_relay.c
@@ -61,14 +61,16 @@ test_relay_append_cell_to_circuit_queue(void *arg)
(void)arg;
/* We'll need the cell pool for append_cell_to_circuit_queue() to work */
+#ifdef ENABLE_MEMPOOLS
init_cell_pool();
+#endif /* ENABLE_MEMPOOLS */
/* Make fake channels to be nchan and pchan for the circuit */
nchan = new_fake_channel();
- test_assert(nchan);
+ tt_assert(nchan);
pchan = new_fake_channel();
- test_assert(pchan);
+ tt_assert(pchan);
/* We'll need chans with working cmuxes */
nchan->cmux = circuitmux_alloc();
@@ -76,7 +78,7 @@ test_relay_append_cell_to_circuit_queue(void *arg)
/* Make a fake orcirc */
orcirc = new_fake_orcirc(nchan, pchan);
- test_assert(orcirc);
+ tt_assert(orcirc);
/* Make a cell */
cell = tor_malloc_zero(sizeof(cell_t));
@@ -90,14 +92,14 @@ test_relay_append_cell_to_circuit_queue(void *arg)
append_cell_to_circuit_queue(TO_CIRCUIT(orcirc), nchan, cell,
CELL_DIRECTION_OUT, 0);
new_count = get_mock_scheduler_has_waiting_cells_count();
- test_eq(new_count, old_count + 1);
+ tt_int_op(new_count, ==, old_count + 1);
/* Now try the reverse direction */
old_count = get_mock_scheduler_has_waiting_cells_count();
append_cell_to_circuit_queue(TO_CIRCUIT(orcirc), pchan, cell,
CELL_DIRECTION_IN, 0);
new_count = get_mock_scheduler_has_waiting_cells_count();
- test_eq(new_count, old_count + 1);
+ tt_int_op(new_count, ==, old_count + 1);
UNMOCK(scheduler_channel_has_waiting_cells);
@@ -117,7 +119,9 @@ test_relay_append_cell_to_circuit_queue(void *arg)
tor_free(nchan);
if (pchan && pchan->cmux) circuitmux_free(pchan->cmux);
tor_free(pchan);
+#ifdef ENABLE_MEMPOOLS
free_cell_pool();
+#endif /* ENABLE_MEMPOOLS */
return;
}