2025-06-13 23:14:57 +08:00
|
|
|
#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-13 23:14:57 +08:00
|
|
|
|
2025-06-14 09:27:50 +08:00
|
|
|
int test1()
|
2025-06-13 23:14:57 +08:00
|
|
|
{
|
|
|
|
|
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();
|
2025-06-13 23:14:57 +08:00
|
|
|
|
|
|
|
|
auto ret = Protocol::ParseBuffer(packet);
|
2025-06-14 09:27:50 +08:00
|
|
|
return 0;
|
|
|
|
|
}
|
2025-06-13 23:14:57 +08:00
|
|
|
|
2025-06-14 09:27:50 +08:00
|
|
|
int main()
|
|
|
|
|
{
|
2025-11-08 18:11:52 +08:00
|
|
|
//setConsoleMsgHandler();
|
|
|
|
|
infoTest3();
|
2025-06-13 23:14:57 +08:00
|
|
|
return 0;
|
2025-11-08 18:11:52 +08:00
|
|
|
}
|