libcryfs/test/implementations/ondisk/OnDiskBlockStoreTest.cpp

43 lines
1.3 KiB
C++
Raw Normal View History

#include "../../../implementations/ondisk/OnDiskBlock.h"
#include "../../../implementations/ondisk/OnDiskBlockStore.h"
#include "../../testutils/BlockStoreTest.h"
#include "../../testutils/BlockStoreWithRandomKeysTest.h"
2015-02-17 00:23:33 +01:00
#include "google/gtest/gtest.h"
2015-04-25 03:47:03 +02:00
#include "messmer/cpp-utils/tempfile/TempDir.h"
2014-12-09 17:19:59 +01:00
using blockstore::BlockStore;
using blockstore::BlockStoreWithRandomKeys;
using blockstore::ondisk::OnDiskBlockStore;
2015-04-25 03:47:03 +02:00
using cpputils::TempDir;
using cpputils::unique_ref;
using cpputils::make_unique_ref;
2015-02-17 00:23:33 +01:00
2014-12-09 17:19:59 +01:00
class OnDiskBlockStoreTestFixture: public BlockStoreTestFixture {
public:
2015-10-17 21:10:26 +02:00
OnDiskBlockStoreTestFixture(): tempdir() {}
unique_ref<BlockStore> createBlockStore() override {
return make_unique_ref<OnDiskBlockStore>(tempdir.path());
2014-12-09 17:19:59 +01:00
}
private:
TempDir tempdir;
};
INSTANTIATE_TYPED_TEST_CASE_P(OnDisk, BlockStoreTest, OnDiskBlockStoreTestFixture);
class OnDiskBlockStoreWithRandomKeysTestFixture: public BlockStoreWithRandomKeysTestFixture {
public:
2015-10-17 21:10:26 +02:00
OnDiskBlockStoreWithRandomKeysTestFixture(): tempdir() {}
unique_ref<BlockStoreWithRandomKeys> createBlockStore() override {
return make_unique_ref<OnDiskBlockStore>(tempdir.path());
2014-12-09 17:19:59 +01:00
}
private:
TempDir tempdir;
};
INSTANTIATE_TYPED_TEST_CASE_P(OnDisk, BlockStoreWithRandomKeysTest, OnDiskBlockStoreWithRandomKeysTestFixture);