TEST_P(DataTestWithSizeParam, StoreAndLoad) { TempFile file; randomData.StoreToFile(file.path()); Data loaded_data = Data::LoadFromFile(file.path()).value(); EXPECT_EQ(randomData, loaded_data); }
TEST_P(DataTestWithSizeParam, CheckLoadedData) { TempFile file; StoreData(randomData, file.path()); Data data = Data::LoadFromFile(file.path()).value(); EXPECT_EQ(randomData, data); }
TEST_P(DataTestWithSizeParam, StoreDoesntChangeData) { Data data = randomData.copy(); TempFile file; data.StoreToFile(file.path()); EXPECT_EQ(randomData, data); }
void CreateWithCipher(const string &cipher, const TempFile &tempFile) { CryConfig cfg; cfg.SetCipher(cipher); CryConfigFile::create(tempFile.path(), std::move(cfg), "mypassword", SCrypt::TestSettings); }
optional<CryConfigFile> Load(const string &password = "******") { return CryConfigFile::load(file.path(), password); }
void Create(CryConfig cfg, const string &password = "******") { CryConfigFile::create(file.path(), std::move(cfg), password, SCrypt::TestSettings); }
TEST_P(CliTest_WrongEnvironment, MountDir_IsNotDirectory) { TempFile mountdirfile; mountdir = mountdirfile.path(); Test_Run_Error("Error: mount directory is not a directory"); }
TEST_P(CliTest_WrongEnvironment, BaseDir_IsNotDirectory) { TempFile basedirfile; basedir = basedirfile.path(); Test_Run_Error("Error: base directory is not a directory"); }
TEST_P(DataTestWithSizeParam, CheckStoredFile) { TempFile file; randomData.StoreToFile(file.path()); EXPECT_STORED_FILE_DATA_CORRECT(randomData, file.path()); }