Test BlockStoreUtils fillWithZeroes()

This commit is contained in:
Sebastian Messmer 2015-03-08 00:36:59 +01:00
parent 71f55361b4
commit ffd9ada260
2 changed files with 8 additions and 2 deletions

View File

@ -32,6 +32,14 @@ public:
unique_ptr<BlockStore> blockStore;
};
TEST_F(BlockStoreUtilsTest, FillWithZeroes) {
auto block = blockStore->create(SIZE);
block->write(dataFixture.data(), 0, SIZE);
EXPECT_NE(0, std::memcmp(ZEROES.data(), block->data(), SIZE));
fillWithZeroes(block.get());
EXPECT_EQ(0, std::memcmp(ZEROES.data(), block->data(), SIZE));
}
class BlockStoreUtilsTest_CopyToNewBlock: public BlockStoreUtilsTest {};
TEST_F(BlockStoreUtilsTest_CopyToNewBlock, CopyEmptyBlock) {

View File

@ -13,8 +13,6 @@ std::unique_ptr<Block> copyToNewBlock(BlockStore *blockStore, const Block &block
void copyTo(Block *target, const Block &source);
void fillWithZeroes(Block *target);
//TODO Test fillWithZeroes
}
}