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

Unified Diff: cc/quads/draw_polygon_unittest.cc

Issue 783183003: Use EXPECT_FLOAT_EQ for points equality test. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/quads/draw_polygon_unittest.cc
diff --git a/cc/quads/draw_polygon_unittest.cc b/cc/quads/draw_polygon_unittest.cc
index 360a01412acad774217f14966a8c21aa16d18dfb..27cfed43816b02bc64df851c03d4806bf6efe268 100644
--- a/cc/quads/draw_polygon_unittest.cc
+++ b/cc/quads/draw_polygon_unittest.cc
@@ -19,11 +19,16 @@ namespace {
#define EXPECT_FLOAT_WITHIN_EPSILON_OF(a, b) \
EXPECT_TRUE(std::abs(a - b) < std::numeric_limits<float>::epsilon());
+#define EXPECT_POINT_EQ(point_a, point_b) \
+ EXPECT_FLOAT_EQ(point_a.x(), point_b.x()); \
+ EXPECT_FLOAT_EQ(point_a.y(), point_b.y()); \
+ EXPECT_FLOAT_EQ(point_a.z(), point_b.z());
+
static void ValidatePoints(const DrawPolygon& polygon,
const std::vector<gfx::Point3F>& points) {
EXPECT_EQ(polygon.points().size(), points.size());
for (size_t i = 0; i < points.size(); i++) {
- EXPECT_EQ(polygon.points()[i], points[i]);
+ EXPECT_POINT_EQ(polygon.points()[i], points[i]);
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698