test/nbt_read_write_helpers: Change unnecessarily long string to be just one above the allowed size

Soda
BodgeMaster 2022-09-26 23:53:53 +02:00
parent 10b1d9fa0c
commit 47fd1f8970
1 changed files with 1 additions and 1 deletions

View File

@ -574,7 +574,7 @@ int main(){
ASSERT(javaStdString1 == *exportedString); ASSERT(javaStdString1 == *exportedString);
//check that we get an error when trying to write a string that is too long //check that we get an error when trying to write a string that is too long
std::string overrunString = std::string(0xFFFFF, '.'); std::string overrunString = std::string(0x10000, '.');
ASSERT(NBT::Helper::writeString(exportedString, tiny_utf8::string(overrunString)).isError); ASSERT(NBT::Helper::writeString(exportedString, tiny_utf8::string(overrunString)).isError);
ASSERT(NBT::Helper::writeString(exportedString, tiny_utf8::string(overrunString)).errorCode == ErrorCodes::OVERRUN); ASSERT(NBT::Helper::writeString(exportedString, tiny_utf8::string(overrunString)).errorCode == ErrorCodes::OVERRUN);