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

Side by Side Diff: tools/ipc_fuzzer/fuzzer/fuzzer_main.cc

Issue 1549203002: Switch to standard integer types in tools/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 12 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 unified diff | Download patch
« no previous file with comments | « tools/ipc_fuzzer/fuzzer/fuzzer.cc ('k') | tools/ipc_fuzzer/fuzzer/generator.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 <stddef.h>
6 #include <stdint.h>
7
5 #include <iostream> 8 #include <iostream>
6 #include <set> 9 #include <set>
7 #include <vector> 10 #include <vector>
8 11
9 #include "base/command_line.h" 12 #include "base/command_line.h"
10 #include "base/strings/string_split.h" 13 #include "base/strings/string_split.h"
11 #include "ipc/ipc_message_macros.h" 14 #include "ipc/ipc_message_macros.h"
12 #include "tools/ipc_fuzzer/fuzzer/fuzzer.h" 15 #include "tools/ipc_fuzzer/fuzzer/fuzzer.h"
13 #include "tools/ipc_fuzzer/fuzzer/generator.h" 16 #include "tools/ipc_fuzzer/fuzzer/generator.h"
14 #include "tools/ipc_fuzzer/fuzzer/mutator.h" 17 #include "tools/ipc_fuzzer/fuzzer/mutator.h"
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 return EXIT_FAILURE; 157 return EXIT_FAILURE;
155 } 158 }
156 base::FilePath::StringType input_file_name = args[0]; 159 base::FilePath::StringType input_file_name = args[0];
157 base::FilePath::StringType output_file_name = args[1]; 160 base::FilePath::StringType output_file_name = args[1];
158 161
159 bool permute = cmd->HasSwitch(kPermuteSwitch); 162 bool permute = cmd->HasSwitch(kPermuteSwitch);
160 163
161 std::string type_string_list = cmd->GetSwitchValueASCII(kTypeListSwitch); 164 std::string type_string_list = cmd->GetSwitchValueASCII(kTypeListSwitch);
162 std::vector<std::string> type_string_vector = base::SplitString( 165 std::vector<std::string> type_string_vector = base::SplitString(
163 type_string_list, ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); 166 type_string_list, ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
164 std::set<uint32> type_set; 167 std::set<uint32_t> type_set;
165 for (size_t i = 0; i < type_string_vector.size(); ++i) { 168 for (size_t i = 0; i < type_string_vector.size(); ++i) {
166 type_set.insert(atoi(type_string_vector[i].c_str())); 169 type_set.insert(atoi(type_string_vector[i].c_str()));
167 } 170 }
168 171
169 FuzzerFunctionMap fuzz_function_map; 172 FuzzerFunctionMap fuzz_function_map;
170 PopulateFuzzerFunctionMap(&fuzz_function_map); 173 PopulateFuzzerFunctionMap(&fuzz_function_map);
171 174
172 MessageVector message_vector; 175 MessageVector message_vector;
173 if (!MessageFile::Read(base::FilePath(input_file_name), &message_vector)) 176 if (!MessageFile::Read(base::FilePath(input_file_name), &message_vector))
174 return EXIT_FAILURE; 177 return EXIT_FAILURE;
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 } 239 }
237 240
238 return result; 241 return result;
239 } 242 }
240 243
241 } // namespace ipc_fuzzer 244 } // namespace ipc_fuzzer
242 245
243 int main(int argc, char** argv) { 246 int main(int argc, char** argv) {
244 return ipc_fuzzer::FuzzerMain(argc, argv); 247 return ipc_fuzzer::FuzzerMain(argc, argv);
245 } 248 }
OLDNEW
« no previous file with comments | « tools/ipc_fuzzer/fuzzer/fuzzer.cc ('k') | tools/ipc_fuzzer/fuzzer/generator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698