#include #include #include "wireframe/byteio.hpp" using namespace wireframe; TEST_CASE("read_be16 reads a big-endian 16-bit value") { std::vector bytes = {0x12, 0x34}; CHECK(read_be16(bytes, 0) == 0x1234); } TEST_CASE("read_be32 reads a big-endian 32-bit value") { std::vector bytes = {0xDE, 0xAD, 0xBE, 0xEF}; CHECK(read_be32(bytes, 0) == 0xDEADBEEFu); } TEST_CASE("read_be16/read_be32 read from a nonzero offset") { std::vector bytes = {0x00, 0x00, 0x12, 0x34, 0x56, 0x78}; CHECK(read_be16(bytes, 2) == 0x1234); CHECK(read_be32(bytes, 2) == 0x12345678u); }