Title: [127775] trunk/Tools
Revision
127775
Author
[email protected]
Date
2012-09-06 12:50:18 -0700 (Thu, 06 Sep 2012)

Log Message

Fix WTF.Lrint on 32-bit platforms
https://bugs.webkit.org/show_bug.cgi?id=96003

Patch by Fady Samuel <[email protected]> on 2012-09-06
Reviewed by Benjamin Poulain.

Fixed failing WTF.Lrint test on 32-bit platforms.

* TestWebKitAPI/Tests/WTF/MathExtras.cpp:
(TestWebKitAPI::TEST):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (127774 => 127775)


--- trunk/Tools/ChangeLog	2012-09-06 19:45:35 UTC (rev 127774)
+++ trunk/Tools/ChangeLog	2012-09-06 19:50:18 UTC (rev 127775)
@@ -1,3 +1,15 @@
+2012-09-06  Fady Samuel  <[email protected]>
+
+        Fix WTF.Lrint on 32-bit platforms
+        https://bugs.webkit.org/show_bug.cgi?id=96003
+
+        Reviewed by Benjamin Poulain.
+
+        Fixed failing WTF.Lrint test on 32-bit platforms.
+
+        * TestWebKitAPI/Tests/WTF/MathExtras.cpp:
+        (TestWebKitAPI::TEST):
+
 2012-09-06  Tommy Widenflycht  <[email protected]>
 
         MediaStream API: Add the local and remote description functionality to RTCPeerConnection

Modified: trunk/Tools/TestWebKitAPI/Tests/WTF/MathExtras.cpp (127774 => 127775)


--- trunk/Tools/TestWebKitAPI/Tests/WTF/MathExtras.cpp	2012-09-06 19:45:35 UTC (rev 127774)
+++ trunk/Tools/TestWebKitAPI/Tests/WTF/MathExtras.cpp	2012-09-06 19:50:18 UTC (rev 127775)
@@ -40,12 +40,14 @@
     EXPECT_EQ(lrint(1.7), 2);
     EXPECT_EQ(lrint(0), 0);
     EXPECT_EQ(lrint(-0), 0);
-    // Largest double number with 0.5 precision and one halfway rounding case below.
-    EXPECT_EQ(lrint(pow(2.0, 52) - 0.5), pow(2.0, 52));
-    EXPECT_EQ(lrint(pow(2.0, 52) - 1.5), pow(2.0, 52) - 2);
-    // Smallest double number with 0.5 precision and one halfway rounding case above.
-    EXPECT_EQ(lrint(-pow(2.0, 52) + 0.5), -pow(2.0, 52));
-    EXPECT_EQ(lrint(-pow(2.0, 52) + 1.5), -pow(2.0, 52) + 2);
+    if (sizeof(long int) == 8) {
+        // Largest double number with 0.5 precision and one halfway rounding case below.
+        EXPECT_EQ(lrint(pow(2.0, 52) - 0.5), pow(2.0, 52));
+        EXPECT_EQ(lrint(pow(2.0, 52) - 1.5), pow(2.0, 52) - 2);
+        // Smallest double number with 0.5 precision and one halfway rounding case above.
+        EXPECT_EQ(lrint(-pow(2.0, 52) + 0.5), -pow(2.0, 52));
+        EXPECT_EQ(lrint(-pow(2.0, 52) + 1.5), -pow(2.0, 52) + 2);
+    }
 }
 
 } // namespace TestWebKitAPI
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to