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