BIND 10 trac2218_2, updated. f4663e8cab5485f19069ddb80fef073a6705c105 [2218] Make some DomainTreeNode methods private again
BIND 10 source code commits
bind10-changes at lists.isc.org
Mon Sep 24 05:16:25 UTC 2012
The branch, trac2218_2 has been updated
via f4663e8cab5485f19069ddb80fef073a6705c105 (commit)
from ca9f73e098180f9d5d188f1d1bd46031f9b81ce3 (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 f4663e8cab5485f19069ddb80fef073a6705c105
Author: Mukund Sivaraman <muks at isc.org>
Date: Mon Sep 24 10:45:09 2012 +0530
[2218] Make some DomainTreeNode methods private again
isSubTreeRoot(), getSubTreeRoot() and getLargestInSubTree() were made
private again.
-----------------------------------------------------------------------
Summary of changes:
src/lib/datasrc/memory/domaintree.h | 2 +-
.../datasrc/memory/tests/domaintree_unittest.cc | 40 ++++++++++++--------
2 files changed, 25 insertions(+), 17 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/lib/datasrc/memory/domaintree.h b/src/lib/datasrc/memory/domaintree.h
index aa37006..874c177 100644
--- a/src/lib/datasrc/memory/domaintree.h
+++ b/src/lib/datasrc/memory/domaintree.h
@@ -373,7 +373,6 @@ 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
@@ -399,6 +398,7 @@ public:
/// This method never throws an exception.
const DomainTreeNode<T>* getLargestInSubTree() const;
+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 0793206..ac22a4f 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->isSubTreeRoot());
+ EXPECT_FALSE(dtnode->getFlag(TestDomainTreeNode::FLAG_SUBTREE_ROOT));
// 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->isSubTreeRoot());
+ EXPECT_FALSE(dtnode->getFlag(TestDomainTreeNode::FLAG_SUBTREE_ROOT));
// "g.h" should be a subtree root now.
EXPECT_EQ(TestDomainTree::EXACTMATCH,
dtree_expose_empty_node.find(Name("g.h"), &dtnode));
- EXPECT_TRUE(dtnode->isSubTreeRoot());
+ EXPECT_TRUE(dtnode->getFlag(TestDomainTreeNode::FLAG_SUBTREE_ROOT));
}
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->isSubTreeRoot());
+ EXPECT_FALSE(dtnode->getFlag(TestDomainTreeNode::FLAG_SUBTREE_ROOT));
// 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->isSubTreeRoot());
+ EXPECT_FALSE(dtnode->getFlag(TestDomainTreeNode::FLAG_SUBTREE_ROOT));
// "t.0" should be a subtree root now.
EXPECT_EQ(TestDomainTree::EXACTMATCH,
dtree_expose_empty_node.find(Name("t.0"), &dtnode));
- EXPECT_TRUE(dtnode->isSubTreeRoot());
+ EXPECT_TRUE(dtnode->getFlag(TestDomainTreeNode::FLAG_SUBTREE_ROOT));
}
TEST_F(DomainTreeTest, findName) {
@@ -687,16 +687,6 @@ const char* const upper_node_names[] = {
"w.y.d.e.f", "w.y.d.e.f", "d.e.f", "z.d.e.f",
".", "g.h", "g.h"};
-const char* const subtree_root_node_names[] = {
- "b", "b", "b", "b", "w.y.d.e.f", "w.y.d.e.f", "p.w.y.d.e.f",
- "p.w.y.d.e.f", "p.w.y.d.e.f", "w.y.d.e.f", "j.z.d.e.f",
- "b", "i.g.h", "i.g.h"};
-
-const char* const largest_node_names[] = {
- "g.h", "g.h", "g.h", "g.h", "z.d.e.f", "z.d.e.f", "q.w.y.d.e.f",
- "q.w.y.d.e.f", "q.w.y.d.e.f", "z.d.e.f", "j.z.d.e.f",
- "g.h", "k.g.h", "k.g.h"};
-
TEST_F(DomainTreeTest, getUpperNode) {
TestDomainTreeNodeChain node_path;
const TestDomainTreeNode* node = NULL;
@@ -726,6 +716,16 @@ TEST_F(DomainTreeTest, getUpperNode) {
EXPECT_EQ(static_cast<void*>(NULL), node);
}
+
+#if 0
+// Disabled and kept still, for use in case we make getSubTreeRoot() and
+// getLargestInSubTree() public functions again.
+
+const char* const subtree_root_node_names[] = {
+ "b", "b", "b", "b", "w.y.d.e.f", "w.y.d.e.f", "p.w.y.d.e.f",
+ "p.w.y.d.e.f", "p.w.y.d.e.f", "w.y.d.e.f", "j.z.d.e.f",
+ "b", "i.g.h", "i.g.h"};
+
TEST_F(DomainTreeTest, getSubTreeRoot) {
TestDomainTreeNodeChain node_path;
const TestDomainTreeNode* node = NULL;
@@ -755,6 +755,11 @@ TEST_F(DomainTreeTest, getSubTreeRoot) {
EXPECT_EQ(static_cast<void*>(NULL), node);
}
+const char* const largest_node_names[] = {
+ "g.h", "g.h", "g.h", "g.h", "z.d.e.f", "z.d.e.f", "q.w.y.d.e.f",
+ "q.w.y.d.e.f", "q.w.y.d.e.f", "z.d.e.f", "j.z.d.e.f",
+ "g.h", "k.g.h", "k.g.h"};
+
TEST_F(DomainTreeTest, getLargestInSubTree) {
TestDomainTreeNodeChain node_path;
const TestDomainTreeNode* node = NULL;
@@ -784,6 +789,9 @@ TEST_F(DomainTreeTest, getLargestInSubTree) {
EXPECT_EQ(static_cast<void*>(NULL), node);
}
+#endif // disabled getSubTreeRoot() and getLargestInSubTree()
+
+
TEST_F(DomainTreeTest, nextNode) {
TestDomainTreeNodeChain node_path;
const TestDomainTreeNode* node = NULL;
More information about the bind10-changes
mailing list