diff options
author | 2014-10-10 11:02:11 -0700 | |
---|---|---|
committer | 2014-10-10 12:26:02 -0700 | |
commit | 647b1a86f518d8db0331b3d52a96392b7a62504b (patch) | |
tree | 7370f795ef3c7fbdd2695d23bc6f8171f40f43f1 /runtime/class_linker_test.cc | |
parent | acfbbd4df2fc1c79a7102587bebf398f95b5e5de (diff) |
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/class_linker_test.cc')
-rw-r--r-- | runtime/class_linker_test.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/runtime/class_linker_test.cc b/runtime/class_linker_test.cc index e990181aa8..88e6265df5 100644 --- a/runtime/class_linker_test.cc +++ b/runtime/class_linker_test.cc @@ -907,12 +907,12 @@ TEST_F(ClassLinkerTest, StaticFields) { mirror::ArtField* s6 = mirror::Class::FindStaticField(soa.Self(), statics, "s6", "F"); EXPECT_EQ(s6->GetTypeAsPrimitiveType(), Primitive::kPrimFloat); - EXPECT_EQ(0.5, s6->GetFloat(statics.Get())); + EXPECT_DOUBLE_EQ(0.5, s6->GetFloat(statics.Get())); s6->SetFloat<false>(statics.Get(), 0.75); mirror::ArtField* s7 = mirror::Class::FindStaticField(soa.Self(), statics, "s7", "D"); EXPECT_EQ(s7->GetTypeAsPrimitiveType(), Primitive::kPrimDouble); - EXPECT_EQ(16777217, s7->GetDouble(statics.Get())); + EXPECT_DOUBLE_EQ(16777217.0, s7->GetDouble(statics.Get())); s7->SetDouble<false>(statics.Get(), 16777219); mirror::ArtField* s8 = mirror::Class::FindStaticField(soa.Self(), statics, "s8", @@ -930,8 +930,8 @@ TEST_F(ClassLinkerTest, StaticFields) { EXPECT_EQ(-535, s3->GetShort(statics.Get())); EXPECT_EQ(2000000001, s4->GetInt(statics.Get())); EXPECT_EQ(INT64_C(0x34567890abcdef12), s5->GetLong(statics.Get())); - EXPECT_EQ(0.75, s6->GetFloat(statics.Get())); - EXPECT_EQ(16777219, s7->GetDouble(statics.Get())); + EXPECT_FLOAT_EQ(0.75, s6->GetFloat(statics.Get())); + EXPECT_DOUBLE_EQ(16777219.0, s7->GetDouble(statics.Get())); EXPECT_TRUE(s8->GetObject(statics.Get())->AsString()->Equals("robot")); } |