libcryfs/test/FileSystemTest.cpp
Sebastian Meßmer 09f89327da Fix test cases
2015-06-17 12:28:18 +02:00

32 lines
828 B
C++

#include <messmer/blockstore/implementations/testfake/FakeBlockStore.h>
#include <messmer/fspp/fstest/FsTest.h>
#include <messmer/cpp-utils/tempfile/TempFile.h>
#include "../src/CryDevice.h"
using std::unique_ptr;
using std::make_unique;
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_ptr<Device> createDevice() override {
auto blockStore = make_unique<FakeBlockStore>();
auto config = CryConfigLoader::loadOrCreateWithWeakKey(configFile.path());
return make_unique<CryDevice>(std::move(config), std::move(blockStore));
}
cpputils::TempFile configFile;
};
FSPP_ADD_FILESYTEM_TESTS(CryFS, CryFsTestFixture);