do {
uint32_t shardIndex = (d_expungeIndex++ % d_shardCount);
+ scannedMaps++;
WriteLock w(&d_shards.at(shardIndex).d_lock);
auto& map = d_shards.at(shardIndex).d_map;
++it;
}
}
-
- scannedMaps++;
}
while (scannedMaps < d_shardCount);
auto removed = PC.expungeByName(DNSName(" hello"), QType::ANY, true);
BOOST_CHECK_EQUAL(PC.getSize(), 0U);
BOOST_CHECK_EQUAL(removed, remaining);
+
+ /* nothing to remove */
+ BOOST_CHECK_EQUAL(PC.purgeExpired(0, now), 0U);
}
catch (const PDNSException& e) {
cerr<<"Had error: "<<e.reason<<endl;
removed = PC.purgeExpired(0, now + 7200 + 3600);
BOOST_CHECK_EQUAL(removed, 1000U);
BOOST_CHECK_EQUAL(PC.getSize(), 0U);
+
+ /* nothing to remove */
+ BOOST_CHECK_EQUAL(PC.purgeExpired(0, now), 0U);
}
catch (const PDNSException& e) {
cerr<<"Had error: "<<e.reason<<endl;