Commit 9e8813ef authored by Michal 'vorner' Vaner's avatar Michal 'vorner' Vaner
Browse files

[2377] Reject load incremental of 0 RRs

As it makes little sense.
parent 85c5f472
......@@ -108,6 +108,9 @@ public:
bool
MasterLoader::MasterLoaderImpl::loadIncremental(size_t count_limit) {
if (count_limit == 0) {
isc_throw(isc::InvalidParameter, "Count limit set to 0");
}
if (complete_) {
isc_throw(isc::InvalidOperation,
"Trying to load when already loaded");
......
......@@ -299,4 +299,12 @@ TEST_F(MasterLoaderTest, loadTwice) {
loader_->load();
EXPECT_THROW(loader_->load(), isc::InvalidOperation);
}
// Load 0 items should be rejected
TEST_F(MasterLoaderTest, loadZero) {
setLoader(TEST_DATA_SRCDIR "/example.org", Name("example.org."),
RRClass::IN(), MasterLoader::MANY_ERRORS);
EXPECT_THROW(loader_->loadIncremental(0), isc::InvalidParameter);
}
}
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