2015-03-12 14:27:51 +01:00
|
|
|
#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;
|
2015-07-21 18:19:34 +02:00
|
|
|
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() {}
|
|
|
|
|
2015-07-21 18:19:34 +02:00
|
|
|
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() {}
|
|
|
|
|
2015-07-21 18:19:34 +02:00
|
|
|
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);
|