llvm.org GIT mirror llvm / 9d74909
Fix a test that wasn't testing the right thing. The APFloat "Zero" test was actually calling the APFloat(const fltSemantics &, integerPart) constructor, and EXPECT_EQ was treating 0 and -0 as equal. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138745 91177308-0d34-0410-b5e6-96231b3b80d8 Matt Beaumont-Gay 9 years ago
1 changed file(s) with 7 addition(s) and 5 deletion(s). Raw diff Collapse all Expand all
3333 namespace {
3434
3535 TEST(APFloatTest, Zero) {
36 EXPECT_EQ(0.0f, APFloat(APFloat::IEEEsingle, 0.0f).convertToFloat());
37 EXPECT_EQ(-0.0f, APFloat(APFloat::IEEEsingle, -0.0f).convertToFloat());
38
39 EXPECT_EQ(0.0, APFloat(APFloat::IEEEdouble, 0.0).convertToDouble());
40 EXPECT_EQ(-0.0, APFloat(APFloat::IEEEdouble, -0.0).convertToDouble());
36 EXPECT_EQ(0.0f, APFloat(0.0f).convertToFloat());
37 EXPECT_EQ(-0.0f, APFloat(-0.0f).convertToFloat());
38 EXPECT_TRUE(APFloat(-0.0f).isNegative());
39
40 EXPECT_EQ(0.0, APFloat(0.0).convertToDouble());
41 EXPECT_EQ(-0.0, APFloat(-0.0).convertToDouble());
42 EXPECT_TRUE(APFloat(-0.0).isNegative());
4143 }
4244
4345 TEST(APFloatTest, fromZeroDecimalString) {