diff options
author | Michael Gottesman <mgottesman@apple.com> | 2013-05-30 00:18:44 +0000 |
---|---|---|
committer | Michael Gottesman <mgottesman@apple.com> | 2013-05-30 00:18:44 +0000 |
commit | 7d13d525bc9894a3be8e698002a01ce8ba5fc45d (patch) | |
tree | 4fb1e5da46153349e88b2cb1589d91e2bdf578b9 /unittests/ADT | |
parent | 3e8d356b8103e1e3ddeb9b44d19f3a51af873261 (diff) | |
download | external_llvm-7d13d525bc9894a3be8e698002a01ce8ba5fc45d.zip external_llvm-7d13d525bc9894a3be8e698002a01ce8ba5fc45d.tar.gz external_llvm-7d13d525bc9894a3be8e698002a01ce8ba5fc45d.tar.bz2 |
Added code to the unittest for APFloat::getSmallest to double check that we consider the result to be denormal.
I additionally changed certain checks to use EXPECT_FALSE instead of a boolean
complement with EXPECT_TRUE.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182896 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/ADT')
-rw-r--r-- | unittests/ADT/APFloatTest.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/unittests/ADT/APFloatTest.cpp b/unittests/ADT/APFloatTest.cpp index 4b51e85..fce7994 100644 --- a/unittests/ADT/APFloatTest.cpp +++ b/unittests/ADT/APFloatTest.cpp @@ -797,26 +797,30 @@ TEST(APFloatTest, getLargest) { TEST(APFloatTest, getSmallest) { APFloat test = APFloat::getSmallest(APFloat::IEEEsingle, false); APFloat expected = APFloat(APFloat::IEEEsingle, "0x0.000002p-126"); - EXPECT_TRUE(!test.isNegative()); + EXPECT_FALSE(test.isNegative()); EXPECT_TRUE(test.isNormal()); + EXPECT_TRUE(test.isDenormal()); EXPECT_TRUE(test.bitwiseIsEqual(expected)); test = APFloat::getSmallest(APFloat::IEEEsingle, true); expected = APFloat(APFloat::IEEEsingle, "-0x0.000002p-126"); EXPECT_TRUE(test.isNegative()); EXPECT_TRUE(test.isNormal()); + EXPECT_TRUE(test.isDenormal()); EXPECT_TRUE(test.bitwiseIsEqual(expected)); test = APFloat::getSmallest(APFloat::IEEEquad, false); expected = APFloat(APFloat::IEEEquad, "0x0.0000000000000000000000000001p-16382"); - EXPECT_TRUE(!test.isNegative()); + EXPECT_FALSE(test.isNegative()); EXPECT_TRUE(test.isNormal()); + EXPECT_TRUE(test.isDenormal()); EXPECT_TRUE(test.bitwiseIsEqual(expected)); test = APFloat::getSmallest(APFloat::IEEEquad, true); expected = APFloat(APFloat::IEEEquad, "-0x0.0000000000000000000000000001p-16382"); EXPECT_TRUE(test.isNegative()); EXPECT_TRUE(test.isNormal()); + EXPECT_TRUE(test.isDenormal()); EXPECT_TRUE(test.bitwiseIsEqual(expected)); } |