BIND 10 trac2108_3, updated. 9d1a6c855efa69033fce89cd1d9c640757324696 [2108] Add the outline of a memory client test file
BIND 10 source code commits
bind10-changes at lists.isc.org
Wed Sep 5 11:31:37 UTC 2012
The branch, trac2108_3 has been updated
via 9d1a6c855efa69033fce89cd1d9c640757324696 (commit)
via 31a1014180ca193b7bf27c754974fc6166ad648e (commit)
via cc90d4ea448ab2297fb80ef8880601020ad4a885 (commit)
via f573cd7f9148766399605dec1b6b42852095bc63 (commit)
from 8b1a6f28fc6238001d66d8aa16348efb7dfd14e1 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 9d1a6c855efa69033fce89cd1d9c640757324696
Author: Mukund Sivaraman <muks at isc.org>
Date: Wed Sep 5 17:00:39 2012 +0530
[2108] Add the outline of a memory client test file
commit 31a1014180ca193b7bf27c754974fc6166ad648e
Author: Mukund Sivaraman <muks at isc.org>
Date: Wed Sep 5 16:56:28 2012 +0530
[2108] Add the ZoneIterator for the memory client
commit cc90d4ea448ab2297fb80ef8880601020ad4a885
Author: Mukund Sivaraman <muks at isc.org>
Date: Wed Sep 5 16:55:54 2012 +0530
[2108] Add another typedef in ZoneData class
commit f573cd7f9148766399605dec1b6b42852095bc63
Author: Mukund Sivaraman <muks at isc.org>
Date: Wed Sep 5 16:55:39 2012 +0530
[2108] Add log messages related parts in lib/datasrc/memory
-----------------------------------------------------------------------
Summary of changes:
src/lib/datasrc/memory/.gitignore | 2 +
src/lib/datasrc/memory/Makefile.am | 12 ++-
src/lib/{asiodns => datasrc/memory}/logger.cc | 10 +--
src/lib/datasrc/{ => memory}/logger.h | 30 ++++---
src/lib/datasrc/memory/memory_client.cc | 90 +++++++++-----------
src/lib/datasrc/memory/memory_messages.mes | 90 ++++++++++++++++++++
src/lib/datasrc/memory/tests/Makefile.am | 2 +
.../datasrc/memory/tests/memory_client_unittest.cc | 63 ++++++++++++++
src/lib/datasrc/memory/zone_data.h | 1 +
9 files changed, 234 insertions(+), 66 deletions(-)
create mode 100644 src/lib/datasrc/memory/.gitignore
copy src/lib/{asiodns => datasrc/memory}/logger.cc (87%)
copy src/lib/datasrc/{ => memory}/logger.h (66%)
create mode 100644 src/lib/datasrc/memory/memory_messages.mes
create mode 100644 src/lib/datasrc/memory/tests/memory_client_unittest.cc
-----------------------------------------------------------------------
diff --git a/src/lib/datasrc/memory/.gitignore b/src/lib/datasrc/memory/.gitignore
new file mode 100644
index 0000000..fbb6381
--- /dev/null
+++ b/src/lib/datasrc/memory/.gitignore
@@ -0,0 +1,2 @@
+/memory_messages.cc
+/memory_messages.h
diff --git a/src/lib/datasrc/memory/Makefile.am b/src/lib/datasrc/memory/Makefile.am
index 9a854cd..d34633d 100644
--- a/src/lib/datasrc/memory/Makefile.am
+++ b/src/lib/datasrc/memory/Makefile.am
@@ -6,7 +6,7 @@ AM_CPPFLAGS += $(BOOST_INCLUDES)
AM_CXXFLAGS = $(B10_CXXFLAGS)
-CLEANFILES = *.gcno *.gcda datasrc_messages.h datasrc_messages.cc
+CLEANFILES = *.gcno *.gcda
noinst_LTLIBRARIES = libdatasrc_memory.la
@@ -17,4 +17,14 @@ libdatasrc_memory_la_SOURCES += rdata_serialization.h rdata_serialization.cc
libdatasrc_memory_la_SOURCES += zone_data.h zone_data.cc
libdatasrc_memory_la_SOURCES += zone_table.h zone_table.cc
libdatasrc_memory_la_SOURCES += memory_client.h memory_client.cc
+libdatasrc_memory_la_SOURCES += logger.h logger.cc
+nodist_libdatasrc_memory_la_SOURCES = memory_messages.h memory_messages.cc
+
EXTRA_DIST = rdata_serialization_priv.cc
+
+BUILT_SOURCES = memory_messages.h memory_messages.cc
+memory_messages.h memory_messages.cc: Makefile memory_messages.mes
+ $(top_builddir)/src/lib/log/compiler/message $(top_srcdir)/src/lib/datasrc/memory/memory_messages.mes
+
+EXTRA_DIST += memory_messages.mes
+CLEANFILES += memory_messages.h memory_messages.cc
diff --git a/src/lib/datasrc/memory/logger.cc b/src/lib/datasrc/memory/logger.cc
new file mode 100644
index 0000000..59c93bf
--- /dev/null
+++ b/src/lib/datasrc/memory/logger.cc
@@ -0,0 +1,25 @@
+// Copyright (C) 2012 Internet Systems Consortium, Inc. ("ISC")
+//
+// Permission to use, copy, modify, and/or distribute this software for any
+// purpose with or without fee is hereby granted, provided that the above
+// copyright notice and this permission notice appear in all copies.
+//
+// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+// AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+// PERFORMANCE OF THIS SOFTWARE.
+
+#include <datasrc/memory/logger.h>
+
+namespace isc {
+namespace datasrc {
+namespace memory {
+
+isc::log::Logger logger("datasrc_memory");
+
+}
+}
+}
diff --git a/src/lib/datasrc/memory/logger.h b/src/lib/datasrc/memory/logger.h
new file mode 100644
index 0000000..554ba7b
--- /dev/null
+++ b/src/lib/datasrc/memory/logger.h
@@ -0,0 +1,52 @@
+// Copyright (C) 2012 Internet Systems Consortium, Inc. ("ISC")
+//
+// Permission to use, copy, modify, and/or distribute this software for any
+// purpose with or without fee is hereby granted, provided that the above
+// copyright notice and this permission notice appear in all copies.
+//
+// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+// AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+// PERFORMANCE OF THIS SOFTWARE.
+
+#ifndef DATASRC_MEMORY_LOGGER_H
+#define DATASRC_MEMORY_LOGGER_H
+
+#include <log/macros.h>
+#include <datasrc/memory/memory_messages.h>
+
+/// \file datasrc/memory/logger.h
+/// \brief Data Source memory library global logger
+///
+/// This holds the logger for the data source memory library. It is a
+/// private header and should not be included in any publicly used
+/// header, only in local cc files.
+
+namespace isc {
+namespace datasrc {
+namespace memory {
+
+/// \brief The logger for this library
+extern isc::log::Logger logger;
+
+/// \brief Trace basic operations
+const int DBG_TRACE_BASIC = DBGLVL_TRACE_BASIC;
+
+/// \brief Trace data changes and lookups as well
+const int DBG_TRACE_DATA = DBGLVL_TRACE_BASIC_DATA;
+
+/// \brief Detailed even about how the lookups happen
+const int DBG_TRACE_DETAILED = DBGLVL_TRACE_DETAIL;
+
+} // namespace memory
+} // namespace datasrc
+} // namespace isc
+
+#endif // DATASRC_MEMORY_LOGGER_H
+
+// Local Variables:
+// mode: c++
+// End:
diff --git a/src/lib/datasrc/memory/memory_client.cc b/src/lib/datasrc/memory/memory_client.cc
index 7aab10c..faa7b2d 100644
--- a/src/lib/datasrc/memory/memory_client.cc
+++ b/src/lib/datasrc/memory/memory_client.cc
@@ -15,15 +15,16 @@
#include <exceptions/exceptions.h>
#include <datasrc/memory/memory_client.h>
+#include <datasrc/memory/logger.h>
#include <datasrc/memory/zone_data.h>
#include <datasrc/memory/rdata_serialization.h>
#include <datasrc/memory/rdataset.h>
#include <datasrc/memory/domaintree.h>
#include <datasrc/memory/segment_object_holder.h>
+#include <datasrc/memory/treenode_rrset.h>
#include <util/memory_segment_local.h>
-#include <datasrc/logger.h>
#include <datasrc/iterator.h>
#include <datasrc/data_source.h>
#include <datasrc/factory.h>
@@ -107,7 +108,7 @@ public:
// (This will eventually have to be abstract; for now we hardcode the
// specific derived segment class).
util::MemorySegmentLocal local_mem_sgmt_;
- RRClass rrclass_;
+ const RRClass rrclass_;
unsigned int zone_count_;
ZoneTable* zone_table_;
FileNameTree* file_name_tree_;
@@ -728,39 +729,42 @@ InMemoryClient::add(const isc::dns::Name& zone_name,
return (impl_->add(rrset, zone_name, *result.zone_data));
}
-#if 0
-
namespace {
class MemoryIterator : public ZoneIterator {
private:
- RBTreeNodeChain<Domain> chain_;
- Domain::const_iterator dom_iterator_;
- const DomainTree& tree_;
- const DomainNode* node_;
+ ZoneChain chain_;
+ const RdataSet* set_node_;
+ const RRClass rrclass_;
+ const ZoneTree& tree_;
+ const ZoneNode* node_;
// Only used when separate_rrs_ is true
+ ConstRRsetPtr rrset_;
RdataIteratorPtr rdata_iterator_;
bool separate_rrs_;
bool ready_;
public:
- MemoryIterator(const DomainTree& tree, const Name& origin, bool separate_rrs) :
+ MemoryIterator(const RRClass rrclass,
+ const ZoneTree& tree, const Name& origin, bool separate_rrs) :
+ rrclass_(rrclass),
tree_(tree),
separate_rrs_(separate_rrs),
ready_(true)
{
// Find the first node (origin) and preserve the node chain for future
// searches
- DomainTree::Result result(tree_.find(origin, &node_, chain_));
+ ZoneTree::Result result(tree_.find(origin, &node_, chain_));
// It can't happen that the origin is not in there
- if (result != DomainTree::EXACTMATCH) {
+ if (result != ZoneTree::EXACTMATCH) {
isc_throw(Unexpected,
"In-memory zone corrupted, missing origin node");
}
// Initialize the iterator if there's somewhere to point to
- if (node_ != NULL && node_->getData() != DomainPtr()) {
- dom_iterator_ = node_->getData()->begin();
- if (separate_rrs_ && dom_iterator_ != node_->getData()->end()) {
- rdata_iterator_ = dom_iterator_->second->getRdataIterator();
+ if (node_ != NULL && node_->getData() != NULL) {
+ set_node_ = node_->getData();
+ if (separate_rrs_ && set_node_ != NULL) {
+ rrset_.reset(new TreeNodeRRset(rrclass_, node_, set_node_, true));
+ rdata_iterator_ = rrset_->getRdataIterator();
}
}
}
@@ -770,21 +774,23 @@ public:
isc_throw(Unexpected, "Iterating past the zone end");
}
/*
- * This cycle finds the first nonempty node with yet unused RRset.
- * If it is NULL, we run out of nodes. If it is empty, it doesn't
- * contain any RRsets. If we are at the end, just get to next one.
+ * This cycle finds the first nonempty node with yet unused
+ * RdataSset. If it is NULL, we run out of nodes. If it is
+ * empty, it doesn't contain any RdataSets. If we are at the
+ * end, just get to next one.
*/
- while (node_ != NULL && (node_->getData() == DomainPtr() ||
- dom_iterator_ == node_->getData()->end())) {
+ while (node_ != NULL &&
+ (node_->getData() == NULL || set_node_ == NULL)) {
node_ = tree_.nextNode(chain_);
// If there's a node, initialize the iterator and check next time
// if the map is empty or not
if (node_ != NULL && node_->getData() != NULL) {
- dom_iterator_ = node_->getData()->begin();
+ set_node_ = node_->getData();
// New RRset, so get a new rdata iterator
- if (separate_rrs_) {
- rdata_iterator_ = dom_iterator_->second->getRdataIterator();
- }
+ if (separate_rrs_ && set_node_ != NULL) {
+ rrset_.reset(new TreeNodeRRset(rrclass_, node_, set_node_, true));
+ rdata_iterator_ = rrset_->getRdataIterator();
+ }
}
}
if (node_ == NULL) {
@@ -796,28 +802,28 @@ public:
if (separate_rrs_) {
// For separate rrs, reconstruct a new RRset with just the
// 'current' rdata
- RRsetPtr result(new RRset(dom_iterator_->second->getName(),
- dom_iterator_->second->getClass(),
- dom_iterator_->second->getType(),
- dom_iterator_->second->getTTL()));
+ RRsetPtr result(new RRset(rrset_->getName(),
+ rrset_->getClass(),
+ rrset_->getType(),
+ rrset_->getTTL()));
result->addRdata(rdata_iterator_->getCurrent());
rdata_iterator_->next();
if (rdata_iterator_->isLast()) {
// all used up, next.
- ++dom_iterator_;
+ set_node_ = set_node_->getNext();
// New RRset, so get a new rdata iterator, but only if this
// was not the final RRset in the chain
- if (dom_iterator_ != node_->getData()->end()) {
- rdata_iterator_ = dom_iterator_->second->getRdataIterator();
+ if (set_node_ != NULL) {
+ rrset_.reset(new TreeNodeRRset(rrclass_, node_, set_node_, true));
+ rdata_iterator_ = rrset_->getRdataIterator();
}
}
return (result);
} else {
- // The iterator points to the next yet unused RRset now
- ConstRRsetPtr result(dom_iterator_->second);
+ ConstRRsetPtr result(new TreeNodeRRset(rrclass_, node_, set_node_, true));
// This one is used, move it to the next time for next call
- ++dom_iterator_;
+ set_node_ = set_node_->getNext();
return (result);
}
@@ -837,19 +843,9 @@ InMemoryClient::getIterator(const Name& name, bool separate_rrs) const {
isc_throw(DataSourceError, "No such zone: " + name.toText());
}
- const ZoneData* data = result.zone_data;
- if (zone == NULL) {
- /*
- * TODO: This can happen only during some of the tests and only as
- * a temporary solution. This should be fixed by #1159 and then
- * this cast and check shouldn't be necessary. We don't have
- * test for handling a "can not happen" condition.
- */
- isc_throw(Unexpected, "The zone at " + name.toText() +
- " is not InMemoryZoneFinder");
- }
return (ZoneIteratorPtr(new MemoryIterator(
- zone->impl_->zone_data_->domains_, name,
+ getClass(),
+ result.zone_data->getZoneTree(), name,
separate_rrs)));
}
@@ -866,8 +862,6 @@ InMemoryClient::getJournalReader(const isc::dns::Name&, uint32_t,
"in memory data source");
}
-#endif
-
} // end of namespace memory
} // end of namespace datasrc
} // end of namespace isc
diff --git a/src/lib/datasrc/memory/memory_messages.mes b/src/lib/datasrc/memory/memory_messages.mes
new file mode 100644
index 0000000..6fe63c7
--- /dev/null
+++ b/src/lib/datasrc/memory/memory_messages.mes
@@ -0,0 +1,90 @@
+# Copyright (C) 2011 Internet Systems Consortium, Inc. ("ISC")
+#
+# Permission to use, copy, modify, and/or distribute this software for any
+# purpose with or without fee is hereby granted, provided that the above
+# copyright notice and this permission notice appear in all copies.
+#
+# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+# PERFORMANCE OF THIS SOFTWARE.
+
+$NAMESPACE isc::datasrc::memory
+
+# \brief Messages for the data source memory library
+
+% DATASRC_MEM_ADD_WILDCARD adding wildcards for '%1'
+This is a debug message issued during the processing of a wildcard
+name. The internal domain name tree is scanned and some nodes are
+specially marked to allow the wildcard lookup to succeed.
+
+% DATASRC_MEM_CNAME_TO_NONEMPTY can't add CNAME to domain with other data in '%1'
+Someone or something tried to add a CNAME into a domain that already contains
+some other data. But the protocol forbids coexistence of CNAME with anything
+(RFC 1034, section 3.6.2). This indicates a problem with provided data.
+
+% DATASRC_MEM_CNAME_COEXIST can't add data to CNAME in domain '%1'
+This is the same problem as in MEM_CNAME_TO_NONEMPTY, but it happened the
+other way around -- adding some other data to CNAME.
+
+% DATASRC_MEM_DNAME_NS DNAME and NS can't coexist in non-apex domain '%1'
+A request was made for DNAME and NS records to be put into the same
+domain which is not the apex (the top of the zone). This is forbidden
+by RFC 2672 (section 3) and indicates a problem with provided data.
+
+% DATASRC_MEM_SINGLETON trying to add multiple RRs for domain '%1' and type '%2'
+Some resource types are singletons -- only one is allowed in a domain
+(for example CNAME or SOA). This indicates a problem with provided data.
+
+% DATASRC_MEM_OUT_OF_ZONE domain '%1' doesn't belong to zone '%2'
+It was attempted to add the domain into a zone that shouldn't have it
+(eg. the domain is not subdomain of the zone origin). This indicates a
+problem with provided data.
+
+% DATASRC_MEM_WILDCARD_NS NS record in wildcard domain '%1'
+The software refuses to load NS records into a wildcard domain. It isn't
+explicitly forbidden, but the protocol is ambiguous about how this should
+behave and BIND 9 refuses that as well. Please describe your intention using
+different tools.
+
+% DATASRC_MEM_WILDCARD_DNAME DNAME record in wildcard domain '%1'
+The software refuses to load DNAME records into a wildcard domain. It isn't
+explicitly forbidden, but the protocol is ambiguous about how this should
+behave and BIND 9 refuses that as well. Please describe your intention using
+different tools.
+
+% DATASRC_BAD_NSEC3_NAME NSEC3 record has a bad owner name '%1'
+The software refuses to load NSEC3 records into a wildcard domain or
+the owner name has two or more labels below the zone origin.
+It isn't explicitly forbidden, but no sane zone wouldn have such names
+for NSEC3. BIND 9 also refuses NSEC3 at wildcard, so this behavior is
+compatible with BIND 9.
+
+% DATASRC_MEM_ADD_RRSET adding RRset '%1/%2' into zone '%3'
+Debug information. An RRset is being added to the in-memory data source.
+
+% DATASRC_MEM_DUP_RRSET duplicate RRset '%1/%2'
+An RRset is being inserted into in-memory data source for a second time. The
+original version must be removed first. Note that loading master files where an
+RRset is split into multiple locations is not supported yet.
+
+% DATASRC_MEM_NO_NSEC3PARAM NSEC3PARAM is missing for NSEC3-signed zone %1/%2
+The in-memory data source has loaded a zone signed with NSEC3 RRs,
+but it doesn't have a NSEC3PARAM RR at the zone origin. It's likely that
+the zone is somehow broken, but this RR is not necessarily needed for
+handling lookups with NSEC3 in this data source, so it accepts the given
+content of the zone. Nevertheless the administrator should look into
+the integrity of the zone data.
+
+% DATASRC_MEM_ADD_ZONE adding zone '%1/%2'
+Debug information. A zone is being added into the in-memory data source.
+
+% DATASRC_MEM_FIND_ZONE looking for zone '%1'
+Debug information. A zone object for this zone is being searched for in the
+in-memory data source.
+
+% DATASRC_MEM_LOAD loading zone '%1' from file '%2'
+Debug information. The content of master file is being loaded into the memory.
diff --git a/src/lib/datasrc/memory/tests/Makefile.am b/src/lib/datasrc/memory/tests/Makefile.am
index 334094d..43dd9f2 100644
--- a/src/lib/datasrc/memory/tests/Makefile.am
+++ b/src/lib/datasrc/memory/tests/Makefile.am
@@ -26,6 +26,7 @@ run_unittests_SOURCES += zone_table_unittest.cc
run_unittests_SOURCES += zone_data_unittest.cc
run_unittests_SOURCES += memory_segment_test.h
run_unittests_SOURCES += segment_object_holder_unittest.cc
+run_unittests_SOURCES += memory_client_unittest.cc
run_unittests_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES)
run_unittests_LDFLAGS = $(AM_LDFLAGS) $(GTEST_LDFLAGS)
@@ -36,6 +37,7 @@ run_unittests_LDADD += $(top_builddir)/src/lib/util/unittests/libutil_unittests.
run_unittests_LDADD += $(top_builddir)/src/lib/util/libb10-util.la
run_unittests_LDADD += $(top_builddir)/src/lib/testutils/libb10-testutils.la
run_unittests_LDADD += $(top_builddir)/src/lib/exceptions/libb10-exceptions.la
+run_unittests_LDADD += $(top_builddir)/src/lib/log/libb10-log.la
run_unittests_LDADD += $(GTEST_LDADD)
endif
diff --git a/src/lib/datasrc/memory/tests/memory_client_unittest.cc b/src/lib/datasrc/memory/tests/memory_client_unittest.cc
new file mode 100644
index 0000000..e19ca39
--- /dev/null
+++ b/src/lib/datasrc/memory/tests/memory_client_unittest.cc
@@ -0,0 +1,63 @@
+// Copyright (C) 2012 Internet Systems Consortium, Inc. ("ISC")
+//
+// Permission to use, copy, modify, and/or distribute this software for any
+// purpose with or without fee is hereby granted, provided that the above
+// copyright notice and this permission notice appear in all copies.
+//
+// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+// AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+// PERFORMANCE OF THIS SOFTWARE.
+
+#include <exceptions/exceptions.h>
+
+#include <util/memory_segment_local.h>
+
+#include <dns/name.h>
+#include <dns/rrclass.h>
+
+#include <datasrc/result.h>
+#include <datasrc/memory/zone_data.h>
+#include <datasrc/memory/zone_table.h>
+#include <datasrc/memory/memory_client.h>
+
+#include <gtest/gtest.h>
+
+#include <new> // for bad_alloc
+
+using namespace isc::dns;
+using namespace isc::datasrc;
+using namespace isc::datasrc::memory;
+
+namespace {
+class MemoryClientTest : public ::testing::Test {
+protected:
+ MemoryClientTest() : zclass_(RRClass::IN()),
+ zname1(Name("example.com")),
+ zname2(Name("example.net")),
+ zname3(Name("example")),
+ client_(new InMemoryClient(zclass_))
+ {}
+ ~MemoryClientTest() {
+ if (client_ != NULL) {
+ delete client_;
+ }
+ }
+ void TearDown() {
+ delete client_;
+ client_ = NULL;
+ EXPECT_TRUE(mem_sgmt_.allMemoryDeallocated()); // catch any leak here.
+ }
+ const RRClass zclass_;
+ const Name zname1, zname2, zname3;
+ isc::util::MemorySegmentLocal mem_sgmt_;
+ InMemoryClient* client_;
+ memory::ZoneTable* zone_table;
+};
+
+TEST_F(MemoryClientTest, create) {
+}
+}
diff --git a/src/lib/datasrc/memory/zone_data.h b/src/lib/datasrc/memory/zone_data.h
index f592680..09306d7 100644
--- a/src/lib/datasrc/memory/zone_data.h
+++ b/src/lib/datasrc/memory/zone_data.h
@@ -43,6 +43,7 @@ namespace memory {
typedef DomainTree<RdataSet> ZoneTree;
typedef DomainTreeNode<RdataSet> ZoneNode;
+typedef DomainTreeNodeChain<RdataSet> ZoneChain;
/// \brief NSEC3 data for a DNS zone.
///
More information about the bind10-changes
mailing list