Bug 148073 - Fix conversion-null warning in conversion.cpp of TestWebKitAPI
Summary: Fix conversion-null warning in conversion.cpp of TestWebKitAPI
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Gyuyoung Kim
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-08-16 19:22 PDT by Gyuyoung Kim
Modified: 2015-08-18 18:25 PDT (History)
2 users (show)

See Also:


Attachments
Patch (1.20 KB, patch)
2015-08-16 19:23 PDT, Gyuyoung Kim
no flags Details | Formatted Diff | Diff
Patch (1.22 KB, patch)
2015-08-18 00:50 PDT, Gyuyoung Kim
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Gyuyoung Kim 2015-08-16 19:22:42 PDT
When building EFL port, there is conversion-null build warning.


[5131/5306] Building CXX object Tools/TestWebKitAPI/CMakeFiles/TestWTF.dir/Tests/WTF/Condition.cpp.o
../../Tools/TestWebKitAPI/Tests/WTF/Condition.cpp: In member function ‘virtual void TestWebKitAPI::WTF_Condition_TimeoutTimesOut_Test::TestBody()’:
../../Tools/TestWebKitAPI/Tests/WTF/Condition.cpp:253:158: warning: converting ‘false’ to pointer type for argument 1 of ‘char testing::internal::IsNullLiteralHelper(testing::internal::Secret*)’ [-Wconversion-null]
     EXPECT_EQ(false, result);
                                                                                                                                                              ^
[5306/5306] Linking CXX executable bin/TestWebKitAPI/WebKit2/WillSendSubmitEvent
Comment 1 Gyuyoung Kim 2015-08-16 19:23:54 PDT
Created attachment 259134 [details]
Patch
Comment 2 Alexey Proskuryakov 2015-08-17 18:06:57 PDT
Comment on attachment 259134 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=259134&action=review

> Tools/TestWebKitAPI/Tests/WTF/Condition.cpp:253
> -    EXPECT_EQ(false, result);
> +    EXPECT_EQ(result, false);

According to documentation, the order is correct: EXPECT_EQ(expected, actual). This needs a different fix.
Comment 3 Gyuyoung Kim 2015-08-18 00:50:55 PDT
Created attachment 259258 [details]
Patch
Comment 4 Gyuyoung Kim 2015-08-18 00:51:56 PDT
(In reply to comment #2)
> Comment on attachment 259134 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=259134&action=review
> 
> > Tools/TestWebKitAPI/Tests/WTF/Condition.cpp:253
> > -    EXPECT_EQ(false, result);
> > +    EXPECT_EQ(result, false);
> 
> According to documentation, the order is correct: EXPECT_EQ(expected,
> actual). This needs a different fix.

Yes, we should use EXPECT_FALSE|TRUE when checking boolean instead of EXPECT_EQ.
Comment 5 WebKit Commit Bot 2015-08-18 18:25:39 PDT
Comment on attachment 259258 [details]
Patch

Clearing flags on attachment: 259258

Committed r188618: <http://trac.webkit.org/changeset/188618>
Comment 6 WebKit Commit Bot 2015-08-18 18:25:42 PDT
All reviewed patches have been landed.  Closing bug.