@@ -239,7 +239,7 @@ TEST(KaitaiStreamTest, bytes_to_str_big_dest)
239239{
240240 // Prepare a string in IBM437 that is reasonably big, fill it with U+2248 ALMOST EQUAL TO character,
241241 // which is just 1 byte 0xFB in IBM437.
242- const int len = 10000000 ;
242+ const int len = 10 ;
243243 std::string src (len, ' \xF7 ' );
244244
245245 std::string res = kaitai::kstream::bytes_to_str (src, " IBM437" );
@@ -274,6 +274,8 @@ TEST(KaitaiStreamTest, bytes_to_str_invalid_seq_euc_jp_too_short)
274274 EXPECT_EQ (e.what (), std::string (" bytes_to_str error: illegal sequence: EINVAL" ));
275275#elif defined(KS_STR_ENCODING_WIN32API)
276276 EXPECT_EQ (e.what (), std::string (" bytes_to_str error: illegal sequence: MultiByteToWideChar" ));
277+ #elif defined(KS_STR_ENCODING_ICU)
278+ EXPECT_EQ (e.what (), std::string (" xxx" ));
277279#else
278280#error Unknown KS_STR_ENCODING
279281#endif
@@ -291,6 +293,8 @@ TEST(KaitaiStreamTest, bytes_to_str_invalid_seq_gb2312_too_short)
291293 EXPECT_EQ (e.what (), std::string (" bytes_to_str error: illegal sequence: EINVAL" ));
292294#elif defined(KS_STR_ENCODING_WIN32API)
293295 EXPECT_EQ (e.what (), std::string (" bytes_to_str error: illegal sequence: MultiByteToWideChar" ));
296+ #elif defined(KS_STR_ENCODING_ICU)
297+ EXPECT_EQ (e.what (), std::string (" xxx" ));
294298#else
295299#error Unknown KS_STR_ENCODING
296300#endif
@@ -307,6 +311,8 @@ TEST(KaitaiStreamTest, bytes_to_str_invalid_seq_gb2312_two_bytes)
307311 EXPECT_EQ (e.what (), std::string (" bytes_to_str error: illegal sequence: EILSEQ" ));
308312#elif defined(KS_STR_ENCODING_WIN32API)
309313 EXPECT_EQ (e.what (), std::string (" bytes_to_str error: illegal sequence: MultiByteToWideChar" ));
314+ #elif defined(KS_STR_ENCODING_ICU)
315+ EXPECT_EQ (e.what (), std::string (" xxx" ));
310316#else
311317#error Unknown KS_STR_ENCODING
312318#endif
@@ -324,6 +330,8 @@ TEST(KaitaiStreamTest, bytes_to_str_invalid_seq_utf_16le_odd_bytes)
324330 EXPECT_EQ (e.what (), std::string (" bytes_to_str error: illegal sequence: EINVAL" ));
325331#elif defined(KS_STR_ENCODING_WIN32API)
326332 EXPECT_EQ (e.what (), std::string (" bytes_to_str error: illegal sequence: incomplete" ));
333+ #elif defined(KS_STR_ENCODING_ICU)
334+ EXPECT_EQ (e.what (), std::string (" xxx" ));
327335#else
328336#error Unknown KS_STR_ENCODING
329337#endif
@@ -342,6 +350,8 @@ TEST(KaitaiStreamTest, bytes_to_str_invalid_seq_utf_16le_incomplete_high_surroga
342350 EXPECT_EQ (e.what (), std::string (" bytes_to_str error: illegal sequence: EINVAL" ));
343351#elif defined(KS_STR_ENCODING_WIN32API)
344352 EXPECT_EQ (e.what (), std::string (" bytes_to_str error: illegal sequence: WideCharToMultiByte" ));
353+ #elif defined(KS_STR_ENCODING_ICU)
354+ EXPECT_EQ (e.what (), std::string (" xxx" ));
345355#else
346356#error Unknown KS_STR_ENCODING
347357#endif
0 commit comments