ConstElementPtr control_socket = mutable_cfg->get("control-socket");
if (control_socket) {
mutable_cfg->remove("control-socket");
- ElementPtr l = Element::createList();
+ ElementPtr l = Element::createList(control_socket->getPosition());
l->add(UserContext::toElement(control_socket));
mutable_cfg->set("control-sockets", l);
}
// Pass lease and response into addRelayAgentInfo().
ASSERT_THROW_MSG(LeaseQueryImpl4::addRelayAgentInfo(response, lease),
Unexpected, "Error creating relay-agent-info option:"
- " stringValue() called on non-string Element");
+ " stringValue() called on non-string Element in (<string>:1:32)");
// Verify relay-agent-info is not in the response
checkRelayAgentInfo(response, "");
if (!from) {
isc_throw(BadValue, "copy got a null pointer");
}
+
+ auto pos = from->getPosition();
int from_type = from->getType();
if (from_type == Element::integer) {
- return (ElementPtr(new IntElement(from->intValue())));
+ return (ElementPtr(new IntElement(from->intValue(), pos)));
} else if (from_type == Element::real) {
- return (ElementPtr(new DoubleElement(from->doubleValue())));
+ return (ElementPtr(new DoubleElement(from->doubleValue(), pos)));
} else if (from_type == Element::boolean) {
- return (ElementPtr(new BoolElement(from->boolValue())));
+ return (ElementPtr(new BoolElement(from->boolValue(), pos)));
} else if (from_type == Element::null) {
return (ElementPtr(new NullElement()));
} else if (from_type == Element::string) {
- return (ElementPtr(new StringElement(from->stringValue())));
+ return (ElementPtr(new StringElement(from->stringValue(), pos)));
} else if (from_type == Element::list) {
- ElementPtr result = ElementPtr(new ListElement());
+ ElementPtr result = ElementPtr(new ListElement(pos));
for (auto const& elem : from->listValue()) {
if (level == 0) {
result->add(elem);
}
return (result);
} else if (from_type == Element::map) {
- ElementPtr result = ElementPtr(new MapElement());
+ ElementPtr result = ElementPtr(new MapElement(pos));
for (auto const& kv : from->mapValue()) {
auto key = kv.first;
auto value = kv.second;
cfg->set("clients", clients_cfg);
EXPECT_NO_THROW(config.parse(cfg));
runToElementTest<BasicHttpAuthConfig>(cfg, config);
- std::cout << "TKM config: " << prettyPrint(config.toElement()) << std::endl;
// Check a working not empty config with files.
config.clear();