| OLD | NEW |
| 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 <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
| 9 #include "tools/ipc_fuzzer/mutate/generator.h" | 9 #include "tools/ipc_fuzzer/fuzzer/generator.h" |
| 10 #include "tools/ipc_fuzzer/mutate/rand_util.h" | 10 #include "tools/ipc_fuzzer/fuzzer/rand_util.h" |
| 11 | 11 |
| 12 namespace ipc_fuzzer { | 12 namespace ipc_fuzzer { |
| 13 | 13 |
| 14 template <typename T> | 14 template <typename T> |
| 15 void GenerateIntegralType(T* value) { | 15 void GenerateIntegralType(T* value) { |
| 16 switch (RandInRange(16)) { | 16 switch (RandInRange(16)) { |
| 17 case 0: | 17 case 0: |
| 18 *value = static_cast<T>(0); | 18 *value = static_cast<T>(0); |
| 19 break; | 19 break; |
| 20 case 1: | 20 case 1: |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 void Generator::FuzzBytes(void* data, int data_len) { | 111 void Generator::FuzzBytes(void* data, int data_len) { |
| 112 FuzzData(static_cast<char*>(data), data_len); | 112 FuzzData(static_cast<char*>(data), data_len); |
| 113 } | 113 } |
| 114 | 114 |
| 115 bool Generator::ShouldGenerate() { | 115 bool Generator::ShouldGenerate() { |
| 116 // The generator fuzzer should always generate new values. | 116 // The generator fuzzer should always generate new values. |
| 117 return true; | 117 return true; |
| 118 } | 118 } |
| 119 | 119 |
| 120 } // namespace ipc_fuzzer | 120 } // namespace ipc_fuzzer |
| OLD | NEW |