test/javacompat: add test for mismatched size
parent
a1fc0ce4b4
commit
91d16ea451
|
@ -75,7 +75,16 @@ int main(){
|
||||||
|
|
||||||
tiny_utf8::string normalString = tiny_utf8::string(normalStdString);
|
tiny_utf8::string normalString = tiny_utf8::string(normalStdString);
|
||||||
|
|
||||||
|
// check for normal operation
|
||||||
ASSERT(normalString == importedString);
|
ASSERT(normalString == importedString);
|
||||||
|
|
||||||
|
// check for mismatched size error
|
||||||
|
std::string javaStdStringCopy = javaStdString;
|
||||||
|
javaStdStringCopy[0]='b';
|
||||||
|
ErrorOr<tiny_utf8::string> errorString = JavaCompat::importJavaString(reinterpret_cast<uint8_t*>(javaStdStringCopy.data()), 0x75);
|
||||||
|
ASSERT(errorString.isError);
|
||||||
|
ASSERT(errorString.errorCode == ErrorCodes::MISMATCHEDSIZE);
|
||||||
|
|
||||||
std::cout << "Passed Import Java string test." << std::endl;
|
std::cout << "Passed Import Java string test." << std::endl;
|
||||||
|
|
||||||
//using normalString from when we read the file earlier
|
//using normalString from when we read the file earlier
|
||||||
|
@ -91,5 +100,5 @@ int main(){
|
||||||
std::cout << "Passed Export Java string test." << std::endl;
|
std::cout << "Passed Export Java string test." << std::endl;
|
||||||
delete nextChar;
|
delete nextChar;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue