diff options
author | scroggo <scroggo@google.com> | 2015-03-11 13:58:17 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-03-11 13:58:17 -0700 |
commit | dd8c637bc74be9a03c5738e6b37f62bbd653846b (patch) | |
tree | 08333f43a552d6caf2ba219de9aa4b2d3af9ac09 /tests/InvalidIndexedPngTest.cpp | |
parent | 97cd070442aaf5511c638a4586e0a7a75297e468 (diff) |
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
Diffstat (limited to 'tests/InvalidIndexedPngTest.cpp')
-rw-r--r-- | tests/InvalidIndexedPngTest.cpp | 22 |
1 files changed, 7 insertions, 15 deletions
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); +} |