Commit c659dd07 authored by Leif Walsh's avatar Leif Walsh Committed by Yoni Fogel

refs #5507 zero out structs before calling .init in tests that reuse objects


git-svn-id: file:///svn/toku/tokudb@48052 c7de825b-a66e-492c-adef-691d508d4ae1
parent ed85de18
......@@ -42,6 +42,7 @@ void checkpointer_test::test_begin_checkpoint() {
cachetable ctbl;
ctbl.list.init();
ZERO_STRUCT(m_cp);
m_cp.init(&ctbl.list, NULL, &ctbl.ev, &cfl);
// 1. Call checkpoint with NO cachefiles.
......@@ -97,6 +98,7 @@ void checkpointer_test::test_pending_bits() {
cachetable ctbl;
ctbl.list.init();
ZERO_STRUCT(m_cp);
m_cp.init(&ctbl.list, NULL, &ctbl.ev, &cfl);
//
......@@ -250,6 +252,7 @@ void checkpointer_test::test_end_checkpoint() {
cf.for_checkpoint = true;
create_dummy_functions(&cf);
ZERO_STRUCT(m_cp);
m_cp.init(&ctbl.list, NULL, &ctbl.ev, &cfl);
m_cp.m_cf_list->m_head = &cf;
......
......@@ -75,6 +75,7 @@ void evictor_unit_test::disable_ev_thread() {
void evictor_unit_test::verify_ev_counts() {
long limit = 10;
long expected_m_size_reserved = limit/4;
ZERO_STRUCT(m_ev);
m_ev.init(limit, &m_pl, m_kb, 0);
this->verify_ev_init(limit);
......@@ -140,6 +141,7 @@ void evictor_unit_test::verify_ev_counts() {
void evictor_unit_test::verify_ev_m_size_reserved() {
long limit = 400;
long expected_m_size_reserved = 100; //limit/4
ZERO_STRUCT(m_ev);
m_ev.init(limit, &m_pl, m_kb, 0);
this->verify_ev_init(limit);
assert(m_ev.m_size_reserved == expected_m_size_reserved);
......@@ -162,6 +164,7 @@ void evictor_unit_test::verify_ev_m_size_reserved() {
// threads up works correctly
void evictor_unit_test::verify_ev_handling_cache_pressure() {
long limit = 400;
ZERO_STRUCT(m_ev);
m_ev.init(limit, &m_pl, m_kb, 0);
this->verify_ev_init(limit);
m_ev.m_low_size_watermark = 400;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment