add: spdlog and basic client code.
This commit is contained in:
@@ -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
7
Test/msgTest.cpp
Normal file
@@ -0,0 +1,7 @@
|
||||
#include "msgTest.h"
|
||||
|
||||
void setConsoleMsgHandler()
|
||||
{
|
||||
Util::InitLogger("FrelayTest.log", "FrelayTest");
|
||||
qInstallMessageHandler(Util::ConsoleMsgHander);
|
||||
}
|
||||
8
Test/msgTest.h
Normal file
8
Test/msgTest.h
Normal file
@@ -0,0 +1,8 @@
|
||||
#ifndef MSGTEST_H
|
||||
#define MSGTEST_H
|
||||
|
||||
#include <Util.h>
|
||||
|
||||
void setConsoleMsgHandler();
|
||||
|
||||
#endif // MSGTEST_H
|
||||
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user