return (sn6ptr);
}
+// Unused?
void
Subnet6ConfigParser::duplicate_option_warning(uint32_t code,
asiolink::IOAddress& addr) {
DUIDConfigParser::parse(const CfgDUIDPtr& cfg,
isc::data::ConstElementPtr duid_configuration) {
if (!cfg) {
+ // Sanity check
isc_throw(DhcpConfigError, "Must provide valid pointer to cfg when parsing duid");
}
std::pair<OptionDescriptor, std::string> opt = createOption(single_option);
if (!opt.first.option_) {
+ // Should never happen (@todo: update message)
isc_throw(isc::InvalidOperation,
"parser logic error: no option has been configured and"
" thus there is nothing to commit. Has build() been called?");
cfg.runCfgOptionsTest(family_, expected);
}
+/// @brief Check parsing of unknown options fails.
+TEST_F(ParseConfigTest, unknownOptionDataTest) {
+
+ // Configuration string.
+ std::string config =
+ "{ \"option-data\": [ {"
+ " \"name\": \"foo\","
+ " \"data\": \"01\","
+ " \"space\": \"bar\""
+ " } ]"
+ "}";
+
+ // Verify that the configuration string does not parse.
+ int rcode = parseConfiguration(config, true);
+ ASSERT_NE(0, rcode);
+}
+
/// @brief Check parsing of options with invalid space fails.
TEST_F(ParseConfigTest, badSpaceOptionDataTest) {