diff --git a/src/test/nbt_read_write_helpers.cpp b/src/test/nbt_read_write_helpers.cpp index cd08330..02b5b54 100644 --- a/src/test/nbt_read_write_helpers.cpp +++ b/src/test/nbt_read_write_helpers.cpp @@ -490,9 +490,10 @@ int main(){ tiny_utf8::string normalString = tiny_utf8::string(normalStdString); - ASSERT(normalString == NBT::helper::readString(reinterpret_cast(javaStdString.data()), 0x75, 0).value) - ASSERT(NBT::helper::readString(reinterpret_cast(javaStdString.data()), 0xFFFFF, 0).errorCode == ErrorCodes::OVERRUN); - ASSERT(NBT::helper::readString(reinterpret_cast(javaStdString.data()), 0xF, 0).errorCode == ErrorCodes::MISMATCHEDSIZE); + ASSERT(normalString == NBT::helper::readString(reinterpret_cast(javaStdString.data()), javaStdString.size(), 0).value) + + javaStdString[0] = '1'; + ASSERT(NBT::helper::readString(reinterpret_cast(javaStdString.data()), javaStdString.size(), 0).errorCode == ErrorCodes::OVERRUN); std::cout << "Passed readString NBT helper test." << std::endl; delete nextChar;