lib/icu/Converter: throw exception on error

This commit is contained in:
Max Kellermann
2016-04-13 10:39:29 +02:00
parent ac7ce73526
commit bec6fa4ad7
4 changed files with 23 additions and 20 deletions

View File

@@ -54,8 +54,11 @@ public:
CPPUNIT_ASSERT(converter != nullptr);
for (const auto i : invalid_utf8) {
auto f = converter->FromUTF8(i);
CPPUNIT_ASSERT_EQUAL(true, f.IsNull());
try {
auto f = converter->FromUTF8(i);
CPPUNIT_FAIL("Exception expected");
} catch (const std::runtime_error &) {
}
}
for (const auto i : latin1_tests) {