Added testcase for DataNodeStore::remove()
This commit is contained in:
parent
b9e3a9b109
commit
db32c37b87
@ -37,7 +37,7 @@ public:
|
||||
void remove(std::unique_ptr<DataNode> node);
|
||||
|
||||
uint64_t numNodes() const;
|
||||
//TODO Test remove(), overwriteNodeWith(), createNodeAsCopyFrom()
|
||||
//TODO Test overwriteNodeWith(), createNodeAsCopyFrom()
|
||||
|
||||
private:
|
||||
std::unique_ptr<DataNode> load(std::unique_ptr<blockstore::Block> block);
|
||||
|
@ -93,6 +93,14 @@ TEST_F(DataNodeStoreTest, CreatedLeafNodeIsInitialized) {
|
||||
EXPECT_EQ(0u, leaf->numBytes());
|
||||
}
|
||||
|
||||
TEST_F(DataNodeStoreTest, NodeIsNotLoadableAfterDeleting) {
|
||||
auto nodekey = nodeStore->createNewLeafNode()->key();
|
||||
auto node = nodeStore->load(nodekey);
|
||||
EXPECT_NE(nullptr, node);
|
||||
nodeStore->remove(std::move(node));
|
||||
EXPECT_EQ(nullptr, nodeStore->load(nodekey));
|
||||
}
|
||||
|
||||
TEST_F(DataNodeStoreTest, NumNodesIsCorrectOnEmptyNodestore) {
|
||||
EXPECT_EQ(0, nodeStore->numNodes());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user