| 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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |