Add a test case that loading a filesystem doesn't modify the config file

This commit is contained in:
Sebastian Messmer 2015-11-11 11:22:46 -08:00
parent d003b7f0c5
commit 923cd40acf

View File

@ -23,6 +23,7 @@ using cpputils::unique_ref;
using cpputils::Console;
using cpputils::Random;
using cpputils::SCrypt;
using cpputils::Data;
using blockstore::ondisk::OnDiskBlockStore;
using boost::none;
@ -54,3 +55,15 @@ TEST_F(CryFsTest, CreatedRootdirIsLoadableAfterClosing) {
auto root = dev.Load(bf::path("/"));
dynamic_pointer_move<CryDir>(root.get()).get()->children();
}
TEST_F(CryFsTest, LoadingFilesystemDoesntModifyConfigFile) {
{
CryDevice dev(loadOrCreateConfig(), blockStore());
}
Data configAfterCreating = Data::LoadFromFile(config.path()).value();
{
CryDevice dev(loadOrCreateConfig(), blockStore());
}
Data configAfterLoading = Data::LoadFromFile(config.path()).value();
EXPECT_EQ(configAfterCreating, configAfterLoading);
}