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

Unified Diff: ui/gfx/geometry/rect_unittest.cc

Issue 2749513011: Stabilize empty rect handling in EnclosingRect. (Closed)
Patch Set: Nits Created 3 years, 9 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
« no previous file with comments | « ui/gfx/geometry/rect_conversions.cc ('k') | ui/gfx/geometry/size_f.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/geometry/rect_unittest.cc
diff --git a/ui/gfx/geometry/rect_unittest.cc b/ui/gfx/geometry/rect_unittest.cc
index 29d6f2c8ce53f1c2752b29c18d757b532f414ac0..63b2d52c6bdef6b0478f4622c81f4a046fd22475 100644
--- a/ui/gfx/geometry/rect_unittest.cc
+++ b/ui/gfx/geometry/rect_unittest.cc
@@ -521,6 +521,7 @@ TEST(RectTest, ToEnclosingRect) {
static const int max_int = std::numeric_limits<int>::max();
static const int min_int = std::numeric_limits<int>::min();
static const float max_float = std::numeric_limits<float>::max();
+ static const float epsilon_float = std::numeric_limits<float>::epsilon();
static const struct Test {
float x1; // source
float y1;
@@ -533,6 +534,7 @@ TEST(RectTest, ToEnclosingRect) {
} tests[] = {
{0.0f, 0.0f, 0.0f, 0.0f, 0, 0, 0, 0},
{5.5f, 5.5f, 0.0f, 0.0f, 5, 5, 0, 0},
+ {3.5f, 2.5f, epsilon_float, -0.0f, 3, 2, 0, 0},
{-1.5f, -1.5f, 3.0f, 3.0f, -2, -2, 4, 4},
{-1.5f, -1.5f, 3.5f, 3.5f, -2, -2, 4, 4},
{max_float, max_float, 2.0f, 2.0f, max_int, max_int, 0, 0},
« no previous file with comments | « ui/gfx/geometry/rect_conversions.cc ('k') | ui/gfx/geometry/size_f.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698