shared_ptr<InMemoryClient>());
}
shared_ptr<TestedList> list_;
- const ClientList::FindResult negativeResult_;
+ const ClientList::FindResult negative_result_;
vector<shared_ptr<MockDataSourceClient> > ds_;
vector<ConfigurableClientList::DataSourceInfo> ds_info_;
const ConstElementPtr config_elem_, config_elem_zones_;
EXPECT_EQ(result::NOTFOUND, ds_[0]->findZone(Name("zzz")).code);
// Nothing to keep alive here.
EXPECT_EQ(shared_ptr<ClientList::FindResult::LifeKeeper>(),
- negativeResult_.life_keeper_);
+ negative_result_.life_keeper_);
}
// Test the list we create with empty configuration is, in fact, empty
// Note: we don't have operator<< for the result class, so we cannot use
// EXPECT_EQ. Same for other similar cases.
- EXPECT_TRUE(negativeResult_ == list_->find(Name("example.org"), false,
- false));
- EXPECT_TRUE(negativeResult_ == list_->find(Name("example.org"), false,
- true));
- EXPECT_TRUE(negativeResult_ == list_->find(Name("example.org"), true,
- false));
- EXPECT_TRUE(negativeResult_ == list_->find(Name("example.org"), true,
- true));
+ EXPECT_TRUE(negative_result_ == list_->find(Name("example.org"), false,
+ false));
+ EXPECT_TRUE(negative_result_ == list_->find(Name("example.org"), false,
+ true));
+ EXPECT_TRUE(negative_result_ == list_->find(Name("example.org"), true,
+ false));
+ EXPECT_TRUE(negative_result_ == list_->find(Name("example.org"), true,
+ true));
}
// Put a single data source inside the list and check it can find an
TEST_F(ListTest, singleDSExactMatch) {
list_->getDataSources().push_back(ds_info_[0]);
// This zone is not there
- EXPECT_TRUE(negativeResult_ == list_->find(Name("org."), true));
+ EXPECT_TRUE(negative_result_ == list_->find(Name("org."), true));
// But this one is, so check it.
positiveResult(list_->find(Name("example.org"), true), ds_[0],
Name("example.org"), true, "Exact match");
// When asking for a sub zone of a zone there, we get nothing
// (we want exact match, this would be partial one)
- EXPECT_TRUE(negativeResult_ == list_->find(Name("sub.example.org."),
- true));
+ EXPECT_TRUE(negative_result_ == list_->find(Name("sub.example.org."),
+ true));
}
// When asking for a partial match, we get all that the exact one, but more.
TEST_F(ListTest, singleDSBestMatch) {
list_->getDataSources().push_back(ds_info_[0]);
// This zone is not there
- EXPECT_TRUE(negativeResult_ == list_->find(Name("org.")));
+ EXPECT_TRUE(negative_result_ == list_->find(Name("org.")));
// But this one is, so check it.
positiveResult(list_->find(Name("example.org")), ds_[0],
Name("example.org"), true, "Exact match");
SCOPED_TRACE(test_names[i]);
multiConfiguration(i);
// Something that is nowhere there
- EXPECT_TRUE(negativeResult_ == list_->find(Name("org."), true));
+ EXPECT_TRUE(negative_result_ == list_->find(Name("org."), true));
// This one is there exactly.
positiveResult(list_->find(Name("example.org"), true), ds_[0],
Name("example.org"), true, "Exact match");
positiveResult(list_->find(Name("sub.example.org."), true), ds_[1],
Name("sub.example.org"), true, "Subdomain match");
// But this one is in neither data source.
- EXPECT_TRUE(negativeResult_ ==
+ EXPECT_TRUE(negative_result_ ==
list_->find(Name("sub.example.com."), true));
}
}
SCOPED_TRACE(test_names[i]);
multiConfiguration(i);
// Something that is nowhere there
- EXPECT_TRUE(negativeResult_ == list_->find(Name("org.")));
+ EXPECT_TRUE(negative_result_ == list_->find(Name("org.")));
// This one is there exactly.
positiveResult(list_->find(Name("example.org")), ds_[0],
Name("example.org"), true, "Exact match");
positiveResult(list_->find(Name("sub.example.com.")), ds_[0],
Name("example.com."), false, "Subdomain of com", true);
// For now, the ones not cached are ignored.
- EXPECT_TRUE(negativeResult_ == list_->find(Name("example.cz.")));
+ EXPECT_TRUE(negative_result_ == list_->find(Name("example.cz.")));
}
// Check the caching handles misbehaviour from the data source and
positiveResult(list_->find(Name("example.com."), true), ds_[0],
Name("example.com."), true, "example.com", true);
- EXPECT_EQ(negativeResult_, list_->find(Name("example.org."), true));
- EXPECT_EQ(negativeResult_, list_->find(Name("foo.bar"), true));
+ EXPECT_TRUE(negative_result_ == list_->find(Name("example.org."), true));
+ EXPECT_TRUE(negative_result_ == list_->find(Name("foo.bar"), true));
positiveResult(list_->find(Name(".")), ds_[0], Name("."), true, "root",
true);
}