File: CompressingBlockStoreTest.cpp

package info (click to toggle)
cryfs 1.0.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 28,404 kB
  • sloc: cpp: 150,188; asm: 10,493; python: 1,455; javascript: 65; sh: 50; makefile: 17; xml: 7
file content (27 lines) | stat: -rw-r--r-- 1,143 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include "blockstore/implementations/compressing/CompressingBlockStore.h"
#include "blockstore/implementations/compressing/compressors/Gzip.h"
#include "blockstore/implementations/compressing/compressors/RunLengthEncoding.h"
#include "blockstore/implementations/testfake/FakeBlockStore.h"
#include "../../testutils/BlockStoreTest.h"
#include <gtest/gtest.h>


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_SUITE_P(Compressing_Gzip, BlockStoreTest, CompressingBlockStoreTestFixture<Gzip>);
INSTANTIATE_TYPED_TEST_SUITE_P(Compressing_RunLengthEncoding, BlockStoreTest, CompressingBlockStoreTestFixture<RunLengthEncoding>);