]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[1607] added a test to confirm that getAdditional keeps existing RRs intact.
authorJINMEI Tatuya <jinmei@isc.org>
Mon, 5 Mar 2012 17:33:46 +0000 (09:33 -0800)
committerJINMEI Tatuya <jinmei@isc.org>
Mon, 5 Mar 2012 17:33:46 +0000 (09:33 -0800)
src/lib/datasrc/tests/zone_finder_context_unittest.cc

index 0e5c56e87e144e46abaca49746bed869301df434..5639f266ec9347388223087b4fa5ba4312f3aa1d 100644 (file)
@@ -164,6 +164,16 @@ TEST_P(ZoneFinderContextTest, getAdditionalAuthNS) {
     rrsetsCheck("ns1.example.org. 3600 IN AAAA 2001:db8::1\n",
                 result_sets_.begin(), result_sets_.end());
 
+    // Getting A again, without clearing the result sets.  This confirms
+    // getAdditional() doesn't change the existing vector content.
+    ctx->getAdditional(REQUESTED_A, result_sets_);
+    // The first element should be the existing AAAA RR, followed by the A's.
+    EXPECT_EQ(RRType::AAAA(), result_sets_[0]->getType());
+    rrsetsCheck("ns1.example.org. 3600 IN AAAA 2001:db8::1\n"
+                "ns1.example.org. 3600 IN A 192.0.2.1\n"
+                "ns2.example.org. 3600 IN A 192.0.2.2\n",
+                result_sets_.begin(), result_sets_.end());
+
     // Normally expected type set contain only A and/or AAAA, but others aren't
     // excluded.
     result_sets_.clear();