aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorcypherpunks <cypherpunks@torproject.org>2015-02-21 17:18:20 -0500
committerNick Mathewson <nickm@torproject.org>2015-02-23 11:19:31 -0500
commit5246e8f99255b376ded3d90b3c7a345c4748e68c (patch)
tree29959cb325f3f95a2fc051cf3395e82208bb8a0c /src/test
parent385558c32f666456ed10ed9dce3f4009437b015d (diff)
downloadtor-5246e8f99255b376ded3d90b3c7a345c4748e68c.tar.gz
tor-5246e8f99255b376ded3d90b3c7a345c4748e68c.zip
Remove lingering mempool code
Diffstat (limited to 'src/test')
-rw-r--r--src/test/test.c3
-rw-r--r--src/test/test_cell_queue.c16
-rw-r--r--src/test/test_channel.c30
-rw-r--r--src/test/test_circuitmux.c7
-rw-r--r--src/test/test_oom.c16
-rw-r--r--src/test/test_relay.c8
-rw-r--r--src/test/test_util.c3
7 files changed, 0 insertions, 83 deletions
diff --git a/src/test/test.c b/src/test/test.c
index 6c7db4e2c9..0524a6978f 100644
--- a/src/test/test.c
+++ b/src/test/test.c
@@ -49,9 +49,6 @@ double fabs(double x);
#include "rendcommon.h"
#include "test.h"
#include "torgzip.h"
-#ifdef ENABLE_MEMPOOLS
-#include "mempool.h"
-#endif
#include "memarea.h"
#include "onion.h"
#include "onion_ntor.h"
diff --git a/src/test/test_cell_queue.c b/src/test/test_cell_queue.c
index effd316f34..ed34df2ea2 100644
--- a/src/test/test_cell_queue.c
+++ b/src/test/test_cell_queue.c
@@ -16,10 +16,6 @@ test_cq_manip(void *arg)
cell_t cell;
(void) arg;
-#ifdef ENABLE_MEMPOOLS
- init_cell_pool();
-#endif /* ENABLE_MEMPOOLS */
-
cell_queue_init(&cq);
tt_int_op(cq.n, OP_EQ, 0);
@@ -99,10 +95,6 @@ test_cq_manip(void *arg)
packed_cell_free(pc_tmp);
cell_queue_clear(&cq);
-
-#ifdef ENABLE_MEMPOOLS
- free_cell_pool();
-#endif /* ENABLE_MEMPOOLS */
}
static void
@@ -114,10 +106,6 @@ test_circuit_n_cells(void *arg)
(void)arg;
-#ifdef ENABLE_MEMPOOLS
- init_cell_pool();
-#endif /* ENABLE_MEMPOOLS */
-
pc1 = packed_cell_new();
pc2 = packed_cell_new();
pc3 = packed_cell_new();
@@ -144,10 +132,6 @@ test_circuit_n_cells(void *arg)
done:
circuit_free(TO_CIRCUIT(or_c));
circuit_free(TO_CIRCUIT(origin_c));
-
-#ifdef ENABLE_MEMPOOLS
- free_cell_pool();
-#endif /* ENABLE_MEMPOOLS */
}
struct testcase_t cell_queue_tests[] = {
diff --git a/src/test/test_channel.c b/src/test/test_channel.c
index 99633a4026..6cf66493a8 100644
--- a/src/test/test_channel.c
+++ b/src/test/test_channel.c
@@ -650,10 +650,6 @@ test_channel_flush(void *arg)
(void)arg;
-#ifdef ENABLE_MEMPOOLS
- init_cell_pool();
-#endif /* ENABLE_MEMPOOLS */
-
ch = new_fake_channel();
tt_assert(ch);
@@ -695,9 +691,6 @@ test_channel_flush(void *arg)
done:
tor_free(ch);
-#ifdef ENABLE_MEMPOOLS
- free_cell_pool();
-#endif /* ENABLE_MEMPOOLS */
return;
}
@@ -715,10 +708,6 @@ test_channel_flushmux(void *arg)
(void)arg;
-#ifdef ENABLE_MEMPOOLS
- init_cell_pool();
-#endif /* ENABLE_MEMPOOLS */
-
/* Install mocks we need for this test */
MOCK(channel_flush_from_first_active_circuit,
chan_test_channel_flush_from_first_active_circuit_mock);
@@ -778,10 +767,6 @@ test_channel_flushmux(void *arg)
test_chan_accept_cells = 0;
-#ifdef ENABLE_MEMPOOLS
- free_cell_pool();
-#endif /* ENABLE_MEMPOOLS */
-
return;
}
@@ -1300,10 +1285,6 @@ test_channel_queue_impossible(void *arg)
(void)arg;
-#ifdef ENABLE_MEMPOOLS
- init_cell_pool();
-#endif /* ENABLE_MEMPOOLS */
-
ch = new_fake_channel();
tt_assert(ch);
@@ -1430,9 +1411,6 @@ test_channel_queue_impossible(void *arg)
done:
free_fake_channel(ch);
-#ifdef ENABLE_MEMPOOLS
- free_cell_pool();
-#endif /* ENABLE_MEMPOOLS */
/*
* Doing that meant that we couldn't correctly adjust the queue size
@@ -1575,10 +1553,6 @@ test_channel_write(void *arg)
(void)arg;
-#ifdef ENABLE_MEMPOOLS
- init_cell_pool();
-#endif /* ENABLE_MEMPOOLS */
-
packed_cell = packed_cell_new();
tt_assert(packed_cell);
@@ -1675,10 +1649,6 @@ test_channel_write(void *arg)
packed_cell = NULL;
tt_assert(test_cells_written == old_count);
-#ifdef ENABLE_MEMPOOLS
- free_cell_pool();
-#endif /* ENABLE_MEMPOOLS */
-
done:
free_fake_channel(ch);
tor_free(var_cell);
diff --git a/src/test/test_circuitmux.c b/src/test/test_circuitmux.c
index 2a2a7ba145..6d93731eea 100644
--- a/src/test/test_circuitmux.c
+++ b/src/test/test_circuitmux.c
@@ -43,9 +43,6 @@ test_cmux_destroy_cell_queue(void *arg)
tor_libevent_initialize(&cfg);
scheduler_init();
-#ifdef ENABLE_MEMPOOLS
- init_cell_pool();
-#endif /* ENABLE_MEMPOOLS */
(void) arg;
cmux = circuitmux_alloc();
@@ -82,10 +79,6 @@ test_cmux_destroy_cell_queue(void *arg)
circuitmux_free(cmux);
channel_free(ch);
packed_cell_free(pc);
-
-#ifdef ENABLE_MEMPOOLS
- free_cell_pool();
-#endif /* ENABLE_MEMPOOLS */
}
struct testcase_t circuitmux_tests[] = {
diff --git a/src/test/test_oom.c b/src/test/test_oom.c
index 28b4c0435a..41cfcdbd81 100644
--- a/src/test/test_oom.c
+++ b/src/test/test_oom.c
@@ -13,9 +13,6 @@
#include "compat_libevent.h"
#include "connection.h"
#include "config.h"
-#ifdef ENABLE_MEMPOOLS
-#include "mempool.h"
-#endif
#include "relay.h"
#include "test.h"
@@ -143,10 +140,6 @@ test_oom_circbuf(void *arg)
MOCK(circuit_mark_for_close_, circuit_mark_for_close_dummy_);
-#ifdef ENABLE_MEMPOOLS
- init_cell_pool();
-#endif /* ENABLE_MEMPOOLS */
-
/* Far too low for real life. */
options->MaxMemInQueues = 256*packed_cell_mem_cost();
options->CellStatistics = 0;
@@ -164,13 +157,8 @@ test_oom_circbuf(void *arg)
tor_gettimeofday_cache_set(&tv);
c2 = dummy_or_circuit_new(20, 20);
-#ifdef ENABLE_MEMPOOLS
- tt_int_op(packed_cell_mem_cost(), OP_EQ,
- sizeof(packed_cell_t) + MP_POOL_ITEM_OVERHEAD);
-#else
tt_int_op(packed_cell_mem_cost(), OP_EQ,
sizeof(packed_cell_t));
-#endif /* ENABLE_MEMPOOLS */
tt_int_op(cell_queues_get_total_allocation(), OP_EQ,
packed_cell_mem_cost() * 70);
tt_int_op(cell_queues_check_size(), OP_EQ, 0); /* We are still not OOM */
@@ -242,10 +230,6 @@ test_oom_streambuf(void *arg)
MOCK(circuit_mark_for_close_, circuit_mark_for_close_dummy_);
-#ifdef ENABLE_MEMPOOLS
- init_cell_pool();
-#endif /* ENABLE_MEMPOOLS */
-
/* Far too low for real life. */
options->MaxMemInQueues = 81*packed_cell_mem_cost() + 4096 * 34;
options->CellStatistics = 0;
diff --git a/src/test/test_relay.c b/src/test/test_relay.c
index 2144ef335e..6081956d46 100644
--- a/src/test/test_relay.c
+++ b/src/test/test_relay.c
@@ -60,11 +60,6 @@ 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();
tt_assert(nchan);
@@ -119,9 +114,6 @@ test_relay_append_cell_to_circuit_queue(void *arg)
tor_free(orcirc);
free_fake_channel(nchan);
free_fake_channel(pchan);
-#ifdef ENABLE_MEMPOOLS
- free_cell_pool();
-#endif /* ENABLE_MEMPOOLS */
return;
}
diff --git a/src/test/test_util.c b/src/test/test_util.c
index 9939bf4e3e..51e9e761ab 100644
--- a/src/test/test_util.c
+++ b/src/test/test_util.c
@@ -4338,9 +4338,6 @@ struct testcase_t util_tests[] = {
UTIL_LEGACY(pow2),
UTIL_LEGACY(gzip),
UTIL_LEGACY(datadir),
-#ifdef ENABLE_MEMPOOLS
- UTIL_LEGACY(mempool),
-#endif
UTIL_LEGACY(memarea),
UTIL_LEGACY(control_formats),
UTIL_LEGACY(mmap),