From dd8c637bc74be9a03c5738e6b37f62bbd653846b Mon Sep 17 00:00:00 2001 From: scroggo Date: Wed, 11 Mar 2015 13:58:17 -0700 Subject: Fix Windows build. SK_BUILD_FOR_WIN is no longer a valid way to check for building on Windows (go figure). Build everywhere. Remove the REPORTER_ASSERT, which was the failing part. It also isn't necessary for the test, which is just that we are not leaking an SkColorTable. Also fix indentation. TBR=bungeman@google.com,mtklein@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia:3457 Review URL: https://codereview.chromium.org/1002583002 --- tests/InvalidIndexedPngTest.cpp | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) (limited to 'tests/InvalidIndexedPngTest.cpp') diff --git a/tests/InvalidIndexedPngTest.cpp b/tests/InvalidIndexedPngTest.cpp index b3789e3f6b..7ae99fd03c 100644 --- a/tests/InvalidIndexedPngTest.cpp +++ b/tests/InvalidIndexedPngTest.cpp @@ -5,11 +5,6 @@ * found in the LICENSE file. */ -// The PNG decoder is not available on all platforms. -#if !defined(SK_BUILD_FOR_MAC) && \ - !defined(SK_BUILD_FOR_WIN) && \ - !defined(SK_BUILD_FOR_IOS) - #include "SkBitmap.h" #include "SkForceLinking.h" #include "SkImageDecoder.h" @@ -32,15 +27,12 @@ unsigned char gPngData[] = { // Attempt to decode an invalid PNG that has a palette. Mostly we're looking to // make sure we don't leak memory since libpng uses setjmp for error handling so // it's very easy to accidentally skip destructors when a failure happens. +// As a result, we do not have any REPORTER_ASSERT statements DEF_TEST(InvalidIndexedPng, reporter) { - SkBitmap image; - SkForceLinking(false); - // Make our PNG invalid by changing a byte. - gPngData[sizeof(gPngData) - 1] = 1; - bool success = SkImageDecoder::DecodeMemory( - gPngData, sizeof(gPngData), &image, SkColorType::kUnknown_SkColorType, - SkImageDecoder::kDecodePixels_Mode); - REPORTER_ASSERT(reporter, !success); -} + SkBitmap image; + SkForceLinking(false); + // Make our PNG invalid by changing a byte. + gPngData[sizeof(gPngData) - 1] = 1; -#endif // !(SK_BUILD_FOR_MAC||SK_BUILD_FOR_WIN||SK_BUILD_FOR_IOS) + SkImageDecoder::DecodeMemory(gPngData, sizeof(gPngData), &image); +} -- cgit v1.2.3