summaryrefslogtreecommitdiffstats
path: root/runtime/base/histogram_test.cc
diff options
context:
space:
mode:
authorIan Rogers <irogers@google.com>2014-10-10 11:02:11 -0700
committerIan Rogers <irogers@google.com>2014-10-10 12:26:02 -0700
commit647b1a86f518d8db0331b3d52a96392b7a62504b (patch)
tree7370f795ef3c7fbdd2695d23bc6f8171f40f43f1 /runtime/base/histogram_test.cc
parentacfbbd4df2fc1c79a7102587bebf398f95b5e5de (diff)
downloadart-647b1a86f518d8db0331b3d52a96392b7a62504b.zip
art-647b1a86f518d8db0331b3d52a96392b7a62504b.tar.gz
art-647b1a86f518d8db0331b3d52a96392b7a62504b.tar.bz2
Fix 2 new sets of clang compiler warnings.
Fix issues that are flagged by -Wfloat-equal and -Wmissing-noreturn. In the case of -Wfloat-equal the current cases in regular code are deliberate, so the change is to silence the warning. For gtest code the appropriate fix is to switch from EXPECT_EQ to EXPECT_(FLOAT|DOUBLE)_EQ. The -Wmissing-noreturn warning isn't enabled due to a missing noreturn in gtest. This issue has been reported to gtest. Change-Id: Id84c70c21c542716c9ee0c41492e8ff8788c4ef8
Diffstat (limited to 'runtime/base/histogram_test.cc')
-rw-r--r--runtime/base/histogram_test.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/runtime/base/histogram_test.cc b/runtime/base/histogram_test.cc
index 454f2ab..7aa5f90 100644
--- a/runtime/base/histogram_test.cc
+++ b/runtime/base/histogram_test.cc
@@ -41,14 +41,14 @@ TEST(Histtest, MeanTest) {
hist->AddValue(static_cast<uint64_t>(50));
}
mean = hist->Mean();
- EXPECT_EQ(mean, 50);
+ EXPECT_DOUBLE_EQ(mean, 50.0);
hist->Reset();
hist->AddValue(9);
hist->AddValue(17);
hist->AddValue(28);
hist->AddValue(28);
mean = hist->Mean();
- EXPECT_EQ(20.5, mean);
+ EXPECT_DOUBLE_EQ(20.5, mean);
}
TEST(Histtest, VarianceTest) {
@@ -60,7 +60,7 @@ TEST(Histtest, VarianceTest) {
hist->AddValue(28);
hist->AddValue(28);
variance = hist->Variance();
- EXPECT_EQ(64.25, variance);
+ EXPECT_DOUBLE_EQ(64.25, variance);
}
TEST(Histtest, Percentile) {
@@ -236,7 +236,7 @@ TEST(Histtest, CappingPercentiles) {
}
hist->CreateHistogram(&data);
per_995 = hist->Percentile(0.995, data);
- EXPECT_EQ(per_995, 0);
+ EXPECT_DOUBLE_EQ(per_995, 0.0);
hist->Reset();
for (size_t idx = 0; idx < 200; idx++) {
for (uint64_t val = 1ull; val <= 4ull; val++) {
@@ -246,8 +246,8 @@ TEST(Histtest, CappingPercentiles) {
hist->CreateHistogram(&data);
per_005 = hist->Percentile(0.005, data);
per_995 = hist->Percentile(0.995, data);
- EXPECT_EQ(1, per_005);
- EXPECT_EQ(4, per_995);
+ EXPECT_DOUBLE_EQ(1.0, per_005);
+ EXPECT_DOUBLE_EQ(4.0, per_995);
}
TEST(Histtest, SpikyValues) {