diff options
author | tomhudson@google.com <tomhudson@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-04-10 17:42:21 +0000 |
---|---|---|
committer | tomhudson@google.com <tomhudson@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-04-10 17:42:21 +0000 |
commit | 75589257c6ac7fc55a66502b74b8bc09c0212fea (patch) | |
tree | 24d452385ad37eba7f91a17aec9b5a7851007229 /tests/MathTest.cpp | |
parent | 56dd630c41d662bcf2a3f08100f2c6accda05ba9 (diff) |
Fix miscellaneous compiler warnings from Visual Studio 2010.
Changes serialization path for MorphologyImageFilter, handling of Windows
HRESULTS; otherwise just tweaks tests.
git-svn-id: http://skia.googlecode.com/svn/trunk@3642 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'tests/MathTest.cpp')
-rw-r--r-- | tests/MathTest.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/tests/MathTest.cpp b/tests/MathTest.cpp index fef93cdacb..fe162b114f 100644 --- a/tests/MathTest.cpp +++ b/tests/MathTest.cpp @@ -245,8 +245,8 @@ static float make_zero() { static void unittest_isfinite(skiatest::Reporter* reporter) { #ifdef SK_SCALAR_IS_FLOAT float nan = sk_float_asin(2); - float inf = 1.0 / make_zero(); - float big = 3.40282e+038; + float inf = 1.0f / make_zero(); + float big = 3.40282e+038f; REPORTER_ASSERT(reporter, !SkScalarIsNaN(inf)); REPORTER_ASSERT(reporter, !SkScalarIsNaN(-inf)); @@ -416,9 +416,13 @@ static void TestMath(skiatest::Reporter* reporter) { for (i = 0; i < 10000; i++) { SkPoint p; - p.setLength(rand.nextS(), rand.nextS(), SK_Scalar1); + // These random values are being treated as 32-bit-patterns, not as + // ints; calling SkIntToScalar() here produces crashes. + p.setLength(rand.nextS(), + rand.nextS(), SK_Scalar1); check_length(reporter, p, SK_Scalar1); - p.setLength(rand.nextS() >> 13, rand.nextS() >> 13, SK_Scalar1); + p.setLength(rand.nextS() >> 13, + rand.nextS() >> 13, SK_Scalar1); check_length(reporter, p, SK_Scalar1); } |