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

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

Issue 1025483002: Restructure the ipc_fuzzer directory. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move more files around Created 5 years, 9 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/generator.h ('k') | tools/ipc_fuzzer/fuzzer/mutator.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 <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
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
OLDNEW
« no previous file with comments | « tools/ipc_fuzzer/fuzzer/generator.h ('k') | tools/ipc_fuzzer/fuzzer/mutator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698