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);
32 CPPUNIT_TEST_SUITE_END();
43 void testPlayerUpdate();
44 void testSpawnEntity();
45 void testDespawnEntity();
48 static void AssertPacket(
49 const std::string &name,
50 std::uint8_t expected_type,
51 std::size_t expected_length,
52 const Packet::Payload &actual);
53 static void AssertPacket(
54 const std::string &name,
55 std::uint8_t expected_type,
56 std::size_t min_length,
57 std::size_t max_length,
58 const Packet::Payload &actual);
60 static void AssertEqual(
61 const std::string &message,
62 const EntityState &expected,
63 const EntityState &actual);
64 static void AssertEqual(
65 const std::string &message,
68 static void AssertEqual(
69 const std::string &message,
70 const glm::ivec3 &expected,
71 const glm::ivec3 &actual);
72 static void AssertEqual(
73 const std::string &message,
74 const glm::vec3 &expected,
75 const glm::vec3 &actual);
76 static void AssertEqual(
77 const std::string &message,
78 const glm::quat &expected,
79 const glm::quat &actual);