OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <stdlib.h> | 5 #include <stdlib.h> |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <iostream> | 8 #include <iostream> |
9 #include <ostream> | 9 #include <ostream> |
10 #include <set> | 10 #include <set> |
(...skipping 1267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1278 #undef IPC_MESSAGE_DECL | 1278 #undef IPC_MESSAGE_DECL |
1279 #define IPC_MESSAGE_DECL(kind, type, name, in, out, ilist, olist) \ | 1279 #define IPC_MESSAGE_DECL(kind, type, name, in, out, ilist, olist) \ |
1280 function_vector->push_back(generator_for_##name); | 1280 function_vector->push_back(generator_for_##name); |
1281 #include "tools/ipc_fuzzer/message_lib/all_messages.h" | 1281 #include "tools/ipc_fuzzer/message_lib/all_messages.h" |
1282 } | 1282 } |
1283 | 1283 |
1284 static const char kCountSwitch[] = "count"; | 1284 static const char kCountSwitch[] = "count"; |
1285 static const char kHelpSwitch[] = "help"; | 1285 static const char kHelpSwitch[] = "help"; |
1286 | 1286 |
1287 int GenerateMain(int argc, char** argv) { | 1287 int GenerateMain(int argc, char** argv) { |
1288 CommandLine::Init(argc, argv); | 1288 base::CommandLine::Init(argc, argv); |
1289 CommandLine* cmd = CommandLine::ForCurrentProcess(); | 1289 base::CommandLine* cmd = base::CommandLine::ForCurrentProcess(); |
1290 CommandLine::StringVector args = cmd->GetArgs(); | 1290 base::CommandLine::StringVector args = cmd->GetArgs(); |
1291 | 1291 |
1292 if (args.size() != 1 || cmd->HasSwitch(kHelpSwitch)) { | 1292 if (args.size() != 1 || cmd->HasSwitch(kHelpSwitch)) { |
1293 std::cerr << "Usage: ipc_fuzzer_generate [--help] [--count=n] outfile\n"; | 1293 std::cerr << "Usage: ipc_fuzzer_generate [--help] [--count=n] outfile\n"; |
1294 return EXIT_FAILURE; | 1294 return EXIT_FAILURE; |
1295 } | 1295 } |
1296 std::string output_file_name = args[0]; | 1296 std::string output_file_name = args[0]; |
1297 | 1297 |
1298 int message_count = 1000; | 1298 int message_count = 1000; |
1299 if (cmd->HasSwitch(kCountSwitch)) | 1299 if (cmd->HasSwitch(kCountSwitch)) |
1300 message_count = atoi(cmd->GetSwitchValueASCII(kCountSwitch).c_str()); | 1300 message_count = atoi(cmd->GetSwitchValueASCII(kCountSwitch).c_str()); |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1335 return EXIT_FAILURE; | 1335 return EXIT_FAILURE; |
1336 | 1336 |
1337 return EXIT_SUCCESS; | 1337 return EXIT_SUCCESS; |
1338 } | 1338 } |
1339 | 1339 |
1340 } // namespace ipc_fuzzer | 1340 } // namespace ipc_fuzzer |
1341 | 1341 |
1342 int main(int argc, char** argv) { | 1342 int main(int argc, char** argv) { |
1343 return ipc_fuzzer::GenerateMain(argc, argv); | 1343 return ipc_fuzzer::GenerateMain(argc, argv); |
1344 } | 1344 } |
OLD | NEW |