Bug 137360

Summary: Annoying build warnings in WTFString API tests
Product: WebKit Reporter: Brendan Long <b.long>
Component: Tools / TestsAssignee: Brendan Long <b.long>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, ysuzuki
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

Description Brendan Long 2014-10-02 14:13:29 PDT
I just built WebKitGTK and got a bunch of output like this:

[6/7] Building CXX object Tools/TestWebKitAPI/CMakeFiles/TestWTF.dir/Tests/WTF/WTFString.cpp.o
../../Tools/TestWebKitAPI/Tests/WTF/WTFString.cpp: In member function ‘virtual void TestWebKitAPI::WTF_StringToInt_Test::TestBody()’:
../../Tools/TestWebKitAPI/Tests/WTF/WTFString.cpp:169:158: warning: converting ‘false’ to pointer type for argument 1 of ‘char testing::internal::IsNullLiteralHelper(testing::internal::Secret*)’ [-Wconversion-null]
     EXPECT_EQ(false, ok);
                                                                                                                                                              ^
../../Tools/TestWebKitAPI/Tests/WTF/WTFString.cpp:173:158: warning: converting ‘false’ to pointer type for argument 1 of ‘char testing::internal::IsNullLiteralHelper(testing::internal::Secret*)’ [-Wconversion-null]
     EXPECT_EQ(false, ok);
                                                                                                                                                              ^
../../Tools/TestWebKitAPI/Tests/WTF/WTFString.cpp:189:158: warning: converting ‘false’ to pointer type for argument 1 of ‘char testing::internal::IsNullLiteralHelper(testing::internal::Secret*)’ [-Wconversion-null]
     EXPECT_EQ(false, ok);
                                                                                                                                                              ^
../../Tools/TestWebKitAPI/Tests/WTF/WTFString.cpp:197:158: warning: converting ‘false’ to pointer type for argument 1 of ‘char testing::internal::IsNullLiteralHelper(testing::internal::Secret*)’ [-Wconversion-null]
     EXPECT_EQ(false, ok);
                                                                                                                                                              ^
../../Tools/TestWebKitAPI/Tests/WTF/WTFString.cpp:202:158: warning: converting ‘false’ to pointer type for argument 1 of ‘char testing::internal::IsNullLiteralHelper(testing::internal::Secret*)’ [-Wconversion-null]
     EXPECT_EQ(false, ok);
                                                                                                                                                              ^
../../Tools/TestWebKitAPI/Tests/WTF/WTFString.cpp: In member function ‘virtual void TestWebKitAPI::WTF_StringToDouble_Test::TestBody()’:
../../Tools/TestWebKitAPI/Tests/WTF/WTFString.cpp:221:158: warning: converting ‘false’ to pointer type for argument 1 of ‘char testing::internal::IsNullLiteralHelper(testing::internal::Secret*)’ [-Wconversion-null]
     EXPECT_EQ(false, ok);
                                                                                                                                                              ^
../../Tools/TestWebKitAPI/Tests/WTF/WTFString.cpp:225:158: warning: converting ‘false’ to pointer type for argument 1 of ‘char testing::internal::IsNullLiteralHelper(testing::internal::Secret*)’ [-Wconversion-null]
     EXPECT_EQ(false, ok);
                                                                                                                                                              ^
../../Tools/TestWebKitAPI/Tests/WTF/WTFString.cpp:238:158: warning: converting ‘false’ to pointer type for argument 1 of ‘char testing::internal::IsNullLiteralHelper(testing::internal::Secret*)’ [-Wconversion-null]
     EXPECT_EQ(false, ok);
                                                                                                                                                              ^
../../Tools/TestWebKitAPI/Tests/WTF/WTFString.cpp:250:158: warning: converting ‘false’ to pointer type for argument 1 of ‘char testing::internal::IsNullLiteralHelper(testing::internal::Secret*)’ [-Wconversion-null]
     EXPECT_EQ(false, ok);
                                                                                                                                                              ^
../../Tools/TestWebKitAPI/Tests/WTF/WTFString.cpp:255:158: warning: converting ‘false’ to pointer type for argument 1 of ‘char testing::internal::IsNullLiteralHelper(testing::internal::Secret*)’ [-Wconversion-null]
     EXPECT_EQ(false, ok);
                                                                                                                                                              ^
../../Tools/TestWebKitAPI/Tests/WTF/WTFString.cpp:260:158: warning: converting ‘false’ to pointer type for argument 1 of ‘char testing::internal::IsNullLiteralHelper(testing::internal::Secret*)’ [-Wconversion-null]
     EXPECT_EQ(false, ok);
                                                                                                                                                              ^
I'm not sure why EXPECT_EQ(false, ...) causes these warnings, but it seems like EXPECT_TRUE and EXPECT_FALSE are more clear anyway in these cases.
Comment 1 Brendan Long 2014-10-02 14:46:05 PDT
Created attachment 239141 [details]
Patch
Comment 2 Darin Adler 2014-10-02 16:03:19 PDT
Comment on attachment 239141 [details]
Patch

Change seems fine. I think the GTK compiler has a configuration problem of some sort.
Comment 3 WebKit Commit Bot 2014-10-02 16:41:29 PDT
Comment on attachment 239141 [details]
Patch

Clearing flags on attachment: 239141

Committed r174246: <http://trac.webkit.org/changeset/174246>
Comment 4 WebKit Commit Bot 2014-10-02 16:41:31 PDT
All reviewed patches have been landed.  Closing bug.
Comment 5 Yusuke Suzuki 2014-10-03 19:13:36 PDT
*** Bug 137344 has been marked as a duplicate of this bug. ***