]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnsdist: Fix wrong type (bool vs size_t) and typos in the tests 7592/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 18 Mar 2019 11:09:26 +0000 (12:09 +0100)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 18 Mar 2019 11:09:26 +0000 (12:09 +0100)
pdns/dnsdist-cache.cc
pdns/dnsdistdist/test-dnsdistrules_cc.cc
pdns/test-dnsdistpacketcache_cc.cc

index 5342f93b23488e21735296341af11c6843b49ef2..a359ea8a2a0a26ba4158bc7630c97d6acdcf0169 100644 (file)
@@ -335,7 +335,7 @@ size_t DNSDistPacketCache::purgeExpired(size_t upTo)
    entries in the cache */
 size_t DNSDistPacketCache::expunge(size_t upTo)
 {
-  bool removed = 0;
+  size_t removed = 0;
   const uint64_t size = getSize();
 
   if (upTo >= size) {
index a669c941ff4608de9c018a5f02749a7508ed90dd..cd2a22158d5044d7e706d1240bd62fc3717d8231 100644 (file)
@@ -45,7 +45,7 @@ BOOST_AUTO_TEST_CASE(test_MaxQPSIPRule) {
   BOOST_CHECK_EQUAL(rule.matches(&dq), true);
   BOOST_CHECK_EQUAL(rule.getEntriesCount(), 1);
 
-  /* remove all entries that have not been since 'now' + 1,
+  /* remove all entries that have not been updated since 'now' + 1,
      so all of them */
   expiredTime.tv_sec += 1;
   rule.cleanup(expiredTime);
index a82600d073690b21f756d893d181cef8d338cc2b..38d35dfdf3e0516979add623b7d54e29ca70423b 100644 (file)
@@ -112,7 +112,7 @@ BOOST_AUTO_TEST_CASE(test_PacketCacheSimple) {
       }
     }
 
-    /* in the unlikely event that the test took so long that entries did expire.. */
+    /* in the unlikely event that the test took so long that the entries did expire.. */
     auto expired = PC.purgeExpired();
     BOOST_CHECK_EQUAL(matches + expired, expected);