Index: utils.cc |
diff --git a/utils.cc b/utils.cc |
index cf1c3f5f11fcfe7fa2af0cf0a80c2f20cfa0a6d2..246bfaa74e94ed8abe414fc50ab701b5668913ad 100644 |
--- a/utils.cc |
+++ b/utils.cc |
@@ -20,6 +20,7 @@ |
#include "base/file_path.h" |
#include "base/file_util.h" |
+#include "base/rand_util.h" |
#include "base/string_util.h" |
#include "base/logging.h" |
#include "update_engine/file_writer.h" |
@@ -457,6 +458,12 @@ int ComparePriorities(ProcessPriority priority_lhs, |
return static_cast<int>(priority_rhs) - static_cast<int>(priority_lhs); |
} |
+int FuzzInt(int value, unsigned int range) { |
+ int min = value - range / 2; |
+ int max = value + range - range / 2; |
+ return base::RandInt(min, max); |
+} |
+ |
const char* const kStatefulPartition = "/mnt/stateful_partition"; |
} // namespace utils |