From: mtklein Date: Fri, 15 Jan 2016 15:56:20 +0000 (-0800) Subject: If we pass no bytes, use the fuzz binary itself. X-Git-Tag: submit/tizen/20180928.044319~129^2~2538 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d0b823479af35c559271999a0ebb2ad3327daaae;p=platform%2Fupstream%2FlibSkiaSharp.git If we pass no bytes, use the fuzz binary itself. This is mostly for convenient local testing. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1587043009 Review URL: https://codereview.chromium.org/1587043009 --- diff --git a/fuzz/fuzz.cpp b/fuzz/fuzz.cpp index 343e25b453..bd7c723c16 100644 --- a/fuzz/fuzz.cpp +++ b/fuzz/fuzz.cpp @@ -16,11 +16,8 @@ DEFINE_string2(match, m, "", "The usual --match, applied to DEF_FUZZ names."); int main(int argc, char** argv) { SkCommandLineFlags::Parse(argc, argv); - if (FLAGS_bytes.isEmpty()) { - SkDebugf("Usage: %s -b [-m pattern]\n", argv[0]); - return 1; - } - SkAutoTUnref bytes(SkData::NewFromFileName(FLAGS_bytes[0])); + const char* path = FLAGS_bytes.isEmpty() ? argv[0] : FLAGS_bytes[0]; + SkAutoTUnref bytes(SkData::NewFromFileName(path)); for (auto r = SkTRegistry::Head(); r; r = r->next()) { auto fuzzable = r->factory();