From: Remi Gacogne Date: Tue, 18 Jul 2017 07:49:08 +0000 (+0200) Subject: rec: Fix the recursor cache unit tests X-Git-Tag: rec-4.1.0-alpha1~3^2 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F5530%2Fhead;p=thirdparty%2Fpdns.git rec: Fix the recursor cache unit tests --- diff --git a/pdns/recursordist/test-recursorcache_cc.cc b/pdns/recursordist/test-recursorcache_cc.cc index c2a65babea..162df76105 100644 --- a/pdns/recursordist/test-recursorcache_cc.cc +++ b/pdns/recursordist/test-recursorcache_cc.cc @@ -266,7 +266,7 @@ BOOST_AUTO_TEST_CASE(test_RecursorCacheSimple) { // insert an entry for 192.0.0.1/8 records.clear(); records.push_back(dr2); - MRC.replace(now, power, QType(QType::A), records, signatures, true, boost::optional("192.0.0.1/8")); + MRC.replace(now, power, QType(QType::A), records, signatures, authRecords, true, boost::optional("192.0.0.1/8")); BOOST_CHECK_EQUAL(MRC.size(), 1); /* same as dr2 except for the actual IP */ @@ -282,19 +282,19 @@ BOOST_AUTO_TEST_CASE(test_RecursorCacheSimple) { // insert an other entry but for 192.168.0.1/31 records.clear(); records.push_back(dr4); - MRC.replace(now, power, QType(QType::A), records, signatures, true, boost::optional("192.168.0.1/31")); + MRC.replace(now, power, QType(QType::A), records, signatures, authRecords, true, boost::optional("192.168.0.1/31")); // we should not have replaced any existing entry BOOST_CHECK_EQUAL(MRC.size(), 2); // insert the same than the first one but for 192.168.0.2/32 records.clear(); records.push_back(dr2); - MRC.replace(now, power, QType(QType::A), records, signatures, true, boost::optional("192.168.0.2/32")); + MRC.replace(now, power, QType(QType::A), records, signatures, authRecords, true, boost::optional("192.168.0.2/32")); // we should not have replaced any existing entry BOOST_CHECK_EQUAL(MRC.size(), 3); // we should get the most specific entry for 192.168.0.1, so the second one - BOOST_CHECK_EQUAL(MRC.get(now, power, QType(QType::A), &retrieved, ComboAddress("192.168.0.1"), nullptr), (ttd-now)); + BOOST_CHECK_EQUAL(MRC.get(now, power, QType(QType::A), false, &retrieved, ComboAddress("192.168.0.1"), nullptr), (ttd-now)); BOOST_REQUIRE_EQUAL(retrieved.size(), 1); BOOST_CHECK_EQUAL(getRR(retrieved.at(0))->getCA().toString(), dr4Content.toString()); retrieved.clear();