You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed that it's not possible to skip to the end of a byte_stream_reader. I have made this unit test (googletest) to show the problem. In the example I would expect read and skip to leave the byte_stream_reader in the same, valid state. But actually read works and skip does not work (it asserts/returns false). Am I missing the point of skip or is this a bug where < should be replaced with <=here
TEST(TestByteStreamReader, skip)
{
etl::array<uint8_t, 4> data;
etl::byte_stream_reader r(data.begin(), data.size(), etl::endian::little);
r.skip<uint8_t>(4); // This fails
r.read<uint8_t>(4); // This works
EXPECT_TRUE(r.empty());
}
The text was updated successfully, but these errors were encountered:
I noticed that it's not possible to skip to the end of a byte_stream_reader. I have made this unit test (googletest) to show the problem. In the example I would expect
read
andskip
to leave the byte_stream_reader in the same, valid state. But actuallyread
works andskip
does not work (it asserts/returns false). Am I missing the point ofskip
or is this a bug where<
should be replaced with<=
hereThe text was updated successfully, but these errors were encountered: