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

Unified Diff: tests/KtxTest.cpp

Issue 1590023002: Update tests to produce more sensible output for Android framework builds. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: cleanup Created 4 years, 11 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 | « src/ports/SkFontMgr_android_parser.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/KtxTest.cpp
diff --git a/tests/KtxTest.cpp b/tests/KtxTest.cpp
index e0d9a27b40236012cc2dc421c1d83f12ec068292..84d162c0f83a103582b1e5d26384e4203f309dfa 100644
--- a/tests/KtxTest.cpp
+++ b/tests/KtxTest.cpp
@@ -53,14 +53,21 @@ DEF_TEST(KtxReadWrite, reporter) {
REPORTER_ASSERT(reporter, !(bm8888.empty()));
SkAutoDataUnref encodedData(SkImageEncoder::EncodeData(bm8888, SkImageEncoder::kKTX_Type, 0));
- REPORTER_ASSERT(reporter, encodedData);
+ if (nullptr == encodedData.get()) {
+ ERRORF(reporter, "failed to encode the bitmap to KTX");
+ return;
+ }
+
SkAutoTDelete<SkMemoryStream> stream(new SkMemoryStream(encodedData));
REPORTER_ASSERT(reporter, stream);
SkBitmap decodedBitmap;
bool imageDecodeSuccess = SkImageDecoder::DecodeStream(stream, &decodedBitmap);
- REPORTER_ASSERT(reporter, imageDecodeSuccess);
+ if (!imageDecodeSuccess) {
+ ERRORF(reporter, "failed to decode the KTX stream");
+ return;
+ }
REPORTER_ASSERT(reporter, decodedBitmap.colorType() == bm8888.colorType());
REPORTER_ASSERT(reporter, decodedBitmap.alphaType() == bm8888.alphaType());
@@ -112,7 +119,10 @@ DEF_TEST(KtxReadUnpremul, reporter) {
SkBitmap decodedBitmap;
bool imageDecodeSuccess = SkImageDecoder::DecodeStream(stream, &decodedBitmap);
- REPORTER_ASSERT(reporter, imageDecodeSuccess);
+ if (!imageDecodeSuccess) {
+ ERRORF(reporter, "failed to decode the KTX stream");
+ return;
+ }
REPORTER_ASSERT(reporter, decodedBitmap.colorType() == kN32_SkColorType);
REPORTER_ASSERT(reporter, decodedBitmap.alphaType() == kPremul_SkAlphaType);
@@ -151,7 +161,10 @@ DEF_TEST(KtxReexportPKM, reporter) {
bool installDiscardablePixelRefSuccess =
SkDEPRECATED_InstallDiscardablePixelRef(fileData, &etcBitmap);
- REPORTER_ASSERT(reporter, installDiscardablePixelRefSuccess);
+ if (!installDiscardablePixelRefSuccess) {
+ ERRORF(reporter, "failed to create discardable pixelRef from KTX file");
+ return;
+ }
// Write the bitmap out to a KTX file.
SkData *ktxDataPtr = SkImageEncoder::EncodeData(etcBitmap, SkImageEncoder::kKTX_Type, 0);
« no previous file with comments | « src/ports/SkFontMgr_android_parser.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698