diff options
Diffstat (limited to 'src/test/test_circuitmux.c')
-rw-r--r-- | src/test/test_circuitmux.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/src/test/test_circuitmux.c b/src/test/test_circuitmux.c index b9c0436ebf..9e8fb54964 100644 --- a/src/test/test_circuitmux.c +++ b/src/test/test_circuitmux.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2013, The Tor Project, Inc. */ +/* Copyright (c) 2013-2016, The Tor Project, Inc. */ /* See LICENSE for licensing information */ #define TOR_CHANNEL_INTERNAL_ @@ -8,6 +8,7 @@ #include "channel.h" #include "circuitmux.h" #include "relay.h" +#include "scheduler.h" #include "test.h" /* XXXX duplicated function from test_circuitlist.c */ @@ -36,9 +37,8 @@ test_cmux_destroy_cell_queue(void *arg) cell_queue_t *cq = NULL; packed_cell_t *pc = NULL; -#ifdef ENABLE_MEMPOOLS - init_cell_pool(); -#endif /* ENABLE_MEMPOOLS */ + scheduler_init(); + (void) arg; cmux = circuitmux_alloc(); @@ -55,30 +55,26 @@ test_cmux_destroy_cell_queue(void *arg) circuitmux_append_destroy_cell(ch, cmux, 190, 6); circuitmux_append_destroy_cell(ch, cmux, 30, 1); - tt_int_op(circuitmux_num_cells(cmux), ==, 3); + tt_int_op(circuitmux_num_cells(cmux), OP_EQ, 3); circ = circuitmux_get_first_active_circuit(cmux, &cq); tt_assert(!circ); tt_assert(cq); - tt_int_op(cq->n, ==, 3); + tt_int_op(cq->n, OP_EQ, 3); pc = cell_queue_pop(cq); tt_assert(pc); - test_mem_op(pc->body, ==, "\x00\x00\x00\x64\x04\x0a\x00\x00\x00", 9); + tt_mem_op(pc->body, OP_EQ, "\x00\x00\x00\x64\x04\x0a\x00\x00\x00", 9); packed_cell_free(pc); pc = NULL; - tt_int_op(circuitmux_num_cells(cmux), ==, 2); + tt_int_op(circuitmux_num_cells(cmux), OP_EQ, 2); done: circuitmux_free(cmux); channel_free(ch); packed_cell_free(pc); - -#ifdef ENABLE_MEMPOOLS - free_cell_pool(); -#endif /* ENABLE_MEMPOOLS */ } struct testcase_t circuitmux_tests[] = { |