Commit 51580fd1 authored by Michal 'vorner' Vaner's avatar Michal 'vorner' Vaner
Browse files

[2207] Tests for the getZoneReloader

parent c55218e6
......@@ -13,8 +13,14 @@
// PERFORMANCE OF THIS SOFTWARE.
#include <datasrc/memory/zone_table_segment.h>
#include <datasrc/memory/zone_reloader.h>
#include <gtest/gtest.h>
#include <boost/scoped_ptr.hpp>
using boost::scoped_ptr;
using isc::dns::Name;
using isc::dns::RRClass;
using namespace isc::datasrc::memory;
using namespace isc::data;
using namespace isc::util;
......@@ -80,4 +86,22 @@ TEST_F(ZoneTableSegmentTest, getMemorySegment) {
EXPECT_TRUE(mem_sgmt.allMemoryDeallocated());
}
ZoneData*
load_action(MemorySegment&) {
// The function won't be called, so this is OK
return (NULL);
}
// Test we can get a reloader.
TEST_F(ZoneTableSegmentTest, getZoneReloader) {
scoped_ptr<ZoneReloader>
reloader(segment_->getZoneReloader(load_action, Name("example.org"),
RRClass::IN()));
// We have to get something
EXPECT_NE(static_cast<void*>(NULL), reloader.get());
// And for now, it should be the local reloader
EXPECT_NE(static_cast<void*>(NULL),
dynamic_cast<ZoneReloaderLocal*>(reloader.get()));
}
} // anonymous namespace
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