libcryfs/test/FileSystemTest.cpp

32 lines
851 B
C++
Raw Normal View History

2015-03-16 02:15:51 +01:00
#include <messmer/blockstore/implementations/testfake/FakeBlockStore.h>
#include <messmer/fspp/fstest/FsTest.h>
#include <messmer/cpp-utils/tempfile/TempFile.h>
2015-03-16 02:15:51 +01:00
#include "../src/CryDevice.h"
using cpputils::unique_ref;
using cpputils::make_unique_ref;
2015-03-16 02:15:51 +01:00
using fspp::Device;
using blockstore::testfake::FakeBlockStore;
using namespace cryfs;
class CryFsTestFixture: public FileSystemTestFixture {
public:
CryFsTestFixture()
// Don't create config tempfile yet
: configFile(false) {}
unique_ref<Device> createDevice() override {
auto blockStore = std::make_unique<FakeBlockStore>();
2015-06-17 12:28:18 +02:00
auto config = CryConfigLoader::loadOrCreateWithWeakKey(configFile.path());
return make_unique_ref<CryDevice>(std::move(config), std::move(blockStore));
2015-03-16 02:15:51 +01:00
}
cpputils::TempFile configFile;
2015-03-16 02:15:51 +01:00
};
2015-03-16 02:57:01 +01:00
FSPP_ADD_FILESYTEM_TESTS(CryFS, CryFsTestFixture);