]> granicus.if.org Git - pdns/commitdiff
speed up the testbag test a bit (by doing smaller tests)
authorbert hubert <bert.hubert@netherlabs.nl>
Fri, 5 Dec 2014 11:04:01 +0000 (12:04 +0100)
committermind04 <mind04@monshouwer.org>
Tue, 23 Dec 2014 07:34:08 +0000 (08:34 +0100)
pdns/test-statbag_cc.cc

index 9f5cbfde9e07a31300a2aaddb86e41948ac7e1d7..48b82ea5b2c5e8c5dfbb96dff19abbb599db8644 100644 (file)
@@ -15,7 +15,7 @@ using std::string;
 static void *threadMangler(void* a)
 {
   AtomicCounter* ac = (AtomicCounter*)a;
-  for(unsigned int n=0; n < 10000000; ++n)
+  for(unsigned int n=0; n < 1000000; ++n)
     (*ac)++;
   return 0;
 }
@@ -23,7 +23,7 @@ static void *threadMangler(void* a)
 static void *threadMangler2(void* a)
 {
   StatBag* S = (StatBag*)a;
-  for(unsigned int n=0; n < 10000000; ++n)
+  for(unsigned int n=0; n < 1000000; ++n)
     S->inc("c");
   return 0;
 }
@@ -60,7 +60,7 @@ BOOST_AUTO_TEST_CASE(test_StatBagBasic) {
   for(int i=0; i < 4 ; ++i)
     pthread_join(tid[i], &res);
 
-  BOOST_CHECK_EQUAL(s.read("c"), 40000000U);
+  BOOST_CHECK_EQUAL(s.read("c"), 4000000U);
  
   s.set("c", 0);
 
@@ -70,7 +70,7 @@ BOOST_AUTO_TEST_CASE(test_StatBagBasic) {
   for(int i=0; i < 4 ; ++i)
     pthread_join(tid[i], &res);
 
-  BOOST_CHECK_EQUAL(s.read("c"), 40000000U);
+  BOOST_CHECK_EQUAL(s.read("c"), 4000000U);
 
 
   s.set("c", 1ULL<<31);