Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(90)

Unified Diff: tests/InvalidIndexedPngTest.cpp

Issue 1002583002: Fix Windows build. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/InvalidIndexedPngTest.cpp
diff --git a/tests/InvalidIndexedPngTest.cpp b/tests/InvalidIndexedPngTest.cpp
index b3789e3f6b4c894a3d310af455bd0dd3a95176fe..7ae99fd03cee83e38d7ebe87cf745ce5eacd2248 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);
+}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698