Fixed minor comments, updated error text in two UTs.
new file: changelog_unreleased/3659-enable-lease-caching-as-default
modified: src/lib/dhcpsrv/tests/cfg_subnets4_unittest.cc
modified: src/lib/dhcpsrv/tests/cfg_subnets6_unittest.cc
modified: src/lib/testutils/test_to_element.cc
modified: src/lib/testutils/test_to_element.h
--- /dev/null
+[func]* tmark
+ Lease caching is now enabled by default. The default
+ value for ``cache-threshold`` is 0.25,``cache-max-age``
+ is left unspecified. It may be disabled at the desired
+ scope either by setting ``cache-threshold`` to 0.0 or
+ setting ``cache-max-age`` to 0.
+ (Gitlab #3659)
{"valid", 0.0, ""},
{"negative", -.25,
"subnet configuration failed: cache-threshold:"
- " -0.25 is invalid, it must be greater than 0.0 and less than 1.0"
+ " -0.25 is invalid, it must be greater than or equal to 0.0 and less than 1.0"
},
{"too big", 1.05,
"subnet configuration failed: cache-threshold:"
- " 1.05 is invalid, it must be greater than 0.0 and less than 1.0"
+ " 1.05 is invalid, it must be greater than or equal to 0.0 and less than 1.0"
}
};
{"valid", 0.0, ""},
{"negative", -.25,
"subnet configuration failed: cache-threshold:"
- " -0.25 is invalid, it must be greater than 0.0 and less than 1.0"
+ " -0.25 is invalid, it must be greater than or equal to 0.0 and less than 1.0"
},
{"too big", 1.05,
"subnet configuration failed: cache-threshold:"
- " 1.05 is invalid, it must be greater than 0.0 and less than 1.0"
+ " 1.05 is invalid, it must be greater than or equal to 0.0 and less than 1.0"
}
};
<< generateDiff(pretty_print_a, pretty_print_b) << endl;
}
+void assertEqWithDiff(ElementPtr const& a, ConstElementPtr const& b) {
+ ASSERT_TRUE(a);
+ ASSERT_TRUE(b);
+ string const pretty_print_a(prettyPrint(a));
+ string const pretty_print_b(prettyPrint(b));
+ ASSERT_EQ(pretty_print_a, pretty_print_b)
+ << endl
+ << "Diff:" << endl
+ << generateDiff(pretty_print_a, pretty_print_b) << endl;
+}
#ifdef HAVE_CREATE_UNIFIED_DIFF
string generateDiff(string left, string right) {
void
assertEqWithDiff(isc::data::ConstElementPtr const& left, isc::data::ConstElementPtr const& right);
+
+void
+assertEqWithDiff(isc::data::ElementPtr const& left, isc::data::ConstElementPtr const& right);
/// @}
/// @brief Return the difference between two strings