first commit

This commit is contained in:
2025-02-04 19:11:03 +01:00
commit cfeea10634
43 changed files with 2448 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
// #include <sp/protocol/packet/PacketSerializer.h>
// #include <sp/misc/Test.h>
// #include <sp/protocol/packet/PacketFactory.h>
// namespace tp = sp::protocol;
// template <typename Packet_T, typename Packet_Data_T = typename Packet_T::PacketDataType>
// static int TestPacket() {
// Packet_T packet;
// td::DataBuffer buffer = tp::PacketSerializer::Serialize(packet);
// auto abstractPacket = tp::PacketSerializer::Deserialize(buffer);
// td_test_assert(abstractPacket);
// Packet_T* packet2 = dynamic_cast<Packet_T*>(abstractPacket.get());
// td_test_assert(packet2);
// td_test_assert(packet.GetType() == packet2->GetType());
// return std::memcmp(&packet.m_Data, &packet2->m_Data, sizeof(Packet_Data_T));
// }
// #define DeclarePacket(Packet, ...) TestPacket<tp::packets::Packet>();
// static int TestAllPackets() {
// DeclareAllPacket()
// return TD_TEST_SUCCESSFUL;
// }
// int main() {
// return TestAllPackets();
// }