Title: [231806] trunk/Tools
Revision
231806
Author
[email protected]
Date
2018-05-15 09:44:58 -0700 (Tue, 15 May 2018)

Log Message

TestWebKitAPI: Fix warnings found by new clang compiler
<https://webkit.org/b/185631>

Reviewed by Michael Catanzaro.

* TestWebKitAPI/Tests/WTF/NakedPtr.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WTF/Poisoned.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WTF/PoisonedRefPtr.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WTF/RefPtr.cpp:
(TestWebKitAPI::TEST):
- Add #pragma statements to ignore the new
  -Wself-assign-overloaded warning and to ignore
  this as an unknown warning on older clang versions.  We want
  to keep these self assigments as this code is designed to test
  that use case.

* TestWebKitAPI/Tests/WebKit/FindMatches.mm:
(TestWebKitAPI::didFindStringMatches):
- Replace the "rect = rect;" statement that was used to avoid an
  unused variable warning with two expectations.

* TestWebKitAPI/Tests/WebKitCocoa/UIDelegate.mm:
(-[PinnedStateObserver observeValueForKeyPath:ofObject:change:context:]):
- Switch from -integerValue to -unsignedIntegerValue when
  comparing against _WKRectEdgeAll since it's an enum declared
  as an NSUInteger.

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (231805 => 231806)


--- trunk/Tools/ChangeLog	2018-05-15 16:40:35 UTC (rev 231805)
+++ trunk/Tools/ChangeLog	2018-05-15 16:44:58 UTC (rev 231806)
@@ -1,3 +1,35 @@
+2018-05-15  David Kilzer  <[email protected]>
+
+        TestWebKitAPI: Fix warnings found by new clang compiler
+        <https://webkit.org/b/185631>
+
+        Reviewed by Michael Catanzaro.
+
+        * TestWebKitAPI/Tests/WTF/NakedPtr.cpp:
+        (TestWebKitAPI::TEST):
+        * TestWebKitAPI/Tests/WTF/Poisoned.cpp:
+        (TestWebKitAPI::TEST):
+        * TestWebKitAPI/Tests/WTF/PoisonedRefPtr.cpp:
+        (TestWebKitAPI::TEST):
+        * TestWebKitAPI/Tests/WTF/RefPtr.cpp:
+        (TestWebKitAPI::TEST):
+        - Add #pragma statements to ignore the new
+          -Wself-assign-overloaded warning and to ignore
+          this as an unknown warning on older clang versions.  We want
+          to keep these self assigments as this code is designed to test
+          that use case.
+
+        * TestWebKitAPI/Tests/WebKit/FindMatches.mm:
+        (TestWebKitAPI::didFindStringMatches):
+        - Replace the "rect = rect;" statement that was used to avoid an
+          unused variable warning with two expectations.
+
+        * TestWebKitAPI/Tests/WebKitCocoa/UIDelegate.mm:
+        (-[PinnedStateObserver observeValueForKeyPath:ofObject:change:context:]):
+        - Switch from -integerValue to -unsignedIntegerValue when
+          comparing against _WKRectEdgeAll since it's an enum declared
+          as an NSUInteger.
+
 2018-05-15  Michael Catanzaro  <[email protected]>
 
         Unreviewed, rolling out r230749

Modified: trunk/Tools/TestWebKitAPI/Tests/WTF/NakedPtr.cpp (231805 => 231806)


--- trunk/Tools/TestWebKitAPI/Tests/WTF/NakedPtr.cpp	2018-05-15 16:40:35 UTC (rev 231805)
+++ trunk/Tools/TestWebKitAPI/Tests/WTF/NakedPtr.cpp	2018-05-15 16:44:58 UTC (rev 231806)
@@ -172,7 +172,16 @@
     {
         NakedPtr<RefLogger> ptr(&a);
         ASSERT_EQ(&a, ptr.get());
+#if COMPILER(CLANG)
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wunknown-pragmas"
+#pragma clang diagnostic ignored "-Wunknown-warning-option"
+#pragma clang diagnostic ignored "-Wself-assign-overloaded"
+#endif
         ptr = ptr;
+#if COMPILER(CLANG)
+#pragma clang diagnostic pop
+#endif
         ASSERT_EQ(&a, ptr.get());
     }
 

Modified: trunk/Tools/TestWebKitAPI/Tests/WTF/Poisoned.cpp (231805 => 231806)


