aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorGravatar bungeman@google.com <bungeman@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-08-24 19:53:58 +0000
committerGravatar bungeman@google.com <bungeman@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-08-24 19:53:58 +0000
commitb7b5d93359fdd3c5b2c48be7c5bbc4c978538af5 (patch)
treee5dab299a97a1e7c4ce3d562e23088dc98374ccc /tests
parent6e59e498e5ecfd644b47fc51b2c99ad0bc75842a (diff)
Fix PointTest.
Diffstat (limited to 'tests')
-rw-r--r--tests/PointTest.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/PointTest.cpp b/tests/PointTest.cpp
index efae223e0f..343c94388e 100644
--- a/tests/PointTest.cpp
+++ b/tests/PointTest.cpp
@@ -18,7 +18,9 @@ static void test_length(skiatest::Reporter* reporter, SkScalar x, SkScalar y,
point.set(x, y);
SkScalar s1 = point.length();
SkScalar s2 = SkPoint::Length(x, y);
- REPORTER_ASSERT(reporter, s1 == s2);
+ //The following should be exactly the same, but need not be.
+ //See http://code.google.com/p/skia/issues/detail?id=816
+ REPORTER_ASSERT(reporter, SkScalarNearlyEqual(s1, s2));
REPORTER_ASSERT(reporter, SkScalarNearlyEqual(s1, expectedLength));
}
@@ -30,7 +32,7 @@ static void test_Normalize(skiatest::Reporter* reporter,
SkScalar oldLength = point.length();
SkScalar returned = SkPoint::Normalize(&point);
SkScalar newLength = point.length();
- REPORTER_ASSERT(reporter, returned == oldLength);
+ REPORTER_ASSERT(reporter, SkScalarNearlyEqual(returned, oldLength));
REPORTER_ASSERT(reporter, SkScalarNearlyEqual(newLength, SK_Scalar1));
}