BIND 10 trac2850_2, updated. 53a1410acc5726fe8ed83ded19b65be7c9002ee1 [2850] Test that the dynamic_cast passes every time

BIND 10 source code commits bind10-changes at lists.isc.org
Wed May 1 08:44:40 UTC 2013


The branch, trac2850_2 has been updated
       via  53a1410acc5726fe8ed83ded19b65be7c9002ee1 (commit)
       via  832eddac5d9724af4b228cb123a84ed7ddae0473 (commit)
      from  c055314da48eaadb3f88b64eda17263fc6b387fa (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 53a1410acc5726fe8ed83ded19b65be7c9002ee1
Author: Mukund Sivaraman <muks at isc.org>
Date:   Wed May 1 14:13:55 2013 +0530

    [2850] Test that the dynamic_cast passes every time

commit 832eddac5d9724af4b228cb123a84ed7ddae0473
Author: Mukund Sivaraman <muks at isc.org>
Date:   Wed May 1 14:11:25 2013 +0530

    [2850] Test resetting a ZoneTableSegmentMapped in READ_WRITE mode when the file exists

-----------------------------------------------------------------------

Summary of changes:
 .../memory/zone_table_segment_mapped_unittest.cc   |   17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

-----------------------------------------------------------------------
diff --git a/src/lib/datasrc/tests/memory/zone_table_segment_mapped_unittest.cc b/src/lib/datasrc/tests/memory/zone_table_segment_mapped_unittest.cc
index 8583ad6..a8b706e 100644
--- a/src/lib/datasrc/tests/memory/zone_table_segment_mapped_unittest.cc
+++ b/src/lib/datasrc/tests/memory/zone_table_segment_mapped_unittest.cc
@@ -37,7 +37,10 @@ protected:
             ZoneTableSegment::create(RRClass::IN(), "mapped"))),
         config_params_(
             Element::fromJSON("{\"mapped-file\": \"" + mapped_file + "\"}"))
-    {}
+    {
+        // Verify that a ZoneTableSegmentMapped is created.
+        EXPECT_NE(static_cast<void*>(NULL), ztable_segment_);
+    }
 
     ~ZoneTableSegmentMappedTest() {
         boost::interprocess::file_mapping::remove(mapped_file.c_str());
@@ -52,12 +55,6 @@ protected:
     const ConstElementPtr config_params_;
 };
 
-
-TEST_F(ZoneTableSegmentMappedTest, create) {
-    // Verify that a mapped segment is created.
-    EXPECT_NE(static_cast<void*>(NULL), ztable_segment_);
-}
-
 TEST_F(ZoneTableSegmentMappedTest, getHeaderUninitialized) {
     // This should throw as we haven't called reset() yet.
     EXPECT_THROW(ztable_segment_->getHeader(), isc::Unexpected);
@@ -167,6 +164,12 @@ TEST_F(ZoneTableSegmentMappedTest, reset) {
     EXPECT_THROW(ztable_segment_->getHeader(), isc::Unexpected);
     EXPECT_THROW(ztable_segment_->getMemorySegment(), isc::Unexpected);
     EXPECT_THROW(ztable_segment_->isWritable(), isc::Unexpected);
+
+    // READ_WRITE with an existing map file ought to work too. This
+    // would use existing named addresses.
+    ztable_segment_->reset(ZoneTableSegmentMapped::READ_WRITE,
+                           config_params_);
+    EXPECT_TRUE(ztable_segment_->isWritable());
 }
 
 } // anonymous namespace



More information about the bind10-changes mailing list