diff options
author | danakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-23 02:13:28 +0000 |
---|---|---|
committer | danakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-23 02:13:28 +0000 |
commit | 606e11d46b5a122c8289e85b800b56ab84b6212f (patch) | |
tree | 4d8fe1b07679fef0f5bb8132bb6ce28b813087c0 | |
parent | 0e70c44184dfd2a11750c4680d606540621b2725 (diff) | |
download | chromium_src-606e11d46b5a122c8289e85b800b56ab84b6212f.zip chromium_src-606e11d46b5a122c8289e85b800b56ab84b6212f.tar.gz chromium_src-606e11d46b5a122c8289e85b800b56ab84b6212f.tar.bz2 |
ui: Prevent negative sizes in unit tests.
TBR=sky
BUG=160158
Relanding https://codereview.chromium.org/11365160/ in pieces.
Review URL: https://chromiumcodereview.appspot.com/12035023
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@178202 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | ui/gfx/rect_unittest.cc | 5 | ||||
-rw-r--r-- | ui/gfx/size_unittest.cc | 18 |
2 files changed, 1 insertions, 22 deletions
diff --git a/ui/gfx/rect_unittest.cc b/ui/gfx/rect_unittest.cc index bf15c8f..f0bf7d5 100644 --- a/ui/gfx/rect_unittest.cc +++ b/ui/gfx/rect_unittest.cc @@ -441,10 +441,7 @@ TEST(RectTest, ScaleRect) { std::numeric_limits<float>::max(), std::numeric_limits<float>::max(), std::numeric_limits<float>::max(), - std::numeric_limits<float>::max() }, - { 3, 3, 3, 3, - -1.0f, - -3.0f, -3.0f, 0.0f, 0.0f } + std::numeric_limits<float>::max() } }; for (size_t i = 0; i < ARRAYSIZE_UNSAFE(tests); ++i) { diff --git a/ui/gfx/size_unittest.cc b/ui/gfx/size_unittest.cc index a6fda9d..e68bdd6 100644 --- a/ui/gfx/size_unittest.cc +++ b/ui/gfx/size_unittest.cc @@ -43,12 +43,6 @@ TEST(SizeTest, ToFlooredSize) { EXPECT_EQ(Size(10, 10), ToFlooredSize(SizeF(10.4999f, 10.4999f))); EXPECT_EQ(Size(10, 10), ToFlooredSize(SizeF(10.5f, 10.5f))); EXPECT_EQ(Size(10, 10), ToFlooredSize(SizeF(10.9999f, 10.9999f))); - - EXPECT_EQ(Size(-10, -10), ToFlooredSize(SizeF(-10, -10))); - EXPECT_EQ(Size(-11, -11), ToFlooredSize(SizeF(-10.0001f, -10.0001f))); - EXPECT_EQ(Size(-11, -11), ToFlooredSize(SizeF(-10.4999f, -10.4999f))); - EXPECT_EQ(Size(-11, -11), ToFlooredSize(SizeF(-10.5f, -10.5f))); - EXPECT_EQ(Size(-11, -11), ToFlooredSize(SizeF(-10.9999f, -10.9999f))); } TEST(SizeTest, ToCeiledSize) { @@ -63,12 +57,6 @@ TEST(SizeTest, ToCeiledSize) { EXPECT_EQ(Size(11, 11), ToCeiledSize(SizeF(10.4999f, 10.4999f))); EXPECT_EQ(Size(11, 11), ToCeiledSize(SizeF(10.5f, 10.5f))); EXPECT_EQ(Size(11, 11), ToCeiledSize(SizeF(10.9999f, 10.9999f))); - - EXPECT_EQ(Size(-10, -10), ToCeiledSize(SizeF(-10, -10))); - EXPECT_EQ(Size(-10, -10), ToCeiledSize(SizeF(-10.0001f, -10.0001f))); - EXPECT_EQ(Size(-10, -10), ToCeiledSize(SizeF(-10.4999f, -10.4999f))); - EXPECT_EQ(Size(-10, -10), ToCeiledSize(SizeF(-10.5f, -10.5f))); - EXPECT_EQ(Size(-10, -10), ToCeiledSize(SizeF(-10.9999f, -10.9999f))); } TEST(SizeTest, ToRoundedSize) { @@ -83,12 +71,6 @@ TEST(SizeTest, ToRoundedSize) { EXPECT_EQ(Size(10, 10), ToRoundedSize(SizeF(10.4999f, 10.4999f))); EXPECT_EQ(Size(11, 11), ToRoundedSize(SizeF(10.5f, 10.5f))); EXPECT_EQ(Size(11, 11), ToRoundedSize(SizeF(10.9999f, 10.9999f))); - - EXPECT_EQ(Size(-10, -10), ToRoundedSize(SizeF(-10, -10))); - EXPECT_EQ(Size(-10, -10), ToRoundedSize(SizeF(-10.0001f, -10.0001f))); - EXPECT_EQ(Size(-10, -10), ToRoundedSize(SizeF(-10.4999f, -10.4999f))); - EXPECT_EQ(Size(-11, -11), ToRoundedSize(SizeF(-10.5f, -10.5f))); - EXPECT_EQ(Size(-11, -11), ToRoundedSize(SizeF(-10.9999f, -10.9999f))); } TEST(SizeTest, ClampSize) { |