Files
frelay/Test/protocolTest.cpp

29 lines
627 B
C++
Raw Permalink Normal View History

#include <Protocol.h>
#include <QDebug>
2025-06-14 23:25:16 +08:00
2025-06-14 09:27:50 +08:00
#include "infoTest.h"
2025-06-14 23:25:16 +08:00
#include "msgTest.h"
2025-06-14 09:27:50 +08:00
int test1()
{
auto frame = QSharedPointer<FrameBuffer>::create();
frame->type = FBT_CLI_BIN_FILEDATA;
frame->fid = "client123";
frame->tid = "file456";
frame->data = QByteArray("This is test binary data", 24);
QByteArray packet = Protocol::PackBuffer(frame);
qDebug() << "Test1 - Packed data size:" << packet.size();
2025-06-14 23:25:16 +08:00
qWarning() << "Packed data hex:" << packet.toHex();
auto ret = Protocol::ParseBuffer(packet);
2025-06-14 09:27:50 +08:00
return 0;
}
2025-06-14 09:27:50 +08:00
int main()
{
//setConsoleMsgHandler();
infoTest3();
return 0;
}