RESOLVED FIXED 223730
NowPlayingInfoArtwork operator== returns wrong value
https://bugs.webkit.org/show_bug.cgi?id=223730
Summary NowPlayingInfoArtwork operator== returns wrong value
Jean-Yves Avenard [:jya]
Reported 2021-03-24 22:32:17 PDT
Bug introduced in bug 223118 NowPlayingInfoArtwork::operator== checks if the value differs.
Attachments
Patch (1.35 KB, patch)
2021-03-25 02:16 PDT, Jean-Yves Avenard [:jya]
no flags
Patch (9.83 KB, patch)
2021-03-25 16:14 PDT, Jean-Yves Avenard [:jya]
ews-feeder: commit-queue-
Patch (9.83 KB, patch)
2021-03-25 16:22 PDT, Jean-Yves Avenard [:jya]
no flags
Radar WebKit Bug Importer
Comment 1 2021-03-24 22:32:26 PDT
Jean-Yves Avenard [:jya]
Comment 2 2021-03-25 02:16:15 PDT
youenn fablet
Comment 3 2021-03-25 07:20:27 PDT
Comment on attachment 424224 [details] Patch I would be tempted to change the patch so that we define == operator. And implement != operator based on ==
youenn fablet
Comment 4 2021-03-25 07:20:47 PDT
Comment on attachment 424224 [details] Patch r=me
youenn fablet
Comment 5 2021-03-25 07:27:46 PDT
Rethinking about it, we should probably add a test for it. The principle is to write a unit test (or API test). You can for instance look at examples in Tools/TestWebKitAPI/Tests/WebCore/IntRectTests.cpp.
Jean-Yves Avenard [:jya]
Comment 6 2021-03-25 16:14:47 PDT
Jean-Yves Avenard [:jya]
Comment 7 2021-03-25 16:22:58 PDT
youenn fablet
Comment 8 2021-03-26 03:48:48 PDT
Comment on attachment 424293 [details] Patch Landing the changes now. Some additional comments below. View in context: https://bugs.webkit.org/attachment.cgi?id=424293&action=review > Source/WebCore/platform/audio/NowPlayingInfo.h:42 > bool operator==(const NowPlayingInfoArtwork& other) const Given this is a struct, we could make it a free function, which is usually preferred when possible. > Tools/TestWebKitAPI/Tests/WebCore/NowPlayingInfoTests.cpp:32 > +static void testEmptyArtwork(const WebCore::NowPlayingInfoArtwork& artwork) Not really needed, it could be inline in the TEST itself.
EWS
Comment 9 2021-03-26 04:07:50 PDT
Committed r275091: <https://commits.webkit.org/r275091> All reviewed patches have been landed. Closing bug and clearing flags on attachment 424293 [details].
Note You need to log in before you can comment on or make changes to this bug.