1 #ifndef BLANK_TEST_NET_PACKETTEST_HPP_
2 #define BLANK_TEST_NET_PACKETTEST_HPP_
4 #include "model/geometry.hpp"
5 #include "net/Packet.hpp"
6 #include "world/EntityState.hpp"
11 #include <glm/glm.hpp>
12 #include <cppunit/extensions/HelperMacros.h>
19 : public CppUnit::TestFixture {
21 CPPUNIT_TEST_SUITE(PacketTest);
23 CPPUNIT_TEST(testControl);
24 CPPUNIT_TEST(testPing);
25 CPPUNIT_TEST(testLogin);
26 CPPUNIT_TEST(testJoin);
27 CPPUNIT_TEST(testPart);
28 CPPUNIT_TEST(testPlayerUpdate);
29 CPPUNIT_TEST(testSpawnEntity);
30 CPPUNIT_TEST(testDespawnEntity);
31 CPPUNIT_TEST(testEntityUpdate);
33 CPPUNIT_TEST_SUITE_END();
44 void testPlayerUpdate();
45 void testSpawnEntity();
46 void testDespawnEntity();
47 void testEntityUpdate();
50 static void AssertPacket(
51 const std::string &name,
52 std::uint8_t expected_type,
53 std::size_t expected_length,
54 const Packet::Payload &actual);
55 static void AssertPacket(
56 const std::string &name,
57 std::uint8_t expected_type,
58 std::size_t min_length,
59 std::size_t max_length,
60 const Packet::Payload &actual);
62 static void AssertEqual(
63 const std::string &message,
64 const EntityState &expected,
65 const EntityState &actual);
66 static void AssertEqual(
67 const std::string &message,
70 static void AssertEqual(
71 const std::string &message,
72 const glm::ivec3 &expected,
73 const glm::ivec3 &actual);
74 static void AssertEqual(
75 const std::string &message,
76 const glm::vec3 &expected,
77 const glm::vec3 &actual);
78 static void AssertEqual(
79 const std::string &message,
80 const glm::quat &expected,
81 const glm::quat &actual);