Browse Source

[2108] Test when add() is called with a null RRset

Mukund Sivaraman 12 years ago
parent
commit
6ed1c019aa
1 changed files with 10 additions and 0 deletions
  1. 10 0
      src/lib/datasrc/memory/tests/memory_client_unittest.cc

+ 10 - 0
src/lib/datasrc/memory/tests/memory_client_unittest.cc

@@ -233,6 +233,16 @@ TEST_F(MemoryClientTest, addRRsetToNonExistentZoneThrows) {
     EXPECT_THROW(client_->add(Name("example.org"), rrset_a), DataSourceError);
 }
 
+TEST_F(MemoryClientTest, addNullRRsetThrows) {
+    client_->load(Name("example.org"),
+                  TEST_DATA_DIR "/example.org-rrsigs.zone");
+
+    EXPECT_THROW(client_->add(Name("example.org"), ConstRRsetPtr()),
+                 InMemoryClient::NullRRset);
+
+    // Teardown checks for memory segment leaks
+}
+
 TEST_F(MemoryClientTest, add) {
     client_->load(Name("example.org"), TEST_DATA_DIR "/example.org-empty.zone");