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

Unified Diff: fuzz/fuzz.cpp

Issue 1657743002: Make fuzz broadcast when it terminates via return. (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: Tidy up newlines 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fuzz/fuzz.cpp
diff --git a/fuzz/fuzz.cpp b/fuzz/fuzz.cpp
index 042b3ca9a40b269d82fff58e09fd23017c150497..02bf76e6653fe6cb1a09ee1730e316b5a38d387e 100644
--- a/fuzz/fuzz.cpp
+++ b/fuzz/fuzz.cpp
@@ -66,7 +66,7 @@ int fuzz_api(SkData* bytes) {
SkDebugf("Fuzzing %s...\n", fuzzable.name);
Fuzz fuzz(bytes);
fuzzable.fn(&fuzz);
- SkDebugf("Success!");
+ SkDebugf("[terminated] Success!\n");
return 0;
}
}
@@ -87,9 +87,10 @@ static void dump_png(SkBitmap bitmap) {
}
int fuzz_img(SkData* bytes) {
+ SkDebugf("Decoding\n");
SkAutoTDelete<SkCodec> codec(SkCodec::NewFromData(bytes));
if (nullptr == codec.get()) {
- SkDebugf("Couldn't create codec.");
+ SkDebugf("[terminated] Couldn't create codec.\n");
return 3;
}
@@ -112,7 +113,7 @@ int fuzz_img(SkData* bytes) {
options.fZeroInitialized = SkCodec::kYes_ZeroInitialized;
if (!bitmap.tryAllocPixels(decodeInfo, &zeroFactory, nullptr)) {
- SkDebugf("Could not allocate memory. Image might be too large (%d x %d)",
+ SkDebugf("[terminated] Could not allocate memory. Image might be too large (%d x %d)",
decodeInfo.width(), decodeInfo.height());
return 4;
}
@@ -120,17 +121,17 @@ int fuzz_img(SkData* bytes) {
switch (codec->getPixels(decodeInfo, bitmap.getPixels(), bitmap.rowBytes(), &options,
colorPtr, colorCountPtr)) {
case SkCodec::kSuccess:
- SkDebugf("Success!\n");
+ SkDebugf("[terminated] Success!\n");
break;
case SkCodec::kIncompleteInput:
- SkDebugf("Partial Success\n");
+ SkDebugf("[terminated] Partial Success\n");
break;
case SkCodec::kInvalidConversion:
- SkDebugf("Incompatible colortype conversion");
+ SkDebugf("[terminated] Incompatible colortype conversion\n");
return 5;
default:
// Everything else is considered a failure.
- SkDebugf("Couldn't getPixels.");
+ SkDebugf("[terminated] Couldn't getPixels.\n");
return 6;
}
@@ -143,7 +144,7 @@ int fuzz_skp(SkData* bytes) {
SkDebugf("Decoding\n");
SkAutoTUnref<SkPicture> pic(SkPicture::CreateFromStream(&stream));
if (!pic) {
- SkDebugf("Couldn't decode as a picture.\n");
+ SkDebugf("[terminated] Couldn't decode as a picture.\n");
return 3;
}
SkDebugf("Rendering\n");
@@ -154,7 +155,7 @@ int fuzz_skp(SkData* bytes) {
}
SkCanvas canvas(bitmap);
canvas.drawPicture(pic);
- SkDebugf("Success! Decoded and rendered an SkPicture!\n");
+ SkDebugf("[terminated] Success! Decoded and rendered an SkPicture!\n");
dump_png(bitmap);
return 0;
}
« 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