1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 03:07:44 +00:00

AK: Don't swap endianness when writing endian wrappers to stream.

This commit is contained in:
asynts 2020-08-28 18:24:00 +02:00 committed by Andreas Kling
parent 054638c355
commit e68b158a52
3 changed files with 55 additions and 26 deletions

View file

@ -181,4 +181,17 @@ TEST_CASE(duplex_wild_seeking)
EXPECT(stream.eof());
}
TEST_CASE(read_endian_values)
{
const u8 input[] { 0, 1, 2, 3, 4, 5, 6, 7 };
InputMemoryStream stream { { input, sizeof(input) } };
LittleEndian<u32> value1;
BigEndian<u32> value2;
stream >> value1 >> value2;
EXPECT_EQ(value1, 0x03020100u);
EXPECT_EQ(value2, 0x04050607u);
}
TEST_MAIN(Stream)