Browse Source

[2108] Test when add() is called with an empty rdata RRset

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

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

@@ -243,6 +243,18 @@ TEST_F(MemoryClientTest, addNullRRsetThrows) {
     // Teardown checks for memory segment leaks
 }
 
+TEST_F(MemoryClientTest, addEmptyRRsetThrows) {
+    client_->load(Name("example.org"),
+                  TEST_DATA_DIR "/example.org-rrsigs.zone");
+
+    RRsetPtr rrset_a(new RRset(Name("example.org"), RRClass::IN(), RRType::A(),
+                               RRTTL(300)));
+    EXPECT_THROW(client_->add(Name("example.org"), rrset_a),
+                 InMemoryClient::AddError);
+
+    // Teardown checks for memory segment leaks
+}
+
 TEST_F(MemoryClientTest, add) {
     client_->load(Name("example.org"), TEST_DATA_DIR "/example.org-empty.zone");