diff options
author | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-01-08 13:23:32 +0000 |
---|---|---|
committer | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-01-08 13:23:32 +0000 |
commit | 2b57dc6bb241a6627c4375ee54b73039983d03da (patch) | |
tree | ab36a35bf71f29f51c8d778464bd9ccf32546bc8 /tests | |
parent | b5715a1c8003e4a8af2301ab44aeef043547808e (diff) |
fix warings. add SkTAbs()
git-svn-id: http://skia.googlecode.com/svn/trunk@7075 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'tests')
-rw-r--r-- | tests/DeferredCanvasTest.cpp | 2 | ||||
-rw-r--r-- | tests/InfRectTest.cpp | 16 | ||||
-rw-r--r-- | tests/Matrix44Test.cpp | 2 | ||||
-rw-r--r-- | tests/RoundRectTest.cpp | 2 |
4 files changed, 12 insertions, 10 deletions
diff --git a/tests/DeferredCanvasTest.cpp b/tests/DeferredCanvasTest.cpp index 1e7725d592..8a834bec68 100644 --- a/tests/DeferredCanvasTest.cpp +++ b/tests/DeferredCanvasTest.cpp @@ -400,7 +400,7 @@ static void TestDeferredCanvasBitmapShaderNoLeak(skiatest::Reporter* reporter) { } } // All cached resources should be evictable since last canvas call was flush() - canvas.freeMemoryIfPossible(~0); + canvas.freeMemoryIfPossible(~0U); REPORTER_ASSERT(reporter, 0 == canvas.storageAllocatedForRecording()); } diff --git a/tests/InfRectTest.cpp b/tests/InfRectTest.cpp index 808bcee811..4d957dcf75 100644 --- a/tests/InfRectTest.cpp +++ b/tests/InfRectTest.cpp @@ -15,22 +15,24 @@ static float make_zero() { } #endif +struct RectCenter { + SkIRect fRect; + SkIPoint fCenter; +}; + static void test_center(skiatest::Reporter* reporter) { - static const struct { - SkIRect fRect; - SkIPoint fCenter; - } data[] = { + static const RectCenter gData[] = { { { 0, 0, 0, 0 }, { 0, 0 } }, { { 0, 0, 1, 1 }, { 0, 0 } }, { { -1, -1, 0, 0 }, { -1, -1 } }, { { 0, 0, 10, 7 }, { 5, 3 } }, { { 0, 0, 11, 6 }, { 5, 3 } }, }; - for (size_t index = 0; index < SK_ARRAY_COUNT(data); ++index) { + for (size_t index = 0; index < SK_ARRAY_COUNT(gData); ++index) { REPORTER_ASSERT(reporter, - data[index].fRect.centerX() == data[index].fCenter.x()); + gData[index].fRect.centerX() == gData[index].fCenter.x()); REPORTER_ASSERT(reporter, - data[index].fRect.centerY() == data[index].fCenter.y()); + gData[index].fRect.centerY() == gData[index].fCenter.y()); } SkRandom rand; diff --git a/tests/Matrix44Test.cpp b/tests/Matrix44Test.cpp index a680b44bda..269e359022 100644 --- a/tests/Matrix44Test.cpp +++ b/tests/Matrix44Test.cpp @@ -25,7 +25,7 @@ static bool nearly_equal_scalar(SkMScalar a, SkMScalar b) { const SkScalar tolerance = SK_Scalar1 / 1024; #endif - return SkScalarAbs(a - b) <= tolerance; + return SkTAbs<SkMScalar>(a - b) <= tolerance; } template <typename T> void assert16(skiatest::Reporter* reporter, const T data[], diff --git a/tests/RoundRectTest.cpp b/tests/RoundRectTest.cpp index 98e4e5d5b4..a8387d5dff 100644 --- a/tests/RoundRectTest.cpp +++ b/tests/RoundRectTest.cpp @@ -35,7 +35,7 @@ static void test_inset(skiatest::Reporter* reporter) { // Test out the basic API entry points static void test_round_rect_basic(skiatest::Reporter* reporter) { // Test out initialization methods - SkPoint zeroPt = { 0.0, 0.0 }; + SkPoint zeroPt = { 0, 0 }; SkRRect empty; empty.setEmpty(); |