Skip to content

Commit

Permalink
fix up testcases
Browse files Browse the repository at this point in the history
  • Loading branch information
ahupowerdns committed Sep 13, 2016
1 parent c47b819 commit 7a59dc5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
6 changes: 1 addition & 5 deletions pdns/test-misc_hh.cc
Expand Up @@ -109,13 +109,9 @@ BOOST_AUTO_TEST_CASE(test_stripDot) {
}

BOOST_AUTO_TEST_CASE(test_labelReverse) {
BOOST_CHECK_EQUAL(labelReverse("www.powerdns.com"), "com powerdns www");
BOOST_CHECK_EQUAL(DNSName("www.powerdns.com").labelReverse().toString(" ", false), "com powerdns www");
}

BOOST_AUTO_TEST_CASE(test_makeRelative) {
BOOST_CHECK_EQUAL(makeRelative("www.powerdns.com", "powerdns.com"), "www");
BOOST_CHECK_EQUAL(makeRelative("PoWeRdNs.CoM", "powerdns.com"), "");
}

BOOST_AUTO_TEST_CASE(test_AtomicCounter) {
AtomicCounter ac(0);
Expand Down
4 changes: 2 additions & 2 deletions pdns/test-packetcache_cc.cc
Expand Up @@ -59,7 +59,7 @@ BOOST_AUTO_TEST_CASE(test_PacketCacheSimple) {
BOOST_CHECK_EQUAL(PC.size(), counter-delcounter);

int matches=0;
vector<DNSResourceRecord> entry;
vector<DNSZoneRecord> entry;
int expected=counter-delcounter;
for(; delcounter < counter; ++delcounter) {
if(PC.getEntry(DNSName("hello ")+DNSName(std::to_string(delcounter)), QType(QType::A), PacketCache::QUERYCACHE, entry, 1)) {
Expand Down Expand Up @@ -97,7 +97,7 @@ static void *threadReader(void* a)
try
{
unsigned int offset=(unsigned int)(unsigned long)a;
vector<DNSResourceRecord> entry;
vector<DNSZoneRecord> entry;
for(unsigned int counter=0; counter < 100000; ++counter)
if(!g_PC->getEntry(DNSName("hello ")+DNSName(std::to_string(counter+offset)), QType(QType::A), PacketCache::QUERYCACHE, entry, 1)) {
g_missing++;
Expand Down

0 comments on commit 7a59dc5

Please sign in to comment.