BIND 10 trac2218_2, updated. 60c7cde711da05825672e5b8601ff596993a030b [2218] Make DomainNode::isSubTreeRoot() a public function
BIND 10 source code commits
bind10-changes at lists.isc.org
Wed Sep 19 06:35:21 UTC 2012
The branch, trac2218_2 has been updated
via 60c7cde711da05825672e5b8601ff596993a030b (commit)
from 88871270308be3aaaeb8918c29c2b2c3ca4286e5 (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 60c7cde711da05825672e5b8601ff596993a030b
Author: Mukund Sivaraman <muks at isc.org>
Date: Wed Sep 19 12:04:36 2012 +0530
[2218] Make DomainNode::isSubTreeRoot() a public function
This will be required for finding whether a hash is less than,
or greater than all nodes in the origin's subtree in an NSEC3 tree.
-----------------------------------------------------------------------
Summary of changes:
src/lib/datasrc/memory/domaintree.h | 8 +++++++-
.../datasrc/memory/tests/domaintree_unittest.cc | 12 ++++++------
2 files changed, 13 insertions(+), 7 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/lib/datasrc/memory/domaintree.h b/src/lib/datasrc/memory/domaintree.h
index 4c4de93..945de44 100644
--- a/src/lib/datasrc/memory/domaintree.h
+++ b/src/lib/datasrc/memory/domaintree.h
@@ -373,11 +373,17 @@ private:
}
}
+public:
+ /// \brief returns if the node is a subtree's root node
+ ///
+ /// This method takes a node and returns \c true if it is the root
+ /// node of the subtree it belongs to.
+ ///
+ /// This method never throws an exception.
bool isSubTreeRoot() const {
return ((flags_ & FLAG_SUBTREE_ROOT) != 0);
}
-public:
/// \brief returns the parent of the root of its subtree
///
/// This method takes a node and returns the parent of the root of
diff --git a/src/lib/datasrc/memory/tests/domaintree_unittest.cc b/src/lib/datasrc/memory/tests/domaintree_unittest.cc
index ef90050..bb322bc 100644
--- a/src/lib/datasrc/memory/tests/domaintree_unittest.cc
+++ b/src/lib/datasrc/memory/tests/domaintree_unittest.cc
@@ -257,7 +257,7 @@ TEST_F(DomainTreeTest, subTreeRoot) {
// "g.h" is not a subtree root
EXPECT_EQ(TestDomainTree::EXACTMATCH,
dtree_expose_empty_node.find(Name("g.h"), &dtnode));
- EXPECT_FALSE(dtnode->getFlag(TestDomainTreeNode::FLAG_SUBTREE_ROOT));
+ EXPECT_FALSE(dtnode->isSubTreeRoot());
// fission the node "g.h"
EXPECT_EQ(TestDomainTree::ALREADYEXISTS,
@@ -266,12 +266,12 @@ TEST_F(DomainTreeTest, subTreeRoot) {
// the node "h" (h.down_ -> "g") should not be a subtree root. "g"
// should be a subtree root.
- EXPECT_FALSE(dtnode->getFlag(TestDomainTreeNode::FLAG_SUBTREE_ROOT));
+ EXPECT_FALSE(dtnode->isSubTreeRoot());
// "g.h" should be a subtree root now.
EXPECT_EQ(TestDomainTree::EXACTMATCH,
dtree_expose_empty_node.find(Name("g.h"), &dtnode));
- EXPECT_TRUE(dtnode->getFlag(TestDomainTreeNode::FLAG_SUBTREE_ROOT));
+ EXPECT_TRUE(dtnode->isSubTreeRoot());
}
TEST_F(DomainTreeTest, additionalNodeFission) {
@@ -287,7 +287,7 @@ TEST_F(DomainTreeTest, additionalNodeFission) {
// "t.0" is not a subtree root
EXPECT_EQ(TestDomainTree::EXACTMATCH,
dtree_expose_empty_node.find(Name("t.0"), &dtnode));
- EXPECT_FALSE(dtnode->getFlag(TestDomainTreeNode::FLAG_SUBTREE_ROOT));
+ EXPECT_FALSE(dtnode->isSubTreeRoot());
// fission the node "t.0"
EXPECT_EQ(TestDomainTree::ALREADYEXISTS,
@@ -296,12 +296,12 @@ TEST_F(DomainTreeTest, additionalNodeFission) {
// the node "0" ("0".down_ -> "t") should not be a subtree root. "t"
// should be a subtree root.
- EXPECT_FALSE(dtnode->getFlag(TestDomainTreeNode::FLAG_SUBTREE_ROOT));
+ EXPECT_FALSE(dtnode->isSubTreeRoot());
// "t.0" should be a subtree root now.
EXPECT_EQ(TestDomainTree::EXACTMATCH,
dtree_expose_empty_node.find(Name("t.0"), &dtnode));
- EXPECT_TRUE(dtnode->getFlag(TestDomainTreeNode::FLAG_SUBTREE_ROOT));
+ EXPECT_TRUE(dtnode->isSubTreeRoot());
}
TEST_F(DomainTreeTest, findName) {
More information about the bind10-changes
mailing list