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

Side by Side Diff: tools/ipc_fuzzer/mutate/mutate.cc

Issue 121123002: Update uses of UTF conversions in ppapi/, printing/, remoting/, rlz/, sandbox/, skia/, sql/, sync/,… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tools/imagediff/image_diff.cc ('k') | tools/json_schema_compiler/cc_generator.py » ('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 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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 if (base::RandInt(0, frequency_) == 0) 142 if (base::RandInt(0, frequency_) == 0)
143 *value = base::RandDouble(); 143 *value = base::RandDouble();
144 } 144 }
145 145
146 virtual void FuzzString(std::string* value) OVERRIDE { 146 virtual void FuzzString(std::string* value) OVERRIDE {
147 FuzzStringType<std::string>(value, frequency_, "BORKED", std::string()); 147 FuzzStringType<std::string>(value, frequency_, "BORKED", std::string());
148 } 148 }
149 149
150 virtual void FuzzString16(base::string16* value) OVERRIDE { 150 virtual void FuzzString16(base::string16* value) OVERRIDE {
151 FuzzStringType<base::string16>(value, frequency_, 151 FuzzStringType<base::string16>(value, frequency_,
152 WideToUTF16(L"BORKED"), 152 base::WideToUTF16(L"BORKED"),
153 WideToUTF16(L"")); 153 base::WideToUTF16(L""));
154 } 154 }
155 155
156 virtual void FuzzData(char* data, int length) OVERRIDE { 156 virtual void FuzzData(char* data, int length) OVERRIDE {
157 if (base::RandInt(0, frequency_) == 0) { 157 if (base::RandInt(0, frequency_) == 0) {
158 for (int i = 0; i < length; ++i) { 158 for (int i = 0; i < length; ++i) {
159 FuzzIntegralType<char>(&data[i], frequency_); 159 FuzzIntegralType<char>(&data[i], frequency_);
160 } 160 }
161 } 161 }
162 } 162 }
163 163
(...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after
716 if (permute) 716 if (permute)
717 std::random_shuffle(message_vector.begin(), message_vector.end()); 717 std::random_shuffle(message_vector.begin(), message_vector.end());
718 718
719 if (!ipc_fuzzer::MessageFile::Write( 719 if (!ipc_fuzzer::MessageFile::Write(
720 base::FilePath(output_file_name), message_vector)) { 720 base::FilePath(output_file_name), message_vector)) {
721 return EXIT_FAILURE; 721 return EXIT_FAILURE;
722 } 722 }
723 723
724 return EXIT_SUCCESS; 724 return EXIT_SUCCESS;
725 } 725 }
OLDNEW
« no previous file with comments | « tools/imagediff/image_diff.cc ('k') | tools/json_schema_compiler/cc_generator.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698