Added code to the unittest for APFloat::getSmallest to double check that we consider...
authorMichael Gottesman <mgottesman@apple.com>
Thu, 30 May 2013 00:18:44 +0000 (00:18 +0000)
committerMichael Gottesman <mgottesman@apple.com>
Thu, 30 May 2013 00:18:44 +0000 (00:18 +0000)
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

unittests/ADT/APFloatTest.cpp

index 4b51e85d631e3034ce3022988294ec9bb7fb0edd..fce79941ff20886d6aefa93b0d1e7316f620b17e 100644 (file)
@@ -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));  
 }