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

Unified Diff: ui/gfx/vector3d_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 | « ui/gfx/vector2d_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/vector3d_unittest.cc
===================================================================
--- ui/gfx/vector3d_unittest.cc (revision 175421)
+++ ui/gfx/vector3d_unittest.cc (working copy)
@@ -2,13 +2,13 @@
// 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/vector3d_f.h"
-#include <cmath>
-#include <limits>
-
namespace gfx {
TEST(Vector3dTest, IsZero) {
@@ -171,8 +171,8 @@
static_cast<double>(v2) * v2;
double length = std::sqrt(length_squared);
gfx::Vector3dF vector(v0, v1, v2);
- 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());
}
}
@@ -227,7 +227,6 @@
Vector3dF actual = gfx::CrossProduct(tests[i].input1, tests[i].input2);
EXPECT_EQ(tests[i].expected.ToString(), actual.ToString());
}
-
}
TEST(Vector3dFTest, ClampVector3dF) {
« no previous file with comments | « ui/gfx/vector2d_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698