mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-16 18:25:57 +00:00
ICU-10013 Fix some no data test error and memory leaks
X-SVN-Rev: 33424
This commit is contained in:
parent
dbd26b8c36
commit
0990f9bd02
2 changed files with 11 additions and 1 deletions
|
@ -4232,6 +4232,9 @@ void RBBITest::TestBug9983(void) {
|
|||
LocalPointer<RuleBasedBreakIterator> brkiter(static_cast<RuleBasedBreakIterator *>(
|
||||
BreakIterator::createWordInstance(Locale::getRoot(), status)));
|
||||
TEST_ASSERT_SUCCESS(status);
|
||||
if (U_FAILURE(status)) {
|
||||
return;
|
||||
}
|
||||
brkiter->setText(text);
|
||||
int32_t offset, rstatus;
|
||||
brkiter->last();
|
||||
|
|
|
@ -694,12 +694,19 @@ void RegionTest::TestAvailableTerritories() {
|
|||
|
||||
void RegionTest::TestNoContainedRegions(void) {
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
const char *emptyStr = Region::getInstance("BM",status)->getContainedRegions()->next(NULL, status);
|
||||
const Region *region = Region::getInstance("BM",status);
|
||||
if (U_FAILURE(status) || region == NULL) {
|
||||
dataerrln("Fail called to Region::getInstance(\"BM\", status) - %s", u_errorName(status));
|
||||
return;
|
||||
}
|
||||
StringEnumeration *containedRegions = region->getContainedRegions();
|
||||
const char *emptyStr = containedRegions->next(NULL, status);
|
||||
if (U_FAILURE(status)||(emptyStr!=NULL)) {
|
||||
errln("Error, 'BM' should have no subregions, but returned str=%p, err=%s\n", emptyStr, u_errorName(status));
|
||||
} else {
|
||||
logln("Success - BM has no subregions\n");
|
||||
}
|
||||
delete containedRegions;
|
||||
}
|
||||
|
||||
#endif /* #if !UCONFIG_NO_FORMATTING */
|
||||
|
|
Loading…
Add table
Reference in a new issue