libcryfs/test/FileSystemTest.cpp

32 lines
798 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/tempfile/src/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 = make_unique<CryConfig>(configFile.path());
return make_unique<CryDevice>(std::move(config), std::move(blockStore));
}
tempfile::TempFile configFile;
};
2015-03-16 02:57:01 +01:00
FSPP_ADD_FILESYTEM_TESTS(CryFS, CryFsTestFixture);