}
};
-} // namespace
+} // anonymous namespace
// Use an internal iterator that sometimes returns errors and sometimes
// adds/removes entries on the fly. Do random operations on a DBIter and
a /= 10;
++len;
}
- std::string s = ToString(rnd.Next() % static_cast<uint64_t>(max_key));
+ std::string s = std::to_string(rnd.Next() % static_cast<uint64_t>(max_key));
s.insert(0, len - (int)s.size(), '0');
return s;
};
for (double mutation_probability : {0.01, 0.5}) {
for (double target_hidden_fraction : {0.1, 0.5}) {
std::string trace_str =
- "entries: " + ToString(num_entries) +
- ", key_space: " + ToString(key_space) +
- ", error_probability: " + ToString(error_probability) +
- ", mutation_probability: " + ToString(mutation_probability) +
+ "entries: " + std::to_string(num_entries) +
+ ", key_space: " + std::to_string(key_space) +
+ ", error_probability: " + std::to_string(error_probability) +
+ ", mutation_probability: " +
+ std::to_string(mutation_probability) +
", target_hidden_fraction: " +
- ToString(target_hidden_fraction);
+ std::to_string(target_hidden_fraction);
SCOPED_TRACE(trace_str);
if (trace) {
std::cout << trace_str << std::endl;
types[rnd.Next() % (sizeof(types) / sizeof(types[0]))];
}
e.sequence = i;
- e.value = "v" + ToString(i);
+ e.value = "v" + std::to_string(i);
ParsedInternalKey internal_key(e.key, e.sequence, e.type);
AppendInternalKey(&e.ikey, internal_key);
std::cout << "entries:";
for (size_t i = 0; i < data.entries.size(); ++i) {
Entry& e = data.entries[i];
- std::cout
- << "\n idx " << i << ": \"" << e.key << "\": \""
- << e.value << "\" seq: " << e.sequence << " type: "
- << (e.type == kTypeValue
- ? "val"
- : e.type == kTypeDeletion ? "del" : "merge");
+ std::cout << "\n idx " << i << ": \"" << e.key << "\": \""
+ << e.value << "\" seq: " << e.sequence << " type: "
+ << (e.type == kTypeValue ? "val"
+ : e.type == kTypeDeletion ? "del"
+ : "merge");
}
std::cout << std::endl;
}
target_hidden_fraction;
internal_iter->trace = trace;
db_iter.reset(NewDBIterator(
- env_, ropt, ImmutableCFOptions(options),
+ env_, ropt, ImmutableOptions(options),
MutableCFOptions(options), BytewiseComparator(),
- internal_iter, sequence,
+ internal_iter, nullptr /* version */, sequence,
options.max_sequential_skip_in_iterations,
nullptr /*read_callback*/));
}
} // namespace ROCKSDB_NAMESPACE
int main(int argc, char** argv) {
+ ROCKSDB_NAMESPACE::port::InstallStackTraceHandler();
::testing::InitGoogleTest(&argc, argv);
ParseCommandLineFlags(&argc, &argv, true);
return RUN_ALL_TESTS();