Speedup test cases by using scrypt test config

This commit is contained in:
Sebastian Messmer 2015-10-31 17:23:14 +01:00
parent d25d51f195
commit 4d6970837e
2 changed files with 4 additions and 2 deletions

View File

@ -9,6 +9,7 @@
#include "../../src/filesystem/CryOpenFile.h"
#include "../testutils/MockConsole.h"
#include "../../src/config/CryConfigLoader.h"
#include <messmer/cpp-utils/test/crypto/kdf/testutils/SCryptTestSettings.h>
//TODO (whole project) Make constructors explicit when implicit construction not needed
@ -34,7 +35,7 @@ public:
}
CryConfigFile loadOrCreateConfig() {
return CryConfigLoader(mockConsole(), Random::PseudoRandom(), [] {return "mypassword";}, none).loadOrCreate(config.path()).value();
return CryConfigLoader(mockConsole(), Random::PseudoRandom(), [] {return "mypassword";}, none).loadOrCreate<SCryptTestSettings>(config.path()).value();
}
unique_ref<OnDiskBlockStore> blockStore() {

View File

@ -5,6 +5,7 @@
#include "../../src/filesystem/CryDevice.h"
#include "../../src/config/CryConfigLoader.h"
#include "../testutils/MockConsole.h"
#include <messmer/cpp-utils/test/crypto/kdf/testutils/SCryptTestSettings.h>
using cpputils::unique_ref;
using cpputils::make_unique_ref;
@ -28,7 +29,7 @@ public:
unique_ref<Device> createDevice() override {
auto blockStore = cpputils::make_unique_ref<FakeBlockStore>();
auto config = CryConfigLoader(mockConsole(), Random::PseudoRandom(), [] {return "mypassword";}, none)
.loadOrCreate(configFile.path()).value();
.loadOrCreate<SCryptTestSettings>(configFile.path()).value();
return make_unique_ref<CryDevice>(std::move(config), std::move(blockStore));
}