mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
moved server config init into global test main, instead per test. ServerConfig can't handle multiple initializing calls, from every test case
This commit is contained in:
parent
c44184f823
commit
c617ed7173
@ -9,13 +9,6 @@
|
|||||||
|
|
||||||
void TestAuthenticatedEncryption::SetUp()
|
void TestAuthenticatedEncryption::SetUp()
|
||||||
{
|
{
|
||||||
if (!ServerConfig::g_CryptoAppSecret) {
|
|
||||||
ServerConfig::g_CryptoAppSecret = DataTypeConverter::hexToBin("21ffbbc616fe");
|
|
||||||
}
|
|
||||||
if (!ServerConfig::g_ServerCryptoKey) {
|
|
||||||
auto serverKey = DataTypeConverter::hexToBin("a51ef8ac7ef1abf162fb7a65261acd7a");
|
|
||||||
ServerConfig::g_ServerCryptoKey = new ObfusArray(serverKey->size(), *serverKey);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(TestAuthenticatedEncryption, encryptDecryptTest) {
|
TEST_F(TestAuthenticatedEncryption, encryptDecryptTest) {
|
||||||
|
|||||||
@ -84,7 +84,7 @@ void PassphraseTest::SetUp()
|
|||||||
wordIndices3
|
wordIndices3
|
||||||
));
|
));
|
||||||
|
|
||||||
ServerConfig::loadMnemonicWordLists();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(PassphraseTest, detectMnemonic) {
|
TEST_F(PassphraseTest, detectMnemonic) {
|
||||||
|
|||||||
@ -3,6 +3,10 @@
|
|||||||
#include <list>
|
#include <list>
|
||||||
#include "gtest/gtest.h"
|
#include "gtest/gtest.h"
|
||||||
|
|
||||||
|
#include "Poco/Util/PropertyFileConfiguration.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
std::list<Test*> gTests;
|
std::list<Test*> gTests;
|
||||||
|
|
||||||
void fillTests()
|
void fillTests()
|
||||||
@ -16,6 +20,21 @@ void fillTests()
|
|||||||
|
|
||||||
int load() {
|
int load() {
|
||||||
// init server config, init seed array
|
// init server config, init seed array
|
||||||
|
|
||||||
|
Poco::AutoPtr<Poco::Util::LayeredConfiguration> test_config(new Poco::Util::LayeredConfiguration);
|
||||||
|
auto cfg = new Poco::Util::PropertyFileConfiguration("Gradido_LoginServer_Test.properties");
|
||||||
|
test_config->add(cfg);
|
||||||
|
|
||||||
|
if (!ServerConfig::initServerCrypto(*test_config)) {
|
||||||
|
//printf("[Gradido_LoginServer::%s] error init server crypto\n", __FUNCTION__);
|
||||||
|
printf("[load] error init server crypto");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
if (!ServerConfig::loadMnemonicWordLists()) {
|
||||||
|
printf("[load] error in loadMnemonicWordLists");
|
||||||
|
return -2;
|
||||||
|
}
|
||||||
|
|
||||||
fillTests();
|
fillTests();
|
||||||
for (std::list<Test*>::iterator it = gTests.begin(); it != gTests.end(); it++)
|
for (std::list<Test*>::iterator it = gTests.begin(); it != gTests.end(); it++)
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user