// and the need_updater parameter is true, get the zone there.
}
-void
+bool
ConfigurableClientList::resetMemorySegment
(const std::string& datasrc_name,
ZoneTableSegment::MemorySegmentOpenMode mode,
if (info.name_ == datasrc_name) {
ZoneTableSegment& segment = *info.ztable_segment_;
segment.reset(mode, config_params);
- break;
+ return true;
}
}
+ return false;
}
ConfigurableClientList::ZoneWriterPair
/// \param datasrc_name The name of the data source whose segment to reset
/// \param mode The open mode for the new memory segment
/// \param config_params The configuration for the new memory segment.
- void resetMemorySegment
+ /// \return If the data source was found and reset.
+ bool resetMemorySegment
(const std::string& datasrc_name,
memory::ZoneTableSegment::MemorySegmentOpenMode mode,
isc::data::ConstElementPtr config_params);
const std::string& datasrc_name,
ZoneTableSegment::MemorySegmentOpenMode mode,
ConstElementPtr config_params) {
- list.resetMemorySegment(datasrc_name, mode, config_params);
+ EXPECT_TRUE(list.resetMemorySegment(datasrc_name, mode,
+ config_params));
}
virtual std::string getType() {
return ("mapped");
#endif
+// Calling reset on empty list finds no data and returns false.
+TEST_P(ListTest, emptyReset) {
+ EXPECT_FALSE(list_->resetMemorySegment("Something",
+ memory::ZoneTableSegment::CREATE,
+ Element::create()));
+}
+
// Test the test itself
TEST_P(ListTest, selfTest) {
EXPECT_EQ(result::SUCCESS, ds_[0]->findZone(Name("example.org")).code);