实现登录接口。

This commit is contained in:
root
2025-03-01 09:09:30 +00:00
parent 63aa6a6270
commit d1b8bf6342
15 changed files with 608 additions and 8 deletions

10
UnitTest/Account.cpp Normal file
View File

@ -0,0 +1,10 @@
#include "Base/DataStructure.h"
#include <boost/test/unit_test.hpp>
BOOST_AUTO_TEST_CASE(SyncMessage) {
using namespace Older;
constexpr auto password = "123456";
auto account = Account::hashPassword(password);
BOOST_CHECK_EQUAL(Account::verifyPassword(account, password), true);
BOOST_CHECK_EQUAL(Account::verifyPassword(account, "23456"), false);
}

11
UnitTest/CMakeLists.txt Normal file
View File

@ -0,0 +1,11 @@
find_package(Boost REQUIRED COMPONENTS unit_test_framework)
add_executable(OlderUnitTest main.cpp
Account.cpp
)
target_link_libraries(OlderUnitTest
PRIVATE Base
PRIVATE Kylin::Core
PRIVATE Boost::unit_test_framework
)

2
UnitTest/main.cpp Normal file
View File

@ -0,0 +1,2 @@
#define BOOST_TEST_MODULE OlderTest
#include "boost/test/included/unit_test.hpp"