ICU-496 don't crash if missing test data

X-SVN-Rev: 1791
This commit is contained in:
Steven R. Loomis 2000-07-11 22:17:37 +00:00
parent 237c25901f
commit f3af060e13
2 changed files with 17 additions and 3 deletions

View File

@ -472,7 +472,7 @@ void TestConvert()
if (!ucs_file_in)
{
log_err("Couldn't open the Unicode file [%s]... Exiting...\n", ucs_file_name);
exit(0);
return;
}
/*Creates a converter and testing ucnv_openCCSID(u_int code_page, platform, errstatus*/
@ -484,7 +484,7 @@ void TestConvert()
{
log_err("Error creating the convertor \n");
exit(0);
return;
}
/*testing for ucnv_getName() */
@ -744,7 +744,7 @@ void TestConvert()
if (BOM!=0xFEFF && BOM!=0xFFFE)
{
log_err("File Missing BOM...Bailing!\n");
exit(0);
return;
}

View File

@ -325,6 +325,18 @@ UBool testTag(const char* frag,
strcpy(item_tag, "tag");
status = U_ZERO_ERROR;
theBundle = ures_open(testdatapath, "root", &status);
if(U_FAILURE(status))
{
ures_close(theBundle);
log_err("Couldn't open root bundle in %s", testdatapath);
return FALSE;
}
ures_close(theBundle);
theBundle = NULL;
for (i=0; i<bundles_count; ++i)
{
strcpy(action,"construction for");
@ -338,6 +350,8 @@ UBool testTag(const char* frag,
CONFIRM_ErrorCode(status,param[i].expected_constructor_status);
if(i == 5)
actual_bundle = 0; /* ne -> default */
else if(i == 3)