Skip to content

Commit 4ad5dd2

Browse files
committed
Packet test: use AV_HAVE_BIGENDIAN
1 parent 5133c67 commit 4ad5dd2

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

tests/Packet.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#include <catch2/catch_test_macros.hpp>
22

33
#include <vector>
4-
#include <bit>
54

65
#include "avcpp/avconfig.h"
76
#include "avcpp/packet.h"
@@ -216,7 +215,8 @@ TEST_CASE("Packet define", "[Packet][Construct]")
216215
std::vector<uint8_t> side_block_adds(meta.size() + sizeof(uint64_t));
217216
std::span out = side_block_adds;
218217
uint64_t id = 100;
219-
if (std::endian::native == std::endian::little)
218+
//if (std::endian::native == std::endian::little)
219+
if (AV_HAVE_BIGENDIAN == 0)
220220
id = av_bswap64(id);
221221
memcpy(out.data(), &id, sizeof(id));
222222
out = out.subspan(sizeof(id));
@@ -235,7 +235,8 @@ TEST_CASE("Packet define", "[Packet][Construct]")
235235
uint64_t id{};
236236
memcpy(&id, in.data(), sizeof(uint64_t));
237237
in = in.subspan(sizeof(uint64_t));
238-
if (std::endian::native == std::endian::little)
238+
//if (std::endian::native == std::endian::little)
239+
if (AV_HAVE_BIGENDIAN == 0)
239240
id = av_bswap64(id);
240241
REQUIRE(id == 100);
241242

@@ -253,7 +254,8 @@ TEST_CASE("Packet define", "[Packet][Construct]")
253254
uint64_t id{};
254255
memcpy(&id, in.data(), sizeof(uint64_t));
255256
in = in.subspan(sizeof(uint64_t));
256-
if (std::endian::native == std::endian::little)
257+
//if (std::endian::native == std::endian::little)
258+
if (AV_HAVE_BIGENDIAN == 0)
257259
id = av_bswap64(id);
258260
REQUIRE(id == 100);
259261

0 commit comments

Comments
 (0)