2016-02-11 15:19:58 +01:00
|
|
|
#include "blockstore/implementations/ondisk/OnDiskBlock.h"
|
|
|
|
#include "blockstore/implementations/ondisk/OnDiskBlockStore.h"
|
2017-02-21 23:27:46 +01:00
|
|
|
#include "blockstore/implementations/ondisk/OnDiskBlockStore2.h"
|
2015-03-12 14:27:51 +01:00
|
|
|
#include "../../testutils/BlockStoreTest.h"
|
2017-02-21 23:27:46 +01:00
|
|
|
#include "../../testutils/BlockStore2Test.h"
|
2015-03-12 14:27:51 +01:00
|
|
|
#include "../../testutils/BlockStoreWithRandomKeysTest.h"
|
2016-02-11 15:19:58 +01:00
|
|
|
#include <gtest/gtest.h>
|
2015-02-17 00:23:33 +01:00
|
|
|
|
2016-02-11 15:19:58 +01:00
|
|
|
#include <cpp-utils/tempfile/TempDir.h>
|
2014-12-09 17:19:59 +01:00
|
|
|
|
|
|
|
|
|
|
|
using blockstore::BlockStore;
|
|
|
|
using blockstore::BlockStoreWithRandomKeys;
|
|
|
|
using blockstore::ondisk::OnDiskBlockStore;
|
2017-02-21 23:27:46 +01:00
|
|
|
using blockstore::BlockStore2;
|
|
|
|
using blockstore::ondisk::OnDiskBlockStore2;
|
2014-12-09 17:19:59 +01:00
|
|
|
|
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);
|
2017-02-21 23:27:46 +01:00
|
|
|
|
|
|
|
class OnDiskBlockStore2TestFixture: public BlockStore2TestFixture {
|
|
|
|
public:
|
|
|
|
OnDiskBlockStore2TestFixture(): tempdir() {}
|
|
|
|
|
|
|
|
unique_ref<BlockStore2> createBlockStore() override {
|
|
|
|
return make_unique_ref<OnDiskBlockStore2>(tempdir.path());
|
|
|
|
}
|
|
|
|
private:
|
|
|
|
TempDir tempdir;
|
|
|
|
};
|
|
|
|
|
|
|
|
INSTANTIATE_TYPED_TEST_CASE_P(OnDisk, BlockStore2Test, OnDiskBlockStore2TestFixture);
|