Definition at line 437 of file table_test.cc.
§ Harness()
| leveldb::Harness::Harness |
( |
| ) |
|
|
inline |
§ ~Harness()
| leveldb::Harness::~Harness |
( |
| ) |
|
|
inline |
§ Add()
| void leveldb::Harness::Add |
( |
const std::string & |
key, |
|
|
const std::string & |
value |
|
) |
| |
|
inline |
Definition at line 473 of file table_test.cc.
Constructor * constructor_
void Add(const std::string &key, const Slice &value)
§ db()
| DB* leveldb::Harness::db |
( |
| ) |
const |
|
inline |
§ Init()
| void leveldb::Harness::Init |
( |
const TestArgs & |
args | ) |
|
|
inline |
Definition at line 441 of file table_test.cc.
450 if (args.reverse_compare) {
static ReverseKeyComparator reverse_key_comparator
Constructor * constructor_
int block_restart_interval
const Comparator * comparator
§ PickRandomKey()
| std::string leveldb::Harness::PickRandomKey |
( |
Random * |
rnd, |
|
|
const std::vector< std::string > & |
keys |
|
) |
| |
|
inline |
Definition at line 612 of file table_test.cc.
616 const int index = rnd->Uniform(keys.size());
617 std::string result = keys[index];
618 switch (rnd->Uniform(3)) {
624 if (result.size() > 0 && result[result.size()-1] >
'\0') {
625 result[result.size()-1]--;
static void Increment(const Comparator *cmp, std::string *key)
const Comparator * comparator
§ Test()
| void leveldb::Harness::Test |
( |
Random * |
rnd | ) |
|
|
inline |
Definition at line 477 of file table_test.cc.
478 std::vector<std::string> keys;
Constructor * constructor_
void TestRandomAccess(Random *rnd, const std::vector< std::string > &keys, const KVMap &data)
std::map< std::string, std::string, STLLessThan > KVMap
void TestBackwardScan(const std::vector< std::string > &keys, const KVMap &data)
void Finish(const Options &options, std::vector< std::string > *keys, KVMap *kvmap)
void TestForwardScan(const std::vector< std::string > &keys, const KVMap &data)
§ TestBackwardScan()
| void leveldb::Harness::TestBackwardScan |
( |
const std::vector< std::string > & |
keys, |
|
|
const KVMap & |
data |
|
) |
| |
|
inline |
Definition at line 502 of file table_test.cc.
507 for (KVMap::const_reverse_iterator model_iter = data.rbegin();
508 model_iter != data.rend();
virtual Iterator * NewIterator() const =0
std::string ToString(const KVMap &data, const KVMap::const_iterator &it)
Constructor * constructor_
§ TestForwardScan()
| void leveldb::Harness::TestForwardScan |
( |
const std::vector< std::string > & |
keys, |
|
|
const KVMap & |
data |
|
) |
| |
|
inline |
Definition at line 487 of file table_test.cc.
492 for (KVMap::const_iterator model_iter = data.begin();
493 model_iter != data.end();
virtual Iterator * NewIterator() const =0
std::string ToString(const KVMap &data, const KVMap::const_iterator &it)
Constructor * constructor_
§ TestRandomAccess()
| void leveldb::Harness::TestRandomAccess |
( |
Random * |
rnd, |
|
|
const std::vector< std::string > & |
keys, |
|
|
const KVMap & |
data |
|
) |
| |
|
inline |
Definition at line 517 of file table_test.cc.
523 KVMap::const_iterator model_iter = data.begin();
524 if (kVerbose) fprintf(stderr,
"---\n");
525 for (
int i = 0; i < 200; i++) {
526 const int toss = rnd->Uniform(5);
530 if (kVerbose) fprintf(stderr,
"Next\n");
539 if (kVerbose) fprintf(stderr,
"SeekToFirst\n");
541 model_iter = data.begin();
548 model_iter = data.lower_bound(key);
549 if (kVerbose) fprintf(stderr,
"Seek '%s'\n",
551 iter->Seek(Slice(key));
558 if (kVerbose) fprintf(stderr,
"Prev\n");
560 if (model_iter == data.begin()) {
561 model_iter = data.end();
571 if (kVerbose) fprintf(stderr,
"SeekToLast\n");
574 model_iter = data.end();
576 std::string last = data.rbegin()->first;
577 model_iter = data.lower_bound(last);
std::string PickRandomKey(Random *rnd, const std::vector< std::string > &keys)
virtual Iterator * NewIterator() const =0
std::string ToString(const KVMap &data, const KVMap::const_iterator &it)
Constructor * constructor_
std::string EscapeString(const Slice &value)
static const int kVerbose
§ ToString() [1/3]
| std::string leveldb::Harness::ToString |
( |
const KVMap & |
data, |
|
|
const KVMap::const_iterator & |
it |
|
) |
| |
|
inline |
Definition at line 587 of file table_test.cc.
588 if (it == data.end()) {
591 return "'" + it->first +
"->" + it->second +
"'";
§ ToString() [2/3]
| std::string leveldb::Harness::ToString |
( |
const KVMap & |
data, |
|
|
const KVMap::const_reverse_iterator & |
it |
|
) |
| |
|
inline |
Definition at line 595 of file table_test.cc.
597 if (it == data.rend()) {
600 return "'" + it->first +
"->" + it->second +
"'";
§ ToString() [3/3]
| std::string leveldb::Harness::ToString |
( |
const Iterator * |
it | ) |
|
|
inline |
Definition at line 604 of file table_test.cc.
608 return "'" + it->key().ToString() +
"->" + it->value().ToString() +
"'";
§ constructor_
§ options_
The documentation for this class was generated from the following file: