add: spdlog and basic client code.

This commit is contained in:
2025-06-14 23:25:16 +08:00
parent 16572fa29c
commit 3f74ca3b1b
116 changed files with 26940 additions and 4 deletions

View File

@@ -4,5 +4,10 @@ project(frelayTest LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
add_executable(frelayTest protocolTest.cpp infoTest.h infoTest.cpp)
target_link_libraries(frelayTest PRIVATE Protocol)
set(MSOURCES
msgTest.h msgTest.cpp
protocolTest.cpp infoTest.h infoTest.cpp
)
add_executable(frelayTest ${MSOURCES})
target_link_libraries(frelayTest PRIVATE Protocol Util)

7
Test/msgTest.cpp Normal file
View File

@@ -0,0 +1,7 @@
#include "msgTest.h"
void setConsoleMsgHandler()
{
Util::InitLogger("FrelayTest.log", "FrelayTest");
qInstallMessageHandler(Util::ConsoleMsgHander);
}

8
Test/msgTest.h Normal file
View File

@@ -0,0 +1,8 @@
#ifndef MSGTEST_H
#define MSGTEST_H
#include <Util.h>
void setConsoleMsgHandler();
#endif // MSGTEST_H

View File

@@ -1,6 +1,8 @@
#include <Protocol.h>
#include <QDebug>
#include "infoTest.h"
#include "msgTest.h"
int test1()
{
@@ -12,7 +14,7 @@ int test1()
QByteArray packet = Protocol::PackBuffer(frame);
qDebug() << "Test1 - Packed data size:" << packet.size();
qDebug() << "Packed data hex:" << packet.toHex();
qWarning() << "Packed data hex:" << packet.toHex();
auto ret = Protocol::ParseBuffer(packet);
return 0;
@@ -20,6 +22,7 @@ int test1()
int main()
{
performanceTest();
setConsoleMsgHandler();
test1();
return 0;
}