WebKit Bugzilla
Attachment 340390 Details for
Bug 185631
: TestWebKitAPI: Fix warnings found by new clang compiler
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch v2
bug-185631-20180514201115.patch (text/plain), 6.62 KB, created by
David Kilzer (:ddkilzer)
on 2018-05-14 20:11:16 PDT
(
hide
)
Description:
Patch v2
Filename:
MIME Type:
Creator:
David Kilzer (:ddkilzer)
Created:
2018-05-14 20:11:16 PDT
Size:
6.62 KB
patch
obsolete
>Subversion Revision: 231739 >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index 8cb18d9cff772b2b6c4a975a62af39fecd83940e..0778a047320105e6244a8cba80fead7805b2db1a 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,35 @@ >+2018-05-14 David Kilzer <ddkilzer@apple.com> >+ >+ TestWebKitAPI: Fix warnings found by new clang compiler >+ <https://webkit.org/b/185631> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * 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-11 Leo Balter <leonardo.balter@gmail.com> > > Test262 Runner should search for the Debug JSC by default >diff --git a/Tools/TestWebKitAPI/Tests/WTF/NakedPtr.cpp b/Tools/TestWebKitAPI/Tests/WTF/NakedPtr.cpp >index f4b4836cd406def468a1f7f38c2462df615879a8..a8ab66f4e87401f73b49d25c32340e78446fe124 100644 >--- a/Tools/TestWebKitAPI/Tests/WTF/NakedPtr.cpp >+++ b/Tools/TestWebKitAPI/Tests/WTF/NakedPtr.cpp >@@ -172,7 +172,16 @@ TEST(WTF_NakedPtr, Assignment) > { > 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()); > } > >diff --git a/Tools/TestWebKitAPI/Tests/WTF/Poisoned.cpp b/Tools/TestWebKitAPI/Tests/WTF/Poisoned.cpp >index ac8c72ffa9cf3c4db919ee15954bb9be7612df6a..a128e40c16e8bdbcf2822e3cbc904ab53f6c7a93 100644 >--- a/Tools/TestWebKitAPI/Tests/WTF/Poisoned.cpp >+++ b/Tools/TestWebKitAPI/Tests/WTF/Poisoned.cpp >@@ -479,7 +479,16 @@ TEST(WTF_Poisoned, Assignment) > { > 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()); > } > >diff --git a/Tools/TestWebKitAPI/Tests/WTF/PoisonedRefPtr.cpp b/Tools/TestWebKitAPI/Tests/WTF/PoisonedRefPtr.cpp >index cee4c676c7410c2b92ead702edece7db44e13fa6..fb40cf649382ed7b70755bfcd7ad86d4eaf8dab0 100644 >--- a/Tools/TestWebKitAPI/Tests/WTF/PoisonedRefPtr.cpp >+++ b/Tools/TestWebKitAPI/Tests/WTF/PoisonedRefPtr.cpp >@@ -304,7 +304,16 @@ TEST(WTF_PoisonedRefPtr, Assignment) > 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() << "| "; > } >diff --git a/Tools/TestWebKitAPI/Tests/WTF/RefPtr.cpp b/Tools/TestWebKitAPI/Tests/WTF/RefPtr.cpp >index d74df97442eea99600b8b9e878d0ef3e97ba0856..1ceb07ff275b96f0807a0044cd474d5b7b17e5ba 100644 >--- a/Tools/TestWebKitAPI/Tests/WTF/RefPtr.cpp >+++ b/Tools/TestWebKitAPI/Tests/WTF/RefPtr.cpp >@@ -260,7 +260,16 @@ TEST(WTF_RefPtr, Assignment) > 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() << "| "; > } >diff --git a/Tools/TestWebKitAPI/Tests/WebKit/FindMatches.mm b/Tools/TestWebKitAPI/Tests/WebKit/FindMatches.mm >index 47c2e990824602c4b12056d094ee16dd5ed16b74..3d7b5314a6998036e7555fca6eacf511ec0e95a3 100644 >--- a/Tools/TestWebKitAPI/Tests/WebKit/FindMatches.mm >+++ b/Tools/TestWebKitAPI/Tests/WebKit/FindMatches.mm >@@ -85,7 +85,8 @@ static void didFindStringMatches(WKPageRef page, WKStringRef string, WKArrayRef > 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); >diff --git a/Tools/TestWebKitAPI/Tests/WebKitCocoa/UIDelegate.mm b/Tools/TestWebKitAPI/Tests/WebKitCocoa/UIDelegate.mm >index d43be87143ba82f2267203a4a6277a480ad3f649..b24cdd85519403239782841757891c666385de75 100644 >--- a/Tools/TestWebKitAPI/Tests/WebKitCocoa/UIDelegate.mm >+++ b/Tools/TestWebKitAPI/Tests/WebKitCocoa/UIDelegate.mm >@@ -660,7 +660,7 @@ - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(N > { > 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;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 185631
:
340365
| 340390