实现登录接口。
This commit is contained in:
10
UnitTest/Account.cpp
Normal file
10
UnitTest/Account.cpp
Normal 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
11
UnitTest/CMakeLists.txt
Normal 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
2
UnitTest/main.cpp
Normal file
@ -0,0 +1,2 @@
|
||||
#define BOOST_TEST_MODULE OlderTest
|
||||
#include "boost/test/included/unit_test.hpp"
|
Reference in New Issue
Block a user