WebKit Bugzilla
Attachment 340365 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 v1
bug-185631-20180514151058.patch (text/plain), 6.76 KB, created by
David Kilzer (:ddkilzer)
on 2018-05-14 15:10:59 PDT
(
hide
)
Description:
Patch v1
Filename:
MIME Type:
Creator:
David Kilzer (:ddkilzer)
Created:
2018-05-14 15:10:59 PDT
Size:
6.76 KB
patch
obsolete
>Subversion Revision: 231739 >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index 8cb18d9cff772b2b6c4a975a62af39fecd83940e..9655e867dce4d1bfd106d27df3349f5fc0e5d35a 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 >+ -Wunknown-pragmas on older clang version. This code is >+ designed to test assigning these objects to themselves. >+ >+ * TestWebKitAPI/Tests/WebKit/FindMatches.mm: >+ (TestWebKitAPI::didFindStringMatches): >+ - Replace the "rect = rect;" statement that was used to avoid an >+ unused variable warning with a variable declared outside the >+ for loop. >+ >+ * 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..c3bbfda562045484045389d7bfa6522ff5a071eb 100644 >--- a/Tools/TestWebKitAPI/Tests/WTF/NakedPtr.cpp >+++ b/Tools/TestWebKitAPI/Tests/WTF/NakedPtr.cpp >@@ -172,7 +172,15 @@ 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 "-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..225659269ed526e31f87cf6480b693a028eaa7bd 100644 >--- a/Tools/TestWebKitAPI/Tests/WTF/Poisoned.cpp >+++ b/Tools/TestWebKitAPI/Tests/WTF/Poisoned.cpp >@@ -479,7 +479,15 @@ 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 "-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..c91427f7c3c3a89d9c0c2ca15a824d3f1faa2b2b 100644 >--- a/Tools/TestWebKitAPI/Tests/WTF/PoisonedRefPtr.cpp >+++ b/Tools/TestWebKitAPI/Tests/WTF/PoisonedRefPtr.cpp >@@ -304,7 +304,15 @@ 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 "-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..386ec29ee6b24beef3fb71e568d85f2b98b9c278 100644 >--- a/Tools/TestWebKitAPI/Tests/WTF/RefPtr.cpp >+++ b/Tools/TestWebKitAPI/Tests/WTF/RefPtr.cpp >@@ -260,7 +260,15 @@ 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 "-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..abf907de630b0eb0b58345edffe4ec4877d1ceb8 100644 >--- a/Tools/TestWebKitAPI/Tests/WebKit/FindMatches.mm >+++ b/Tools/TestWebKitAPI/Tests/WebKit/FindMatches.mm >@@ -74,6 +74,7 @@ static void didFindStringMatches(WKPageRef page, WKStringRef string, WKArrayRef > else > EXPECT_EQ(2, firstIndex); > >+ WKRect unusedRect; > for (size_t i = 0; i < numMatches; ++i) { > WKTypeRef items = WKArrayGetItemAtIndex(matches, i); > WKTypeID type = WKGetTypeID(items); >@@ -84,8 +85,7 @@ static void didFindStringMatches(WKPageRef page, WKStringRef string, WKArrayRef > items = WKArrayGetItemAtIndex(rects, 0); > type = WKGetTypeID(items); > EXPECT_EQ(type, WKRectGetTypeID()); >- WKRect rect = WKRectGetValue(reinterpret_cast<WKRectRef>(items)); >- rect = rect; >+ unusedRect = WKRectGetValue(reinterpret_cast<WKRectRef>(items)); > } > } 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