mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 20:51:52 +01:00
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. llvm-svn: 138745
This commit is contained in:
parent
3a09888a72
commit
f26343ced2
@ -34,11 +34,13 @@ static std::string convertToString(double d, unsigned Prec, unsigned Pad) {
|
||||
namespace {
|
||||
|
||||
TEST(APFloatTest, Zero) {
|
||||
EXPECT_EQ(0.0f, APFloat(APFloat::IEEEsingle, 0.0f).convertToFloat());
|
||||
EXPECT_EQ(-0.0f, APFloat(APFloat::IEEEsingle, -0.0f).convertToFloat());
|
||||
EXPECT_EQ(0.0f, APFloat(0.0f).convertToFloat());
|
||||
EXPECT_EQ(-0.0f, APFloat(-0.0f).convertToFloat());
|
||||
EXPECT_TRUE(APFloat(-0.0f).isNegative());
|
||||
|
||||
EXPECT_EQ(0.0, APFloat(APFloat::IEEEdouble, 0.0).convertToDouble());
|
||||
EXPECT_EQ(-0.0, APFloat(APFloat::IEEEdouble, -0.0).convertToDouble());
|
||||
EXPECT_EQ(0.0, APFloat(0.0).convertToDouble());
|
||||
EXPECT_EQ(-0.0, APFloat(-0.0).convertToDouble());
|
||||
EXPECT_TRUE(APFloat(-0.0).isNegative());
|
||||
}
|
||||
|
||||
TEST(APFloatTest, fromZeroDecimalString) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user