summaryrefslogtreecommitdiff
path: root/util/testutil.cc
diff options
context:
space:
mode:
Diffstat (limited to 'util/testutil.cc')
-rw-r--r--util/testutil.cc14
1 files changed, 7 insertions, 7 deletions
diff --git a/util/testutil.cc b/util/testutil.cc
index 9d8079c..5f77b08 100644
--- a/util/testutil.cc
+++ b/util/testutil.cc
@@ -4,6 +4,8 @@
#include "util/testutil.h"
+#include <string>
+
#include "util/random.h"
namespace leveldb {
@@ -12,7 +14,7 @@ namespace test {
Slice RandomString(Random* rnd, int len, std::string* dst) {
dst->resize(len);
for (int i = 0; i < len; i++) {
- (*dst)[i] = static_cast<char>(' ' + rnd->Uniform(95)); // ' ' .. '~'
+ (*dst)[i] = static_cast<char>(' ' + rnd->Uniform(95)); // ' ' .. '~'
}
return Slice(*dst);
}
@@ -20,9 +22,8 @@ Slice RandomString(Random* rnd, int len, std::string* dst) {
std::string RandomKey(Random* rnd, int len) {
// Make sure to generate a wide variety of characters so we
// test the boundary conditions for short-key optimizations.
- static const char kTestChars[] = {
- '\0', '\1', 'a', 'b', 'c', 'd', 'e', '\xfd', '\xfe', '\xff'
- };
+ static const char kTestChars[] = {'\0', '\1', 'a', 'b', 'c',
+ 'd', 'e', '\xfd', '\xfe', '\xff'};
std::string result;
for (int i = 0; i < len; i++) {
result += kTestChars[rnd->Uniform(sizeof(kTestChars))];
@@ -30,9 +31,8 @@ std::string RandomKey(Random* rnd, int len) {
return result;
}
-
-Slice CompressibleString(Random* rnd, double compressed_fraction,
- size_t len, std::string* dst) {
+Slice CompressibleString(Random* rnd, double compressed_fraction, size_t len,
+ std::string* dst) {
int raw = static_cast<int>(len * compressed_fraction);
if (raw < 1) raw = 1;
std::string raw_data;