Commit 9964f279 authored by Jelte Jansen's avatar Jelte Jansen
Browse files

ok that should actually be an exception (also added test for that)


git-svn-id: svn://bind10.isc.org/svn/bind10/trunk@929 e5f2f494-b856-4b98-b285-d166d9295462
parent 008ae4d3
......@@ -31,7 +31,7 @@ find_spec_part(ElementPtr spec, const std::string& identifier)
{
//std::cout << "[XX] find_spec_part for " << identifier << std::endl;
if (!spec) {
return ElementPtr();
dns_throw(DataNotFoundError, "Empty specification");
}
//std::cout << "in: " << std::endl << spec << std::endl;
ElementPtr spec_part = spec;
......
......@@ -38,8 +38,8 @@ TEST(ConfigData, Creation) {
}
TEST(ConfigData, getValue) {
ModuleSpec spec2 = moduleSpecFromFile(std::string(TEST_DATA_PATH) + "/spec22.spec");
ConfigData cd = ConfigData(spec2);
ModuleSpec spec22 = moduleSpecFromFile(std::string(TEST_DATA_PATH) + "/spec22.spec");
ConfigData cd = ConfigData(spec22);
//std::cout << "[XX] SPEC2: " << cd.getModuleSpec().getFullSpec() << std::endl;
bool is_default;
//ElementPtr value = cd.getValue(is_default, "item1");
......@@ -74,6 +74,12 @@ TEST(ConfigData, getValue) {
EXPECT_THROW(cd.getValue("value6/a")->str(), DataNotFoundError);
EXPECT_THROW(cd.getValue("value6/no_such_item")->str(), DataNotFoundError);
EXPECT_THROW(cd.getValue("value8/a")->str(), DataNotFoundError);
EXPECT_THROW(cd.getValue("value8/a")->str(), DataNotFoundError);
EXPECT_THROW(cd.getValue("value8/a")->str(), DataNotFoundError);
ModuleSpec spec1 = moduleSpecFromFile(std::string(TEST_DATA_PATH) + "/spec1.spec");
ConfigData cd1 = ConfigData(spec1);
EXPECT_THROW(cd1.getValue("anything")->str(), DataNotFoundError);
}
TEST(ConfigData, setLocalConfig) {
......
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