]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Basic speedtest for NetmaksGroup 7708/head
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Mon, 15 Apr 2019 07:05:22 +0000 (09:05 +0200)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Mon, 15 Apr 2019 07:05:22 +0000 (09:05 +0200)
pdns/Makefile.am
pdns/speedtest.cc

index 6749e4cf6e15e6d3aa4608ff818209b56a531ea4..e991c570f0888e78b4a448e1cbeb9da4e7b67af1 100644 (file)
@@ -877,7 +877,8 @@ speedtest_SOURCES = \
        sillyrecords.cc \
        speedtest.cc \
        statbag.cc \
-       unix_utility.cc
+       unix_utility.cc \
+       iputils.cc
 
 speedtest_LDFLAGS = $(AM_LDFLAGS) $(LIBCRYPTO_LDFLAGS)
 speedtest_LDADD = $(LIBCRYPTO_LIBS) \
index 3f923cb1bd77391750e5a6736e259778566cb3f4..381c373f313ba19017bb1ccac48a179432fd1215 100644 (file)
@@ -6,6 +6,7 @@
 #include "misc.hh"
 #include "dnswriter.hh"
 #include "dnsrecords.hh"
+#include "iputils.hh"
 #include <fstream>
 
 #ifndef RECURSOR
@@ -820,6 +821,18 @@ struct StatRingDNSNameQTypeTest
 };
 
 
+struct NetmaskTreeTest
+{
+  string getName() const { return "NetmaskTreeTest"; }
+
+  void operator()() const {
+    Netmask nm("ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff/64");
+    NetmaskTree<bool> tree;
+
+    for (int i = 0; i < 100; i++)
+      tree.insert_or_assign(nm, true);
+  }
+};
 
 int main(int argc, char** argv)
 try
@@ -904,6 +917,8 @@ try
   doRun(DNSNameParseTest());
   doRun(DNSNameRootTest());
 
+  doRun(NetmaskTreeTest());
+
 #ifndef RECURSOR
   S.doRings();