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

Unified Diff: ui/gfx/vector2d_unittest.cc

Issue 11776034: Fix a couple test cases where we should be doing floating point comparisons. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 11 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 | « no previous file | ui/gfx/vector3d_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/vector2d_unittest.cc
===================================================================
--- ui/gfx/vector2d_unittest.cc (revision 175421)
+++ ui/gfx/vector2d_unittest.cc (working copy)
@@ -2,14 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <cmath>
+#include <limits>
+
#include "base/basictypes.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/gfx/vector2d.h"
#include "ui/gfx/vector2d_f.h"
-#include <cmath>
-#include <limits>
-
namespace gfx {
TEST(Vector2dTest, ConversionToFloat) {
@@ -190,8 +190,8 @@
static_cast<double>(v0) * v0 + static_cast<double>(v1) * v1;
double length = std::sqrt(length_squared);
Vector2dF vector(v0, v1);
- EXPECT_EQ(length_squared, vector.LengthSquared());
- EXPECT_EQ(static_cast<float>(length), vector.Length());
+ EXPECT_DOUBLE_EQ(length_squared, vector.LengthSquared());
+ EXPECT_FLOAT_EQ(static_cast<float>(length), vector.Length());
}
}
« no previous file with comments | « no previous file | ui/gfx/vector3d_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698