Skip to content

Commit

Permalink
Fix warnings in TestWebKitAPI
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=247464

Reviewed by Michael Catanzaro.

Add `-Wno-deprecated-declarations` because there are some certificate
tests that are using deprecated WebKit APIs. Clean up the default
list of warnings and share it in the CMake.

Move an unused variable in a casting test for `IntSize` that's only
relevant for `USE(CG)`.

* Tools/TestWebKitAPI/CMakeLists.txt:
* Tools/TestWebKitAPI/Tests/WebCore/IntSizeTests.cpp:

Canonical link: https://commits.webkit.org/256307@main
  • Loading branch information
donny-dont committed Nov 4, 2022
1 parent bbe3ef5 commit b21ea30
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 deletions.
21 changes: 9 additions & 12 deletions Tools/TestWebKitAPI/CMakeLists.txt
@@ -1,4 +1,10 @@
set(TESTWEBKITAPI_DIR "${TOOLS_DIR}/TestWebKitAPI")
set(TestWebKitAPI_DISABLED_WARNINGS
-Wno-dangling-else
-Wno-sign-compare
-Wno-undef
-Wno-unused-parameter
)

macro(WEBKIT_TEST _target)
WEBKIT_EXECUTABLE(${_target})
Expand All @@ -9,10 +15,7 @@ macro(WEBKIT_TEST _target)
)

if (COMPILER_IS_GCC_OR_CLANG)
WEBKIT_ADD_TARGET_CXX_FLAGS(${_target} -Wno-dangling-else
-Wno-sign-compare
-Wno-undef
-Wno-unused-parameter)
WEBKIT_ADD_TARGET_CXX_FLAGS(${_target} ${TestWebKitAPI_DISABLED_WARNINGS})
endif ()
endmacro()

Expand Down Expand Up @@ -345,10 +348,7 @@ if (ENABLE_WEBKIT)
target_link_libraries(TestWebKitAPIBase PRIVATE WebKit::WebKit WebKit::gtest)

if (COMPILER_IS_GCC_OR_CLANG)
WEBKIT_ADD_TARGET_CXX_FLAGS(TestWebKitAPIBase -Wno-dangling-else
-Wno-sign-compare
-Wno-undef
-Wno-unused-parameter)
WEBKIT_ADD_TARGET_CXX_FLAGS(TestWebKitAPIBase ${TestWebKitAPI_DISABLED_WARNINGS} -Wno-deprecated-declarations)
endif ()

set(TestWebKitAPIInjectedBundle_SOURCES
Expand Down Expand Up @@ -399,10 +399,7 @@ if (ENABLE_WEBKIT)
target_link_libraries(TestWebKitAPIInjectedBundle PRIVATE WebKit::WebKit WebKit::gtest)

if (COMPILER_IS_GCC_OR_CLANG)
WEBKIT_ADD_TARGET_CXX_FLAGS(TestWebKitAPIInjectedBundle -Wno-dangling-else
-Wno-sign-compare
-Wno-undef
-Wno-unused-parameter)
WEBKIT_ADD_TARGET_CXX_FLAGS(TestWebKitAPIInjectedBundle ${TestWebKitAPI_DISABLED_WARNINGS})
endif ()

WEBKIT_EXECUTABLE_DECLARE(TestWebKit)
Expand Down
3 changes: 1 addition & 2 deletions Tools/TestWebKitAPI/Tests/WebCore/IntSizeTests.cpp
Expand Up @@ -189,9 +189,8 @@ TEST(IntSize, TransposedSize)

TEST(IntSize, Casting)
{
WebCore::IntSize test(1024, 768);

#if USE(CG)
WebCore::IntSize test(1024, 768);
CGSize cgSize = test;

EXPECT_FLOAT_EQ(1024.0f, cgSize.width);
Expand Down

0 comments on commit b21ea30

Please sign in to comment.