Commit 72539e99 authored by Mukund Sivaraman's avatar Mukund Sivaraman
Browse files

[2054] Add an additional node fission testcase for left-child case

Right child's fission is already covered in the default tree of
the fixture.
parent a82d0b16
...@@ -252,6 +252,36 @@ TEST_F(RBTreeTest, subTreeRoot) { ...@@ -252,6 +252,36 @@ TEST_F(RBTreeTest, subTreeRoot) {
EXPECT_TRUE(rbtnode->getFlag(RBNode<int>::FLAG_SUBTREE_ROOT)); EXPECT_TRUE(rbtnode->getFlag(RBNode<int>::FLAG_SUBTREE_ROOT));
} }
TEST_F(RBTreeTest, additionalNodeFission) {
// These are additional nodeFission tests added by #2054's rewrite
// of RBTree::nodeFission(). These test specific corner cases that
// are not covered by other tests.
// Insert "t.0" (which becomes the left child of its parent)
rbtree_expose_empty_node.insert(mem_sgmt_, Name("t.0"),
// "t.0" is not a subtree root
rbtree_expose_empty_node.find(Name("t.0"), &rbtnode));
// fission the node "t.0"
rbtree_expose_empty_node.insert(mem_sgmt_, Name("0"),
// the node "0" ("0".down_ -> "t") should not be a subtree root. "t"
// should be a subtree root.
// "t.0" should be a subtree root now.
rbtree_expose_empty_node.find(Name("t.0"), &rbtnode));
TEST_F(RBTreeTest, findName) { TEST_F(RBTreeTest, findName) {
// find const rbtnode // find const rbtnode
// exact match // exact match
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