[block-cache] unit tests + debug io_engine and copier

This commit is contained in:
Joe Thornber
2016-06-07 11:12:27 +01:00
parent 34c039d7dc
commit a94bfea798
12 changed files with 560 additions and 150 deletions

View File

@@ -93,4 +93,20 @@ TEST_F(MempoolTests, exhaust_pool)
ASSERT_EQ(md, nullptr);
}
// Use valgrind
TEST_F(MempoolTests, data_can_be_written)
{
mempool mp(512, 100 * 512, 512);
for (unsigned i = 0; i < 100; i++) {
auto md = mp.alloc();
ASSERT_NE(md, nullptr);
memset(md, 0, 512);
}
auto md = mp.alloc();
ASSERT_EQ(md, nullptr);
}
//----------------------------------------------------------------