From: Remi Gacogne Date: Mon, 18 Mar 2019 11:09:26 +0000 (+0100) Subject: dnsdist: Fix wrong type (bool vs size_t) and typos in the tests X-Git-Tag: dnsdist-1.4.0-alpha1~59^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F7592%2Fhead;p=thirdparty%2Fpdns.git dnsdist: Fix wrong type (bool vs size_t) and typos in the tests --- 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);