Browse Source

[2850] Rename ZoneTableSegmentTest to ZoneTableSegmentMock (to not resemble a fixture)

Mukund Sivaraman 12 years ago
parent
commit
7bea7dd8c1

+ 3 - 3
src/lib/datasrc/tests/memory/memory_client_unittest.cc

@@ -38,7 +38,7 @@
 #include <testutils/dnsmessage_test.h>
 
 #include "memory_segment_test.h"
-#include "zone_table_segment_test.h"
+#include <datasrc/tests/memory/zone_table_segment_mock.h>
 
 #include <gtest/gtest.h>
 
@@ -169,7 +169,7 @@ public:
 class MemoryClientTest : public ::testing::Test {
 protected:
     MemoryClientTest() : zclass_(RRClass::IN()),
-                         ztable_segment_(new test::ZoneTableSegmentTest(
+                         ztable_segment_(new test::ZoneTableSegmentMock(
                              zclass_, mem_sgmt_)),
                          client_(new InMemoryClient(ztable_segment_, zclass_))
     {}
@@ -305,7 +305,7 @@ TEST_F(MemoryClientTest, loadMemoryAllocationFailures) {
         mem_sgmt_.setThrowCount(i);
         EXPECT_THROW({
             shared_ptr<ZoneTableSegment> ztable_segment(
-                new test::ZoneTableSegmentTest(
+                new test::ZoneTableSegmentMock(
                     zclass_, mem_sgmt_));
 
             // Include the InMemoryClient construction too here. Now,

+ 3 - 3
src/lib/datasrc/tests/memory/zone_finder_unittest.cc

@@ -13,7 +13,7 @@
 // PERFORMANCE OF THIS SOFTWARE.
 
 #include <datasrc/tests/memory/memory_segment_test.h>
-#include <datasrc/tests/memory/zone_table_segment_test.h>
+#include <datasrc/tests/memory/zone_table_segment_mock.h>
 #include <datasrc/tests/memory/zone_loader_util.h>
 
 // NOTE: this faked_nsec3 inclusion (and all related code below)
@@ -1613,7 +1613,7 @@ TEST_F(InMemoryZoneFinderTest, findOrphanRRSIG) {
 TEST_F(InMemoryZoneFinderTest, NSECNonExistentTest) {
     const Name name("example.com.");
     shared_ptr<ZoneTableSegment> ztable_segment(
-         new ZoneTableSegmentTest(class_, mem_sgmt_));
+         new ZoneTableSegmentMock(class_, mem_sgmt_));
     loadZoneIntoTable(*ztable_segment, name, class_,
                       TEST_DATA_DIR "/2504-test.zone");
     InMemoryClient client(ztable_segment, class_);
@@ -1775,7 +1775,7 @@ TEST_F(InMemoryZoneFinderNSEC3Test, findNSEC3MissingOrigin) {
 
      const Name name("example.com.");
      shared_ptr<ZoneTableSegment> ztable_segment(
-          new ZoneTableSegmentTest(class_, mem_sgmt_));
+          new ZoneTableSegmentMock(class_, mem_sgmt_));
      loadZoneIntoTable(*ztable_segment, name, class_,
                        TEST_DATA_DIR "/2503-test.zone");
      InMemoryClient client(ztable_segment, class_);

+ 3 - 3
src/lib/datasrc/tests/memory/zone_table_segment_test.h

@@ -28,16 +28,16 @@ namespace test {
 // A special ZoneTableSegment that can be used for tests.  It can be
 // passed a MemorySegment that can be used later to test if all memory
 // was de-allocated on it.
-class ZoneTableSegmentTest : public ZoneTableSegment {
+class ZoneTableSegmentMock : public ZoneTableSegment {
 public:
-    ZoneTableSegmentTest(const isc::dns::RRClass& rrclass,
+    ZoneTableSegmentMock(const isc::dns::RRClass& rrclass,
                          isc::util::MemorySegment& mem_sgmt) :
         ZoneTableSegment(rrclass),
         mem_sgmt_(mem_sgmt),
         header_(ZoneTable::create(mem_sgmt_, rrclass))
     {}
 
-    virtual ~ZoneTableSegmentTest() {
+    virtual ~ZoneTableSegmentMock() {
         ZoneTable::destroy(mem_sgmt_, header_.getTable());
     }
 

+ 3 - 3
src/lib/datasrc/tests/memory/zone_writer_unittest.cc

@@ -20,7 +20,7 @@
 #include <dns/name.h>
 
 #include <datasrc/tests/memory/memory_segment_test.h>
-#include <datasrc/tests/memory/zone_table_segment_test.h>
+#include <datasrc/tests/memory/zone_table_segment_mock.h>
 
 #include <gtest/gtest.h>
 
@@ -88,11 +88,11 @@ public:
     }
 };
 
-class ReadOnlySegment : public ZoneTableSegmentTest {
+class ReadOnlySegment : public ZoneTableSegmentMock {
 public:
     ReadOnlySegment(const isc::dns::RRClass& rrclass,
                     isc::util::MemorySegment& mem_sgmt) :
-        ZoneTableSegmentTest(rrclass, mem_sgmt)
+        ZoneTableSegmentMock(rrclass, mem_sgmt)
     {}
 
     // Returns false indicating it is a read-only segment. It is used in