This commit is contained in:
@@ -5,8 +5,9 @@
|
||||
|
||||
#include <cstdint>
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
|
||||
enum class PacketID { KeepAlive = 0};
|
||||
enum class PacketID { KeepAlive = 0 };
|
||||
|
||||
class PacketHandler;
|
||||
|
||||
@@ -38,6 +39,9 @@ using PacketFactory = sp::MessageFactory<PacketBase, AllMessages>;
|
||||
|
||||
int main() {
|
||||
KeepAliveMessage m{5UL};
|
||||
|
||||
// dispatch tests
|
||||
|
||||
MyHandler h;
|
||||
PacketDispatcher d;
|
||||
d.RegisterHandler(PacketID::KeepAlive, &h);
|
||||
@@ -45,5 +49,17 @@ int main() {
|
||||
PacketFactory f;
|
||||
auto message = f.CreateMessage(PacketID::KeepAlive);
|
||||
d.Dispatch(*message);
|
||||
|
||||
|
||||
|
||||
// write tests
|
||||
|
||||
std::ofstream file {"test.bin"};
|
||||
|
||||
message->Write(file);
|
||||
// file << std::endl;
|
||||
m.Write(file);
|
||||
// file << std::endl;
|
||||
// message->Read(file);
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user