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

Unified Diff: fuzz/fuzz.cpp

Issue 1587043009: If we pass no bytes, use the fuzz binary itself. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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 343e25b45303527a8a5cbfb5cc33bcebfb747afa..bd7c723c1657e0d67b1c13e106b9398d1d50e4ed 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 <path/to/fuzzed.data> [-m pattern]\n", argv[0]);
- return 1;
- }
- SkAutoTUnref<SkData> bytes(SkData::NewFromFileName(FLAGS_bytes[0]));
+ const char* path = FLAGS_bytes.isEmpty() ? argv[0] : FLAGS_bytes[0];
+ SkAutoTUnref<SkData> bytes(SkData::NewFromFileName(path));
for (auto r = SkTRegistry<Fuzzable>::Head(); r; r = r->next()) {
auto fuzzable = r->factory();
« 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