Commit 61e7f493 authored by Jelte Jansen's avatar Jelte Jansen

[trac471] address review comments

parent 13a3fcfa
......@@ -584,11 +584,6 @@ Resolver::updateConfig(ConstElementPtr config) {
}
}
void
Resolver::setConfigured() {
configured_ = true;
}
void
Resolver::setForwardAddresses(const AddressList& addresses)
{
......
......@@ -119,11 +119,11 @@ public:
asiolink::SimpleCallback* getCheckinProvider() { return (checkin_); }
/**
* \brief Tell the Resolver that is should has already been
* configured (used by updateConfig() and tests, so
* that it will only set some defaults the first time
* \brief Tell the Resolver that is has already been configured
* so that it will only set some defaults the first time
* (used by updateConfig() and tests)
*/
void setConfigured();
void setConfigured() { configured_ = true; };
/**
* \brief Specify the list of upstream servers.
......
......@@ -373,19 +373,17 @@ ModuleSpec::validateSpecList(ConstElementPtr spec, ConstElementPtr data,
BOOST_FOREACH(maptype m, data->mapValue()) {
bool found = false;
// Ignore 'version' as a config element
if (m.first.compare("version") == 0) {
found = true;
} else {
if (m.first.compare("version") != 0) {
BOOST_FOREACH(ConstElementPtr cur_spec_el, spec->listValue()) {
if (cur_spec_el->get("item_name")->stringValue().compare(m.first) == 0) {
found = true;
}
}
}
if (!found) {
validated = false;
if (errors) {
errors->add(Element::create("Unknown item " + m.first));
if (!found) {
validated = false;
if (errors) {
errors->add(Element::create("Unknown item " + m.first));
}
}
}
}
......
......@@ -162,6 +162,10 @@ TEST(ModuleSpec, DataValidation) {
EXPECT_FALSE(dataTest(dd, "data22_8.data"));
EXPECT_FALSE(dataTest(dd, "data22_9.data"));
// Test if "version" is allowed in config data
// (same data as 22_7, but added "version")
EXPECT_TRUE(dataTest(dd, "data22_10.data"));
ElementPtr errors = Element::createList();
EXPECT_FALSE(dataTestWithErrors(dd, "data22_8.data", errors));
EXPECT_EQ("[ \"Type mismatch\" ]", errors->str());
......
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