ICU-21431 Adds a check to an ICU4C unit test to prevent a segmentation fault

if this test runs without ICU data.
This commit is contained in:
gnrunge 2020-12-08 10:10:13 -08:00 committed by Norbert Runge
parent c3ed0c5371
commit 563f8b550a

View file

@ -10069,6 +10069,9 @@ void NumberFormatTest::Test10997_FormatCurrency() {
UErrorCode error = U_ZERO_ERROR;
NumberFormat* fmt = NumberFormat::createCurrencyInstance(Locale::getUS(), error);
if (U_FAILURE(error)) {
return;
}
fmt->setMinimumFractionDigits(4);
fmt->setMaximumFractionDigits(4);