Commit e84770a8 authored by Michal 'vorner' Vaner's avatar Michal 'vorner' Vaner Committed by JINMEI Tatuya
Browse files

[2292] Update tests

They don't need the mutable versions to work, but they used them anyway.
parent fa5076be
...@@ -256,8 +256,8 @@ TEST_F(DomainTreeTest, subTreeRoot) { ...@@ -256,8 +256,8 @@ TEST_F(DomainTreeTest, subTreeRoot) {
// "g.h" is not a subtree root // "g.h" is not a subtree root
EXPECT_EQ(TestDomainTree::EXACTMATCH, EXPECT_EQ(TestDomainTree::EXACTMATCH,
dtree_expose_empty_node.find(Name("g.h"), &dtnode)); dtree_expose_empty_node.find(Name("g.h"), &cdtnode));
EXPECT_FALSE(dtnode->getFlag(TestDomainTreeNode::FLAG_SUBTREE_ROOT)); EXPECT_FALSE(cdtnode->getFlag(TestDomainTreeNode::FLAG_SUBTREE_ROOT));
// fission the node "g.h" // fission the node "g.h"
EXPECT_EQ(TestDomainTree::ALREADYEXISTS, EXPECT_EQ(TestDomainTree::ALREADYEXISTS,
...@@ -270,8 +270,8 @@ TEST_F(DomainTreeTest, subTreeRoot) { ...@@ -270,8 +270,8 @@ TEST_F(DomainTreeTest, subTreeRoot) {
// "g.h" should be a subtree root now. // "g.h" should be a subtree root now.
EXPECT_EQ(TestDomainTree::EXACTMATCH, EXPECT_EQ(TestDomainTree::EXACTMATCH,
dtree_expose_empty_node.find(Name("g.h"), &dtnode)); dtree_expose_empty_node.find(Name("g.h"), &cdtnode));
EXPECT_TRUE(dtnode->getFlag(TestDomainTreeNode::FLAG_SUBTREE_ROOT)); EXPECT_TRUE(cdtnode->getFlag(TestDomainTreeNode::FLAG_SUBTREE_ROOT));
} }
TEST_F(DomainTreeTest, additionalNodeFission) { TEST_F(DomainTreeTest, additionalNodeFission) {
...@@ -286,8 +286,8 @@ TEST_F(DomainTreeTest, additionalNodeFission) { ...@@ -286,8 +286,8 @@ TEST_F(DomainTreeTest, additionalNodeFission) {
// "t.0" is not a subtree root // "t.0" is not a subtree root
EXPECT_EQ(TestDomainTree::EXACTMATCH, EXPECT_EQ(TestDomainTree::EXACTMATCH,
dtree_expose_empty_node.find(Name("t.0"), &dtnode)); dtree_expose_empty_node.find(Name("t.0"), &cdtnode));
EXPECT_FALSE(dtnode->getFlag(TestDomainTreeNode::FLAG_SUBTREE_ROOT)); EXPECT_FALSE(cdtnode->getFlag(TestDomainTreeNode::FLAG_SUBTREE_ROOT));
// fission the node "t.0" // fission the node "t.0"
EXPECT_EQ(TestDomainTree::ALREADYEXISTS, EXPECT_EQ(TestDomainTree::ALREADYEXISTS,
...@@ -300,8 +300,8 @@ TEST_F(DomainTreeTest, additionalNodeFission) { ...@@ -300,8 +300,8 @@ TEST_F(DomainTreeTest, additionalNodeFission) {
// "t.0" should be a subtree root now. // "t.0" should be a subtree root now.
EXPECT_EQ(TestDomainTree::EXACTMATCH, EXPECT_EQ(TestDomainTree::EXACTMATCH,
dtree_expose_empty_node.find(Name("t.0"), &dtnode)); dtree_expose_empty_node.find(Name("t.0"), &cdtnode));
EXPECT_TRUE(dtnode->getFlag(TestDomainTreeNode::FLAG_SUBTREE_ROOT)); EXPECT_TRUE(cdtnode->getFlag(TestDomainTreeNode::FLAG_SUBTREE_ROOT));
} }
TEST_F(DomainTreeTest, findName) { TEST_F(DomainTreeTest, findName) {
...@@ -328,10 +328,10 @@ TEST_F(DomainTreeTest, findName) { ...@@ -328,10 +328,10 @@ TEST_F(DomainTreeTest, findName) {
EXPECT_EQ(TestDomainTree::PARTIALMATCH, EXPECT_EQ(TestDomainTree::PARTIALMATCH,
dtree_expose_empty_node.find(Name("m.d.e.f"), &cdtnode)); dtree_expose_empty_node.find(Name("m.d.e.f"), &cdtnode));
// find dtnode // find cdtnode
EXPECT_EQ(TestDomainTree::EXACTMATCH, dtree.find(Name("q.w.y.d.e.f"), EXPECT_EQ(TestDomainTree::EXACTMATCH, dtree.find(Name("q.w.y.d.e.f"),
&dtnode)); &cdtnode));
EXPECT_EQ(Name("q"), dtnode->getName()); EXPECT_EQ(Name("q"), cdtnode->getName());
} }
TEST_F(DomainTreeTest, findError) { TEST_F(DomainTreeTest, findError) {
...@@ -411,11 +411,11 @@ performCallbackTest(TestDomainTree& dtree, ...@@ -411,11 +411,11 @@ performCallbackTest(TestDomainTree& dtree,
Name("example"), Name("example"),
&parentdtnode)); &parentdtnode));
// the child/parent nodes shouldn't "inherit" the callback flag. // the child/parent nodes shouldn't "inherit" the callback flag.
// "dtnode" may be invalid due to the insertion, so we need to re-find // "cdtnode" may be invalid due to the insertion, so we need to re-find
// it. // it.
EXPECT_EQ(TestDomainTree::EXACTMATCH, dtree.find(Name("callback.example"), EXPECT_EQ(TestDomainTree::EXACTMATCH, dtree.find(Name("callback.example"),
&dtnode)); &cdtnode));
EXPECT_TRUE(dtnode->getFlag(TestDomainTreeNode::FLAG_CALLBACK)); EXPECT_TRUE(cdtnode->getFlag(TestDomainTreeNode::FLAG_CALLBACK));
EXPECT_FALSE(subdtnode->getFlag(TestDomainTreeNode::FLAG_CALLBACK)); EXPECT_FALSE(subdtnode->getFlag(TestDomainTreeNode::FLAG_CALLBACK));
EXPECT_FALSE(parentdtnode->getFlag(TestDomainTreeNode::FLAG_CALLBACK)); EXPECT_FALSE(parentdtnode->getFlag(TestDomainTreeNode::FLAG_CALLBACK));
......
...@@ -108,7 +108,7 @@ void ...@@ -108,7 +108,7 @@ void
checkFindRdataSet(const ZoneTree& tree, const Name& name, RRType type, checkFindRdataSet(const ZoneTree& tree, const Name& name, RRType type,
const RdataSet* expected_set) const RdataSet* expected_set)
{ {
ZoneNode* node = NULL; const ZoneNode* node = NULL;
tree.find(name, &node); tree.find(name, &node);
ASSERT_NE(static_cast<ZoneNode*>(NULL), node); ASSERT_NE(static_cast<ZoneNode*>(NULL), node);
EXPECT_EQ(expected_set, RdataSet::find(node->getData(), type)); EXPECT_EQ(expected_set, RdataSet::find(node->getData(), type));
......
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