Commit 156bb123 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 8682ab10
...@@ -42,6 +42,7 @@ void checkpointer_test::test_begin_checkpoint() { ...@@ -42,6 +42,7 @@ void checkpointer_test::test_begin_checkpoint() {
cachetable ctbl; cachetable ctbl;
ctbl.list.init(); ctbl.list.init();
ZERO_STRUCT(m_cp);
m_cp.init(&ctbl.list, NULL, &ctbl.ev, &cfl); m_cp.init(&ctbl.list, NULL, &ctbl.ev, &cfl);
// 1. Call checkpoint with NO cachefiles. // 1. Call checkpoint with NO cachefiles.
...@@ -97,6 +98,7 @@ void checkpointer_test::test_pending_bits() { ...@@ -97,6 +98,7 @@ void checkpointer_test::test_pending_bits() {
cachetable ctbl; cachetable ctbl;
ctbl.list.init(); ctbl.list.init();
ZERO_STRUCT(m_cp);
m_cp.init(&ctbl.list, NULL, &ctbl.ev, &cfl); m_cp.init(&ctbl.list, NULL, &ctbl.ev, &cfl);
// //
...@@ -250,6 +252,7 @@ void checkpointer_test::test_end_checkpoint() { ...@@ -250,6 +252,7 @@ void checkpointer_test::test_end_checkpoint() {
cf.for_checkpoint = true; cf.for_checkpoint = true;
create_dummy_functions(&cf); create_dummy_functions(&cf);
ZERO_STRUCT(m_cp);
m_cp.init(&ctbl.list, NULL, &ctbl.ev, &cfl); m_cp.init(&ctbl.list, NULL, &ctbl.ev, &cfl);
m_cp.m_cf_list->m_head = &cf; m_cp.m_cf_list->m_head = &cf;
......
...@@ -75,6 +75,7 @@ void evictor_unit_test::disable_ev_thread() { ...@@ -75,6 +75,7 @@ void evictor_unit_test::disable_ev_thread() {
void evictor_unit_test::verify_ev_counts() { void evictor_unit_test::verify_ev_counts() {
long limit = 10; long limit = 10;
long expected_m_size_reserved = limit/4; long expected_m_size_reserved = limit/4;
ZERO_STRUCT(m_ev);
m_ev.init(limit, &m_pl, m_kb, 0); m_ev.init(limit, &m_pl, m_kb, 0);
this->verify_ev_init(limit); this->verify_ev_init(limit);
...@@ -140,6 +141,7 @@ void evictor_unit_test::verify_ev_counts() { ...@@ -140,6 +141,7 @@ void evictor_unit_test::verify_ev_counts() {
void evictor_unit_test::verify_ev_m_size_reserved() { void evictor_unit_test::verify_ev_m_size_reserved() {
long limit = 400; long limit = 400;
long expected_m_size_reserved = 100; //limit/4 long expected_m_size_reserved = 100; //limit/4
ZERO_STRUCT(m_ev);
m_ev.init(limit, &m_pl, m_kb, 0); m_ev.init(limit, &m_pl, m_kb, 0);
this->verify_ev_init(limit); this->verify_ev_init(limit);
assert(m_ev.m_size_reserved == expected_m_size_reserved); assert(m_ev.m_size_reserved == expected_m_size_reserved);
...@@ -162,6 +164,7 @@ void evictor_unit_test::verify_ev_m_size_reserved() { ...@@ -162,6 +164,7 @@ void evictor_unit_test::verify_ev_m_size_reserved() {
// threads up works correctly // threads up works correctly
void evictor_unit_test::verify_ev_handling_cache_pressure() { void evictor_unit_test::verify_ev_handling_cache_pressure() {
long limit = 400; long limit = 400;
ZERO_STRUCT(m_ev);
m_ev.init(limit, &m_pl, m_kb, 0); m_ev.init(limit, &m_pl, m_kb, 0);
this->verify_ev_init(limit); this->verify_ev_init(limit);
m_ev.m_low_size_watermark = 400; 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