test/nbt_read_write_helpers: fix unit tests for readString()
parent
91d16ea451
commit
5272636cb8
|
@ -490,9 +490,10 @@ int main(){
|
||||||
|
|
||||||
tiny_utf8::string normalString = tiny_utf8::string(normalStdString);
|
tiny_utf8::string normalString = tiny_utf8::string(normalStdString);
|
||||||
|
|
||||||
ASSERT(normalString == NBT::helper::readString(reinterpret_cast<uint8_t*>(javaStdString.data()), 0x75, 0).value)
|
ASSERT(normalString == NBT::helper::readString(reinterpret_cast<uint8_t*>(javaStdString.data()), javaStdString.size(), 0).value)
|
||||||
ASSERT(NBT::helper::readString(reinterpret_cast<uint8_t*>(javaStdString.data()), 0xFFFFF, 0).errorCode == ErrorCodes::OVERRUN);
|
|
||||||
ASSERT(NBT::helper::readString(reinterpret_cast<uint8_t*>(javaStdString.data()), 0xF, 0).errorCode == ErrorCodes::MISMATCHEDSIZE);
|
javaStdString[0] = '1';
|
||||||
|
ASSERT(NBT::helper::readString(reinterpret_cast<uint8_t*>(javaStdString.data()), javaStdString.size(), 0).errorCode == ErrorCodes::OVERRUN);
|
||||||
std::cout << "Passed readString NBT helper test." << std::endl;
|
std::cout << "Passed readString NBT helper test." << std::endl;
|
||||||
delete nextChar;
|
delete nextChar;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue