Browse Source

[2105] Rename other instances of rbtree/rbnode

Mukund Sivaraman 13 years ago
parent
commit
1319a26ec4
2 changed files with 258 additions and 258 deletions
  1. 22 22
      src/lib/datasrc/memory/domaintree.h
  2. 236 236
      src/lib/datasrc/memory/tests/domaintree_unittest.cc

+ 22 - 22
src/lib/datasrc/memory/domaintree.h

@@ -146,15 +146,15 @@ private:
     /// \throw none
     /// \throw none
     ///
     ///
     /// \param mem_sgmt The \c MemorySegment that allocated memory for
     /// \param mem_sgmt The \c MemorySegment that allocated memory for
-    /// \c rbnode.
-    /// \param rbnode A non NULL pointer to a valid \c DomainTreeNode object
+    /// \c node.
+    /// \param node A non NULL pointer to a valid \c DomainTreeNode object
     /// that was originally created by the \c create() method (the behavior
     /// that was originally created by the \c create() method (the behavior
     /// is undefined if this condition isn't met).
     /// is undefined if this condition isn't met).
     static void destroy(util::MemorySegment& mem_sgmt,
     static void destroy(util::MemorySegment& mem_sgmt,
-                        DomainTreeNode<T, DT>* rbnode) {
-        const size_t labels_capacity = rbnode->labels_capacity_;
-        rbnode->~DomainTreeNode<T, DT>();
-        mem_sgmt.deallocate(rbnode,
+                        DomainTreeNode<T, DT>* node) {
+        const size_t labels_capacity = node->labels_capacity_;
+        node->~DomainTreeNode<T, DT>();
+        mem_sgmt.deallocate(node,
                             sizeof(DomainTreeNode<T, DT>) + labels_capacity);
                             sizeof(DomainTreeNode<T, DT>) + labels_capacity);
     }
     }
 
 
@@ -311,7 +311,7 @@ private:
     //@}
     //@}
 
 
 
 
-    /// \brief Define rbnode color
+    /// \brief Define node color
     enum DomainTreeNodeColor {BLACK, RED};
     enum DomainTreeNodeColor {BLACK, RED};
 
 
     /// \brief Returns the color of this node
     /// \brief Returns the color of this node
@@ -758,9 +758,9 @@ private:
     }
     }
 
 
 private:
 private:
-    // The max label count for one domain name is Name::MAX_LABELS (128).
-    // Since each node in rbtree stores at least one label, it's also equal
-    // to the possible maximum level.
+    // The max label count for one domain name is Name::MAX_LABELS
+    // (128).  Since each node in domaintree stores at least one label,
+    // it's also equal to the possible maximum level.
     const static int RBT_MAX_LEVEL = isc::dns::Name::MAX_LABELS;
     const static int RBT_MAX_LEVEL = isc::dns::Name::MAX_LABELS;
 
 
     int node_count_;
     int node_count_;
@@ -789,11 +789,11 @@ private:
  *  - Decreases the memory footprint, as it doesn't store the suffix labels
  *  - Decreases the memory footprint, as it doesn't store the suffix labels
  *      multiple times.
  *      multiple times.
  *
  *
- * Depending on different usage, rbtree will support different search policies.
- * Whether to return an empty node to end user is one policy among them.
- * The default policy is to NOT return an empty node to end user;
- * to change the behavior, specify \c true for the constructor parameter
- * \c returnEmptyNode.
+ * Depending on different usage, domaintree will support different
+ * search policies.  Whether to return an empty node to end user is one
+ * policy among them.  The default policy is to NOT return an empty node
+ * to end user; to change the behavior, specify \c true for the
+ * constructor parameter \c returnEmptyNode.
  * \note The search policy only affects the \c find() behavior of DomainTree.
  * \note The search policy only affects the \c find() behavior of DomainTree.
  * When inserting one name into DomainTree, if the node with the name already
  * When inserting one name into DomainTree, if the node with the name already
  * exists in the DomainTree and it's an empty node which doesn't have any data,
  * exists in the DomainTree and it's an empty node which doesn't have any data,
@@ -887,15 +887,15 @@ public:
     /// \throw none
     /// \throw none
     ///
     ///
     /// \param mem_sgmt The \c MemorySegment that allocated memory for
     /// \param mem_sgmt The \c MemorySegment that allocated memory for
-    /// \c rbtree and for all nodes inserted to the tree.
-    /// \param rbtree A non NULL pointer to a valid \c DomainTree object
+    /// \c tree and for all nodes inserted to the tree.
+    /// \param tree A non NULL pointer to a valid \c DomainTree object
     /// that was originally created by the \c create() method (the behavior
     /// that was originally created by the \c create() method (the behavior
     /// is undefined if this condition isn't met).
     /// is undefined if this condition isn't met).
     static void destroy(util::MemorySegment& mem_sgmt,
     static void destroy(util::MemorySegment& mem_sgmt,
-                        DomainTree<T, DT>* rbtree) {
-        rbtree->deleteAllNodes(mem_sgmt);
-        rbtree->~DomainTree<T, DT>();
-        mem_sgmt.deallocate(rbtree, sizeof(DomainTree<T, DT>));
+                        DomainTree<T, DT>* tree) {
+        tree->deleteAllNodes(mem_sgmt);
+        tree->~DomainTree<T, DT>();
+        mem_sgmt.deallocate(tree, sizeof(DomainTree<T, DT>));
     }
     }
 
 
 private:
 private:
@@ -1329,7 +1329,7 @@ private:
     typename DomainTreeNode<T, DT>::DomainTreeNodePtr root_;
     typename DomainTreeNode<T, DT>::DomainTreeNodePtr root_;
     /// the node count of current tree
     /// the node count of current tree
     unsigned int node_count_;
     unsigned int node_count_;
-    /// search policy for rbtree
+    /// search policy for domaintree
     const bool needsReturnEmptyNode_;
     const bool needsReturnEmptyNode_;
 };
 };
 
 

+ 236 - 236
src/lib/datasrc/memory/tests/domaintree_unittest.cc

@@ -38,7 +38,7 @@ using namespace isc::datasrc::memory;
 // EXPECT_xxx macros, for which we need an explicit empty definition.
 // EXPECT_xxx macros, for which we need an explicit empty definition.
 const size_t Name::MAX_LABELS;
 const size_t Name::MAX_LABELS;
 
 
-/* The initial structure of rbtree
+/* The initial structure of dtree
  *
  *
 *              .
 *              .
  *             |
  *             |
@@ -89,139 +89,139 @@ private:
 class DomainTreeTest : public::testing::Test {
 class DomainTreeTest : public::testing::Test {
 protected:
 protected:
     DomainTreeTest() :
     DomainTreeTest() :
-        rbtree_holder_(mem_sgmt_, TestDomainTree::create(mem_sgmt_)),
-        rbtree_expose_empty_node_holder_(mem_sgmt_,
+        dtree_holder_(mem_sgmt_, TestDomainTree::create(mem_sgmt_)),
+        dtree_expose_empty_node_holder_(mem_sgmt_,
                                          TestDomainTree::create(mem_sgmt_, true)),
                                          TestDomainTree::create(mem_sgmt_, true)),
-        rbtree(*rbtree_holder_.get()),
-        rbtree_expose_empty_node(*rbtree_expose_empty_node_holder_.get()),
-        crbtnode(NULL)
+        dtree(*dtree_holder_.get()),
+        dtree_expose_empty_node(*dtree_expose_empty_node_holder_.get()),
+        cdtnode(NULL)
     {
     {
         const char* const domain_names[] = {
         const char* const domain_names[] = {
             "c", "b", "a", "x.d.e.f", "z.d.e.f", "g.h", "i.g.h", "o.w.y.d.e.f",
             "c", "b", "a", "x.d.e.f", "z.d.e.f", "g.h", "i.g.h", "o.w.y.d.e.f",
             "j.z.d.e.f", "p.w.y.d.e.f", "q.w.y.d.e.f", "k.g.h"};
             "j.z.d.e.f", "p.w.y.d.e.f", "q.w.y.d.e.f", "k.g.h"};
         int name_count = sizeof(domain_names) / sizeof(domain_names[0]);
         int name_count = sizeof(domain_names) / sizeof(domain_names[0]);
         for (int i = 0; i < name_count; ++i) {
         for (int i = 0; i < name_count; ++i) {
-            rbtree.insert(mem_sgmt_, Name(domain_names[i]), &rbtnode);
-            rbtnode->setData(new int(i + 1));
+            dtree.insert(mem_sgmt_, Name(domain_names[i]), &dtnode);
+            dtnode->setData(new int(i + 1));
 
 
-            rbtree_expose_empty_node.insert(mem_sgmt_, Name(domain_names[i]),
-                                            &rbtnode);
-            rbtnode->setData(new int(i + 1));
+            dtree_expose_empty_node.insert(mem_sgmt_, Name(domain_names[i]),
+                                            &dtnode);
+            dtnode->setData(new int(i + 1));
 
 
         }
         }
     }
     }
 
 
     util::MemorySegmentLocal mem_sgmt_;
     util::MemorySegmentLocal mem_sgmt_;
-    TreeHolder rbtree_holder_;
-    TreeHolder rbtree_expose_empty_node_holder_;
-    TestDomainTree& rbtree;
-    TestDomainTree& rbtree_expose_empty_node;
-    TestDomainTreeNode* rbtnode;
-    const TestDomainTreeNode* crbtnode;
+    TreeHolder dtree_holder_;
+    TreeHolder dtree_expose_empty_node_holder_;
+    TestDomainTree& dtree;
+    TestDomainTree& dtree_expose_empty_node;
+    TestDomainTreeNode* dtnode;
+    const TestDomainTreeNode* cdtnode;
 };
 };
 
 
 TEST_F(DomainTreeTest, nodeCount) {
 TEST_F(DomainTreeTest, nodeCount) {
-    EXPECT_EQ(15, rbtree.getNodeCount());
+    EXPECT_EQ(15, dtree.getNodeCount());
 
 
     // Delete all nodes, then the count should be set to 0.  This also tests
     // Delete all nodes, then the count should be set to 0.  This also tests
     // the behavior of deleteAllNodes().
     // the behavior of deleteAllNodes().
-    rbtree.deleteAllNodes(mem_sgmt_);
-    EXPECT_EQ(0, rbtree.getNodeCount());
+    dtree.deleteAllNodes(mem_sgmt_);
+    EXPECT_EQ(0, dtree.getNodeCount());
 }
 }
 
 
 TEST_F(DomainTreeTest, setGetData) {
 TEST_F(DomainTreeTest, setGetData) {
-    rbtnode->setData(new int(11));
-    EXPECT_EQ(11, *(rbtnode->getData()));
+    dtnode->setData(new int(11));
+    EXPECT_EQ(11, *(dtnode->getData()));
 }
 }
 
 
 TEST_F(DomainTreeTest, insertNames) {
 TEST_F(DomainTreeTest, insertNames) {
-    EXPECT_EQ(TestDomainTree::ALREADYEXISTS, rbtree.insert(mem_sgmt_,
+    EXPECT_EQ(TestDomainTree::ALREADYEXISTS, dtree.insert(mem_sgmt_,
                                                         Name("d.e.f"),
                                                         Name("d.e.f"),
-                                                        &rbtnode));
-    EXPECT_EQ(Name("d.e.f"), rbtnode->getName());
-    EXPECT_EQ(15, rbtree.getNodeCount());
+                                                        &dtnode));
+    EXPECT_EQ(Name("d.e.f"), dtnode->getName());
+    EXPECT_EQ(15, dtree.getNodeCount());
 
 
     // insert not exist node
     // insert not exist node
-    EXPECT_EQ(TestDomainTree::SUCCESS, rbtree.insert(mem_sgmt_, Name("0"),
-                                                  &rbtnode));
-    EXPECT_EQ(Name("0"), rbtnode->getName());
-    EXPECT_EQ(16, rbtree.getNodeCount());
+    EXPECT_EQ(TestDomainTree::SUCCESS, dtree.insert(mem_sgmt_, Name("0"),
+                                                  &dtnode));
+    EXPECT_EQ(Name("0"), dtnode->getName());
+    EXPECT_EQ(16, dtree.getNodeCount());
 
 
-    EXPECT_EQ(TestDomainTree::SUCCESS, rbtree.insert(mem_sgmt_,
+    EXPECT_EQ(TestDomainTree::SUCCESS, dtree.insert(mem_sgmt_,
                                                   Name("example.com"),
                                                   Name("example.com"),
-                                                  &rbtnode));
-    EXPECT_EQ(17, rbtree.getNodeCount());
-    rbtnode->setData(new int(12));
+                                                  &dtnode));
+    EXPECT_EQ(17, dtree.getNodeCount());
+    dtnode->setData(new int(12));
 
 
     // return ALREADYEXISTS, since node "example.com" already has
     // return ALREADYEXISTS, since node "example.com" already has
     // been explicitly inserted
     // been explicitly inserted
-    EXPECT_EQ(TestDomainTree::ALREADYEXISTS, rbtree.insert(mem_sgmt_,
+    EXPECT_EQ(TestDomainTree::ALREADYEXISTS, dtree.insert(mem_sgmt_,
                                                         Name("example.com"),
                                                         Name("example.com"),
-                                                        &rbtnode));
-    EXPECT_EQ(17, rbtree.getNodeCount());
+                                                        &dtnode));
+    EXPECT_EQ(17, dtree.getNodeCount());
 
 
     // split the node "d.e.f"
     // split the node "d.e.f"
-    EXPECT_EQ(TestDomainTree::SUCCESS, rbtree.insert(mem_sgmt_, Name("k.e.f"),
-                                                  &rbtnode));
-    EXPECT_EQ(Name("k"), rbtnode->getName());
-    EXPECT_EQ(19, rbtree.getNodeCount());
+    EXPECT_EQ(TestDomainTree::SUCCESS, dtree.insert(mem_sgmt_, Name("k.e.f"),
+                                                  &dtnode));
+    EXPECT_EQ(Name("k"), dtnode->getName());
+    EXPECT_EQ(19, dtree.getNodeCount());
 
 
     // split the node "g.h"
     // split the node "g.h"
-    EXPECT_EQ(TestDomainTree::ALREADYEXISTS, rbtree.insert(mem_sgmt_, Name("h"),
-                                                        &rbtnode));
-    EXPECT_EQ(Name("h"), rbtnode->getName());
-    EXPECT_EQ(20, rbtree.getNodeCount());
+    EXPECT_EQ(TestDomainTree::ALREADYEXISTS, dtree.insert(mem_sgmt_, Name("h"),
+                                                        &dtnode));
+    EXPECT_EQ(Name("h"), dtnode->getName());
+    EXPECT_EQ(20, dtree.getNodeCount());
 
 
     // add child domain
     // add child domain
-    EXPECT_EQ(TestDomainTree::SUCCESS, rbtree.insert(mem_sgmt_,
+    EXPECT_EQ(TestDomainTree::SUCCESS, dtree.insert(mem_sgmt_,
                                                   Name("m.p.w.y.d.e.f"),
                                                   Name("m.p.w.y.d.e.f"),
-                                                  &rbtnode));
-    EXPECT_EQ(Name("m"), rbtnode->getName());
-    EXPECT_EQ(21, rbtree.getNodeCount());
-    EXPECT_EQ(TestDomainTree::SUCCESS, rbtree.insert(mem_sgmt_,
+                                                  &dtnode));
+    EXPECT_EQ(Name("m"), dtnode->getName());
+    EXPECT_EQ(21, dtree.getNodeCount());
+    EXPECT_EQ(TestDomainTree::SUCCESS, dtree.insert(mem_sgmt_,
                                                   Name("n.p.w.y.d.e.f"),
                                                   Name("n.p.w.y.d.e.f"),
-                                                  &rbtnode));
-    EXPECT_EQ(Name("n"), rbtnode->getName());
-    EXPECT_EQ(22, rbtree.getNodeCount());
-
-    EXPECT_EQ(TestDomainTree::SUCCESS, rbtree.insert(mem_sgmt_, Name("l.a"),
-                                                  &rbtnode));
-    EXPECT_EQ(Name("l"), rbtnode->getName());
-    EXPECT_EQ(23, rbtree.getNodeCount());
-
-    EXPECT_EQ(TestDomainTree::SUCCESS, rbtree.insert(mem_sgmt_, Name("r.d.e.f"),
-                                                  &rbtnode));
-    EXPECT_EQ(TestDomainTree::SUCCESS, rbtree.insert(mem_sgmt_, Name("s.d.e.f"),
-                                                  &rbtnode));
-    EXPECT_EQ(25, rbtree.getNodeCount());
-
-    EXPECT_EQ(TestDomainTree::SUCCESS, rbtree.insert(mem_sgmt_,
+                                                  &dtnode));
+    EXPECT_EQ(Name("n"), dtnode->getName());
+    EXPECT_EQ(22, dtree.getNodeCount());
+
+    EXPECT_EQ(TestDomainTree::SUCCESS, dtree.insert(mem_sgmt_, Name("l.a"),
+                                                  &dtnode));
+    EXPECT_EQ(Name("l"), dtnode->getName());
+    EXPECT_EQ(23, dtree.getNodeCount());
+
+    EXPECT_EQ(TestDomainTree::SUCCESS, dtree.insert(mem_sgmt_, Name("r.d.e.f"),
+                                                  &dtnode));
+    EXPECT_EQ(TestDomainTree::SUCCESS, dtree.insert(mem_sgmt_, Name("s.d.e.f"),
+                                                  &dtnode));
+    EXPECT_EQ(25, dtree.getNodeCount());
+
+    EXPECT_EQ(TestDomainTree::SUCCESS, dtree.insert(mem_sgmt_,
                                                   Name("h.w.y.d.e.f"),
                                                   Name("h.w.y.d.e.f"),
-                                                  &rbtnode));
+                                                  &dtnode));
 
 
     // add more nodes one by one to cover leftRotate and rightRotate
     // add more nodes one by one to cover leftRotate and rightRotate
-    EXPECT_EQ(TestDomainTree::ALREADYEXISTS, rbtree.insert(mem_sgmt_, Name("f"),
-                                                        &rbtnode));
-    EXPECT_EQ(TestDomainTree::SUCCESS, rbtree.insert(mem_sgmt_, Name("m"),
-                                                  &rbtnode));
-    EXPECT_EQ(TestDomainTree::SUCCESS, rbtree.insert(mem_sgmt_, Name("nm"),
-                                                  &rbtnode));
-    EXPECT_EQ(TestDomainTree::SUCCESS, rbtree.insert(mem_sgmt_, Name("om"),
-                                                  &rbtnode));
-    EXPECT_EQ(TestDomainTree::SUCCESS, rbtree.insert(mem_sgmt_, Name("k"),
-                                                  &rbtnode));
-    EXPECT_EQ(TestDomainTree::SUCCESS, rbtree.insert(mem_sgmt_, Name("l"),
-                                                  &rbtnode));
-    EXPECT_EQ(TestDomainTree::SUCCESS, rbtree.insert(mem_sgmt_, Name("fe"),
-                                                  &rbtnode));
-    EXPECT_EQ(TestDomainTree::SUCCESS, rbtree.insert(mem_sgmt_, Name("ge"),
-                                                  &rbtnode));
-    EXPECT_EQ(TestDomainTree::SUCCESS, rbtree.insert(mem_sgmt_, Name("i"),
-                                                  &rbtnode));
-    EXPECT_EQ(TestDomainTree::SUCCESS, rbtree.insert(mem_sgmt_, Name("ae"),
-                                                  &rbtnode));
-    EXPECT_EQ(TestDomainTree::SUCCESS, rbtree.insert(mem_sgmt_, Name("n"),
-                                                  &rbtnode));
+    EXPECT_EQ(TestDomainTree::ALREADYEXISTS, dtree.insert(mem_sgmt_, Name("f"),
+                                                        &dtnode));
+    EXPECT_EQ(TestDomainTree::SUCCESS, dtree.insert(mem_sgmt_, Name("m"),
+                                                  &dtnode));
+    EXPECT_EQ(TestDomainTree::SUCCESS, dtree.insert(mem_sgmt_, Name("nm"),
+                                                  &dtnode));
+    EXPECT_EQ(TestDomainTree::SUCCESS, dtree.insert(mem_sgmt_, Name("om"),
+                                                  &dtnode));
+    EXPECT_EQ(TestDomainTree::SUCCESS, dtree.insert(mem_sgmt_, Name("k"),
+                                                  &dtnode));
+    EXPECT_EQ(TestDomainTree::SUCCESS, dtree.insert(mem_sgmt_, Name("l"),
+                                                  &dtnode));
+    EXPECT_EQ(TestDomainTree::SUCCESS, dtree.insert(mem_sgmt_, Name("fe"),
+                                                  &dtnode));
+    EXPECT_EQ(TestDomainTree::SUCCESS, dtree.insert(mem_sgmt_, Name("ge"),
+                                                  &dtnode));
+    EXPECT_EQ(TestDomainTree::SUCCESS, dtree.insert(mem_sgmt_, Name("i"),
+                                                  &dtnode));
+    EXPECT_EQ(TestDomainTree::SUCCESS, dtree.insert(mem_sgmt_, Name("ae"),
+                                                  &dtnode));
+    EXPECT_EQ(TestDomainTree::SUCCESS, dtree.insert(mem_sgmt_, Name("n"),
+                                                  &dtnode));
 }
 }
 
 
 TEST_F(DomainTreeTest, subTreeRoot) {
 TEST_F(DomainTreeTest, subTreeRoot) {
@@ -231,103 +231,103 @@ TEST_F(DomainTreeTest, subTreeRoot) {
     // copied correctly.
     // copied correctly.
 
 
     EXPECT_EQ(TestDomainTree::ALREADYEXISTS,
     EXPECT_EQ(TestDomainTree::ALREADYEXISTS,
-              rbtree_expose_empty_node.insert(mem_sgmt_, Name("d.e.f"),
-                                              &rbtnode));
+              dtree_expose_empty_node.insert(mem_sgmt_, Name("d.e.f"),
+                                              &dtnode));
     EXPECT_EQ(TestDomainTree::SUCCESS,
     EXPECT_EQ(TestDomainTree::SUCCESS,
-              rbtree_expose_empty_node.insert(mem_sgmt_, Name("0"),
-                                              &rbtnode));
+              dtree_expose_empty_node.insert(mem_sgmt_, Name("0"),
+                                              &dtnode));
     EXPECT_EQ(TestDomainTree::SUCCESS,
     EXPECT_EQ(TestDomainTree::SUCCESS,
-              rbtree_expose_empty_node.insert(mem_sgmt_, Name("example.com"),
-                                              &rbtnode));
+              dtree_expose_empty_node.insert(mem_sgmt_, Name("example.com"),
+                                              &dtnode));
     EXPECT_EQ(TestDomainTree::ALREADYEXISTS,
     EXPECT_EQ(TestDomainTree::ALREADYEXISTS,
-              rbtree_expose_empty_node.insert(mem_sgmt_, Name("example.com"),
-                                              &rbtnode));
+              dtree_expose_empty_node.insert(mem_sgmt_, Name("example.com"),
+                                              &dtnode));
     EXPECT_EQ(TestDomainTree::SUCCESS,
     EXPECT_EQ(TestDomainTree::SUCCESS,
-              rbtree_expose_empty_node.insert(mem_sgmt_, Name("k.e.f"),
-                                              &rbtnode));
+              dtree_expose_empty_node.insert(mem_sgmt_, Name("k.e.f"),
+                                              &dtnode));
 
 
     // "g.h" is not a subtree root
     // "g.h" is not a subtree root
     EXPECT_EQ(TestDomainTree::EXACTMATCH,
     EXPECT_EQ(TestDomainTree::EXACTMATCH,
-              rbtree_expose_empty_node.find(Name("g.h"), &rbtnode));
-    EXPECT_FALSE(rbtnode->getFlag(TestDomainTreeNode::FLAG_SUBTREE_ROOT));
+              dtree_expose_empty_node.find(Name("g.h"), &dtnode));
+    EXPECT_FALSE(dtnode->getFlag(TestDomainTreeNode::FLAG_SUBTREE_ROOT));
 
 
     // fission the node "g.h"
     // fission the node "g.h"
     EXPECT_EQ(TestDomainTree::ALREADYEXISTS,
     EXPECT_EQ(TestDomainTree::ALREADYEXISTS,
-              rbtree_expose_empty_node.insert(mem_sgmt_, Name("h"),
-                                              &rbtnode));
+              dtree_expose_empty_node.insert(mem_sgmt_, Name("h"),
+                                              &dtnode));
 
 
     // the node "h" (h.down_ -> "g") should not be a subtree root. "g"
     // the node "h" (h.down_ -> "g") should not be a subtree root. "g"
     // should be a subtree root.
     // should be a subtree root.
-    EXPECT_FALSE(rbtnode->getFlag(TestDomainTreeNode::FLAG_SUBTREE_ROOT));
+    EXPECT_FALSE(dtnode->getFlag(TestDomainTreeNode::FLAG_SUBTREE_ROOT));
 
 
     // "g.h" should be a subtree root now.
     // "g.h" should be a subtree root now.
     EXPECT_EQ(TestDomainTree::EXACTMATCH,
     EXPECT_EQ(TestDomainTree::EXACTMATCH,
-              rbtree_expose_empty_node.find(Name("g.h"), &rbtnode));
-    EXPECT_TRUE(rbtnode->getFlag(TestDomainTreeNode::FLAG_SUBTREE_ROOT));
+              dtree_expose_empty_node.find(Name("g.h"), &dtnode));
+    EXPECT_TRUE(dtnode->getFlag(TestDomainTreeNode::FLAG_SUBTREE_ROOT));
 }
 }
 
 
 TEST_F(DomainTreeTest, findName) {
 TEST_F(DomainTreeTest, findName) {
-    // find const rbtnode
+    // find const dtnode
     // exact match
     // exact match
-    EXPECT_EQ(TestDomainTree::EXACTMATCH, rbtree.find(Name("a"), &crbtnode));
-    EXPECT_EQ(Name("a"), crbtnode->getName());
+    EXPECT_EQ(TestDomainTree::EXACTMATCH, dtree.find(Name("a"), &cdtnode));
+    EXPECT_EQ(Name("a"), cdtnode->getName());
 
 
     // not found
     // not found
-    EXPECT_EQ(TestDomainTree::NOTFOUND, rbtree.find(Name("d.e.f"), &crbtnode));
-    EXPECT_EQ(TestDomainTree::NOTFOUND, rbtree.find(Name("y.d.e.f"), &crbtnode));
-    EXPECT_EQ(TestDomainTree::NOTFOUND, rbtree.find(Name("x"), &crbtnode));
-    EXPECT_EQ(TestDomainTree::NOTFOUND, rbtree.find(Name("m.n"), &crbtnode));
+    EXPECT_EQ(TestDomainTree::NOTFOUND, dtree.find(Name("d.e.f"), &cdtnode));
+    EXPECT_EQ(TestDomainTree::NOTFOUND, dtree.find(Name("y.d.e.f"), &cdtnode));
+    EXPECT_EQ(TestDomainTree::NOTFOUND, dtree.find(Name("x"), &cdtnode));
+    EXPECT_EQ(TestDomainTree::NOTFOUND, dtree.find(Name("m.n"), &cdtnode));
 
 
     // if we expose empty node, we can get the empty node created during insert
     // if we expose empty node, we can get the empty node created during insert
     EXPECT_EQ(TestDomainTree::EXACTMATCH,
     EXPECT_EQ(TestDomainTree::EXACTMATCH,
-              rbtree_expose_empty_node.find(Name("d.e.f"), &crbtnode));
+              dtree_expose_empty_node.find(Name("d.e.f"), &cdtnode));
     EXPECT_EQ(TestDomainTree::EXACTMATCH,
     EXPECT_EQ(TestDomainTree::EXACTMATCH,
-              rbtree_expose_empty_node.find(Name("w.y.d.e.f"), &crbtnode));
+              dtree_expose_empty_node.find(Name("w.y.d.e.f"), &cdtnode));
 
 
     // partial match
     // partial match
-    EXPECT_EQ(TestDomainTree::PARTIALMATCH, rbtree.find(Name("m.b"), &crbtnode));
-    EXPECT_EQ(Name("b"), crbtnode->getName());
+    EXPECT_EQ(TestDomainTree::PARTIALMATCH, dtree.find(Name("m.b"), &cdtnode));
+    EXPECT_EQ(Name("b"), cdtnode->getName());
     EXPECT_EQ(TestDomainTree::PARTIALMATCH,
     EXPECT_EQ(TestDomainTree::PARTIALMATCH,
-              rbtree_expose_empty_node.find(Name("m.d.e.f"), &crbtnode));
+              dtree_expose_empty_node.find(Name("m.d.e.f"), &cdtnode));
 
 
-    // find rbtnode
-    EXPECT_EQ(TestDomainTree::EXACTMATCH, rbtree.find(Name("q.w.y.d.e.f"),
-                                                   &rbtnode));
-    EXPECT_EQ(Name("q"), rbtnode->getName());
+    // find dtnode
+    EXPECT_EQ(TestDomainTree::EXACTMATCH, dtree.find(Name("q.w.y.d.e.f"),
+                                                   &dtnode));
+    EXPECT_EQ(Name("q"), dtnode->getName());
 }
 }
 
 
 TEST_F(DomainTreeTest, findError) {
 TEST_F(DomainTreeTest, findError) {
     // For the version that takes a node chain, the chain must be empty.
     // For the version that takes a node chain, the chain must be empty.
     TestDomainTreeNodeChain chain;
     TestDomainTreeNodeChain chain;
-    EXPECT_EQ(TestDomainTree::EXACTMATCH, rbtree.find(Name("a"), &crbtnode,
+    EXPECT_EQ(TestDomainTree::EXACTMATCH, dtree.find(Name("a"), &cdtnode,
                                                    chain));
                                                    chain));
     // trying to reuse the same chain.  it should result in an exception.
     // trying to reuse the same chain.  it should result in an exception.
-    EXPECT_THROW(rbtree.find(Name("a"), &crbtnode, chain),
+    EXPECT_THROW(dtree.find(Name("a"), &cdtnode, chain),
                  BadValue);
                  BadValue);
 }
 }
 
 
 TEST_F(DomainTreeTest, flags) {
 TEST_F(DomainTreeTest, flags) {
-    EXPECT_EQ(TestDomainTree::SUCCESS, rbtree.insert(mem_sgmt_,
+    EXPECT_EQ(TestDomainTree::SUCCESS, dtree.insert(mem_sgmt_,
                                                   Name("flags.example"),
                                                   Name("flags.example"),
-                                                  &rbtnode));
+                                                  &dtnode));
 
 
     // by default, flags are all off
     // by default, flags are all off
-    EXPECT_FALSE(rbtnode->getFlag(TestDomainTreeNode::FLAG_CALLBACK));
+    EXPECT_FALSE(dtnode->getFlag(TestDomainTreeNode::FLAG_CALLBACK));
 
 
     // set operation, by default it enables the flag
     // set operation, by default it enables the flag
-    rbtnode->setFlag(TestDomainTreeNode::FLAG_CALLBACK);
-    EXPECT_TRUE(rbtnode->getFlag(TestDomainTreeNode::FLAG_CALLBACK));
+    dtnode->setFlag(TestDomainTreeNode::FLAG_CALLBACK);
+    EXPECT_TRUE(dtnode->getFlag(TestDomainTreeNode::FLAG_CALLBACK));
 
 
     // try disable the flag explicitly
     // try disable the flag explicitly
-    rbtnode->setFlag(TestDomainTreeNode::FLAG_CALLBACK, false);
-    EXPECT_FALSE(rbtnode->getFlag(TestDomainTreeNode::FLAG_CALLBACK));
+    dtnode->setFlag(TestDomainTreeNode::FLAG_CALLBACK, false);
+    EXPECT_FALSE(dtnode->getFlag(TestDomainTreeNode::FLAG_CALLBACK));
 
 
     // try enable the flag explicitly
     // try enable the flag explicitly
-    rbtnode->setFlag(TestDomainTreeNode::FLAG_CALLBACK, true);
-    EXPECT_TRUE(rbtnode->getFlag(TestDomainTreeNode::FLAG_CALLBACK));
+    dtnode->setFlag(TestDomainTreeNode::FLAG_CALLBACK, true);
+    EXPECT_TRUE(dtnode->getFlag(TestDomainTreeNode::FLAG_CALLBACK));
 
 
     // setting an unknown flag will trigger an exception
     // setting an unknown flag will trigger an exception
-    EXPECT_THROW(rbtnode->setFlag(static_cast<TestDomainTreeNode::Flags>(2), true),
+    EXPECT_THROW(dtnode->setFlag(static_cast<TestDomainTreeNode::Flags>(2), true),
                  isc::InvalidParameter);
                  isc::InvalidParameter);
 }
 }
 
 
@@ -339,63 +339,63 @@ testCallback(const TestDomainTreeNode&, bool* callback_checker) {
 
 
 template <typename T>
 template <typename T>
 void
 void
-performCallbackTest(TestDomainTree& rbtree,
+performCallbackTest(TestDomainTree& dtree,
                     util::MemorySegmentLocal& mem_sgmt,
                     util::MemorySegmentLocal& mem_sgmt,
                     const T& name_called,
                     const T& name_called,
                     const T& name_not_called)
                     const T& name_not_called)
 {
 {
-    TestDomainTreeNode* rbtnode;
-    const TestDomainTreeNode* crbtnode;
+    TestDomainTreeNode* dtnode;
+    const TestDomainTreeNode* cdtnode;
 
 
     // by default callback isn't enabled
     // by default callback isn't enabled
-    EXPECT_EQ(TestDomainTree::SUCCESS, rbtree.insert(mem_sgmt,
+    EXPECT_EQ(TestDomainTree::SUCCESS, dtree.insert(mem_sgmt,
                                                   Name("callback.example"),
                                                   Name("callback.example"),
-                                                  &rbtnode));
-    rbtnode->setData(new int(1));
-    EXPECT_FALSE(rbtnode->getFlag(TestDomainTreeNode::FLAG_CALLBACK));
+                                                  &dtnode));
+    dtnode->setData(new int(1));
+    EXPECT_FALSE(dtnode->getFlag(TestDomainTreeNode::FLAG_CALLBACK));
 
 
     // enable/re-disable callback
     // enable/re-disable callback
-    rbtnode->setFlag(TestDomainTreeNode::FLAG_CALLBACK);
-    EXPECT_TRUE(rbtnode->getFlag(TestDomainTreeNode::FLAG_CALLBACK));
-    rbtnode->setFlag(TestDomainTreeNode::FLAG_CALLBACK, false);
-    EXPECT_FALSE(rbtnode->getFlag(TestDomainTreeNode::FLAG_CALLBACK));
+    dtnode->setFlag(TestDomainTreeNode::FLAG_CALLBACK);
+    EXPECT_TRUE(dtnode->getFlag(TestDomainTreeNode::FLAG_CALLBACK));
+    dtnode->setFlag(TestDomainTreeNode::FLAG_CALLBACK, false);
+    EXPECT_FALSE(dtnode->getFlag(TestDomainTreeNode::FLAG_CALLBACK));
 
 
     // enable again for subsequent tests
     // enable again for subsequent tests
-    rbtnode->setFlag(TestDomainTreeNode::FLAG_CALLBACK);
+    dtnode->setFlag(TestDomainTreeNode::FLAG_CALLBACK);
     // add more levels below and above the callback node for partial match.
     // add more levels below and above the callback node for partial match.
-    TestDomainTreeNode* subrbtnode;
-    EXPECT_EQ(TestDomainTree::SUCCESS, rbtree.insert(mem_sgmt,
+    TestDomainTreeNode* subdtnode;
+    EXPECT_EQ(TestDomainTree::SUCCESS, dtree.insert(mem_sgmt,
                                                   Name("sub.callback.example"),
                                                   Name("sub.callback.example"),
-                                                  &subrbtnode));
-    subrbtnode->setData(new int(2));
-    TestDomainTreeNode* parentrbtnode;
-    EXPECT_EQ(TestDomainTree::ALREADYEXISTS, rbtree.insert(mem_sgmt,
+                                                  &subdtnode));
+    subdtnode->setData(new int(2));
+    TestDomainTreeNode* parentdtnode;
+    EXPECT_EQ(TestDomainTree::ALREADYEXISTS, dtree.insert(mem_sgmt,
                                                         Name("example"),
                                                         Name("example"),
-                                                        &parentrbtnode));
+                                                        &parentdtnode));
     // the child/parent nodes shouldn't "inherit" the callback flag.
     // the child/parent nodes shouldn't "inherit" the callback flag.
-    // "rbtnode" may be invalid due to the insertion, so we need to re-find
+    // "dtnode" may be invalid due to the insertion, so we need to re-find
     // it.
     // it.
-    EXPECT_EQ(TestDomainTree::EXACTMATCH, rbtree.find(Name("callback.example"),
-                                                   &rbtnode));
-    EXPECT_TRUE(rbtnode->getFlag(TestDomainTreeNode::FLAG_CALLBACK));
-    EXPECT_FALSE(subrbtnode->getFlag(TestDomainTreeNode::FLAG_CALLBACK));
-    EXPECT_FALSE(parentrbtnode->getFlag(TestDomainTreeNode::FLAG_CALLBACK));
+    EXPECT_EQ(TestDomainTree::EXACTMATCH, dtree.find(Name("callback.example"),
+                                                   &dtnode));
+    EXPECT_TRUE(dtnode->getFlag(TestDomainTreeNode::FLAG_CALLBACK));
+    EXPECT_FALSE(subdtnode->getFlag(TestDomainTreeNode::FLAG_CALLBACK));
+    EXPECT_FALSE(parentdtnode->getFlag(TestDomainTreeNode::FLAG_CALLBACK));
 
 
     // check if the callback is called from find()
     // check if the callback is called from find()
     TestDomainTreeNodeChain node_path1;
     TestDomainTreeNodeChain node_path1;
     bool callback_called = false;
     bool callback_called = false;
     EXPECT_EQ(TestDomainTree::EXACTMATCH,
     EXPECT_EQ(TestDomainTree::EXACTMATCH,
-              rbtree.find(name_called, &crbtnode, node_path1,
+              dtree.find(name_called, &cdtnode, node_path1,
                           testCallback, &callback_called));
                           testCallback, &callback_called));
     EXPECT_TRUE(callback_called);
     EXPECT_TRUE(callback_called);
 
 
     // enable callback at the parent node, but it doesn't have data so
     // enable callback at the parent node, but it doesn't have data so
     // the callback shouldn't be called.
     // the callback shouldn't be called.
     TestDomainTreeNodeChain node_path2;
     TestDomainTreeNodeChain node_path2;
-    parentrbtnode->setFlag(TestDomainTreeNode::FLAG_CALLBACK);
+    parentdtnode->setFlag(TestDomainTreeNode::FLAG_CALLBACK);
     callback_called = false;
     callback_called = false;
     EXPECT_EQ(TestDomainTree::EXACTMATCH,
     EXPECT_EQ(TestDomainTree::EXACTMATCH,
-              rbtree.find(name_not_called, &crbtnode, node_path2,
+              dtree.find(name_not_called, &cdtnode, node_path2,
                           testCallback, &callback_called));
                           testCallback, &callback_called));
     EXPECT_FALSE(callback_called);
     EXPECT_FALSE(callback_called);
 }
 }
@@ -404,7 +404,7 @@ TEST_F(DomainTreeTest, callbackName) {
     const Name n1("sub.callback.example");
     const Name n1("sub.callback.example");
     const Name n2("callback.example");
     const Name n2("callback.example");
 
 
-    performCallbackTest(rbtree, mem_sgmt_, n1, n2);
+    performCallbackTest(dtree, mem_sgmt_, n1, n2);
 }
 }
 
 
 TEST_F(DomainTreeTest, callbackLabelSequence) {
 TEST_F(DomainTreeTest, callbackLabelSequence) {
@@ -413,7 +413,7 @@ TEST_F(DomainTreeTest, callbackLabelSequence) {
     const LabelSequence ls1(n1);
     const LabelSequence ls1(n1);
     const LabelSequence ls2(n2);
     const LabelSequence ls2(n2);
 
 
-    performCallbackTest(rbtree, mem_sgmt_, ls1, ls2);
+    performCallbackTest(dtree, mem_sgmt_, ls1, ls2);
 }
 }
 
 
 TEST_F(DomainTreeTest, chainLevel) {
 TEST_F(DomainTreeTest, chainLevel) {
@@ -428,9 +428,9 @@ TEST_F(DomainTreeTest, chainLevel) {
     TestDomainTree& tree(*tree_holder.get());
     TestDomainTree& tree(*tree_holder.get());
     Name node_name(Name::ROOT_NAME());
     Name node_name(Name::ROOT_NAME());
     EXPECT_EQ(TestDomainTree::SUCCESS, tree.insert(mem_sgmt_, node_name,
     EXPECT_EQ(TestDomainTree::SUCCESS, tree.insert(mem_sgmt_, node_name,
-                                                &rbtnode));
+                                                &dtnode));
     EXPECT_EQ(TestDomainTree::EXACTMATCH,
     EXPECT_EQ(TestDomainTree::EXACTMATCH,
-              tree.find(node_name, &crbtnode, chain));
+              tree.find(node_name, &cdtnode, chain));
     EXPECT_EQ(1, chain.getLevelCount());
     EXPECT_EQ(1, chain.getLevelCount());
 
 
     /*
     /*
@@ -451,15 +451,15 @@ TEST_F(DomainTreeTest, chainLevel) {
     for (unsigned int i = 2; i <= Name::MAX_LABELS; ++i) {
     for (unsigned int i = 2; i <= Name::MAX_LABELS; ++i) {
         node_name = Name("a.").concatenate(node_name);
         node_name = Name("a.").concatenate(node_name);
         EXPECT_EQ(TestDomainTree::SUCCESS, tree.insert(mem_sgmt_, node_name,
         EXPECT_EQ(TestDomainTree::SUCCESS, tree.insert(mem_sgmt_, node_name,
-                                                    &rbtnode));
+                                                    &dtnode));
         TestDomainTreeNodeChain found_chain;
         TestDomainTreeNodeChain found_chain;
         EXPECT_EQ(TestDomainTree::EXACTMATCH,
         EXPECT_EQ(TestDomainTree::EXACTMATCH,
-                  tree.find(node_name, &crbtnode, found_chain));
+                  tree.find(node_name, &cdtnode, found_chain));
         EXPECT_EQ(i, found_chain.getLevelCount());
         EXPECT_EQ(i, found_chain.getLevelCount());
     }
     }
 
 
     // Confirm the last inserted name has the possible maximum length with
     // Confirm the last inserted name has the possible maximum length with
-    // maximum label count.  This confirms the rbtree and chain level cannot
+    // maximum label count.  This confirms the dtree and chain level cannot
     // be larger.
     // be larger.
     EXPECT_EQ(Name::MAX_LABELS, node_name.getLabelCount());
     EXPECT_EQ(Name::MAX_LABELS, node_name.getLabelCount());
     EXPECT_THROW(node_name.concatenate(Name("a.")), TooLongName);
     EXPECT_THROW(node_name.concatenate(Name("a.")), TooLongName);
@@ -506,7 +506,7 @@ TEST_F(DomainTreeTest, getUpperNode) {
     TestDomainTreeNodeChain node_path;
     TestDomainTreeNodeChain node_path;
     const TestDomainTreeNode* node = NULL;
     const TestDomainTreeNode* node = NULL;
     EXPECT_EQ(TestDomainTree::EXACTMATCH,
     EXPECT_EQ(TestDomainTree::EXACTMATCH,
-              rbtree_expose_empty_node.find(Name(names[0]),
+              dtree_expose_empty_node.find(Name(names[0]),
                                             &node,
                                             &node,
                                             node_path));
                                             node_path));
     for (int i = 0; i < name_count; ++i) {
     for (int i = 0; i < name_count; ++i) {
@@ -516,7 +516,7 @@ TEST_F(DomainTreeTest, getUpperNode) {
         if (upper_node_names[i] != NULL) {
         if (upper_node_names[i] != NULL) {
             const TestDomainTreeNode* upper_node2 = NULL;
             const TestDomainTreeNode* upper_node2 = NULL;
             EXPECT_EQ(TestDomainTree::EXACTMATCH,
             EXPECT_EQ(TestDomainTree::EXACTMATCH,
-                      rbtree_expose_empty_node.find(Name(upper_node_names[i]),
+                      dtree_expose_empty_node.find(Name(upper_node_names[i]),
                                                     &upper_node2));
                                                     &upper_node2));
             EXPECT_NE(static_cast<void*>(NULL), upper_node2);
             EXPECT_NE(static_cast<void*>(NULL), upper_node2);
             EXPECT_EQ(upper_node, upper_node2);
             EXPECT_EQ(upper_node, upper_node2);
@@ -524,7 +524,7 @@ TEST_F(DomainTreeTest, getUpperNode) {
             EXPECT_EQ(static_cast<void*>(NULL), upper_node);
             EXPECT_EQ(static_cast<void*>(NULL), upper_node);
         }
         }
 
 
-        node = rbtree_expose_empty_node.nextNode(node_path);
+        node = dtree_expose_empty_node.nextNode(node_path);
     }
     }
 
 
     // We should have reached the end of the tree.
     // We should have reached the end of the tree.
@@ -535,11 +535,11 @@ TEST_F(DomainTreeTest, nextNode) {
     TestDomainTreeNodeChain node_path;
     TestDomainTreeNodeChain node_path;
     const TestDomainTreeNode* node = NULL;
     const TestDomainTreeNode* node = NULL;
     EXPECT_EQ(TestDomainTree::EXACTMATCH,
     EXPECT_EQ(TestDomainTree::EXACTMATCH,
-              rbtree.find(Name(names[0]), &node, node_path));
+              dtree.find(Name(names[0]), &node, node_path));
     for (int i = 0; i < name_count; ++i) {
     for (int i = 0; i < name_count; ++i) {
         EXPECT_NE(static_cast<void*>(NULL), node);
         EXPECT_NE(static_cast<void*>(NULL), node);
         EXPECT_EQ(Name(names[i]), node_path.getAbsoluteName());
         EXPECT_EQ(Name(names[i]), node_path.getAbsoluteName());
-        node = rbtree.nextNode(node_path);
+        node = dtree.nextNode(node_path);
     }
     }
 
 
     // We should have reached the end of the tree.
     // We should have reached the end of the tree.
@@ -549,7 +549,7 @@ TEST_F(DomainTreeTest, nextNode) {
 // Just walk using previousNode until the beginning of the tree and check it is
 // Just walk using previousNode until the beginning of the tree and check it is
 // OK
 // OK
 //
 //
-// rbtree - the tree to walk
+// dtree - the tree to walk
 // node - result of previous call to find(), starting position of the walk
 // node - result of previous call to find(), starting position of the walk
 // node_path - the path from the previous call to find(), will be modified
 // node_path - the path from the previous call to find(), will be modified
 // chain_length - the number of names that should be in the chain to be walked
 // chain_length - the number of names that should be in the chain to be walked
@@ -560,7 +560,7 @@ TEST_F(DomainTreeTest, nextNode) {
 //   (true is for finds that return no match, false for the ones that return
 //   (true is for finds that return no match, false for the ones that return
 //   match)
 //   match)
 void
 void
-previousWalk(TestDomainTree& rbtree, const TestDomainTreeNode* node,
+previousWalk(TestDomainTree& dtree, const TestDomainTreeNode* node,
              TestDomainTreeNodeChain& node_path, size_t chain_length,
              TestDomainTreeNodeChain& node_path, size_t chain_length,
              bool skip_first)
              bool skip_first)
 {
 {
@@ -568,7 +568,7 @@ previousWalk(TestDomainTree& rbtree, const TestDomainTreeNode* node,
         // If the first is not found, this is supposed to be NULL and we skip
         // If the first is not found, this is supposed to be NULL and we skip
         // it in our checks.
         // it in our checks.
         EXPECT_EQ(static_cast<void*>(NULL), node);
         EXPECT_EQ(static_cast<void*>(NULL), node);
-        node = rbtree.previousNode(node_path);
+        node = dtree.previousNode(node_path);
     }
     }
     for (size_t i(chain_length); i > 0; --i) {
     for (size_t i(chain_length); i > 0; --i) {
         EXPECT_NE(static_cast<void*>(NULL), node);
         EXPECT_NE(static_cast<void*>(NULL), node);
@@ -581,10 +581,10 @@ previousWalk(TestDomainTree& rbtree, const TestDomainTreeNode* node,
             const TestDomainTreeNode* node2(NULL);
             const TestDomainTreeNode* node2(NULL);
             TestDomainTreeNodeChain node_path2;
             TestDomainTreeNodeChain node_path2;
             EXPECT_EQ(TestDomainTree::EXACTMATCH,
             EXPECT_EQ(TestDomainTree::EXACTMATCH,
-                      rbtree.find(Name(names[i - 1]), &node2, node_path2));
+                      dtree.find(Name(names[i - 1]), &node2, node_path2));
             EXPECT_EQ(node, node2);
             EXPECT_EQ(node, node2);
         }
         }
-        node = rbtree.previousNode(node_path);
+        node = dtree.previousNode(node_path);
     }
     }
 
 
     // We should have reached the start of the tree.
     // We should have reached the start of the tree.
@@ -592,12 +592,12 @@ previousWalk(TestDomainTree& rbtree, const TestDomainTreeNode* node,
     EXPECT_EQ(".", node->getLabels().toText());
     EXPECT_EQ(".", node->getLabels().toText());
 
 
     // With one more call it results in NULL
     // With one more call it results in NULL
-    node = rbtree.previousNode(node_path);
+    node = dtree.previousNode(node_path);
     EXPECT_EQ(static_cast<void*>(NULL), node);
     EXPECT_EQ(static_cast<void*>(NULL), node);
 
 
     // Calling previousNode() yet again should still return NULL without
     // Calling previousNode() yet again should still return NULL without
     // fail.
     // fail.
-    node = rbtree.previousNode(node_path);
+    node = dtree.previousNode(node_path);
     EXPECT_EQ(static_cast<void*>(NULL), node);
     EXPECT_EQ(static_cast<void*>(NULL), node);
 }
 }
 
 
@@ -605,14 +605,14 @@ previousWalk(TestDomainTree& rbtree, const TestDomainTreeNode* node,
 TEST_F(DomainTreeTest, previousNode) {
 TEST_F(DomainTreeTest, previousNode) {
     // First, iterate the whole tree from the end to the beginning.
     // First, iterate the whole tree from the end to the beginning.
     TestDomainTreeNodeChain node_path;
     TestDomainTreeNodeChain node_path;
-    EXPECT_THROW(rbtree.previousNode(node_path), isc::BadValue) <<
+    EXPECT_THROW(dtree.previousNode(node_path), isc::BadValue) <<
         "Throw before a search was done on the path";
         "Throw before a search was done on the path";
     const TestDomainTreeNode* node(NULL);
     const TestDomainTreeNode* node(NULL);
     {
     {
         SCOPED_TRACE("Iterate through");
         SCOPED_TRACE("Iterate through");
         EXPECT_EQ(TestDomainTree::EXACTMATCH,
         EXPECT_EQ(TestDomainTree::EXACTMATCH,
-                  rbtree.find(Name(names[name_count - 1]), &node, node_path));
-        previousWalk(rbtree, node, node_path, name_count, false);
+                  dtree.find(Name(names[name_count - 1]), &node, node_path));
+        previousWalk(dtree, node, node_path, name_count, false);
         node = NULL;
         node = NULL;
         node_path.clear();
         node_path.clear();
     }
     }
@@ -621,8 +621,8 @@ TEST_F(DomainTreeTest, previousNode) {
         SCOPED_TRACE("Iterate from the middle");
         SCOPED_TRACE("Iterate from the middle");
         // Now, start somewhere in the middle, but within the real node.
         // Now, start somewhere in the middle, but within the real node.
         EXPECT_EQ(TestDomainTree::EXACTMATCH,
         EXPECT_EQ(TestDomainTree::EXACTMATCH,
-                  rbtree.find(Name(names[4]), &node, node_path));
-        previousWalk(rbtree, node, node_path, 5, false);
+                  dtree.find(Name(names[4]), &node, node_path));
+        previousWalk(dtree, node, node_path, 5, false);
         node = NULL;
         node = NULL;
         node_path.clear();
         node_path.clear();
     }
     }
@@ -632,9 +632,9 @@ TEST_F(DomainTreeTest, previousNode) {
         // If we start at the lowest (which is "a"), we get to the beginning
         // If we start at the lowest (which is "a"), we get to the beginning
         // right away.
         // right away.
         EXPECT_EQ(TestDomainTree::EXACTMATCH,
         EXPECT_EQ(TestDomainTree::EXACTMATCH,
-                  rbtree.find(Name(names[0]), &node, node_path));
+                  dtree.find(Name(names[0]), &node, node_path));
         EXPECT_NE(static_cast<void*>(NULL), node);
         EXPECT_NE(static_cast<void*>(NULL), node);
-        node = rbtree.previousNode(node_path);
+        node = dtree.previousNode(node_path);
         ASSERT_NE(static_cast<void*>(NULL), node);
         ASSERT_NE(static_cast<void*>(NULL), node);
         EXPECT_EQ(".", node->getLabels().toText());
         EXPECT_EQ(".", node->getLabels().toText());
         node = NULL;
         node = NULL;
@@ -646,9 +646,9 @@ TEST_F(DomainTreeTest, previousNode) {
         // If we start before the lowest (. < 0. < a.), we should not get a
         // If we start before the lowest (. < 0. < a.), we should not get a
         // node.  Its previous node should be the root.
         // node.  Its previous node should be the root.
         EXPECT_EQ(TestDomainTree::NOTFOUND,
         EXPECT_EQ(TestDomainTree::NOTFOUND,
-                  rbtree.find<void*>(Name("0"), &node, node_path, NULL, NULL));
+                  dtree.find<void*>(Name("0"), &node, node_path, NULL, NULL));
         EXPECT_EQ(static_cast<void*>(NULL), node);
         EXPECT_EQ(static_cast<void*>(NULL), node);
-        node = rbtree.previousNode(node_path);
+        node = dtree.previousNode(node_path);
         ASSERT_NE(static_cast<void*>(NULL), node);
         ASSERT_NE(static_cast<void*>(NULL), node);
         EXPECT_EQ(".", node->getLabels().toText());
         EXPECT_EQ(".", node->getLabels().toText());
         node = NULL;
         node = NULL;
@@ -658,8 +658,8 @@ TEST_F(DomainTreeTest, previousNode) {
     {
     {
         SCOPED_TRACE("Start after the last");
         SCOPED_TRACE("Start after the last");
         EXPECT_EQ(TestDomainTree::NOTFOUND,
         EXPECT_EQ(TestDomainTree::NOTFOUND,
-                  rbtree.find(Name("z"), &node, node_path));
-        previousWalk(rbtree, node, node_path, name_count, true);
+                  dtree.find(Name("z"), &node, node_path));
+        previousWalk(dtree, node, node_path, name_count, true);
         node = NULL;
         node = NULL;
         node_path.clear();
         node_path.clear();
     }
     }
@@ -670,8 +670,8 @@ TEST_F(DomainTreeTest, previousNode) {
         // we exited - 'c' (actually, we should get it by the find, as partial
         // we exited - 'c' (actually, we should get it by the find, as partial
         // match).
         // match).
         EXPECT_EQ(TestDomainTree::PARTIALMATCH,
         EXPECT_EQ(TestDomainTree::PARTIALMATCH,
-                  rbtree.find(Name("b.c"), &node, node_path));
-        previousWalk(rbtree, node, node_path, 3, false);
+                  dtree.find(Name("b.c"), &node, node_path));
+        previousWalk(dtree, node, node_path, 3, false);
         node = NULL;
         node = NULL;
         node_path.clear();
         node_path.clear();
     }
     }
@@ -684,8 +684,8 @@ TEST_F(DomainTreeTest, previousNode) {
         // The d.e.f is empty node, so it is hidden by find. Therefore NOTFOUND
         // The d.e.f is empty node, so it is hidden by find. Therefore NOTFOUND
         // and not PARTIALMATCH.
         // and not PARTIALMATCH.
         EXPECT_EQ(TestDomainTree::NOTFOUND,
         EXPECT_EQ(TestDomainTree::NOTFOUND,
-                  rbtree.find(Name("xy.d.e.f"), &node, node_path));
-        previousWalk(rbtree, node, node_path, 5, true);
+                  dtree.find(Name("xy.d.e.f"), &node, node_path));
+        previousWalk(dtree, node, node_path, 5, true);
         node = NULL;
         node = NULL;
         node_path.clear();
         node_path.clear();
     }
     }
@@ -698,8 +698,8 @@ TEST_F(DomainTreeTest, previousNode) {
         // The d.e.f is empty node, so it is hidden by find. Therefore NOTFOUND
         // The d.e.f is empty node, so it is hidden by find. Therefore NOTFOUND
         // and not PARTIALMATCH.
         // and not PARTIALMATCH.
         EXPECT_EQ(TestDomainTree::NOTFOUND,
         EXPECT_EQ(TestDomainTree::NOTFOUND,
-                  rbtree.find(Name("yz.d.e.f"), &node, node_path));
-        previousWalk(rbtree, node, node_path, 9, true);
+                  dtree.find(Name("yz.d.e.f"), &node, node_path));
+        previousWalk(dtree, node, node_path, 9, true);
         node = NULL;
         node = NULL;
         node_path.clear();
         node_path.clear();
     }
     }
@@ -712,7 +712,7 @@ TEST_F(DomainTreeTest, previousNode) {
         // 'g.h' is an empty node, so we get a NOTFOUND and not
         // 'g.h' is an empty node, so we get a NOTFOUND and not
         // PARTIALMATCH.
         // PARTIALMATCH.
         EXPECT_EQ(TestDomainTree::NOTFOUND,
         EXPECT_EQ(TestDomainTree::NOTFOUND,
-                  rbtree.find(Name("x.h"), &node, node_path));
+                  dtree.find(Name("x.h"), &node, node_path));
         // 'g.h' is the COMMONANCESTOR.
         // 'g.h' is the COMMONANCESTOR.
         EXPECT_EQ(node_path.getLastComparedNode()->getName(), Name("g.h"));
         EXPECT_EQ(node_path.getLastComparedNode()->getName(), Name("g.h"));
         EXPECT_EQ(NameComparisonResult::COMMONANCESTOR,
         EXPECT_EQ(NameComparisonResult::COMMONANCESTOR,
@@ -721,7 +721,7 @@ TEST_F(DomainTreeTest, previousNode) {
         EXPECT_GT(node_path.getLastComparisonResult().getOrder(), 0);
         EXPECT_GT(node_path.getLastComparisonResult().getOrder(), 0);
         // We then descend into 'i.g.h' and walk all the nodes in the
         // We then descend into 'i.g.h' and walk all the nodes in the
         // tree.
         // tree.
-        previousWalk(rbtree, node, node_path, name_count, true);
+        previousWalk(dtree, node, node_path, name_count, true);
         node = NULL;
         node = NULL;
         node_path.clear();
         node_path.clear();
     }
     }
@@ -731,8 +731,8 @@ TEST_F(DomainTreeTest, previousNode) {
         // The d.e.f is a single node, but we want only part of it. We
         // The d.e.f is a single node, but we want only part of it. We
         // should start iterating before it.
         // should start iterating before it.
         EXPECT_EQ(TestDomainTree::NOTFOUND,
         EXPECT_EQ(TestDomainTree::NOTFOUND,
-                  rbtree.find(Name("e.f"), &node, node_path));
-        previousWalk(rbtree, node, node_path, 3, true);
+                  dtree.find(Name("e.f"), &node, node_path));
+        previousWalk(dtree, node, node_path, 3, true);
         node = NULL;
         node = NULL;
         node_path.clear();
         node_path.clear();
     }
     }
@@ -755,7 +755,7 @@ TEST_F(DomainTreeTest, previousNode) {
 TEST_F(DomainTreeTest, nextNodeError) {
 TEST_F(DomainTreeTest, nextNodeError) {
     // Empty chain for nextNode() is invalid.
     // Empty chain for nextNode() is invalid.
     TestDomainTreeNodeChain chain;
     TestDomainTreeNodeChain chain;
-    EXPECT_THROW(rbtree.nextNode(chain), BadValue);
+    EXPECT_THROW(dtree.nextNode(chain), BadValue);
 }
 }
 
 
 // A helper function for getLastComparedNode() below.
 // A helper function for getLastComparedNode() below.
@@ -778,7 +778,7 @@ comparisonChecks(const TestDomainTreeNodeChain& chain,
 }
 }
 
 
 TEST_F(DomainTreeTest, getLastComparedNode) {
 TEST_F(DomainTreeTest, getLastComparedNode) {
-    TestDomainTree& tree = rbtree_expose_empty_node; // use the "empty OK" mode
+    TestDomainTree& tree = dtree_expose_empty_node; // use the "empty OK" mode
     TestDomainTreeNodeChain chain;
     TestDomainTreeNodeChain chain;
 
 
     // initially there should be no 'last compared'.
     // initially there should be no 'last compared'.
@@ -788,7 +788,7 @@ TEST_F(DomainTreeTest, getLastComparedNode) {
     TreeHolder tree_holder(mem_sgmt_, TestDomainTree::create(mem_sgmt_));
     TreeHolder tree_holder(mem_sgmt_, TestDomainTree::create(mem_sgmt_));
     TestDomainTree& empty_tree(*tree_holder.get());
     TestDomainTree& empty_tree(*tree_holder.get());
     EXPECT_EQ(TestDomainTree::NOTFOUND,
     EXPECT_EQ(TestDomainTree::NOTFOUND,
-              empty_tree.find(Name("a"), &crbtnode, chain));
+              empty_tree.find(Name("a"), &cdtnode, chain));
     EXPECT_EQ(static_cast<void*>(NULL), chain.getLastComparedNode());
     EXPECT_EQ(static_cast<void*>(NULL), chain.getLastComparedNode());
     chain.clear();
     chain.clear();
 
 
@@ -807,7 +807,7 @@ TEST_F(DomainTreeTest, getLastComparedNode) {
     EXPECT_EQ(TestDomainTree::EXACTMATCH,
     EXPECT_EQ(TestDomainTree::EXACTMATCH,
               tree.find(Name("k.g.h"), &expected_node));
               tree.find(Name("k.g.h"), &expected_node));
     EXPECT_EQ(TestDomainTree::PARTIALMATCH,
     EXPECT_EQ(TestDomainTree::PARTIALMATCH,
-              tree.find(Name("x.k.g.h"), &crbtnode, chain));
+              tree.find(Name("x.k.g.h"), &cdtnode, chain));
     EXPECT_EQ(expected_node, chain.getLastComparedNode());
     EXPECT_EQ(expected_node, chain.getLastComparedNode());
     // k.g.h < x.k.g.h, 1 = # labels of "k"
     // k.g.h < x.k.g.h, 1 = # labels of "k"
     comparisonChecks(chain, 1, 1, NameComparisonResult::SUBDOMAIN);
     comparisonChecks(chain, 1, 1, NameComparisonResult::SUBDOMAIN);
@@ -818,7 +818,7 @@ TEST_F(DomainTreeTest, getLastComparedNode) {
     EXPECT_EQ(TestDomainTree::EXACTMATCH,
     EXPECT_EQ(TestDomainTree::EXACTMATCH,
               tree.find(Name("x.d.e.f"), &expected_node));
               tree.find(Name("x.d.e.f"), &expected_node));
     EXPECT_EQ(TestDomainTree::PARTIALMATCH,
     EXPECT_EQ(TestDomainTree::PARTIALMATCH,
-              tree.find(Name("a.d.e.f"), &crbtnode, chain));
+              tree.find(Name("a.d.e.f"), &cdtnode, chain));
     EXPECT_EQ(expected_node, chain.getLastComparedNode());
     EXPECT_EQ(expected_node, chain.getLastComparedNode());
     // a < x, no common labels
     // a < x, no common labels
     comparisonChecks(chain, -1, 0, NameComparisonResult::NONE);
     comparisonChecks(chain, -1, 0, NameComparisonResult::NONE);
@@ -829,7 +829,7 @@ TEST_F(DomainTreeTest, getLastComparedNode) {
     EXPECT_EQ(TestDomainTree::EXACTMATCH,
     EXPECT_EQ(TestDomainTree::EXACTMATCH,
               tree.find(Name("z.d.e.f"), &expected_node));
               tree.find(Name("z.d.e.f"), &expected_node));
     EXPECT_EQ(TestDomainTree::PARTIALMATCH,
     EXPECT_EQ(TestDomainTree::PARTIALMATCH,
-              tree.find(Name("zz.d.e.f"), &crbtnode, chain));
+              tree.find(Name("zz.d.e.f"), &cdtnode, chain));
     EXPECT_EQ(expected_node, chain.getLastComparedNode());
     EXPECT_EQ(expected_node, chain.getLastComparedNode());
     // zz > z, no common label
     // zz > z, no common label
     comparisonChecks(chain, 1, 0, NameComparisonResult::NONE);
     comparisonChecks(chain, 1, 0, NameComparisonResult::NONE);
@@ -840,7 +840,7 @@ TEST_F(DomainTreeTest, getLastComparedNode) {
     EXPECT_EQ(TestDomainTree::EXACTMATCH,
     EXPECT_EQ(TestDomainTree::EXACTMATCH,
               tree.find(Name("w.y.d.e.f"), &expected_node));
               tree.find(Name("w.y.d.e.f"), &expected_node));
     EXPECT_EQ(TestDomainTree::PARTIALMATCH,
     EXPECT_EQ(TestDomainTree::PARTIALMATCH,
-              tree.find(Name("y.d.e.f"), &crbtnode, chain));
+              tree.find(Name("y.d.e.f"), &cdtnode, chain));
     EXPECT_EQ(expected_node, chain.getLastComparedNode());
     EXPECT_EQ(expected_node, chain.getLastComparedNode());
     // y < w.y, 1 = # labels of "y"
     // y < w.y, 1 = # labels of "y"
     comparisonChecks(chain, -1, 1, NameComparisonResult::SUPERDOMAIN);
     comparisonChecks(chain, -1, 1, NameComparisonResult::SUPERDOMAIN);
@@ -850,7 +850,7 @@ TEST_F(DomainTreeTest, getLastComparedNode) {
     // with the search name in the subtree below the matching node.
     // with the search name in the subtree below the matching node.
     // (the expected node is the same as the previous case)
     // (the expected node is the same as the previous case)
     EXPECT_EQ(TestDomainTree::PARTIALMATCH,
     EXPECT_EQ(TestDomainTree::PARTIALMATCH,
-              tree.find(Name("z.y.d.e.f"), &crbtnode, chain));
+              tree.find(Name("z.y.d.e.f"), &cdtnode, chain));
     EXPECT_EQ(expected_node, chain.getLastComparedNode());
     EXPECT_EQ(expected_node, chain.getLastComparedNode());
     // z.y > w.y, 1 = # labels of "y"
     // z.y > w.y, 1 = # labels of "y"
     comparisonChecks(chain, 1, 1, NameComparisonResult::COMMONANCESTOR);
     comparisonChecks(chain, 1, 1, NameComparisonResult::COMMONANCESTOR);
@@ -860,7 +860,7 @@ TEST_F(DomainTreeTest, getLastComparedNode) {
     // branch. (find() still returns PARTIALMATCH due to the top level ".")
     // branch. (find() still returns PARTIALMATCH due to the top level ".")
     EXPECT_EQ(TestDomainTree::EXACTMATCH, tree.find(Name("c"), &expected_node));
     EXPECT_EQ(TestDomainTree::EXACTMATCH, tree.find(Name("c"), &expected_node));
     EXPECT_EQ(TestDomainTree::PARTIALMATCH,
     EXPECT_EQ(TestDomainTree::PARTIALMATCH,
-              tree.find(Name("bb"), &crbtnode, chain));
+              tree.find(Name("bb"), &cdtnode, chain));
     EXPECT_EQ(expected_node, chain.getLastComparedNode());
     EXPECT_EQ(expected_node, chain.getLastComparedNode());
     // bb < c, no common label
     // bb < c, no common label
     comparisonChecks(chain, -1, 0, NameComparisonResult::NONE);
     comparisonChecks(chain, -1, 0, NameComparisonResult::NONE);
@@ -869,7 +869,7 @@ TEST_F(DomainTreeTest, getLastComparedNode) {
     // Search stops in the highest level (under ".") after following a right
     // Search stops in the highest level (under ".") after following a right
     // branch. (the expected node is the same as the previous case)
     // branch. (the expected node is the same as the previous case)
     EXPECT_EQ(TestDomainTree::PARTIALMATCH,
     EXPECT_EQ(TestDomainTree::PARTIALMATCH,
-              tree.find(Name("d"), &crbtnode, chain));
+              tree.find(Name("d"), &cdtnode, chain));
     EXPECT_EQ(expected_node, chain.getLastComparedNode());
     EXPECT_EQ(expected_node, chain.getLastComparedNode());
     // d > c, no common label
     // d > c, no common label
     comparisonChecks(chain, 1, 0, NameComparisonResult::NONE);
     comparisonChecks(chain, 1, 0, NameComparisonResult::NONE);
@@ -879,7 +879,7 @@ TEST_F(DomainTreeTest, getLastComparedNode) {
 TEST_F(DomainTreeTest, dumpTree) {
 TEST_F(DomainTreeTest, dumpTree) {
     std::ostringstream str;
     std::ostringstream str;
     std::ostringstream str2;
     std::ostringstream str2;
-    rbtree.dumpTree(str);
+    dtree.dumpTree(str);
     str2 << "tree has 15 node(s)\n"
     str2 << "tree has 15 node(s)\n"
             ". (black) [invisible] [subtreeroot]\n"
             ". (black) [invisible] [subtreeroot]\n"
             "     begin down from .\n"
             "     begin down from .\n"
@@ -933,8 +933,8 @@ TEST_F(DomainTreeTest, dumpTree) {
 TEST_F(DomainTreeTest, swap) {
 TEST_F(DomainTreeTest, swap) {
     // Store info about the first tree
     // Store info about the first tree
     std::ostringstream str1;
     std::ostringstream str1;
-    rbtree.dumpTree(str1);
-    size_t count1(rbtree.getNodeCount());
+    dtree.dumpTree(str1);
+    size_t count1(dtree.getNodeCount());
 
 
     // Create second one and store state
     // Create second one and store state
     TreeHolder tree_holder(mem_sgmt_, TestDomainTree::create(mem_sgmt_));
     TreeHolder tree_holder(mem_sgmt_, TestDomainTree::create(mem_sgmt_));
@@ -945,15 +945,15 @@ TEST_F(DomainTreeTest, swap) {
     tree2.dumpTree(str2);
     tree2.dumpTree(str2);
 
 
     // Swap them
     // Swap them
-    ASSERT_NO_THROW(tree2.swap(rbtree));
+    ASSERT_NO_THROW(tree2.swap(dtree));
 
 
     // Check their sizes
     // Check their sizes
-    ASSERT_EQ(1, rbtree.getNodeCount());
+    ASSERT_EQ(1, dtree.getNodeCount());
     ASSERT_EQ(count1, tree2.getNodeCount());
     ASSERT_EQ(count1, tree2.getNodeCount());
 
 
     // And content
     // And content
     std::ostringstream out;
     std::ostringstream out;
-    rbtree.dumpTree(out);
+    dtree.dumpTree(out);
     ASSERT_EQ(str2.str(), out.str());
     ASSERT_EQ(str2.str(), out.str());
     out.str("");
     out.str("");
     tree2.dumpTree(out);
     tree2.dumpTree(out);
@@ -966,40 +966,40 @@ TEST_F(DomainTreeTest, swap) {
 TEST_F(DomainTreeTest, root) {
 TEST_F(DomainTreeTest, root) {
     TreeHolder tree_holder(mem_sgmt_, TestDomainTree::create(mem_sgmt_));
     TreeHolder tree_holder(mem_sgmt_, TestDomainTree::create(mem_sgmt_));
     TestDomainTree& root(*tree_holder.get());
     TestDomainTree& root(*tree_holder.get());
-    root.insert(mem_sgmt_, Name::ROOT_NAME(), &rbtnode);
-    rbtnode->setData(new int(1));
+    root.insert(mem_sgmt_, Name::ROOT_NAME(), &dtnode);
+    dtnode->setData(new int(1));
 
 
     EXPECT_EQ(TestDomainTree::EXACTMATCH,
     EXPECT_EQ(TestDomainTree::EXACTMATCH,
-              root.find(Name::ROOT_NAME(), &crbtnode));
-    EXPECT_EQ(rbtnode, crbtnode);
+              root.find(Name::ROOT_NAME(), &cdtnode));
+    EXPECT_EQ(dtnode, cdtnode);
     EXPECT_EQ(TestDomainTree::PARTIALMATCH,
     EXPECT_EQ(TestDomainTree::PARTIALMATCH,
-              root.find(Name("example.com"), &crbtnode));
-    EXPECT_EQ(rbtnode, crbtnode);
+              root.find(Name("example.com"), &cdtnode));
+    EXPECT_EQ(dtnode, cdtnode);
 
 
     // Insert a new name that better matches the query name.  find() should
     // Insert a new name that better matches the query name.  find() should
     // find the better one.
     // find the better one.
-    root.insert(mem_sgmt_, Name("com"), &rbtnode);
-    rbtnode->setData(new int(2));
+    root.insert(mem_sgmt_, Name("com"), &dtnode);
+    dtnode->setData(new int(2));
     EXPECT_EQ(TestDomainTree::PARTIALMATCH,
     EXPECT_EQ(TestDomainTree::PARTIALMATCH,
-              root.find(Name("example.com"), &crbtnode));
-    EXPECT_EQ(rbtnode, crbtnode);
+              root.find(Name("example.com"), &cdtnode));
+    EXPECT_EQ(dtnode, cdtnode);
 
 
     // Perform the same tests for the tree that allows matching against empty
     // Perform the same tests for the tree that allows matching against empty
     // nodes.
     // nodes.
     TreeHolder tree_holder_emptyok(mem_sgmt_,
     TreeHolder tree_holder_emptyok(mem_sgmt_,
                                    TestDomainTree::create(mem_sgmt_, true));
                                    TestDomainTree::create(mem_sgmt_, true));
     TestDomainTree& root_emptyok(*tree_holder_emptyok.get());
     TestDomainTree& root_emptyok(*tree_holder_emptyok.get());
-    root_emptyok.insert(mem_sgmt_, Name::ROOT_NAME(), &rbtnode);
+    root_emptyok.insert(mem_sgmt_, Name::ROOT_NAME(), &dtnode);
     EXPECT_EQ(TestDomainTree::EXACTMATCH,
     EXPECT_EQ(TestDomainTree::EXACTMATCH,
-              root_emptyok.find(Name::ROOT_NAME(), &crbtnode));
-    EXPECT_EQ(rbtnode, crbtnode);
+              root_emptyok.find(Name::ROOT_NAME(), &cdtnode));
+    EXPECT_EQ(dtnode, cdtnode);
     EXPECT_EQ(TestDomainTree::PARTIALMATCH,
     EXPECT_EQ(TestDomainTree::PARTIALMATCH,
-              root_emptyok.find(Name("example.com"), &crbtnode));
-    EXPECT_EQ(rbtnode, crbtnode);
+              root_emptyok.find(Name("example.com"), &cdtnode));
+    EXPECT_EQ(dtnode, cdtnode);
 
 
-    root.insert(mem_sgmt_, Name("com"), &rbtnode);
+    root.insert(mem_sgmt_, Name("com"), &dtnode);
     EXPECT_EQ(TestDomainTree::PARTIALMATCH,
     EXPECT_EQ(TestDomainTree::PARTIALMATCH,
-              root.find(Name("example.com"), &crbtnode));
-    EXPECT_EQ(rbtnode, crbtnode);
+              root.find(Name("example.com"), &cdtnode));
+    EXPECT_EQ(dtnode, cdtnode);
 }
 }
 }
 }