From 6d1a9248e528d1bc1950367df8ed3c72c24b88fb Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Mon, 18 Mar 2019 12:09:26 +0100 Subject: [PATCH] dnsdist: Fix wrong type (bool vs size_t) and typos in the tests --- pdns/dnsdist-cache.cc | 2 +- pdns/dnsdistdist/test-dnsdistrules_cc.cc | 2 +- pdns/test-dnsdistpacketcache_cc.cc | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pdns/dnsdist-cache.cc b/pdns/dnsdist-cache.cc index 5342f93b23..a359ea8a2a 100644 --- a/pdns/dnsdist-cache.cc +++ b/pdns/dnsdist-cache.cc @@ -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) { diff --git a/pdns/dnsdistdist/test-dnsdistrules_cc.cc b/pdns/dnsdistdist/test-dnsdistrules_cc.cc index a669c941ff..cd2a22158d 100644 --- a/pdns/dnsdistdist/test-dnsdistrules_cc.cc +++ b/pdns/dnsdistdist/test-dnsdistrules_cc.cc @@ -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); diff --git a/pdns/test-dnsdistpacketcache_cc.cc b/pdns/test-dnsdistpacketcache_cc.cc index a82600d073..38d35dfdf3 100644 --- a/pdns/test-dnsdistpacketcache_cc.cc +++ b/pdns/test-dnsdistpacketcache_cc.cc @@ -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); -- 2.47.2