]> git.ipfire.org Git - thirdparty/pdns.git/blame - pdns/speedtest.cc
Merge pull request #7628 from tcely/patch-3
[thirdparty/pdns.git] / pdns / speedtest.cc
CommitLineData
870a0fe4 1#include "config.h"
8c0139b0 2#include <boost/format.hpp>
3#include <boost/container/string.hpp>
34383528
BH
4#include "dnsparser.hh"
5#include "sstuff.hh"
6#include "misc.hh"
7#include "dnswriter.hh"
8#include "dnsrecords.hh"
6b0ea82d 9#include <fstream>
8c0139b0 10
34383528
BH
11#ifndef RECURSOR
12#include "statbag.hh"
88227be0 13#include "base64.hh"
34383528
BH
14StatBag S;
15#endif
8c0139b0 16
b00cab1d 17volatile bool g_ret; // make sure the optimizer does not get too smart
34383528 18uint64_t g_totalRuns;
34383528
BH
19volatile bool g_stop;
20
21void alarmHandler(int)
22{
23 g_stop=true;
24}
25
26template<typename C> void doRun(const C& cmd, int mseconds=100)
27{
28 struct itimerval it;
29 it.it_value.tv_sec=mseconds/1000;
30 it.it_value.tv_usec = 1000* (mseconds%1000);
31 it.it_interval.tv_sec=0;
32 it.it_interval.tv_usec=0;
33
ecefa116 34 signal(SIGVTALRM, alarmHandler);
34383528 35 setitimer(ITIMER_VIRTUAL, &it, 0);
ecefa116 36
34383528
BH
37 unsigned int runs=0;
38 g_stop=false;
ab570fc5 39 CPUTime dt;
40 dt.start();
34383528
BH
41 while(runs++, !g_stop) {
42 cmd();
43 }
ab570fc5 44 double delta=dt.ndiff()/1000000000.0;
34383528
BH
45 boost::format fmt("'%s' %.02f seconds: %.1f runs/s, %.02f usec/run");
46
47 cerr<< (fmt % cmd.getName() % delta % (runs/delta) % (delta* 1000000.0/runs)) << endl;
48 g_totalRuns += runs;
49}
50
51struct ARecordTest
52{
53 explicit ARecordTest(int records) : d_records(records) {}
54
55 string getName() const
56 {
57 return (boost::format("%d a records") % d_records).str();
58 }
59
60 void operator()() const
61 {
62 vector<uint8_t> packet;
e325f20c 63 DNSPacketWriter pw(packet, DNSName("outpost.ds9a.nl"), QType::A);
34383528 64 for(int records = 0; records < d_records; records++) {
e325f20c 65 pw.startRecord(DNSName("outpost.ds9a.nl"), QType::A);
34383528
BH
66 ARecordContent arc("1.2.3.4");
67 arc.toPacket(pw);
68 }
69 pw.commit();
70 }
71 int d_records;
72};
73
74
75struct MakeStringFromCharStarTest
76{
77 MakeStringFromCharStarTest() : d_size(0){}
78 string getName() const
79 {
80 return (boost::format("make a std::string")).str();
81 }
82
83 void operator()() const
84 {
85 string name("outpost.ds9a.nl");
86 d_size += name.length();
87
88 }
89 mutable int d_size;
90};
91
7519bae5
BH
92
93struct GetTimeTest
94{
95 string getName() const
96 {
97 return "gettimeofday-test";
98 }
99
100 void operator()() const
101 {
102 struct timeval tv;
103 gettimeofday(&tv, 0);
104 }
105};
106
1f9faf8b
BH
107pthread_mutex_t s_testlock=PTHREAD_MUTEX_INITIALIZER;
108
109struct GetLockUncontendedTest
110{
111 string getName() const
112 {
113 return "getlock-uncontended-test";
114 }
115
116 void operator()() const
117 {
118 pthread_mutex_lock(&s_testlock);
119 pthread_mutex_unlock(&s_testlock);
120 }
121};
122
123
124struct StaticMemberTest
125{
126 string getName() const
127 {
128 return "static-member-test";
129 }
130
131 void operator()() const
132 {
133 static string* s_ptr;
134 if(!s_ptr)
135 s_ptr = new string();
136 }
137};
138
ab570fc5 139struct StringtokTest
140{
141 string getName() const
142 {
143 return "stringtok";
144 }
145
146 void operator()() const
147 {
148 string str("the quick brown fox jumped");
149 vector<string> parts;
150 stringtok(parts, str);
151 }
152};
153
154struct VStringtokTest
155{
156 string getName() const
157 {
158 return "vstringtok";
159 }
160
161 void operator()() const
162 {
163 string str("the quick brown fox jumped");
164 vector<pair<unsigned int, unsigned> > parts;
165 vstringtok(parts, str);
166 }
167};
168
179dad39 169struct StringAppendTest
170{
171 string getName() const
172 {
173 return "stringappend";
174 }
175
176 void operator()() const
177 {
178 string str;
179 static char i;
180 for(int n=0; n < 1000; ++n)
181 str.append(1, i);
182 i++;
183 }
184};
185
7519bae5 186
6b0ea82d 187struct BoostStringAppendTest
188{
189 string getName() const
190 {
191 return "booststringappend";
192 }
193
194 void operator()() const
195 {
196 boost::container::string str;
197 static char i;
198 for(int n=0; n < 1000; ++n)
199 str.append(1, i);
200 i++;
201 }
202};
203
204
205
34383528
BH
206struct MakeARecordTest
207{
208 string getName() const
209 {
210 return (boost::format("make a-record")).str();
211 }
212
213 void operator()() const
214 {
215 static string src("1.2.3.4");
216 ARecordContent arc(src);
217 //ARecordContent arc(0x01020304);
218
219 }
220};
221
6b0ea82d 222vector<uint8_t> makeBigReferral()
223{
224
225 vector<uint8_t> packet;
226 DNSPacketWriter pw(packet, DNSName("www.google.com"), QType::A);
227
228 string gtld="x.gtld-servers.net";
229 for(char c='a'; c<= 'm';++c) {
230 pw.startRecord(DNSName("com"), QType::NS, 3600, 1, DNSResourceRecord::AUTHORITY);
231 gtld[0]=c;
32122aab 232 auto drc = DNSRecordContent::mastermake(QType::NS, 1, gtld);
6b0ea82d 233 drc->toPacket(pw);
6b0ea82d 234 }
235
236 for(char c='a'; c<= 'k';++c) {
237 gtld[0]=c;
238 pw.startRecord(DNSName(gtld), QType::A, 3600, 1, DNSResourceRecord::ADDITIONAL);
32122aab 239 auto drc = DNSRecordContent::mastermake(QType::A, 1, "1.2.3.4");
6b0ea82d 240 drc->toPacket(pw);
6b0ea82d 241 }
242
243
244 pw.startRecord(DNSName("a.gtld-servers.net"), QType::AAAA, 3600, 1, DNSResourceRecord::ADDITIONAL);
32122aab 245 auto aaaarc = DNSRecordContent::mastermake(QType::AAAA, 1, "2001:503:a83e::2:30");
6b0ea82d 246 aaaarc->toPacket(pw);
6b0ea82d 247
248 pw.startRecord(DNSName("b.gtld-servers.net"), QType::AAAA, 3600, 1, DNSResourceRecord::ADDITIONAL);
32122aab 249 aaaarc = DNSRecordContent::mastermake(QType::AAAA, 1, "2001:503:231d::2:30");
6b0ea82d 250 aaaarc->toPacket(pw);
6b0ea82d 251
252
253 pw.commit();
254 return packet;
255}
256
257vector<uint8_t> makeBigDNSPacketReferral()
258{
259 vector<DNSResourceRecord> records;
260 DNSResourceRecord rr;
261 rr.qtype = QType::NS;
262 rr.ttl=3600;
263 rr.qname=DNSName("com");
6b0ea82d 264
265 string gtld="x.gtld-servers.net";
266 for(char c='a'; c<= 'm';++c) {
267 gtld[0]=c;
268 rr.content = gtld;
269 records.push_back(rr);
270 }
271
272 rr.qtype = QType::A;
273 for(char c='a'; c<= 'k';++c) {
274 gtld[0]=c;
275 rr.qname=DNSName(gtld);
276 rr.content="1.2.3.4";
277 records.push_back(rr);
278 }
279
280 rr.qname=DNSName("a.gtld-servers.net");
281 rr.qtype=QType::AAAA;
282 rr.content="2001:503:a83e::2:30";
283 records.push_back(rr);
284
285 rr.qname=DNSName("b.gtld-servers.net");
286 rr.qtype=QType::AAAA;
287 rr.content="2001:503:231d::2:30";
288 records.push_back(rr);
289
290
291 vector<uint8_t> packet;
292 DNSPacketWriter pw(packet, DNSName("www.google.com"), QType::A);
d190894c 293 // shuffle(records);
6b0ea82d 294 for(const auto& rec : records) {
8695de46 295 pw.startRecord(rec.qname, rec.qtype.getCode(), rec.ttl, 1, DNSResourceRecord::ADDITIONAL);
32122aab 296 auto drc = DNSRecordContent::mastermake(rec.qtype.getCode(), 1, rec.content);
6b0ea82d 297 drc->toPacket(pw);
6b0ea82d 298 }
299
300 pw.commit();
301 return packet;
302}
303
304
305
34383528
BH
306struct MakeARecordTestMM
307{
308 string getName() const
309 {
310 return (boost::format("make a-record (mm)")).str();
311 }
312
313 void operator()() const
314 {
32122aab 315 auto drc = DNSRecordContent::mastermake(QType::A, 1,
6177a176 316 "1.2.3.4");
34383528
BH
317 }
318};
319
320
321struct A2RecordTest
322{
323 explicit A2RecordTest(int records) : d_records(records) {}
324
325 string getName() const
326 {
327 return (boost::format("%d a records") % d_records).str();
328 }
329
330 void operator()() const
331 {
332 vector<uint8_t> packet;
e325f20c 333 DNSPacketWriter pw(packet, DNSName("outpost.ds9a.nl"), QType::A);
34383528 334 ARecordContent arc("1.2.3.4");
e325f20c 335 DNSName name("outpost.ds9a.nl");
34383528
BH
336 for(int records = 0; records < d_records; records++) {
337 pw.startRecord(name, QType::A);
338
339 arc.toPacket(pw);
340 }
341 pw.commit();
342 }
343 int d_records;
344};
345
346
347struct TXTRecordTest
348{
349 explicit TXTRecordTest(int records) : d_records(records) {}
350
351 string getName() const
352 {
353 return (boost::format("%d TXT records") % d_records).str();
354 }
355
356 void operator()() const
357 {
358 vector<uint8_t> packet;
e325f20c 359 DNSPacketWriter pw(packet, DNSName("outpost.ds9a.nl"), QType::TXT);
34383528 360 for(int records = 0; records < d_records; records++) {
e325f20c 361 pw.startRecord(DNSName("outpost.ds9a.nl"), QType::TXT);
34383528
BH
362 TXTRecordContent arc("\"een leuk verhaaltje in een TXT\"");
363 arc.toPacket(pw);
364 }
365 pw.commit();
366 }
367 int d_records;
368};
369
370
371struct GenericRecordTest
372{
373 explicit GenericRecordTest(int records, uint16_t type, const std::string& content)
374 : d_records(records), d_type(type), d_content(content) {}
375
376 string getName() const
377 {
378 return (boost::format("%d %s records") % d_records %
b7821a82 379 DNSRecordContent::NumberToType(d_type)).str();
34383528
BH
380 }
381
382 void operator()() const
383 {
384 vector<uint8_t> packet;
e325f20c 385 DNSPacketWriter pw(packet, DNSName("outpost.ds9a.nl"), d_type);
34383528 386 for(int records = 0; records < d_records; records++) {
e325f20c 387 pw.startRecord(DNSName("outpost.ds9a.nl"), d_type);
32122aab 388 auto drc = DNSRecordContent::mastermake(d_type, 1,
6177a176 389 d_content);
34383528 390 drc->toPacket(pw);
34383528
BH
391 }
392 pw.commit();
393 }
394 int d_records;
395 uint16_t d_type;
396 string d_content;
397};
398
399
400struct AAAARecordTest
401{
402 explicit AAAARecordTest(int records) : d_records(records) {}
403
404 string getName() const
405 {
406 return (boost::format("%d aaaa records (mm)") % d_records).str();
407 }
408
409 void operator()() const
410 {
411 vector<uint8_t> packet;
e325f20c 412 DNSPacketWriter pw(packet, DNSName("outpost.ds9a.nl"), QType::AAAA);
34383528 413 for(int records = 0; records < d_records; records++) {
e325f20c 414 pw.startRecord(DNSName("outpost.ds9a.nl"), QType::AAAA);
32122aab 415 auto drc = DNSRecordContent::mastermake(QType::AAAA, 1, "fe80::21d:92ff:fe6d:8441");
34383528 416 drc->toPacket(pw);
34383528
BH
417 }
418 pw.commit();
419 }
420 int d_records;
421};
422
423struct SOARecordTest
424{
425 explicit SOARecordTest(int records) : d_records(records) {}
426
427 string getName() const
428 {
429 return (boost::format("%d soa records (mm)") % d_records).str();
430 }
431
432 void operator()() const
433 {
434 vector<uint8_t> packet;
e325f20c 435 DNSPacketWriter pw(packet, DNSName("outpost.ds9a.nl"), QType::SOA);
34383528
BH
436
437 for(int records = 0; records < d_records; records++) {
e325f20c 438 pw.startRecord(DNSName("outpost.ds9a.nl"), QType::SOA);
32122aab 439 auto drc = DNSRecordContent::mastermake(QType::SOA, 1, "a0.org.afilias-nst.info. noc.afilias-nst.info. 2008758137 1800 900 604800 86400");
34383528 440 drc->toPacket(pw);
34383528
BH
441 }
442 pw.commit();
443 }
444 int d_records;
445};
446
447vector<uint8_t> makeEmptyQuery()
448{
449 vector<uint8_t> packet;
e325f20c 450 DNSPacketWriter pw(packet, DNSName("outpost.ds9a.nl"), QType::SOA);
34383528
BH
451 return packet;
452}
453
34383528
BH
454vector<uint8_t> makeTypicalReferral()
455{
456 vector<uint8_t> packet;
e325f20c 457 DNSPacketWriter pw(packet, DNSName("outpost.ds9a.nl"), QType::A);
34383528 458
e693ff5a 459 pw.startRecord(DNSName("ds9a.nl"), QType::NS, 3600, 1, DNSResourceRecord::AUTHORITY);
32122aab 460 auto drc = DNSRecordContent::mastermake(QType::NS, 1, "ns1.ds9a.nl");
34383528 461 drc->toPacket(pw);
34383528 462
e693ff5a 463 pw.startRecord(DNSName("ds9a.nl"), QType::NS, 3600, 1, DNSResourceRecord::AUTHORITY);
32122aab 464 drc = DNSRecordContent::mastermake(QType::NS, 1, "ns2.ds9a.nl");
34383528 465 drc->toPacket(pw);
34383528
BH
466
467
e693ff5a 468 pw.startRecord(DNSName("ns1.ds9a.nl"), QType::A, 3600, 1, DNSResourceRecord::ADDITIONAL);
32122aab 469 drc = DNSRecordContent::mastermake(QType::A, 1, "1.2.3.4");
34383528 470 drc->toPacket(pw);
34383528 471
e693ff5a 472 pw.startRecord(DNSName("ns2.ds9a.nl"), QType::A, 3600, 1, DNSResourceRecord::ADDITIONAL);
32122aab 473 drc = DNSRecordContent::mastermake(QType::A, 1, "4.3.2.1");
34383528 474 drc->toPacket(pw);
34383528
BH
475
476 pw.commit();
477 return packet;
478}
479
b7821a82
BH
480struct StackMallocTest
481{
482 string getName() const
483 {
484 return "stack allocation";
485 }
486
487 void operator()() const
488 {
489 char *buffer= new char[200000];
4da9585d 490 delete[] buffer;
b7821a82
BH
491 }
492
493};
494
495
34383528
BH
496struct EmptyQueryTest
497{
498 string getName() const
499 {
500 return "write empty query";
501 }
502
503 void operator()() const
504 {
505 vector<uint8_t> packet=makeEmptyQuery();
506 }
507
508};
509
510struct TypicalRefTest
511{
512 string getName() const
513 {
514 return "write typical referral";
515 }
516
517 void operator()() const
518 {
519 vector<uint8_t> packet=makeTypicalReferral();
520 }
521
522};
523
6b0ea82d 524struct BigRefTest
525{
526 string getName() const
527 {
528 return "write big referral";
529 }
530
531 void operator()() const
532 {
533 vector<uint8_t> packet=makeBigReferral();
534 }
535
536};
537
538struct BigDNSPacketRefTest
539{
540 string getName() const
541 {
542 return "write big dnspacket referral";
543 }
544
545 void operator()() const
546 {
547 vector<uint8_t> packet=makeBigDNSPacketReferral();
548 }
549
550};
551
552
b7821a82
BH
553struct TCacheComp
554{
0c0fd241 555 bool operator()(const pair<DNSName, QType>& a, const pair<DNSName, QType>& b) const
b7821a82 556 {
0c0fd241 557 if(a.first < b.first)
b7821a82 558 return true;
0c0fd241 559 if(b.first < a.first)
b7821a82
BH
560 return false;
561
562 return a.second < b.second;
563 }
564};
565
566struct NegCacheEntry
567{
8171ab83 568 DNSName d_name;
b7821a82 569 QType d_qtype;
8171ab83 570 DNSName d_qname;
b7821a82
BH
571 uint32_t d_ttd;
572};
573
574struct timeval d_now;
575
b7821a82 576
34383528
BH
577
578struct ParsePacketTest
579{
580 explicit ParsePacketTest(const vector<uint8_t>& packet, const std::string& name)
581 : d_packet(packet), d_name(name)
582 {}
583
584 string getName() const
585 {
586 return "parse '"+d_name+"'";
587 }
588
589 void operator()() const
590 {
27c0050c 591 MOADNSParser mdp(false, (const char*)&*d_packet.begin(), d_packet.size());
e8b23f3b 592 typedef map<pair<DNSName, QType>, set<DNSResourceRecord>, TCacheComp > tcache_t;
b7821a82
BH
593 tcache_t tcache;
594
595 struct {
596 vector<DNSResourceRecord> d_result;
597 bool d_aabit;
598 int d_rcode;
599 } lwr;
600 DNSResourceRecord rr;
601 for(MOADNSParser::answers_t::const_iterator i=mdp.d_answers.begin(); i!=mdp.d_answers.end(); ++i) {
602 DNSResourceRecord rr;
603 rr.qtype=i->first.d_type;
e325f20c 604 rr.qname=i->first.d_name;
b7821a82
BH
605
606 rr.ttl=i->first.d_ttl;
607 rr.content=i->first.d_content->getZoneRepresentation(); // this should be the serialised form
b7821a82
BH
608 lwr.d_result.push_back(rr);
609 }
610
8b77d409 611
34383528
BH
612 }
613 const vector<uint8_t>& d_packet;
614 std::string d_name;
615};
616
b7821a82
BH
617struct ParsePacketBareTest
618{
619 explicit ParsePacketBareTest(const vector<uint8_t>& packet, const std::string& name)
620 : d_packet(packet), d_name(name)
621 {}
622
623 string getName() const
624 {
625 return "parse '"+d_name+"' bare";
626 }
627
628 void operator()() const
629 {
27c0050c 630 MOADNSParser mdp(false, (const char*)&*d_packet.begin(), d_packet.size());
b7821a82
BH
631 }
632 const vector<uint8_t>& d_packet;
633 std::string d_name;
634};
635
636
34383528
BH
637struct SimpleCompressTest
638{
639 explicit SimpleCompressTest(const std::string& name)
640 : d_name(name)
641 {}
642
643 string getName() const
644 {
645 return "compress '"+d_name+"'";
646 }
647
648 void operator()() const
649 {
650 simpleCompress(d_name);
651 }
652 std::string d_name;
653};
654
655struct VectorExpandTest
656{
657 string getName() const
658 {
659 return "vector expand";
660 }
661
662 void operator()() const
663 {
664 vector<uint8_t> d_record;
665 d_record.resize(12);
666
667 string out="\x03www\x04ds9a\x02nl";
668 string::size_type len = d_record.size();
669 d_record.resize(len + out.length());
670 memcpy(&d_record[len], out.c_str(), out.length());
671 }
672
673};
674
b8a514bb 675struct DNSNameParseTest
676{
677 string getName() const
678 {
679 return "DNSName parse";
680 }
681
682 void operator()() const
683 {
684 DNSName name("www.powerdns.com");
685 }
686
687};
688
689struct DNSNameRootTest
690{
691 string getName() const
692 {
693 return "DNSName root";
694 }
695
696 void operator()() const
697 {
698 DNSName name(".");
699 }
700
701};
702
b7821a82
BH
703
704
705struct IEqualsTest
706{
707 string getName() const
708 {
709 return "iequals test";
710 }
711
712 void operator()() const
713 {
714 static string a("www.ds9a.nl"), b("www.lwn.net");
b00cab1d 715 g_ret = boost::iequals(a, b);
b7821a82
BH
716 }
717
718};
719
720struct MyIEqualsTest
721{
722 string getName() const
723 {
724 return "pdns_iequals test";
725 }
726
727 void operator()() const
728 {
729 static string a("www.ds9a.nl"), b("www.lwn.net");
b00cab1d 730 g_ret = pdns_iequals(a, b);
b7821a82
BH
731 }
732
733};
734
735
736struct StrcasecmpTest
737{
738 string getName() const
739 {
740 return "strcasecmp test";
741 }
742
743 void operator()() const
744 {
745 static string a("www.ds9a.nl"), b("www.lwn.net");
b00cab1d 746 g_ret = strcasecmp(a.c_str(), b.c_str());
b7821a82
BH
747 }
748};
749
750
88227be0
KM
751struct Base64EncodeTest
752{
753 string getName() const
754 {
755 return "Bas64Encode test";
756 }
757
758 void operator()() const
759 {
760 static string a("dq4KydZjmcoQQ45VYBP2EDR8FqKaMul0eSHBt7Xx5F7A4HFtabXEzDLD01bnSiGK");
761 Base64Encode(a);
762 }
763};
764
765
766struct B64DecodeTest
767{
768 string getName() const
769 {
770 return "B64Decode test";
771 }
772
773 void operator()() const
774 {
775 static string a("ZHE0S3lkWmptY29RUTQ1VllCUDJFRFI4RnFLYU11bDBlU0hCdDdYeDVGN0E0SEZ0YWJYRXpETEQwMWJuU2lHSw=="), b;
776 g_ret = B64Decode(a,b);
777 }
778};
779
780
34383528
BH
781struct NOPTest
782{
783 string getName() const
784 {
785 return "null test";
786 }
787
788 void operator()() const
789 {
790 }
791
792};
793
b756da67
PL
794struct StatRingDNSNameQTypeToStringTest
795{
796 explicit StatRingDNSNameQTypeToStringTest(const DNSName &name, const QType type) : d_name(name), d_type(type) {}
797
798 string getName() const { return "StatRing test with DNSName and QType to string"; }
799
800 void operator()() const {
801 S.ringAccount("testring", d_name.toLogString()+"/"+d_type.getName());
802 };
803
804 DNSName d_name;
805 QType d_type;
806};
807
c410bb1d
PL
808struct StatRingDNSNameQTypeTest
809{
810 explicit StatRingDNSNameQTypeTest(const DNSName &name, const QType type) : d_name(name), d_type(type) {}
811
812 string getName() const { return "StatRing test with DNSName and QType"; }
813
814 void operator()() const {
3b2aeba3 815 S.ringAccount("testringdnsname", d_name, d_type);
c410bb1d
PL
816 };
817
818 DNSName d_name;
819 QType d_type;
820};
821
34383528
BH
822
823
824int main(int argc, char** argv)
825try
826{
827 reportAllTypes();
e325f20c 828
b7821a82 829 doRun(NOPTest());
ecefa116 830
b7821a82
BH
831 doRun(IEqualsTest());
832 doRun(MyIEqualsTest());
833 doRun(StrcasecmpTest());
88227be0
KM
834 doRun(Base64EncodeTest());
835 doRun(B64DecodeTest());
b7821a82
BH
836
837 doRun(StackMallocTest());
34383528 838
34383528
BH
839 doRun(EmptyQueryTest());
840 doRun(TypicalRefTest());
6b0ea82d 841 doRun(BigRefTest());
842 doRun(BigDNSPacketRefTest());
34383528 843
69319910 844 auto packet = makeEmptyQuery();
34383528
BH
845 doRun(ParsePacketTest(packet, "empty-query"));
846
847 packet = makeTypicalReferral();
848 cerr<<"typical referral size: "<<packet.size()<<endl;
b7821a82 849 doRun(ParsePacketBareTest(packet, "typical-referral"));
34383528 850
b7821a82 851 doRun(ParsePacketTest(packet, "typical-referral"));
34383528
BH
852
853 doRun(SimpleCompressTest("www.france.ds9a.nl"));
854
b7821a82 855
34383528 856 doRun(VectorExpandTest());
7519bae5
BH
857
858 doRun(GetTimeTest());
1f9faf8b
BH
859
860 doRun(GetLockUncontendedTest());
861 doRun(StaticMemberTest());
862
34383528
BH
863 doRun(ARecordTest(1));
864 doRun(ARecordTest(2));
865 doRun(ARecordTest(4));
866 doRun(ARecordTest(64));
867
868 doRun(A2RecordTest(1));
869 doRun(A2RecordTest(2));
870 doRun(A2RecordTest(4));
871 doRun(A2RecordTest(64));
872
873 doRun(MakeStringFromCharStarTest());
874 doRun(MakeARecordTest());
875 doRun(MakeARecordTestMM());
876
877 doRun(AAAARecordTest(1));
878 doRun(AAAARecordTest(2));
879 doRun(AAAARecordTest(4));
880 doRun(AAAARecordTest(64));
881
882 doRun(TXTRecordTest(1));
883 doRun(TXTRecordTest(2));
884 doRun(TXTRecordTest(4));
885 doRun(TXTRecordTest(64));
886
887 doRun(GenericRecordTest(1, QType::NS, "powerdnssec1.ds9a.nl"));
888 doRun(GenericRecordTest(2, QType::NS, "powerdnssec1.ds9a.nl"));
889 doRun(GenericRecordTest(4, QType::NS, "powerdnssec1.ds9a.nl"));
890 doRun(GenericRecordTest(64, QType::NS, "powerdnssec1.ds9a.nl"));
891
ab570fc5 892
34383528
BH
893
894 doRun(SOARecordTest(1));
895 doRun(SOARecordTest(2));
896 doRun(SOARecordTest(4));
897 doRun(SOARecordTest(64));
898
ab570fc5 899 doRun(StringtokTest());
900 doRun(VStringtokTest());
179dad39 901 doRun(StringAppendTest());
6b0ea82d 902 doRun(BoostStringAppendTest());
ab570fc5 903
b8a514bb 904 doRun(DNSNameParseTest());
905 doRun(DNSNameRootTest());
906
b756da67
PL
907#ifndef RECURSOR
908 S.doRings();
909
910 S.declareRing("testring", "Just some ring where we'll account things");
911 doRun(StatRingDNSNameQTypeToStringTest(DNSName("example.com"), QType(1)));
c410bb1d 912
3b2aeba3 913 S.declareDNSNameQTypeRing("testringdnsname", "Just some ring where we'll account things");
c410bb1d 914 doRun(StatRingDNSNameQTypeTest(DNSName("example.com"), QType(1)));
b756da67
PL
915#endif
916
34383528
BH
917 cerr<<"Total runs: " << g_totalRuns<<endl;
918
919}
920catch(std::exception &e)
921{
922 cerr<<"Fatal: "<<e.what()<<endl;
923}
924