Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dnsdist: a few warnings fixed, reported by clang on OpenBSD #9059

Merged
merged 1 commit into from Apr 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions pdns/dnsdistdist/test-dnsdistkvs_cc.cc
Expand Up @@ -6,6 +6,7 @@

#include "dnsdist-kvs.hh"

#if defined(HAVE_LMDB) || defined(HAVE_CDB)
static void doKVSChecks(std::unique_ptr<KeyValueStore>& kvs, const ComboAddress& lc, const ComboAddress& rem, const DNSQuestion& dq, const DNSName& plaintextDomain)
{
/* source IP */
Expand Down Expand Up @@ -195,6 +196,7 @@ static void doKVSChecks(std::unique_ptr<KeyValueStore>& kvs, const ComboAddress&
BOOST_CHECK_EQUAL(value, "this is the value for the qname");
}
}
#endif // defined(HAVE_LMDB) || defined(HAVE_CDB)

BOOST_AUTO_TEST_SUITE(dnsdistkvs_cc)

Expand Down
30 changes: 15 additions & 15 deletions pdns/dnsdistdist/test-dnsdistlbpolicies_cc.cc
Expand Up @@ -246,12 +246,12 @@ BOOST_AUTO_TEST_CASE(test_wrandom) {
}
uint64_t total = 0;
for (const auto& entry : serversMap) {
BOOST_CHECK_GT(entry.second, 0);
BOOST_CHECK_GT(entry.second, 0U);
BOOST_CHECK_GT(entry.second, (1000 / servers.size() / 2));
BOOST_CHECK_LT(entry.second, (1000 / servers.size() * 2));
total += entry.second;
}
BOOST_CHECK_EQUAL(total, 1000);
BOOST_CHECK_EQUAL(total, 1000U);

