mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-21 04:29:31 +00:00
ICU-1090 Test for empty resource bundle
X-SVN-Rev: 5527
This commit is contained in:
parent
b9de3d570f
commit
95fdeab5da
1 changed files with 22 additions and 0 deletions
|
@ -156,12 +156,14 @@ static int32_t bundles_count = sizeof(param) / sizeof(param[0]);
|
|||
static void printUChars(UChar*);
|
||||
|
||||
static void TestGetVersion(void);
|
||||
static void TestEmptyBundle(void);
|
||||
/***************************************************************************************/
|
||||
|
||||
/* Array of our test objects */
|
||||
|
||||
void addNEWResourceBundleTest(TestNode** root)
|
||||
{
|
||||
addTest(root, &TestEmptyBundle, "tsutil/creststn/TestEmptyBundle");
|
||||
addTest(root, &TestConstruction1, "tsutil/creststn/TestConstruction1");
|
||||
addTest(root, &TestConstruction2, "tsutil/creststn/TestConstruction2");
|
||||
addTest(root, &TestResourceBundles, "tsutil/creststn/TestResourceBundle");
|
||||
|
@ -324,6 +326,26 @@ static void TestNewTypes() {
|
|||
|
||||
}
|
||||
|
||||
static void TestEmptyBundle(){
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
char testdatapath[256];
|
||||
const char *directory= u_getDataDirectory();
|
||||
UResourceBundle *resb=0, *dResB=0;
|
||||
strcpy(testdatapath, directory);
|
||||
strcat(testdatapath, "testdata");
|
||||
resb = ures_open(testdatapath, "testempty", &status);
|
||||
|
||||
if(U_SUCCESS(status)){
|
||||
dResB = ures_getByKey(resb,"test",dResB,&status);
|
||||
if(status!= U_MISSING_RESOURCE_ERROR){
|
||||
log_err("Did not get the expected error from an empty resource bundle. Expected : %s Got: %s\n",
|
||||
u_errorName(U_MISSING_RESOURCE_ERROR),u_errorName(status));
|
||||
}
|
||||
}
|
||||
ures_close(dResB);
|
||||
ures_close(resb);
|
||||
}
|
||||
|
||||
static void TestBinaryCollationData(){
|
||||
UErrorCode status=U_ZERO_ERROR;
|
||||
const char* directory=NULL;
|
||||
|
|
Loading…
Add table
Reference in a new issue