From 516a04267ed77edc9b902b6aaf3407c940a81f2d Mon Sep 17 00:00:00 2001 From: Igor Canadi Date: Wed, 14 Jan 2015 09:45:29 -0800 Subject: [PATCH] Add LZ4 compression to sanity test Summary: This will be used to test format changes in https://reviews.facebook.net/D31461 Test Plan: run it Reviewers: MarkCallaghan, sdong Reviewed By: sdong Subscribers: dhruba, leveldb Differential Revision: https://reviews.facebook.net/D31515 --- tools/db_sanity_test.cc | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/tools/db_sanity_test.cc b/tools/db_sanity_test.cc index 8219feb37..df3cae11d 100644 --- a/tools/db_sanity_test.cc +++ b/tools/db_sanity_test.cc @@ -133,6 +133,32 @@ class SanityTestZlibCompression : public SanityTest { Options options_; }; +class SanityTestLZ4Compression : public SanityTest { + public: + explicit SanityTestLZ4Compression(const std::string& path) + : SanityTest(path) { + options_.compression = kLZ4Compression; + } + virtual Options GetOptions() const { return options_; } + virtual std::string Name() const { return "LZ4Compression"; } + + private: + Options options_; +}; + +class SanityTestLZ4HCCompression : public SanityTest { + public: + explicit SanityTestLZ4HCCompression(const std::string& path) + : SanityTest(path) { + options_.compression = kLZ4HCCompression; + } + virtual Options GetOptions() const { return options_; } + virtual std::string Name() const { return "LZ4HCCompression"; } + + private: + Options options_; +}; + #ifndef ROCKSDB_LITE class SanityTestPlainTableFactory : public SanityTest { public: @@ -171,6 +197,8 @@ bool RunSanityTests(const std::string& command, const std::string& path) { std::vector sanity_tests = { new SanityTestBasic(path), new SanityTestSpecialComparator(path), new SanityTestZlibCompression(path), + new SanityTestLZ4Compression(path), + new SanityTestLZ4HCCompression(path), #ifndef ROCKSDB_LITE new SanityTestPlainTableFactory(path), #endif // ROCKSDB_LITE