From 647b1a86f518d8db0331b3d52a96392b7a62504b Mon Sep 17 00:00:00 2001 From: Ian Rogers Date: Fri, 10 Oct 2014 11:02:11 -0700 Subject: 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 --- runtime/reflection_test.cc | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'runtime/reflection_test.cc') diff --git a/runtime/reflection_test.cc b/runtime/reflection_test.cc index 75211e00d7..f8e0f47130 100644 --- a/runtime/reflection_test.cc +++ b/runtime/reflection_test.cc @@ -193,19 +193,19 @@ class ReflectionTest : public CommonCompilerTest { args[0].d = 0.0; JValue result = InvokeWithJValues(soa, receiver, soa.EncodeMethod(method), args); - EXPECT_EQ(0.0, result.GetD()); + EXPECT_DOUBLE_EQ(0.0, result.GetD()); args[0].d = -1.0; result = InvokeWithJValues(soa, receiver, soa.EncodeMethod(method), args); - EXPECT_EQ(-1.0, result.GetD()); + EXPECT_DOUBLE_EQ(-1.0, result.GetD()); args[0].d = DBL_MAX; result = InvokeWithJValues(soa, receiver, soa.EncodeMethod(method), args); - EXPECT_EQ(DBL_MAX, result.GetD()); + EXPECT_DOUBLE_EQ(DBL_MAX, result.GetD()); args[0].d = DBL_MIN; result = InvokeWithJValues(soa, receiver, soa.EncodeMethod(method), args); - EXPECT_EQ(DBL_MIN, result.GetD()); + EXPECT_DOUBLE_EQ(DBL_MIN, result.GetD()); } void InvokeSumIntIntMethod(bool is_static) { @@ -375,27 +375,27 @@ class ReflectionTest : public CommonCompilerTest { args[0].d = 0.0; args[1].d = 0.0; JValue result = InvokeWithJValues(soa, receiver, soa.EncodeMethod(method), args); - EXPECT_EQ(0.0, result.GetD()); + EXPECT_DOUBLE_EQ(0.0, result.GetD()); args[0].d = 1.0; args[1].d = 2.0; result = InvokeWithJValues(soa, receiver, soa.EncodeMethod(method), args); - EXPECT_EQ(3.0, result.GetD()); + EXPECT_DOUBLE_EQ(3.0, result.GetD()); args[0].d = 1.0; args[1].d = -2.0; result = InvokeWithJValues(soa, receiver, soa.EncodeMethod(method), args); - EXPECT_EQ(-1.0, result.GetD()); + EXPECT_DOUBLE_EQ(-1.0, result.GetD()); args[0].d = DBL_MAX; args[1].d = DBL_MIN; result = InvokeWithJValues(soa, receiver, soa.EncodeMethod(method), args); - EXPECT_EQ(1.7976931348623157e308, result.GetD()); + EXPECT_DOUBLE_EQ(1.7976931348623157e308, result.GetD()); args[0].d = DBL_MAX; args[1].d = DBL_MAX; result = InvokeWithJValues(soa, receiver, soa.EncodeMethod(method), args); - EXPECT_EQ(INFINITY, result.GetD()); + EXPECT_DOUBLE_EQ(INFINITY, result.GetD()); } void InvokeSumDoubleDoubleDoubleMethod(bool is_static) { @@ -409,19 +409,19 @@ class ReflectionTest : public CommonCompilerTest { args[1].d = 0.0; args[2].d = 0.0; JValue result = InvokeWithJValues(soa, receiver, soa.EncodeMethod(method), args); - EXPECT_EQ(0.0, result.GetD()); + EXPECT_DOUBLE_EQ(0.0, result.GetD()); args[0].d = 1.0; args[1].d = 2.0; args[2].d = 3.0; result = InvokeWithJValues(soa, receiver, soa.EncodeMethod(method), args); - EXPECT_EQ(6.0, result.GetD()); + EXPECT_DOUBLE_EQ(6.0, result.GetD()); args[0].d = 1.0; args[1].d = -2.0; args[2].d = 3.0; result = InvokeWithJValues(soa, receiver, soa.EncodeMethod(method), args); - EXPECT_EQ(2.0, result.GetD()); + EXPECT_DOUBLE_EQ(2.0, result.GetD()); } void InvokeSumDoubleDoubleDoubleDoubleMethod(bool is_static) { @@ -436,21 +436,21 @@ class ReflectionTest : public CommonCompilerTest { args[2].d = 0.0; args[3].d = 0.0; JValue result = InvokeWithJValues(soa, receiver, soa.EncodeMethod(method), args); - EXPECT_EQ(0.0, result.GetD()); + EXPECT_DOUBLE_EQ(0.0, result.GetD()); args[0].d = 1.0; args[1].d = 2.0; args[2].d = 3.0; args[3].d = 4.0; result = InvokeWithJValues(soa, receiver, soa.EncodeMethod(method), args); - EXPECT_EQ(10.0, result.GetD()); + EXPECT_DOUBLE_EQ(10.0, result.GetD()); args[0].d = 1.0; args[1].d = -2.0; args[2].d = 3.0; args[3].d = -4.0; result = InvokeWithJValues(soa, receiver, soa.EncodeMethod(method), args); - EXPECT_EQ(-2.0, result.GetD()); + EXPECT_DOUBLE_EQ(-2.0, result.GetD()); } void InvokeSumDoubleDoubleDoubleDoubleDoubleMethod(bool is_static) { @@ -466,7 +466,7 @@ class ReflectionTest : public CommonCompilerTest { args[3].d = 0.0; args[4].d = 0.0; JValue result = InvokeWithJValues(soa, receiver, soa.EncodeMethod(method), args); - EXPECT_EQ(0.0, result.GetD()); + EXPECT_DOUBLE_EQ(0.0, result.GetD()); args[0].d = 1.0; args[1].d = 2.0; @@ -474,7 +474,7 @@ class ReflectionTest : public CommonCompilerTest { args[3].d = 4.0; args[4].d = 5.0; result = InvokeWithJValues(soa, receiver, soa.EncodeMethod(method), args); - EXPECT_EQ(15.0, result.GetD()); + EXPECT_DOUBLE_EQ(15.0, result.GetD()); args[0].d = 1.0; args[1].d = -2.0; @@ -482,7 +482,7 @@ class ReflectionTest : public CommonCompilerTest { args[3].d = -4.0; args[4].d = 5.0; result = InvokeWithJValues(soa, receiver, soa.EncodeMethod(method), args); - EXPECT_EQ(3.0, result.GetD()); + EXPECT_DOUBLE_EQ(3.0, result.GetD()); } JavaVMExt* vm_; -- cgit v1.2.3-59-g8ed1b