Improve CryConfigLoaderTest

This commit is contained in:
Sebastian Messmer 2017-09-30 22:44:24 +01:00
parent 04341f3f7d
commit 0a7fce6701

View File

@ -102,7 +102,7 @@ public:
} }
void ChangeEncryptionKey(const string &encKey, const string& password = "mypassword") { void ChangeEncryptionKey(const string &encKey, const string& password = "mypassword") {
auto cfg = loader(password, false).loadOrCreate(file.path()).value().configFile; auto cfg = CryConfigFile::load(file.path(), password).value();
cfg.config()->SetEncryptionKey(encKey); cfg.config()->SetEncryptionKey(encKey);
cfg.save(); cfg.save();
} }
@ -121,7 +121,7 @@ public:
} }
void ChangeFilesystemID(const CryConfig::FilesystemID &filesystemId, const string& password = "mypassword") { void ChangeFilesystemID(const CryConfig::FilesystemID &filesystemId, const string& password = "mypassword") {
auto cfg = loader(password, false).loadOrCreate(file.path()).value().configFile; auto cfg = CryConfigFile::load(file.path(), password).value();
cfg.config()->SetFilesystemId(filesystemId); cfg.config()->SetFilesystemId(filesystemId);
cfg.save(); cfg.save();
} }