BIND 10 trac2054, updated. 72539e992045e3b5b733d32660b6b939e5c67015 [2054] Add an additional node fission testcase for left-child case
BIND 10 source code commits
bind10-changes at lists.isc.org
Wed Aug 1 02:34:58 UTC 2012
The branch, trac2054 has been updated
via 72539e992045e3b5b733d32660b6b939e5c67015 (commit)
via a82d0b162c3d651719128154301da4793ed22643 (commit)
from e9eec8d241bb11fcfba0ba4d04cfbfdb62832683 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 72539e992045e3b5b733d32660b6b939e5c67015
Author: Mukund Sivaraman <muks at isc.org>
Date: Wed Aug 1 08:03:10 2012 +0530
[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.
commit a82d0b162c3d651719128154301da4793ed22643
Author: Mukund Sivaraman <muks at isc.org>
Date: Wed Aug 1 08:01:18 2012 +0530
[2054] Justify comments
-----------------------------------------------------------------------
Summary of changes:
src/lib/datasrc/tests/rbtree_unittest.cc | 34 ++++++++++++++++++++++++++++--
1 file changed, 32 insertions(+), 2 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/lib/datasrc/tests/rbtree_unittest.cc b/src/lib/datasrc/tests/rbtree_unittest.cc
index 1d08fed..ff0e1dd 100644
--- a/src/lib/datasrc/tests/rbtree_unittest.cc
+++ b/src/lib/datasrc/tests/rbtree_unittest.cc
@@ -40,7 +40,7 @@ const size_t Name::MAX_LABELS;
/* The initial structure of rbtree
*
-* .
+ * .
* |
* b
* / \
@@ -252,6 +252,36 @@ TEST_F(RBTreeTest, subTreeRoot) {
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)
+ EXPECT_EQ(RBTree<int>::SUCCESS,
+ rbtree_expose_empty_node.insert(mem_sgmt_, Name("t.0"),
+ &rbtnode));
+
+ // "t.0" is not a subtree root
+ EXPECT_EQ(RBTree<int>::EXACTMATCH,
+ rbtree_expose_empty_node.find(Name("t.0"), &rbtnode));
+ EXPECT_FALSE(rbtnode->getFlag(RBNode<int>::FLAG_SUBTREE_ROOT));
+
+ // fission the node "t.0"
+ EXPECT_EQ(RBTree<int>::ALREADYEXISTS,
+ rbtree_expose_empty_node.insert(mem_sgmt_, Name("0"),
+ &rbtnode));
+
+ // the node "0" ("0".down_ -> "t") should not be a subtree root. "t"
+ // should be a subtree root.
+ EXPECT_FALSE(rbtnode->getFlag(RBNode<int>::FLAG_SUBTREE_ROOT));
+
+ // "t.0" should be a subtree root now.
+ EXPECT_EQ(RBTree<int>::EXACTMATCH,
+ rbtree_expose_empty_node.find(Name("t.0"), &rbtnode));
+ EXPECT_TRUE(rbtnode->getFlag(RBNode<int>::FLAG_SUBTREE_ROOT));
+}
+
TEST_F(RBTreeTest, findName) {
// find const rbtnode
// exact match
@@ -458,7 +488,7 @@ TEST_F(RBTreeTest, getAbsoluteNameError) {
}
/*
- *the domain order should be:
+ * The domain order should be:
* ., a, b, c, d.e.f, x.d.e.f, w.y.d.e.f, o.w.y.d.e.f, p.w.y.d.e.f,
* q.w.y.d.e.f, z.d.e.f, j.z.d.e.f, g.h, i.g.h, k.g.h
* . (no data, can't be found)
More information about the bind10-changes
mailing list