chromium/third_party/leveldatabase/src/table/table_test.cc

// Copyright (c) 2011 The LevelDB Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. See the AUTHORS file for names of contributors.

#include "leveldb/table.h"

#include <map>
#include <string>

#include "gtest/gtest.h"
#include "db/dbformat.h"
#include "db/memtable.h"
#include "db/write_batch_internal.h"
#include "leveldb/db.h"
#include "leveldb/env.h"
#include "leveldb/iterator.h"
#include "leveldb/options.h"
#include "leveldb/table_builder.h"
#include "table/block.h"
#include "table/block_builder.h"
#include "table/format.h"
#include "util/random.h"
#include "util/testutil.h"

namespace leveldb {

// Return reverse of "key".
// Used to test non-lexicographic comparators.
static std::string Reverse(const Slice& key) {}

namespace {
class ReverseKeyComparator : public Comparator {};
}  // namespace
static ReverseKeyComparator reverse_key_comparator;

static void Increment(const Comparator* cmp, std::string* key) {}

// An STL comparator that uses a Comparator
namespace {
struct STLLessThan {};
}  // namespace

class StringSink : public WritableFile {};

class StringSource : public RandomAccessFile {};

KVMap;

// Helper class for tests to unify the interface between
// BlockBuilder/TableBuilder and Block/Table.
class Constructor {};

class BlockConstructor : public Constructor {};

class TableConstructor : public Constructor {};

// A helper class that converts internal format keys into user keys
class KeyConvertingIterator : public Iterator {};

class MemTableConstructor : public Constructor {};

class DBConstructor : public Constructor {};

enum TestType {};

struct TestArgs {};

static const TestArgs kTestArgList[] =;
static const int kNumTestArgs =;

class Harness : public testing::Test {};

// Test empty table/block.
TEST_F(Harness, Empty) {}

// Special test for a block with no restart entries.  The C++ leveldb
// code never generates such blocks, but the Java version of leveldb
// seems to.
TEST_F(Harness, ZeroRestartPointsInBlock) {}

// Test the empty key
TEST_F(Harness, SimpleEmptyKey) {}

TEST_F(Harness, SimpleSingle) {}

TEST_F(Harness, SimpleMulti) {}

TEST_F(Harness, SimpleSpecialKey) {}

TEST_F(Harness, Randomized) {}

TEST_F(Harness, RandomizedLongDB) {}

TEST(MemTableTest, Simple) {}

static bool Between(uint64_t val, uint64_t low, uint64_t high) {}

TEST(TableTest, ApproximateOffsetOfPlain) {}

static bool CompressionSupported(CompressionType type) {}

class CompressionTableTest
    : public ::testing::TestWithParam<std::tuple<CompressionType>> {};

INSTANTIATE_TEST_SUITE_P();

TEST_P(CompressionTableTest, ApproximateOffsetOfCompressed) {}

}  // namespace leveldb