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);
32 CPPUNIT_TEST(testPlayerCorrection);
33 CPPUNIT_TEST(testChunkBegin);
34 CPPUNIT_TEST(testChunkData);
36 CPPUNIT_TEST_SUITE_END();
47 void testPlayerUpdate();
48 void testSpawnEntity();
49 void testDespawnEntity();
50 void testEntityUpdate();
51 void testPlayerCorrection();
52 void testChunkBegin();
56 static void AssertPacket(
57 const std::string &name,
58 std::uint8_t expected_type,
59 std::size_t expected_length,
60 const Packet::Payload &actual);
61 static void AssertPacket(
62 const std::string &name,
63 std::uint8_t expected_type,
64 std::size_t min_length,
65 std::size_t max_length,
66 const Packet::Payload &actual);
68 static void AssertEqual(
69 const std::string &message,
70 const EntityState &expected,
71 const EntityState &actual);
72 static void AssertEqual(
73 const std::string &message,
76 static void AssertEqual(
77 const std::string &message,
78 const glm::ivec3 &expected,
79 const glm::ivec3 &actual);
80 static void AssertEqual(
81 const std::string &message,
82 const glm::vec3 &expected,
83 const glm::vec3 &actual);
84 static void AssertEqual(
85 const std::string &message,
86 const glm::quat &expected,
87 const glm::quat &actual);