OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <algorithm> | 5 #include <algorithm> |
6 #include <ostream> | 6 #include <ostream> |
7 #include <set> | 7 #include <set> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 if (rand() % frequency_ == 0) | 173 if (rand() % frequency_ == 0) |
174 (*value) *= rand() / 1000000.0; | 174 (*value) *= rand() / 1000000.0; |
175 } | 175 } |
176 | 176 |
177 virtual void FuzzDouble(double* value) OVERRIDE { | 177 virtual void FuzzDouble(double* value) OVERRIDE { |
178 if (rand() % frequency_ == 0) | 178 if (rand() % frequency_ == 0) |
179 (*value) *= rand() / 1000000.0; | 179 (*value) *= rand() / 1000000.0; |
180 } | 180 } |
181 | 181 |
182 virtual void FuzzString(std::string* value) OVERRIDE { | 182 virtual void FuzzString(std::string* value) OVERRIDE { |
183 FuzzStringType<std::string>(value, frequency_, "BORKED", ""); | 183 FuzzStringType<std::string>(value, frequency_, "BORKED", std::string()); |
184 } | 184 } |
185 | 185 |
186 virtual void FuzzWString(std::wstring* value) OVERRIDE { | 186 virtual void FuzzWString(std::wstring* value) OVERRIDE { |
187 FuzzStringType<std::wstring>(value, frequency_, L"BORKED", L""); | 187 FuzzStringType<std::wstring>(value, frequency_, L"BORKED", std::wstring()); |
188 } | 188 } |
189 | 189 |
190 virtual void FuzzString16(string16* value) OVERRIDE { | 190 virtual void FuzzString16(string16* value) OVERRIDE { |
191 FuzzStringType<string16>(value, frequency_, | 191 FuzzStringType<string16>(value, frequency_, |
192 WideToUTF16(L"BORKED"), | 192 WideToUTF16(L"BORKED"), |
193 WideToUTF16(L"")); | 193 WideToUTF16(std::wstring())); |
194 } | 194 } |
195 | 195 |
196 virtual void FuzzData(char* data, int length) OVERRIDE { | 196 virtual void FuzzData(char* data, int length) OVERRIDE { |
197 if (rand() % frequency_ == 0) { | 197 if (rand() % frequency_ == 0) { |
198 for (int i = 0; i < length; ++i) { | 198 for (int i = 0; i < length; ++i) { |
199 FuzzIntegralType<char>(&data[i], frequency_); | 199 FuzzIntegralType<char>(&data[i], frequency_); |
200 } | 200 } |
201 } | 201 } |
202 } | 202 } |
203 | 203 |
(...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
684 | 684 |
685 // Entry point avoiding mangled names. | 685 // Entry point avoiding mangled names. |
686 extern "C" { | 686 extern "C" { |
687 __attribute__((visibility("default"))) | 687 __attribute__((visibility("default"))) |
688 IPC::ChannelProxy::OutgoingMessageFilter* GetFilter(void); | 688 IPC::ChannelProxy::OutgoingMessageFilter* GetFilter(void); |
689 } | 689 } |
690 | 690 |
691 IPC::ChannelProxy::OutgoingMessageFilter* GetFilter(void) { | 691 IPC::ChannelProxy::OutgoingMessageFilter* GetFilter(void) { |
692 return &g_ipcfuzz; | 692 return &g_ipcfuzz; |
693 } | 693 } |
OLD | NEW |