Summary: | Add Googletest assertion support for CGRect and NSRect | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Daniel Bates <dbates> | ||||||
Component: | Tools / Tests | Assignee: | Daniel Bates <dbates> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | mmaxfield, webkit-bug-importer | ||||||
Priority: | P2 | Keywords: | InRadar | ||||||
Version: | WebKit Local Build | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Bug Depends on: | |||||||||
Bug Blocks: | 203828 | ||||||||
Attachments: |
|
Description
Daniel Bates
2019-11-04 10:41:09 PST
Created attachment 382749 [details]
Patch
Comment on attachment 382749 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=382749&action=review > Tools/TestWebKitAPI/cocoa/TestCocoa.mm:48 > +std::ostream& operator<<(std::ostream& os, const NSRect& rect) > +{ > + return os << "(origin = (x = " << rect.origin.x << ", y = " << rect.origin.y << "), size = (width = " << rect.size.width << ", height = " << rect.size.height << "))"; > +} Probably could use a template to avoid duplicating this code.... I'm not really bothered by duplicating this code. Created attachment 382752 [details]
Patch
Updated patch to use template to avoid duplication. Comment on attachment 382752 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=382752&action=review > Tools/TestWebKitAPI/cocoa/TestCocoa.mm:32 > + return os << "(origin = (x = " << rect.origin.x << ", y = " << rect.origin.y << "), size = (width = " << rect.size.width << ", height = " << rect.size.height << "))"; makeString() would make this more elegant (In reply to Myles C. Maxfield from comment #5) > Comment on attachment 382752 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=382752&action=review > > > Tools/TestWebKitAPI/cocoa/TestCocoa.mm:32 > > + return os << "(origin = (x = " << rect.origin.x << ", y = " << rect.origin.y << "), size = (width = " << rect.size.width << ", height = " << rect.size.height << "))"; > > makeString() would make this more elegant Maybe, but it would be a tiny bit less efficient because the resulting WTF::String needs to be converted (implicitly or explicitly) to a C-string at the end to insert into the stream. Comment on attachment 382752 [details] Patch Clearing flags on attachment: 382752 Committed r252023: <https://trac.webkit.org/changeset/252023> All reviewed patches have been landed. Closing bug. |