]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Add a sum test for histogram
authorOtto <otto.moerbeek@open-xchange.com>
Tue, 24 Aug 2021 14:15:41 +0000 (16:15 +0200)
committerOtto <otto.moerbeek@open-xchange.com>
Tue, 14 Sep 2021 06:54:01 +0000 (08:54 +0200)
pdns/recursordist/test-histogram_hh.cc

index 3858a6ec74b6d0291f89e8bea6f81ab41400be54..b336df55d55d1e78346dc73654f2f4b23cd4fd4d 100644 (file)
@@ -43,7 +43,7 @@ BOOST_AUTO_TEST_CASE(test_simple)
   h(4);
   h(100);
   h(101);
-  h(-1);
+  h(-1); // actually a very large value, but for sum it will boil down to be -1 */
 
   auto data = h.getRawData();
   BOOST_CHECK_EQUAL(data.size(), 6U);
@@ -60,6 +60,7 @@ BOOST_AUTO_TEST_CASE(test_simple)
   for (auto e : cexpected) {
     BOOST_CHECK_EQUAL(c[i++], e);
   }
+  BOOST_CHECK_EQUAL(h.getSum(), 209U);
 }
 
 BOOST_AUTO_TEST_SUITE_END()