aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/MatrixTest.cpp
diff options
context:
space:
mode:
authorGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-03-26 15:57:37 +0000
committerGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-03-26 15:57:37 +0000
commit9ed2ecd3ac9b4601fccee8b7232b49bb2f9fed2e (patch)
tree8375b4847f650ab296e62b9429b8005c4df94ca3 /tests/MatrixTest.cpp
parentcefc8650905f25bcb3a722dfadfca59651202726 (diff)
Another fix for fixed point (nan == nan in fixed pt)
git-svn-id: http://skia.googlecode.com/svn/trunk@3491 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'tests/MatrixTest.cpp')
-rw-r--r--tests/MatrixTest.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/MatrixTest.cpp b/tests/MatrixTest.cpp
index 316e670df3..5920eef6d8 100644
--- a/tests/MatrixTest.cpp
+++ b/tests/MatrixTest.cpp
@@ -39,7 +39,6 @@ static bool are_equal(skiatest::Reporter* reporter,
bool cheapEqual = a.cheapEqualTo(b);
if (equal != cheapEqual) {
#if SK_SCALAR_IS_FLOAT
- if (equal) {
bool foundZeroSignDiff = false;
for (int i = 0; i < 9; ++i) {
float aVal = a.get(i);
@@ -291,7 +290,12 @@ void TestMatrix(skiatest::Reporter* reporter) {
mat.reset();
mat.set(SkMatrix::kMSkewX, SK_ScalarNaN);
mat2.set(SkMatrix::kMSkewX, SK_ScalarNaN);
+ // fixed pt doesn't have the property that NaN does not equal itself.
+#ifdef SK_SCALAR_IS_FIXED
+ REPORTER_ASSERT(reporter, are_equal(reporter, mat, mat2));
+#else
REPORTER_ASSERT(reporter, !are_equal(reporter, mat, mat2));
+#endif
test_matrix_max_stretch(reporter);
}