BIND 10 trac2108_3, updated. 0523c84f2a8a2e32fa5d831b32eec5a59325c119 [2108] Add a basic InMemoryClient::load() test
BIND 10 source code commits
bind10-changes at lists.isc.org
Wed Sep 5 13:11:13 UTC 2012
The branch, trac2108_3 has been updated
via 0523c84f2a8a2e32fa5d831b32eec5a59325c119 (commit)
via a879e6b86253e1179cf95b2a2d65a3c08e29eb93 (commit)
from 0f42cb55b2bfdefcea88ed14bfa1c21f2e4b4cc5 (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 0523c84f2a8a2e32fa5d831b32eec5a59325c119
Author: Mukund Sivaraman <muks at isc.org>
Date: Wed Sep 5 18:41:02 2012 +0530
[2108] Add a basic InMemoryClient::load() test
commit a879e6b86253e1179cf95b2a2d65a3c08e29eb93
Author: Mukund Sivaraman <muks at isc.org>
Date: Wed Sep 5 18:40:37 2012 +0530
[2108] Add some includes useful in memory client tests
-----------------------------------------------------------------------
Summary of changes:
src/lib/datasrc/memory/tests/Makefile.am | 1 +
.../datasrc/memory/tests/memory_client_unittest.cc | 18 ++++++++++++++++++
src/lib/datasrc/memory/tests/testdata/Makefile.am | 3 +++
.../memory/tests/testdata/example.org-empty.zone | 2 ++
4 files changed, 24 insertions(+)
create mode 100644 src/lib/datasrc/memory/tests/testdata/Makefile.am
create mode 100644 src/lib/datasrc/memory/tests/testdata/example.org-empty.zone
-----------------------------------------------------------------------
diff --git a/src/lib/datasrc/memory/tests/Makefile.am b/src/lib/datasrc/memory/tests/Makefile.am
index 43dd9f2..ae32c69 100644
--- a/src/lib/datasrc/memory/tests/Makefile.am
+++ b/src/lib/datasrc/memory/tests/Makefile.am
@@ -1,6 +1,7 @@
AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_builddir)/src/lib
AM_CPPFLAGS += -I$(top_builddir)/src/lib/dns -I$(top_srcdir)/src/lib/dns
AM_CPPFLAGS += $(BOOST_INCLUDES)
+AM_CPPFLAGS += -DTEST_DATA_DIR=\"$(abs_srcdir)/testdata\"
AM_CXXFLAGS = $(B10_CXXFLAGS)
diff --git a/src/lib/datasrc/memory/tests/memory_client_unittest.cc b/src/lib/datasrc/memory/tests/memory_client_unittest.cc
index 2e89041..0a683ff 100644
--- a/src/lib/datasrc/memory/tests/memory_client_unittest.cc
+++ b/src/lib/datasrc/memory/tests/memory_client_unittest.cc
@@ -18,6 +18,13 @@
#include <dns/name.h>
#include <dns/rrclass.h>
+#include <dns/masterload.h>
+#include <dns/nsec3hash.h>
+#include <dns/rdata.h>
+#include <dns/rdataclass.h>
+#include <dns/rrsetlist.h>
+#include <dns/rrttl.h>
+#include <dns/masterload.h>
#include <datasrc/result.h>
#include <datasrc/data_source.h>
@@ -59,6 +66,17 @@ protected:
memory::ZoneTable* zone_table;
};
+TEST_F(MemoryClientTest, load) {
+ // Zone "example.org." doesn't exist
+ EXPECT_THROW(client_->getIterator(Name("example.org")), DataSourceError);
+ EXPECT_EQ(0, client_->getZoneCount());
+
+ client_->load(Name("example.org"), TEST_DATA_DIR "/example.org-empty.zone");
+ EXPECT_EQ(1, client_->getZoneCount());
+
+ ZoneIteratorPtr iterator(client_->getIterator(Name("example.org")));
+}
+
TEST_F(MemoryClientTest, getIteratorNonExistent) {
// Zone "." doesn't exist
EXPECT_THROW(client_->getIterator(Name(".")), DataSourceError);
diff --git a/src/lib/datasrc/memory/tests/testdata/Makefile.am b/src/lib/datasrc/memory/tests/testdata/Makefile.am
new file mode 100644
index 0000000..6a2a760
--- /dev/null
+++ b/src/lib/datasrc/memory/tests/testdata/Makefile.am
@@ -0,0 +1,3 @@
+CLEANFILES = *.copied
+
+EXTRA_DIST = example.org-empty.zone
diff --git a/src/lib/datasrc/memory/tests/testdata/example.org-empty.zone b/src/lib/datasrc/memory/tests/testdata/example.org-empty.zone
new file mode 100644
index 0000000..f11b9b8
--- /dev/null
+++ b/src/lib/datasrc/memory/tests/testdata/example.org-empty.zone
@@ -0,0 +1,2 @@
+;; empty example.org zone
+example.org. 3600 IN SOA ns1.example.org. bugs.x.w.example.org. 68 3600 300 3600000 3600
More information about the bind10-changes
mailing list