Title: [208121] trunk/Tools
Revision
208121
Author
[email protected]
Date
2016-10-29 23:44:32 -0700 (Sat, 29 Oct 2016)

Log Message

Fix failing ExtendedColor tests.

* TestWebKitAPI/Tests/WebCore/ExtendedColor.cpp:
Changed the tests in two ways: First, use EXPECT_EQ instead of EXPECT_TRUE
for the string equality comparisons. This required including WTFStringUtilities.h.
Second, change expected results to match what the code is currently generating,
so alpha channels are "0.25" rather than "0.25 / 1". I'll let Dean fix both these
tests and the code if these results are incorrect.

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (208120 => 208121)


--- trunk/Tools/ChangeLog	2016-10-30 03:53:10 UTC (rev 208120)
+++ trunk/Tools/ChangeLog	2016-10-30 06:44:32 UTC (rev 208121)
@@ -1,3 +1,14 @@
+2016-10-29  Darin Adler  <[email protected]>
+
+        Fix failing ExtendedColor tests.
+
+        * TestWebKitAPI/Tests/WebCore/ExtendedColor.cpp:
+        Changed the tests in two ways: First, use EXPECT_EQ instead of EXPECT_TRUE
+        for the string equality comparisons. This required including WTFStringUtilities.h.
+        Second, change expected results to match what the code is currently generating,
+        so alpha channels are "0.25" rather than "0.25 / 1". I'll let Dean fix both these
+        tests and the code if these results are incorrect.
+
 2016-10-29  Wenson Hsieh  <[email protected]>
 
         UIScriptControllerIOS.mm should not be soft-linking UIKit

Modified: trunk/Tools/TestWebKitAPI/Tests/WebCore/ExtendedColor.cpp (208120 => 208121)


--- trunk/Tools/TestWebKitAPI/Tests/WebCore/ExtendedColor.cpp	2016-10-30 03:53:10 UTC (rev 208120)
+++ trunk/Tools/TestWebKitAPI/Tests/WebCore/ExtendedColor.cpp	2016-10-30 06:44:32 UTC (rev 208121)
@@ -26,6 +26,7 @@
 #include "config.h"
 
 #include "Test.h"
+#include "WTFStringUtilities.h"
 #include <WebCore/Color.h>
 
 using namespace WebCore;
@@ -40,8 +41,8 @@
     EXPECT_FLOAT_EQ(0.5, c1.asExtended().green());
     EXPECT_FLOAT_EQ(0.25, c1.asExtended().blue());
     EXPECT_FLOAT_EQ(1.0, c1.asExtended().alpha());
-    EXPECT_EQ(static_cast<unsigned>(1), c1.asExtended().refCount());
-    EXPECT_TRUE(c1.cssText() == "color(display-p3 1 0.5 0.25 / 1)");
+    EXPECT_EQ(1u, c1.asExtended().refCount());
+    EXPECT_EQ(c1.cssText(), "color(display-p3 1 0.5 0.25)");
 }
 
 TEST(ExtendedColor, CopyConstructor)
@@ -55,9 +56,9 @@
     EXPECT_FLOAT_EQ(0.5, c2.asExtended().green());
     EXPECT_FLOAT_EQ(0.25, c2.asExtended().blue());
     EXPECT_FLOAT_EQ(1.0, c2.asExtended().alpha());
-    EXPECT_EQ(static_cast<unsigned>(2), c1.asExtended().refCount());
-    EXPECT_EQ(static_cast<unsigned>(2), c2.asExtended().refCount());
-    EXPECT_TRUE(c2.cssText() == "color(display-p3 1 0.5 0.25 / 1)");
+    EXPECT_EQ(2u, c1.asExtended().refCount());
+    EXPECT_EQ(2u, c2.asExtended().refCount());
+    EXPECT_EQ(c2.cssText(), "color(display-p3 1 0.5 0.25)");
 }
 
 TEST(ExtendedColor, Assignment)
@@ -71,9 +72,9 @@
     EXPECT_FLOAT_EQ(0.5, c2.asExtended().green());
     EXPECT_FLOAT_EQ(0.25, c2.asExtended().blue());
     EXPECT_FLOAT_EQ(1.0, c2.asExtended().alpha());
