]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
common/DecayCounter: do not decay when testing denc
authorKefu Chai <kchai@redhat.com>
Sun, 25 Aug 2019 13:22:16 +0000 (21:22 +0800)
committerKefu Chai <kchai@redhat.com>
Tue, 27 Aug 2019 05:00:41 +0000 (13:00 +0800)
check-generated.sh tries to verify the invariance of a type after
encoding and decoding. so we should keep the value of `DecayCounter` the
same when encoding/decoding/dumping.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/common/DecayCounter.cc
src/common/DecayCounter.h

index cbf38d6b0754c9fab654435bf2edbc8182bbcd4f..a0cf194216d807ec92bd4bf29875dbc1ce184c55 100644 (file)
@@ -58,7 +58,6 @@ void DecayCounter::generate_test_instances(std::list<DecayCounter*>& ls)
 {
   DecayCounter *counter = new DecayCounter();
   counter->val = 3.0;
-  counter->rate = DecayRate(2.0);
   ls.push_back(counter);
   counter = new DecayCounter();
   ls.push_back(counter);
index 542d9c2f53204079d44881ddc6fdac0d6f998151..b9cbef429072696a9221893a5d35fc86817e1ee9 100644 (file)
@@ -43,7 +43,7 @@ public:
 
   void set_halflife(double hl) {
     k = log(.5) / hl;
-  }    
+  }
 
 private:
   double k = 0;             // k = ln(.5)/half_life