#include "gtest/gtest.h"
#include "db/log_reader.h"
#include "db/log_writer.h"
#include "leveldb/env.h"
#include "util/coding.h"
#include "util/crc32c.h"
#include "util/random.h"
namespace leveldb {
namespace log {
static std::string BigString(const std::string& partial_string, size_t n) { … }
static std::string NumberString(int n) { … }
static std::string RandomSkewedString(int i, Random* rnd) { … }
class LogTest : public testing::Test { … };
size_t LogTest::initial_offset_record_sizes_[] = …;
uint64_t LogTest::initial_offset_last_record_offsets_[] = …;
int LogTest::num_initial_offset_records_ = …;
TEST_F(LogTest, Empty) { … }
TEST_F(LogTest, ReadWrite) { … }
TEST_F(LogTest, ManyBlocks) { … }
TEST_F(LogTest, Fragmentation) { … }
TEST_F(LogTest, MarginalTrailer) { … }
TEST_F(LogTest, MarginalTrailer2) { … }
TEST_F(LogTest, ShortTrailer) { … }
TEST_F(LogTest, AlignedEof) { … }
TEST_F(LogTest, OpenForAppend) { … }
TEST_F(LogTest, RandomRead) { … }
TEST_F(LogTest, ReadError) { … }
TEST_F(LogTest, BadRecordType) { … }
TEST_F(LogTest, TruncatedTrailingRecordIsIgnored) { … }
TEST_F(LogTest, BadLength) { … }
TEST_F(LogTest, BadLengthAtEndIsIgnored) { … }
TEST_F(LogTest, ChecksumMismatch) { … }
TEST_F(LogTest, UnexpectedMiddleType) { … }
TEST_F(LogTest, UnexpectedLastType) { … }
TEST_F(LogTest, UnexpectedFullType) { … }
TEST_F(LogTest, UnexpectedFirstType) { … }
TEST_F(LogTest, MissingLastIsIgnored) { … }
TEST_F(LogTest, PartialLastIsIgnored) { … }
TEST_F(LogTest, SkipIntoMultiRecord) { … }
TEST_F(LogTest, ErrorJoinsRecords) { … }
TEST_F(LogTest, ReadStart) { … }
TEST_F(LogTest, ReadSecondOneOff) { … }
TEST_F(LogTest, ReadSecondTenThousand) { … }
TEST_F(LogTest, ReadSecondStart) { … }
TEST_F(LogTest, ReadThirdOneOff) { … }
TEST_F(LogTest, ReadThirdStart) { … }
TEST_F(LogTest, ReadFourthOneOff) { … }
TEST_F(LogTest, ReadFourthFirstBlockTrailer) { … }
TEST_F(LogTest, ReadFourthMiddleBlock) { … }
TEST_F(LogTest, ReadFourthLastBlock) { … }
TEST_F(LogTest, ReadFourthStart) { … }
TEST_F(LogTest, ReadInitialOffsetIntoBlockPadding) { … }
TEST_F(LogTest, ReadEnd) { … }
TEST_F(LogTest, ReadPastEnd) { … }
}
}