-    EXPECT_EQ(static_cast<unsigned>(2), c1.asExtended().refCount());
-    EXPECT_EQ(static_cast<unsigned>(2), c2.asExtended().refCount());
-    EXPECT_TRUE(c2.cssText() == "color(display-p3 1 0.5 0.25 / 1)");
+    EXPECT_EQ(2u, c1.asExtended().refCount());
+    EXPECT_EQ(2u, c2.asExtended().refCount());
+    EXPECT_EQ(c2.cssText(), "color(display-p3 1 0.5 0.25)");
 }
 
 TEST(ExtendedColor, MoveConstructor)
@@ -91,8 +92,8 @@
     EXPECT_FLOAT_EQ(0.5, c2.asExtended().green());
     EXPECT_FLOAT_EQ(0.25, c2.asExtended().blue());
     EXPECT_FLOAT_EQ(1.0, c2.asExtended().alpha());
-    EXPECT_EQ(static_cast<unsigned>(1), c2.asExtended().refCount());
-    EXPECT_TRUE(c2.cssText() == "color(display-p3 1 0.5 0.25 / 1)");
+    EXPECT_EQ(1u, c2.asExtended().refCount());
+    EXPECT_EQ(c2.cssText(), "color(display-p3 1 0.5 0.25)");
 }
 
 TEST(ExtendedColor, MoveAssignment)
@@ -101,6 +102,7 @@
     EXPECT_TRUE(c1.isExtended());
 
     Color c2 = WTFMove(c1);
+
     // We should have moved the extended color pointer into c2,
     // and set c1 to invalid so that it doesn't cause deletion.
     EXPECT_FALSE(c1.isExtended());
@@ -110,8 +112,8 @@
     EXPECT_FLOAT_EQ(0.5, c2.asExtended().green());
     EXPECT_FLOAT_EQ(0.25, c2.asExtended().blue());
     EXPECT_FLOAT_EQ(1.0, c2.asExtended().alpha());
-    EXPECT_EQ(static_cast<unsigned>(1), c2.asExtended().refCount());
-    EXPECT_TRUE(c2.cssText() == "color(display-p3 1 0.5 0.25 / 1)");
+    EXPECT_EQ(1u, c2.asExtended().refCount());
+    EXPECT_EQ(c2.cssText(), "color(display-p3 1 0.5 0.25)");
 }
 
 TEST(ExtendedColor, BasicReferenceCounting)
@@ -126,14 +128,14 @@
     EXPECT_FLOAT_EQ(0.5, c2->asExtended().green());
     EXPECT_FLOAT_EQ(0.25, c2->asExtended().blue());
     EXPECT_FLOAT_EQ(1.0, c2->asExtended().alpha());
-    EXPECT_EQ(static_cast<unsigned>(3), c2->asExtended().refCount());
-    EXPECT_TRUE(c2->cssText() == "color(display-p3 1 0.5 0.25 / 1)");
+    EXPECT_EQ(3u, c2->asExtended().refCount());
+    EXPECT_EQ(c2->cssText(), "color(display-p3 1 0.5 0.25)");
 
     delete c1;
-    EXPECT_EQ(static_cast<unsigned>(2), c2->asExtended().refCount());
+    EXPECT_EQ(2u, c2->asExtended().refCount());
 
     delete c2;
-    EXPECT_EQ(static_cast<unsigned>(1), c3->asExtended().refCount());
+    EXPECT_EQ(1u, c3->asExtended().refCount());
 
     delete c3;
 }
@@ -142,7 +144,7 @@
 {
     Color c1(1.0, 0.5, 0.25, 1.0, ColorSpaceDisplayP3);
     EXPECT_TRUE(c1.isExtended());
-    EXPECT_EQ(static_cast<unsigned>(1), c1.asExtended().refCount());
+    EXPECT_EQ(1u, c1.asExtended().refCount());
 
     return c1;
 }
@@ -152,9 +154,8 @@
     Color c2 = makeColor();
     EXPECT_TRUE(c2.isExtended());
 
-    EXPECT_EQ(static_cast<unsigned>(1), c2.asExtended().refCount());
-    EXPECT_TRUE(c2.cssText() == "color(display-p3 1 0.5 0.25 / 1)");
-
+    EXPECT_EQ(1u, c2.asExtended().refCount());
+    EXPECT_EQ(c2.cssText(), "color(display-p3 1 0.5 0.25)");
 }
 
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to