test/nbt_read_write_helpers: Insufficient unit tests #43

Closed
opened 2022-08-15 09:35:15 +02:00 by BodgeMaster · 1 comment

Test are needed for all read helpers that read a portion of data from the middle of a data blob.

I just ran into an issue with NBT::helper::readString which was coded under the assumption that dataSize is the size of the string. This would have been caught in a unit test trying to read a string from the middle of a blob of data.

Test are needed for all read helpers that read a portion of data from the middle of a data blob. I just ran into an issue with NBT::helper::readString which was coded under the assumption that dataSize is the size of the string. This would have been caught in a unit test trying to read a string from the middle of a blob of data.
BodgeMaster added this to the NBT milestone 2022-08-15 09:35:15 +02:00
BodgeMaster added the
TODO
label 2022-08-15 09:35:15 +02:00

Okay, it appears that the error stems from a misunderstanding in how the helpers are supposed to work more than no test catching it... One of the tests fails now that I have fixed the function.

The additional unit tests would still be nice to have. I will probably copy the simple NBT file in there and try reading from it.

Okay, it appears that the error stems from a misunderstanding in how the helpers are supposed to work more than no test catching it... One of the tests fails now that I have fixed the function. The additional unit tests would still be nice to have. I will probably copy the simple NBT file in there and try reading from it.
BodgeMaster self-assigned this 2022-08-25 17:02:16 +02:00
Sign in to join this conversation.
There is no content yet.