diff options
author | Nick Mathewson <nickm@torproject.org> | 2014-05-22 16:27:29 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2014-05-22 16:27:29 -0400 |
commit | 1a73e178011d24ad2ef252dab7256d7c4fa94a64 (patch) | |
tree | 35990ad7f447fcebe8422aed4b66047f9fec2d29 /src/test/test_oom.c | |
parent | fef65fa64341fb70df0e7b34d91d3b08a74e7aad (diff) | |
parent | 170e0df7417e78f7b689f3189e7a0b5b8dfd2722 (diff) | |
download | tor-1a73e178011d24ad2ef252dab7256d7c4fa94a64.tar.gz tor-1a73e178011d24ad2ef252dab7256d7c4fa94a64.zip |
Merge remote-tracking branch 'andrea/bug11476'
Diffstat (limited to 'src/test/test_oom.c')
-rw-r--r-- | src/test/test_oom.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/test/test_oom.c b/src/test/test_oom.c index e205673be0..32f4803bba 100644 --- a/src/test/test_oom.c +++ b/src/test/test_oom.c @@ -13,7 +13,9 @@ #include "compat_libevent.h" #include "connection.h" #include "config.h" +#ifdef ENABLE_MEMPOOLS #include "mempool.h" +#endif #include "relay.h" #include "test.h" @@ -131,7 +133,10 @@ test_oom_circbuf(void *arg) (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(); @@ -150,8 +155,13 @@ 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(), ==, sizeof(packed_cell_t) + MP_POOL_ITEM_OVERHEAD); +#else + tt_int_op(packed_cell_mem_cost(), ==, + sizeof(packed_cell_t)); +#endif /* ENABLE_MEMPOOLS */ tt_int_op(cell_queues_get_total_allocation(), ==, packed_cell_mem_cost() * 70); tt_int_op(cell_queues_check_size(), ==, 0); /* We are still not OOM */ @@ -222,7 +232,10 @@ test_oom_streambuf(void *arg) (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; |