Refactor growing test cases

This commit is contained in:
Sebastian Messmer 2015-02-23 17:51:11 +01:00
parent 388c755f63
commit 6c9d4cca39

View File

@ -33,31 +33,15 @@ Key DataTreeGrowingTest::CreateTreeAddThreeLeavesReturnRootKey() {
} }
Key DataTreeGrowingTest::CreateThreeNodeChainedTreeReturnRootKey() { Key DataTreeGrowingTest::CreateThreeNodeChainedTreeReturnRootKey() {
auto leaf = nodeStore.createNewLeafNode(); return CreateInner({CreateInner({CreateLeaf()})})->key();
auto node = nodeStore.createNewInnerNode(*leaf);
auto root = nodeStore.createNewInnerNode(*node);
return root->key();
} }
Key DataTreeGrowingTest::CreateThreeLevelTreeWithLowerLevelFullReturnRootKey() { Key DataTreeGrowingTest::CreateThreeLevelTreeWithLowerLevelFullReturnRootKey() {
auto leaf = nodeStore.createNewLeafNode(); return CreateInner({CreateFullTwoLevel()})->key();
auto node = nodeStore.createNewInnerNode(*leaf);
FillNode(node.get());
auto root = nodeStore.createNewInnerNode(*node);
return root->key();
} }
Key DataTreeGrowingTest::CreateThreeLevelTreeWithTwoFullSubtrees() { Key DataTreeGrowingTest::CreateThreeLevelTreeWithTwoFullSubtrees() {
auto leaf1 = nodeStore.createNewLeafNode(); return CreateInner({CreateFullTwoLevel(), CreateFullTwoLevel()})->key();
auto leaf2 = nodeStore.createNewLeafNode();
auto leaf3 = nodeStore.createNewLeafNode();
auto node1 = nodeStore.createNewInnerNode(*leaf1);
FillNode(node1.get());
auto node2 = nodeStore.createNewInnerNode(*leaf2);
FillNode(node2.get());
auto root = nodeStore.createNewInnerNode(*node1);
root->addChild(*node2);
return root->key();
} }
void DataTreeGrowingTest::AddLeafTo(const Key &key) { void DataTreeGrowingTest::AddLeafTo(const Key &key) {