--- trunk/Tools/TestWebKitAPI/Tests/WTF/Poisoned.cpp	2018-05-15 16:40:35 UTC (rev 231805)
+++ trunk/Tools/TestWebKitAPI/Tests/WTF/Poisoned.cpp	2018-05-15 16:44:58 UTC (rev 231806)
@@ -479,7 +479,16 @@
     {
         Poisoned<TestPoisonA, RefLogger*> ptr(&a);
         ASSERT_EQ(&a, ptr.unpoisoned());
+#if COMPILER(CLANG)
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wunknown-pragmas"
+#pragma clang diagnostic ignored "-Wunknown-warning-option"
+#pragma clang diagnostic ignored "-Wself-assign-overloaded"
+#endif
         ptr = ptr;
+#if COMPILER(CLANG)
+#pragma clang diagnostic pop
+#endif
         ASSERT_EQ(&a, ptr.unpoisoned());
     }
 

Modified: trunk/Tools/TestWebKitAPI/Tests/WTF/PoisonedRefPtr.cpp (231805 => 231806)


--- trunk/Tools/TestWebKitAPI/Tests/WTF/PoisonedRefPtr.cpp	2018-05-15 16:40:35 UTC (rev 231805)
+++ trunk/Tools/TestWebKitAPI/Tests/WTF/PoisonedRefPtr.cpp	2018-05-15 16:44:58 UTC (rev 231806)
@@ -304,7 +304,16 @@
         PoisonedRefPtr<PoisonE, RefLogger> ptr(&a);
         EXPECT_EQ(&a, ptr.get());
         log() << "| ";
+#if COMPILER(CLANG)
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wunknown-pragmas"
+#pragma clang diagnostic ignored "-Wunknown-warning-option"
+#pragma clang diagnostic ignored "-Wself-assign-overloaded"
+#endif
         ptr = ptr;
+#if COMPILER(CLANG)
+#pragma clang diagnostic pop
+#endif
         EXPECT_EQ(&a, ptr.get());
         log() << "| ";
     }

Modified: trunk/Tools/TestWebKitAPI/Tests/WTF/RefPtr.cpp (231805 => 231806)


--- trunk/Tools/TestWebKitAPI/Tests/WTF/RefPtr.cpp	2018-05-15 16:40:35 UTC (rev 231805)
+++ trunk/Tools/TestWebKitAPI/Tests/WTF/RefPtr.cpp	2018-05-15 16:44:58 UTC (rev 231806)
@@ -260,7 +260,16 @@
         RefPtr<RefLogger> ptr(&a);
         EXPECT_EQ(&a, ptr.get());
         log() << "| ";
+#if COMPILER(CLANG)
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wunknown-pragmas"
+#pragma clang diagnostic ignored "-Wunknown-warning-option"
+#pragma clang diagnostic ignored "-Wself-assign-overloaded"
+#endif
         ptr = ptr;
+#if COMPILER(CLANG)
+#pragma clang diagnostic pop
+#endif
         EXPECT_EQ(&a, ptr.get());
         log() << "| ";
     }

Modified: trunk/Tools/TestWebKitAPI/Tests/WebKit/FindMatches.mm (231805 => 231806)


--- trunk/Tools/TestWebKitAPI/Tests/WebKit/FindMatches.mm	2018-05-15 16:40:35 UTC (rev 231805)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit/FindMatches.mm	2018-05-15 16:44:58 UTC (rev 231806)
@@ -85,7 +85,8 @@
             type = WKGetTypeID(items);
             EXPECT_EQ(type, WKRectGetTypeID());
             WKRect rect = WKRectGetValue(reinterpret_cast<WKRectRef>(items));
-            rect = rect;
+            EXPECT_GT(rect.size.height, 0);
+            EXPECT_GT(rect.size.width, 0);
         }
     } else if (WKStringIsEqualToUTF8CString(string, "crazy")) {
         size_t numMatches = WKArrayGetSize(matches);

Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/UIDelegate.mm (231805 => 231806)


--- trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/UIDelegate.mm	2018-05-15 16:40:35 UTC (rev 231805)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/UIDelegate.mm	2018-05-15 16:44:58 UTC (rev 231806)
@@ -660,7 +660,7 @@
 {
     EXPECT_TRUE([keyPath isEqualToString:NSStringFromSelector(@selector(_pinnedState))]);
     EXPECT_TRUE([[object class] isEqual:[TestWKWebView class]]);
-    EXPECT_EQ([[change objectForKey:NSKeyValueChangeOldKey] integerValue], _WKRectEdgeAll);
+    EXPECT_EQ([[change objectForKey:NSKeyValueChangeOldKey] unsignedIntegerValue], _WKRectEdgeAll);
     EXPECT_EQ([[change objectForKey:NSKeyValueChangeNewKey] unsignedIntegerValue], _WKRectEdgeLeft | _WKRectEdgeRight);
     EXPECT_TRUE(context == nullptr);
     done = true;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to