]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Introduce speedtest for case insensitive burtle
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Tue, 31 May 2022 08:33:35 +0000 (10:33 +0200)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Tue, 31 May 2022 08:33:35 +0000 (10:33 +0200)
pdns/speedtest.cc

index 652b7ecf09822dc616e8f7206cedb28baf869961..e227aaa49b6686673747608f8d09b7d524483ff4 100644 (file)
@@ -1106,7 +1106,24 @@ struct BurtleHashTest
   void operator()() const
   {
     burtle(reinterpret_cast<const unsigned char*>(d_name.data()), d_name.length(), 0);
+  }
+
+private:
+  const string d_name;
+};
+
+struct BurtleHashCITest
+{
+  explicit BurtleHashCITest(const string& str) : d_name(str) {}
 
+  string getName() const
+  {
+    return "BurtleHashCI";
+  }
+
+  void operator()() const
+  {
+    burtleCI(reinterpret_cast<const unsigned char*>(d_name.data()), d_name.length(), 0);
   }
 
 private:
@@ -1287,6 +1304,7 @@ try
 #endif
 
   doRun(BurtleHashTest("a string of chars"));
+  doRun(BurtleHashCITest("A String Of Chars"));
 #ifdef HAVE_LIBSODIUM
   doRun(SipHashTest("a string of chars"));
 #endif