libcryfs/test/implementations/compressing/CompressingBlockStoreTest.cpp
2015-12-14 17:17:16 +01:00

29 lines
1.1 KiB
C++

#include "../../../implementations/compressing/CompressingBlockStore.h"
#include "../../../implementations/compressing/compressors/Gzip.h"
#include "../../../implementations/compressing/compressors/RunLengthEncoding.h"
#include "../../../implementations/testfake/FakeBlockStore.h"
#include "../../testutils/BlockStoreTest.h"
#include "google/gtest/gtest.h"
using ::testing::Test;
using blockstore::BlockStore;
using blockstore::compressing::CompressingBlockStore;
using blockstore::compressing::Gzip;
using blockstore::compressing::RunLengthEncoding;
using blockstore::testfake::FakeBlockStore;
using cpputils::make_unique_ref;
using cpputils::unique_ref;
template<class Compressor>
class CompressingBlockStoreTestFixture: public BlockStoreTestFixture {
public:
unique_ref<BlockStore> createBlockStore() override {
return make_unique_ref<CompressingBlockStore<Compressor>>(make_unique_ref<FakeBlockStore>());
}
};
INSTANTIATE_TYPED_TEST_CASE_P(Compressing_Gzip, BlockStoreTest, CompressingBlockStoreTestFixture<Gzip>);
INSTANTIATE_TYPED_TEST_CASE_P(Compressing_RunLengthEncoding, BlockStoreTest, CompressingBlockStoreTestFixture<RunLengthEncoding>);