Be.IO icon indicating copy to clipboard operation
Be.IO copied to clipboard

BeBinaryReader::ReadInt64() seems to be broken

Open IliyaNovikov opened this issue 6 years ago • 3 comments

Writing a long value with BeBinaryWriter and reading it back with BeBinaryReader::ReadInt64() will not give the same value. (While the same test with standard BinaryWriter/BinaryReader works as expected) I suspect that reading is broken just based on what I see in BigEndian.cs source file. BigEndian::WriteInt64() looks straightforward, but BigEndian::ReadInt64() is using more complex (and apparently erroneous) transformations.

IliyaNovikov avatar Sep 06 '18 10:09 IliyaNovikov

Oh, it turns out that there is a pull request fixing this issue from the year 2016. Any chance it will get merged some day?

IliyaNovikov avatar Sep 06 '18 10:09 IliyaNovikov

BUMP

Also encountering multiple issues while testing the BeBinaryReader:

BeBinaryReaderTests

angelobreuer avatar Jun 28 '19 21:06 angelobreuer

After merging 2 pending PRs, it looks like all features are working as expected.

For smaller numeric types (short, int, etc.), I fored the entire range. For larger samples I tested edge cases (min & max) and 10 RNGed numbers each. I also ran the larger tests multiple times to cover more cases.

All tests are done roundtrip: arbitrary data → Writer → file → processed read-only by external HEX editor → Reader → assertion against original data.

VaslD avatar Aug 23 '19 09:08 VaslD