From 70b3d20a7e89ac7313378159b97044818550eaa1 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Tue, 6 Mar 2018 09:30:22 +0100 Subject: [PATCH] Fix ApiUser unit test --- test/remote-user.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/test/remote-user.cpp b/test/remote-user.cpp index 2979285b9..f43816a19 100644 --- a/test/remote-user.cpp +++ b/test/remote-user.cpp @@ -29,14 +29,13 @@ BOOST_AUTO_TEST_SUITE(api_user) BOOST_AUTO_TEST_CASE(password) { -#ifndef I2_DEBUG - std::cout << "Only enabled in Debug builds..." << std::endl; -#else ApiUser::Ptr user = new ApiUser(); String passwd = RandomString(16); String salt = RandomString(8); - user->SetPassword("ThisShouldBeIgnored"); - user->SetPasswordHash(CreateHashedPasswordString(passwd, salt, true)); + user->SetPasswordHash(CreateHashedPasswordString(passwd, salt)); + user->OnConfigLoaded(); + user->OnAllConfigLoaded(); + user->Start(); BOOST_CHECK(user->GetPasswordHash() != passwd); @@ -46,7 +45,6 @@ BOOST_AUTO_TEST_CASE(password) BOOST_CHECK(passwdd->Get("salt") == salt); BOOST_CHECK(ComparePassword(passwdd->Get("password"), passwd, salt)); BOOST_CHECK(!ComparePassword(passwdd->Get("password"), "wrong password uwu!", salt)); -#endif } BOOST_AUTO_TEST_SUITE_END()