/* reset */
for (auto& entry : serversMap) {
Expand Down Expand Up @@ -279,7 +279,7 @@ BOOST_AUTO_TEST_CASE(test_wrandom) {
total += entry.second;
totalW += entry.first->weight;
}
BOOST_CHECK_EQUAL(total, 1000);
BOOST_CHECK_EQUAL(total, 1000U);
auto last = servers.at(servers.size()-1).second;
const auto got = serversMap[last];
float expected = (1000 * 1.0 * last->weight) / totalW;
Expand Down Expand Up @@ -314,7 +314,7 @@ BOOST_AUTO_TEST_CASE(test_whashed) {

uint64_t total = 0;
for (const auto& entry : serversMap) {
BOOST_CHECK_GT(entry.second, 0);
BOOST_CHECK_GT(entry.second, 0U);
BOOST_CHECK_GT(entry.second, (names.size() / servers.size() / 2));
BOOST_CHECK_LT(entry.second, (names.size() / servers.size() * 2));
total += entry.second;
Expand Down Expand Up @@ -399,7 +399,7 @@ BOOST_AUTO_TEST_CASE(test_chashed) {

uint64_t total = 0;
for (const auto& entry : serversMap) {
BOOST_CHECK_GT(entry.second, 0);
BOOST_CHECK_GT(entry.second, 0U);
BOOST_CHECK_GT(entry.second, (names.size() / servers.size() / 2));
BOOST_CHECK_LT(entry.second, (names.size() / servers.size() * 2));
total += entry.second;
Expand Down Expand Up @@ -483,7 +483,7 @@ BOOST_AUTO_TEST_CASE(test_lua) {
serversMap[servers.at(idx - 1).second] = 0;
servers.at(idx - 1).second->setUp();
}
BOOST_REQUIRE_EQUAL(servers.size(), 10);
BOOST_REQUIRE_EQUAL(servers.size(), 10U);

for (const auto& name : names) {
auto dq = getDQ(&name);
Expand All @@ -494,7 +494,7 @@ BOOST_AUTO_TEST_CASE(test_lua) {

uint64_t total = 0;
for (const auto& entry : serversMap) {
BOOST_CHECK_GT(entry.second, 0);
BOOST_CHECK_GT(entry.second, 0U);
BOOST_CHECK_GT(entry.second, (names.size() / servers.size() / 2));
BOOST_CHECK_LT(entry.second, (names.size() / servers.size() * 2));
total += entry.second;
Expand Down Expand Up @@ -543,7 +543,7 @@ BOOST_AUTO_TEST_CASE(test_lua_ffi_rr) {
serversMap[servers.at(idx - 1).second] = 0;
servers.at(idx - 1).second->setUp();
}
BOOST_REQUIRE_EQUAL(servers.size(), 10);
BOOST_REQUIRE_EQUAL(servers.size(), 10U);

for (const auto& name : names) {
auto dq = getDQ(&name);
Expand All @@ -554,7 +554,7 @@ BOOST_AUTO_TEST_CASE(test_lua_ffi_rr) {

uint64_t total = 0;
for (const auto& entry : serversMap) {
BOOST_CHECK_GT(entry.second, 0);
BOOST_CHECK_GT(entry.second, 0U);
BOOST_CHECK_GT(entry.second, (names.size() / servers.size() / 2));
BOOST_CHECK_LT(entry.second, (names.size() / servers.size() * 2));
total += entry.second;
Expand Down Expand Up @@ -600,7 +600,7 @@ BOOST_AUTO_TEST_CASE(test_lua_ffi_hashed) {
serversMap[servers.at(idx - 1).second] = 0;
servers.at(idx - 1).second->setUp();
}
BOOST_REQUIRE_EQUAL(servers.size(), 10);
BOOST_REQUIRE_EQUAL(servers.size(), 10U);

for (const auto& name : names) {
auto dq = getDQ(&name);
Expand All @@ -611,7 +611,7 @@ BOOST_AUTO_TEST_CASE(test_lua_ffi_hashed) {

uint64_t total = 0;
for (const auto& entry : serversMap) {
BOOST_CHECK_GT(entry.second, 0);
BOOST_CHECK_GT(entry.second, 0U);
BOOST_CHECK_GT(entry.second, (names.size() / servers.size() / 2));
BOOST_CHECK_LT(entry.second, (names.size() / servers.size() * 2));
total += entry.second;
Expand Down Expand Up @@ -655,7 +655,7 @@ BOOST_AUTO_TEST_CASE(test_lua_ffi_whashed) {
serversMap[servers.at(idx - 1).second] = 0;
servers.at(idx - 1).second->setUp();
}
BOOST_REQUIRE_EQUAL(servers.size(), 10);
BOOST_REQUIRE_EQUAL(servers.size(), 10U);

for (const auto& name : names) {
auto dq = getDQ(&name);
Expand All @@ -666,7 +666,7 @@ BOOST_AUTO_TEST_CASE(test_lua_ffi_whashed) {

uint64_t total = 0;
for (const auto& entry : serversMap) {
BOOST_CHECK_GT(entry.second, 0);
BOOST_CHECK_GT(entry.second, 0U);
BOOST_CHECK_GT(entry.second, (names.size() / servers.size() / 2));
BOOST_CHECK_LT(entry.second, (names.size() / servers.size() * 2));
total += entry.second;
Expand Down Expand Up @@ -717,7 +717,7 @@ BOOST_AUTO_TEST_CASE(test_lua_ffi_chashed) {
/* make sure that the hashes have been computed */
servers.at(idx - 1).second->hash();
}
BOOST_REQUIRE_EQUAL(servers.size(), 10);
BOOST_REQUIRE_EQUAL(servers.size(), 10U);

for (const auto& name : names) {
auto dq = getDQ(&name);
Expand All @@ -728,7 +728,7 @@ BOOST_AUTO_TEST_CASE(test_lua_ffi_chashed) {

uint64_t total = 0;
for (const auto& entry : serversMap) {
BOOST_CHECK_GT(entry.second, 0);
BOOST_CHECK_GT(entry.second, 0U);
BOOST_CHECK_GT(entry.second, (names.size() / servers.size() / 2));
BOOST_CHECK_LT(entry.second, (names.size() / servers.size() * 2));
total += entry.second;
Expand Down