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));
}
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));
}