Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(631)

Unified Diff: third_party/WebKit/Source/platform/geometry/IntRectTest.cpp

Issue 2191233002: Add platform/geometry pretty printers for logging and testing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adjust tests to work around uninteresting cross-platform differences Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/geometry/IntRectTest.cpp
diff --git a/third_party/WebKit/Source/platform/geometry/IntRectTest.cpp b/third_party/WebKit/Source/platform/geometry/IntRectTest.cpp
index 73f71841d787b6a74361a6fa230c0a4ffeb38fd0..7f8f37b1d73bf6c42e4e05ed3f0c1b24b63c1760 100644
--- a/third_party/WebKit/Source/platform/geometry/IntRectTest.cpp
+++ b/third_party/WebKit/Source/platform/geometry/IntRectTest.cpp
@@ -5,19 +5,20 @@
#include "platform/geometry/IntRect.h"
#include "testing/gtest/include/gtest/gtest.h"
-#include "wtf/text/WTFString.h"
namespace blink {
-#ifndef NDEBUG
-TEST(IntRectTest, ToString)
+TEST(IntRectTest, Formatting)
{
IntRect emptyRect = IntRect();
- EXPECT_EQ(String("0,0 0x0"), emptyRect.toString());
+ std::ostringstream emptyRectStream;
+ emptyRectStream << emptyRect;
+ EXPECT_EQ("IntRect(x=0, y=0, width=0, height=0)", emptyRectStream.str());
IntRect rect(1, 2, 3, 4);
- EXPECT_EQ(String("1,2 3x4"), rect.toString());
+ std::ostringstream rectStream;
esprehn 2016/07/29 18:07:38 I'm not a big fan of making the tests so ugly like
+ rectStream << rect;
+ EXPECT_EQ("IntRect(x=1, y=2, width=3, height=4)", rectStream.str());
}
-#endif
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/platform/geometry/IntRect.cpp ('k') | third_party/WebKit/Source/platform/geometry/IntSize.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698