Project

General

Profile

Actions

Bug #9235

closed

unittest_histogram test case Histogram.Position fail

Added by wei li over 9 years ago. Updated over 9 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
common
Target version:
-
% Done:

100%

Source:
Community (user)
Tags:
Backport:
firefly
Regression:
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

unittest_histogram test case Histogram.Position fail.

https://github.com/ceph/ceph/blob/master/src/test/common/histogram.cc, line 102,103 has problem.
Here missing the assignment for lb and ub.

In my env, centos7, x86_64.
total: 18446744073709551614, upper_sum: 18446744073709551615, lower_sum: 18446744073709551615, bin: 3
lb: 0 ; ub: 0

So the diff for this unittest need change to

diff --git a/src/test/common/histogram.cc b/src/test/common/histogram.cc
index 2fd3cfe..6b9de1e 100644
--- a/src/test/common/histogram.cc
+++ b/src/test/common/histogram.cc
@@ -99,8 +99,9 @@ TEST(Histogram, Position) {
     h.h[0] = UINT_MAX;
     h.h[5] = UINT_MAX;
     uint64_t lb, ub;
-    ASSERT_EQ(500000u, lb);
-    ASSERT_EQ(500000u, ub);
+    h.get_position_micro(4, &lb, &ub);
+    ASSERT_EQ(0u, lb);
+    ASSERT_EQ(0u, ub);
   }
 }

Actions

Also available in: Atom PDF