• Home
  • Raw
  • Download

Lines Matching full:status

248 static void checkStatus(int32_t line, UErrorCode expected, UErrorCode status) {  in checkStatus()  argument
249 if(U_FAILURE(status)) { in checkStatus()
252 if(status != expected) { in checkStatus()
253 …log_err_status(status, "%s:%d: Expected error code %s, got error code %s\n", __FILE__, line, u_err… in checkStatus()
258 UErrorCode status = U_USING_DEFAULT_WARNING; in TestErrorCodes() local
264 r = ures_open(NULL, "ti_ER_ASSAB", &status); in TestErrorCodes()
265 checkStatus(__LINE__, U_USING_FALLBACK_WARNING, status); in TestErrorCodes()
268 /* this bundle should return zero error, so it shouldn't change the status */ in TestErrorCodes()
269 status = U_USING_DEFAULT_WARNING; in TestErrorCodes()
270 r = ures_open(NULL, "ti_ER", &status); in TestErrorCodes()
271 checkStatus(__LINE__, U_USING_DEFAULT_WARNING, status); in TestErrorCodes()
275 if(U_SUCCESS(status) && r != NULL) { in TestErrorCodes()
276 status = U_USING_DEFAULT_WARNING; in TestErrorCodes()
277 … r2 = ures_getByKey(r, "ExemplarCharacters", NULL, &status); /* ExemplarCharacters lives in ti */ in TestErrorCodes()
278 checkStatus(__LINE__, U_USING_FALLBACK_WARNING, status); in TestErrorCodes()
282 /* this bundle should return zero error, so it shouldn't change the status */ in TestErrorCodes()
283 status = U_USING_DEFAULT_WARNING; in TestErrorCodes()
284 r = ures_open(U_ICUDATA_REGION, "ti", &status); in TestErrorCodes()
285 checkStatus(__LINE__, U_USING_DEFAULT_WARNING, status); in TestErrorCodes()
288 status = U_USING_FALLBACK_WARNING; in TestErrorCodes()
289 r = ures_open(NULL, "nolocale", &status); in TestErrorCodes()
290 checkStatus(__LINE__, U_USING_DEFAULT_WARNING, status); in TestErrorCodes()
298 r = ures_open(U_ICUDATA_COLL, "sr_YU_VOJVODINA", &status); in TestErrorCodes()
299 checkStatus(__LINE__, U_USING_FALLBACK_WARNING, status); in TestErrorCodes()
302 /* this bundle should return zero error, so it shouldn't change the status */ in TestErrorCodes()
303 status = U_USING_FALLBACK_WARNING; in TestErrorCodes()
304 r = ures_open(U_ICUDATA_COLL, "sr", &status); in TestErrorCodes()
305 checkStatus(__LINE__, U_USING_FALLBACK_WARNING, status); in TestErrorCodes()
308 if(U_SUCCESS(status) && r != NULL) { in TestErrorCodes()
309 status = U_USING_DEFAULT_WARNING; in TestErrorCodes()
310 r2 = ures_getByKey(r, "collations", NULL, &status); in TestErrorCodes()
311 checkStatus(__LINE__, U_USING_DEFAULT_WARNING, status); in TestErrorCodes()
315 /* this bundle should return zero error, so it shouldn't change the status */ in TestErrorCodes()
316 status = U_USING_DEFAULT_WARNING; in TestErrorCodes()
317 r = ures_open(U_ICUDATA_COLL, "sr", &status); in TestErrorCodes()
318 checkStatus(__LINE__, U_USING_DEFAULT_WARNING, status); in TestErrorCodes()
321 if(U_SUCCESS(status) && r != NULL) { in TestErrorCodes()
322 status = U_USING_DEFAULT_WARNING; in TestErrorCodes()
323 r2 = ures_getByKey(r, "collations", r2, &status); in TestErrorCodes()
324 checkStatus(__LINE__, U_USING_DEFAULT_WARNING, status); in TestErrorCodes()
328 status = U_USING_FALLBACK_WARNING; in TestErrorCodes()
329 r = ures_open(U_ICUDATA_COLL, "nolocale", &status); in TestErrorCodes()
330 checkStatus(__LINE__, U_USING_DEFAULT_WARNING, status); in TestErrorCodes()
337 UErrorCode status = U_ZERO_ERROR; in TestAliasConflict() local
347 he = ures_open(NULL, "he", &status); in TestAliasConflict()
348 iw = ures_open(NULL, "iw", &status); in TestAliasConflict()
349 if(U_FAILURE(status)) { in TestAliasConflict()
350 log_err_status(status, "Failed to get resource with %s\n", myErrorName(status)); in TestAliasConflict()
353 result = ures_getStringByKey(he, "ExemplarCharacters", &resultLen, &status); in TestAliasConflict()
354 if(U_FAILURE(status) || result == NULL) { in TestAliasConflict()
355 …log_err_status(status, "Failed to get resource ExemplarCharacters with %s\n", myErrorName(status)); in TestAliasConflict()
361 status = U_ZERO_ERROR; in TestAliasConflict()
362 norway = ures_open(NULL, norwayNames[i], &status); in TestAliasConflict()
363 if(U_FAILURE(status)) { in TestAliasConflict()
364 …log_err_status(status, "Failed to get resource with %s for %s\n", myErrorName(status), norwayNames… in TestAliasConflict()
367 realName = ures_getLocale(norway, &status); in TestAliasConflict()
456 UErrorCode status = U_ZERO_ERROR; in TestNewTypes() local
469 testdatapath=loadTestData(&status); in TestNewTypes()
471 if(U_FAILURE(status)) in TestNewTypes()
473 log_data_err("Could not load testdata.dat %s \n",myErrorName(status)); in TestNewTypes()
477 theBundle = ures_open(testdatapath, "testtypes", &status); in TestNewTypes()
479 empty = tres_getString(theBundle, -1, "emptystring", &len, &status); in TestNewTypes()
484 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestNewTypes()
493 res = ures_getByKey(theBundle, "zerotest", res, &status); in TestNewTypes()
494 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestNewTypes()
496 zeroString=tres_getString(res, -1, NULL, &len, &status); in TestNewTypes()
497 if(U_SUCCESS(status)){ in TestNewTypes()
498 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestNewTypes()
509 res = ures_getByKey(theBundle, "binarytest", res, &status); in TestNewTypes()
510 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestNewTypes()
512 binResult=(uint8_t*)ures_getBinary(res, &len, &status); in TestNewTypes()
513 if(U_SUCCESS(status)){ in TestNewTypes()
514 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestNewTypes()
522 res = ures_getByKey(theBundle, "importtest", res, &status); in TestNewTypes()
523 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestNewTypes()
525 binResult=(uint8_t*)ures_getBinary(res, &len, &status); in TestNewTypes()
526 if(U_SUCCESS(status)){ in TestNewTypes()
527 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestNewTypes()
535 res = ures_getByKey(theBundle, "one", res, &status); in TestNewTypes()
536 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestNewTypes()
538 intResult=ures_getInt(res, &status); in TestNewTypes()
539 uintResult = ures_getUInt(res, &status); in TestNewTypes()
540 if(U_SUCCESS(status)){ in TestNewTypes()
541 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestNewTypes()
547 res = ures_getByKey(theBundle, "minusone", res, &status); in TestNewTypes()
548 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestNewTypes()
550 intResult=ures_getInt(res, &status); in TestNewTypes()
551 uintResult = ures_getUInt(res, &status); in TestNewTypes()
552 if(U_SUCCESS(status)){ in TestNewTypes()
553 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestNewTypes()
560 res = ures_getByKey(theBundle, "plusone", res, &status); in TestNewTypes()
561 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestNewTypes()
563 intResult=ures_getInt(res, &status); in TestNewTypes()
564 uintResult = ures_getUInt(res, &status); in TestNewTypes()
565 if(U_SUCCESS(status)){ in TestNewTypes()
566 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestNewTypes()
571 res = ures_getByKey(theBundle, "onehundredtwentythree", res, &status); in TestNewTypes()
572 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestNewTypes()
574 intResult=ures_getInt(res, &status); in TestNewTypes()
575 if(U_SUCCESS(status)){ in TestNewTypes()
576 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestNewTypes()
582 const UChar* str = tres_getString(theBundle,-1,"testescape",&len,&status); in TestNewTypes()
583 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestNewTypes()
584 if(U_SUCCESS(status)){ in TestNewTypes()
621 got = tres_getString(theBundle,-1,"test_unescaping",&len,&status); in TestNewTypes()
634 status = U_ZERO_ERROR; in TestNewTypes()
638 const UChar* str = tres_getString(theBundle,-1,"test_underscores",&len,&status); in TestNewTypes()
641 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestNewTypes()
653 status = U_ZERO_ERROR; in TestNewTypes()
654 resB = ures_getByKey(theBundle, "collations", resB, &status); in TestNewTypes()
655 resB = ures_getByKey(resB, "standard", resB, &status); in TestNewTypes()
656 str = tres_getString(resB,-1,"Sequence",&strLength,&status); in TestNewTypes()
657 if(!str || U_FAILURE(status)) { in TestNewTypes()
658 log_data_err("Could not load collations from theBundle: %s\n", u_errorName(status)); in TestNewTypes()
677 status = U_ZERO_ERROR; in TestNewTypes()
680 const UChar* str = tres_getString(theBundle, -1, "testincludeUTF",&strLen,&status); in TestNewTypes()
683 if(U_FAILURE(status)){ in TestNewTypes()
684 …rr("Could not get testincludeUTF resource from testtypes bundle. Error: %s\n",u_errorName(status)); in TestNewTypes()
688 UCHARBUF* ucbuf = ucbuf_open(testDataFileName,&cp,FALSE,FALSE,&status); in TestNewTypes()
690 if(U_SUCCESS(status)){ in TestNewTypes()
691 const UChar* buffer = ucbuf_getBuffer(ucbuf,&len,&status); in TestNewTypes()
692 if(U_SUCCESS(status)){ in TestNewTypes()
705 … log_err("ucbuf failed to open %s. Error: %s\n", testDataFileName, u_errorName(status)); in TestNewTypes()
710 …log_err("Could not get riwords.txt (path : %s). Error: %s\n",testDataFileName,u_errorName(status)); in TestNewTypes()
714 status = U_ZERO_ERROR; in TestNewTypes()
717 const UChar* str = tres_getString(theBundle, -1, "testinclude",&strLen,&status); in TestNewTypes()
721 if(U_FAILURE(status)){ in TestNewTypes()
722 …g_err("Could not get testinclude resource from testtypes bundle. Error: %s\n",u_errorName(status)); in TestNewTypes()
726 UCHARBUF* ucbuf = ucbuf_open(testDataFileName,&cp,FALSE,FALSE,&status); in TestNewTypes()
728 if(U_SUCCESS(status)){ in TestNewTypes()
729 const UChar* buffer = ucbuf_getBuffer(ucbuf,&len,&status); in TestNewTypes()
730 if(U_SUCCESS(status)){ in TestNewTypes()
739 … log_err("ucbuf failed to open %s. Error: %s\n", testDataFileName, u_errorName(status)); in TestNewTypes()
743 …("Could not get translit_rules.txt (path : %s). Error: %s\n",testDataFileName,u_errorName(status)); in TestNewTypes()
758 UErrorCode status = U_ZERO_ERROR; in TestEmptyTypes() local
768 testdatapath=loadTestData(&status); in TestEmptyTypes()
769 if(U_FAILURE(status)) in TestEmptyTypes()
771 log_data_err("Could not load testdata.dat %s \n",myErrorName(status)); in TestEmptyTypes()
775 theBundle = ures_open(testdatapath, "testtypes", &status); in TestEmptyTypes()
777 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestEmptyTypes()
785 status = U_ZERO_ERROR; in TestEmptyTypes()
787 res = ures_getByKey(theBundle, "emptyexplicitstring", res, &status); in TestEmptyTypes()
788 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestEmptyTypes()
790 zeroString=tres_getString(res, -1, NULL, &len, &status); in TestEmptyTypes()
791 if(U_SUCCESS(status)){ in TestEmptyTypes()
792 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestEmptyTypes()
800 status = U_ZERO_ERROR; in TestEmptyTypes()
802 res = ures_getByKey(theBundle, "emptystring", res, &status); in TestEmptyTypes()
803 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestEmptyTypes()
805 zeroString=tres_getString(res, -1, NULL, &len, &status); in TestEmptyTypes()
806 if(U_SUCCESS(status)){ in TestEmptyTypes()
807 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestEmptyTypes()
815 status = U_ZERO_ERROR; in TestEmptyTypes()
817 res = ures_getByKey(theBundle, "emptyint", res, &status); in TestEmptyTypes()
818 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestEmptyTypes()
820 intResult=ures_getInt(res, &status); in TestEmptyTypes()
821 if(U_SUCCESS(status)){ in TestEmptyTypes()
822 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestEmptyTypes()
829 status = U_ZERO_ERROR; in TestEmptyTypes()
831 res = ures_getByKey(theBundle, "emptyintv", res, &status); in TestEmptyTypes()
832 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestEmptyTypes()
835 if(U_FAILURE(status)){ in TestEmptyTypes()
836 log_err("Couldn't get emptyintv key %s\n", u_errorName(status)); in TestEmptyTypes()
839 zeroIntVect=ures_getIntVector(res, &len, &status); in TestEmptyTypes()
841 if(!U_SUCCESS(status) || resArray != NULL || len != 0) { in TestEmptyTypes()
846 status = U_ZERO_ERROR; in TestEmptyTypes()
848 res = ures_getByKey(theBundle, "emptybin", res, &status); in TestEmptyTypes()
849 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestEmptyTypes()
852 if(U_FAILURE(status)){ in TestEmptyTypes()
853 log_err("Couldn't get emptybin key %s\n", u_errorName(status)); in TestEmptyTypes()
856 binResult=ures_getBinary(res, &len, &status); in TestEmptyTypes()
858 if(!U_SUCCESS(status) || len != 0) { in TestEmptyTypes()
863 status = U_ZERO_ERROR; in TestEmptyTypes()
865 res = ures_getByKey(theBundle, "emptyarray", res, &status); in TestEmptyTypes()
866 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestEmptyTypes()
869 if(U_FAILURE(status)){ in TestEmptyTypes()
870 log_err("Couldn't get emptyarray key %s\n", u_errorName(status)); in TestEmptyTypes()
873 resArray=ures_getByIndex(res, 0, resArray, &status); in TestEmptyTypes()
874 if(U_SUCCESS(status) || resArray != NULL){ in TestEmptyTypes()
879 status = U_ZERO_ERROR; in TestEmptyTypes()
881 res = ures_getByKey(theBundle, "emptytable", res, &status); in TestEmptyTypes()
882 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestEmptyTypes()
885 if(U_FAILURE(status)){ in TestEmptyTypes()
886 log_err("Couldn't get emptytable key %s\n", u_errorName(status)); in TestEmptyTypes()
889 resArray=ures_getByIndex(res, 0, resArray, &status); in TestEmptyTypes()
890 if(U_SUCCESS(status) || resArray != NULL){ in TestEmptyTypes()
900 UErrorCode status = U_ZERO_ERROR; in TestEmptyBundle() local
904 testdatapath=loadTestData(&status); in TestEmptyBundle()
905 if(U_FAILURE(status)) in TestEmptyBundle()
907 log_data_err("Could not load testdata.dat %s \n",myErrorName(status)); in TestEmptyBundle()
910 resb = ures_open(testdatapath, "testempty", &status); in TestEmptyBundle()
912 if(U_SUCCESS(status)){ in TestEmptyBundle()
913 dResB = ures_getByKey(resb,"test",dResB,&status); in TestEmptyBundle()
914 if(status!= U_MISSING_RESOURCE_ERROR){ in TestEmptyBundle()
916 u_errorName(U_MISSING_RESOURCE_ERROR),u_errorName(status)); in TestEmptyBundle()
925 UErrorCode status=U_ZERO_ERROR; in TestBinaryCollationData() local
937 testdatapath=loadTestData(&status); in TestBinaryCollationData()
938 if(U_FAILURE(status)) in TestBinaryCollationData()
940 log_data_err("Could not load testdata.dat %s \n",myErrorName(status)); in TestBinaryCollationData()
945 teRes=ures_open(testdatapath, locale, &status); in TestBinaryCollationData()
946 if(U_FAILURE(status)){ in TestBinaryCollationData()
947 log_err("ERROR: Failed to get resource for \"te\" with %s", myErrorName(status)); in TestBinaryCollationData()
950 status=U_ZERO_ERROR; in TestBinaryCollationData()
951 coll = ures_getByKey(teRes, "collations", coll, &status); in TestBinaryCollationData()
952 coll = ures_getByKey(coll, "standard", coll, &status); in TestBinaryCollationData()
953 if(U_SUCCESS(status)){ in TestBinaryCollationData()
954 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestBinaryCollationData()
956 binColl=ures_getByKey(coll, "%%CollationBin", binColl, &status); in TestBinaryCollationData()
957 if(U_SUCCESS(status)){ in TestBinaryCollationData()
958 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestBinaryCollationData()
960 binResult=(uint8_t*)ures_getBinary(binColl, &len, &status); in TestBinaryCollationData()
962 if(U_SUCCESS(status)){ in TestBinaryCollationData()
963 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestBinaryCollationData()
982 UErrorCode status=U_ZERO_ERROR; in TestAPI() local
996 testdatapath=loadTestData(&status); in TestAPI()
997 if(U_FAILURE(status)) in TestAPI()
999 log_data_err("Could not load testdata.dat %s \n",myErrorName(status)); in TestAPI()
1022 status = U_ZERO_ERROR; in TestAPI()
1023 ures_close(ures_openU(largeBuffer, "root", &status)); in TestAPI()
1024 if(status != U_ILLEGAL_ARGUMENT_ERROR){ in TestAPI()
1025 …r("ERROR: ures_openU() worked when the path is very large. It returned %s\n", myErrorName(status)); in TestAPI()
1028 status = U_ZERO_ERROR; in TestAPI()
1029 ures_close(ures_openU(NULL, "root", &status)); in TestAPI()
1030 if(U_FAILURE(status)){ in TestAPI()
1031 … log_err_status(status, "ERROR: ures_openU() failed path = NULL with %s\n", myErrorName(status)); in TestAPI()
1034 status = U_ILLEGAL_ARGUMENT_ERROR; in TestAPI()
1035 if(ures_openU(NULL, "root", &status) != NULL){ in TestAPI()
1036 log_err("ERROR: ures_openU() worked with error status with %s\n", myErrorName(status)); in TestAPI()
1039 status = U_ZERO_ERROR; in TestAPI()
1040 teRes=ures_openU(utestdatapath, "te", &status); in TestAPI()
1041 if(U_FAILURE(status)){ in TestAPI()
1042 …log_err_status(status, "ERROR: ures_openU() failed path =%s with %s\n", austrdup(utestdatapath), m… in TestAPI()
1047 if(strcmp(ures_getLocale(teRes, &status), "te") != 0){ in TestAPI()
1048 …err("ERROR: ures_getLocale() failed. Expected = te_TE Got = %s\n", ures_getLocale(teRes, &status)); in TestAPI()
1051 teFillin=ures_getByKey(teRes, "tagged_array_in_te_te_IN", teFillin, &status); in TestAPI()
1053 value=(UChar*)ures_getNextString(teFillin, &len, &key, &status); in TestAPI()
1056 value=(UChar*)ures_getNextString(teFillin, &len, &key, &status); in TestAPI()
1057 if(status !=U_INDEX_OUTOFBOUNDS_ERROR){ in TestAPI()
1059 myErrorName(status)); in TestAPI()
1063 status=U_ZERO_ERROR; in TestAPI()
1066 teFillin=ures_getNextResource(teRes, teFillin, &status); in TestAPI()
1067 if(U_FAILURE(status)){ in TestAPI()
1079 teFillin=ures_getByKey(teRes, "string_only_in_te", teFillin, &status); in TestAPI()
1080 teFillin2=ures_getByIndex(teFillin, 0, teFillin2, &status); in TestAPI()
1081 if(U_FAILURE(status)){ in TestAPI()
1084 … if(strcmp(u_austrcpy(convOutput, tres_getString(teFillin2, -1, NULL, &len, &status)), "TE") != 0){ in TestAPI()
1085 status=U_ZERO_ERROR; in TestAPI()
1086 …ource fetched the key=%s, expected \"TE\" \n", austrdup(ures_getString(teFillin2, &len, &status))); in TestAPI()
1093 status=U_ZERO_ERROR; in TestAPI()
1094 ures_openFillIn(teRes, testdatapath, "te", &status); in TestAPI()
1095 if(U_FAILURE(status)){ in TestAPI()
1099 if(strcmp(ures_getLocale(teRes, &status), "te") != 0){ in TestAPI()
1102 ures_getByKey(teRes, "string_only_in_te", teFillin, &status); in TestAPI()
1103 teFillin2=ures_getNextResource(teFillin, teFillin2, &status); in TestAPI()
1107 teFillin2=ures_getNextResource(teFillin, teFillin2, &status); in TestAPI()
1108 if(status !=U_INDEX_OUTOFBOUNDS_ERROR){ in TestAPI()
1110 myErrorName(status)); in TestAPI()
1118 status=U_ZERO_ERROR; in TestAPI()
1119 teRes=ures_open(NULL, "dE_At_NOWHERE_TO_BE_FOUND", &status); in TestAPI()
1120 if(U_FAILURE(status)) { in TestAPI()
1121 …e to open a locale resource bundle from \"dE_At_NOWHERE_TO_BE_FOUND\"(%s)\n", u_errorName(status)); in TestAPI()
1123 if(0!=strcmp("de_AT", ures_getLocale(teRes, &status))) { in TestAPI()
1124 …_getLocale(\"dE_At_NOWHERE_TO_BE_FOUND\")=%s but must be de_AT\n", ures_getLocale(teRes, &status)); in TestAPI()
1130 status=U_ZERO_ERROR; in TestAPI()
1131 teRes=ures_open(NULL, "iW_Il_depRecaTed_HebreW", &status); in TestAPI()
1132 if(U_FAILURE(status)) { in TestAPI()
1133 …ble to open a locale resource bundle from \"iW_Il_depRecaTed_HebreW\"(%s)\n", u_errorName(status)); in TestAPI()
1135 if(0!=strcmp("he_IL", ures_getLocale(teRes, &status))) { in TestAPI()
1136 …es_getLocale(\"iW_Il_depRecaTed_HebreW\")=%s but must be he_IL\n", ures_getLocale(teRes, &status)); in TestAPI()
1144 UErrorCode status=U_ZERO_ERROR; in TestErrorConditions() local
1159 testdatapath = loadTestData(&status); in TestErrorConditions()
1160 if(U_FAILURE(status)) in TestErrorConditions()
1162 log_data_err("Could not load testdata.dat %s \n",myErrorName(status)); in TestErrorConditions()
1169 /*Test ures_openU with status != U_ZERO_ERROR*/ in TestErrorConditions()
1170 log_verbose("Testing ures_openU() with status != U_ZERO_ERROR.....\n"); in TestErrorConditions()
1171 status=U_ILLEGAL_ARGUMENT_ERROR; in TestErrorConditions()
1172 teRes=ures_openU(utestdatapath, "te", &status); in TestErrorConditions()
1173 if(U_FAILURE(status)){ in TestErrorConditions()
1174 …log_verbose("ures_openU() failed as expected path =%s with status != U_ZERO_ERROR\n", testdatapath… in TestErrorConditions()
1176 …log_err("ERROR: ures_openU() is supposed to fail path =%s with status != U_ZERO_ERROR\n", austrdup… in TestErrorConditions()
1181 status=U_ZERO_ERROR; in TestErrorConditions()
1182 ures_openFillIn(NULL, testdatapath, "te", &status); in TestErrorConditions()
1183 if(status != U_ILLEGAL_ARGUMENT_ERROR){ in TestErrorConditions()
1185 myErrorName(status)); in TestErrorConditions()
1187 /*Test ures_getLocale() with status != U_ZERO_ERROR*/ in TestErrorConditions()
1188 status=U_ZERO_ERROR; in TestErrorConditions()
1189 teRes=ures_openU(utestdatapath, "te", &status); in TestErrorConditions()
1190 if(U_FAILURE(status)){ in TestErrorConditions()
1191 …err("ERROR: ures_openU() failed path =%s with %s\n", austrdup(utestdatapath), myErrorName(status)); in TestErrorConditions()
1194 status=U_ILLEGAL_ARGUMENT_ERROR; in TestErrorConditions()
1195 if(ures_getLocale(teRes, &status) != NULL){ in TestErrorConditions()
1199 status=U_ZERO_ERROR; in TestErrorConditions()
1200 if(ures_getLocale(NULL, &status) != NULL && status != U_ILLEGAL_ARGUMENT_ERROR){ in TestErrorConditions()
1202 myErrorName(status)); in TestErrorConditions()
1205 status=U_ZERO_ERROR; in TestErrorConditions()
1210 status=U_ZERO_ERROR; in TestErrorConditions()
1215 status=U_ZERO_ERROR; in TestErrorConditions()
1220 status=U_ZERO_ERROR; in TestErrorConditions()
1225 status=U_ZERO_ERROR; in TestErrorConditions()
1226 …if(ures_getStringByKey(NULL, "string_only_in_te", &resultLen, &status) != NULL && status != U_ILLE… in TestErrorConditions()
1228 myErrorName(status)); in TestErrorConditions()
1231 status=U_ZERO_ERROR; in TestErrorConditions()
1232 teFillin=ures_getByKey(NULL, "string_only_in_te", teFillin, &status); in TestErrorConditions()
1233 if( teFillin != NULL && status != U_ILLEGAL_ARGUMENT_ERROR){ in TestErrorConditions()
1235 myErrorName(status)); in TestErrorConditions()
1237 /*Test ures_getByKey() with status != U_ZERO_ERROR*/ in TestErrorConditions()
1238 teFillin=ures_getByKey(NULL, "string_only_in_te", teFillin, &status); in TestErrorConditions()
1243 status=U_ZERO_ERROR; in TestErrorConditions()
1244 …if(ures_getStringByKey(NULL, "string_only_in_te", &len, &status) != NULL && status != U_ILLEGAL_AR… in TestErrorConditions()
1246 myErrorName(status)); in TestErrorConditions()
1248 /*Test ures_getStringByKey() with status != U_ZERO_ERROR*/ in TestErrorConditions()
1249 if(ures_getStringByKey(teRes, "string_only_in_te", &len, &status) != NULL){ in TestErrorConditions()
1250 …log_err("ERROR: ures_getStringByKey is supposed to fail when status != U_ZERO_ERROR. Expected: err… in TestErrorConditions()
1251 myErrorName(status)); in TestErrorConditions()
1254 status=U_ZERO_ERROR; in TestErrorConditions()
1255 if(ures_getString(NULL, &len, &status) != NULL && status != U_ILLEGAL_ARGUMENT_ERROR){ in TestErrorConditions()
1257 myErrorName(status)); in TestErrorConditions()
1259 /*Test ures_getString() with status != U_ZERO_ERROR*/ in TestErrorConditions()
1260 if(ures_getString(teRes, &len, &status) != NULL){ in TestErrorConditions()
1261 …log_err("ERROR: ures_getString is supposed to fail when status != U_ZERO_ERROR. Expected: errorCod… in TestErrorConditions()
1262 myErrorName(status)); in TestErrorConditions()
1265 status=U_ZERO_ERROR; in TestErrorConditions()
1266 if(ures_getBinary(NULL, &len, &status) != NULL && status != U_ILLEGAL_ARGUMENT_ERROR){ in TestErrorConditions()
1268 myErrorName(status)); in TestErrorConditions()
1270 /*Test ures_getBinary(0 status != U_ILLEGAL_ARGUMENT_ERROR*/ in TestErrorConditions()
1271 status=U_ZERO_ERROR; in TestErrorConditions()
1272 coll = ures_getByKey(teRes, "collations", coll, &status); in TestErrorConditions()
1273 coll = ures_getByKey(teRes, "standard", coll, &status); in TestErrorConditions()
1274 binColl=ures_getByKey(coll, "%%CollationBin", binColl, &status); in TestErrorConditions()
1276 status=U_ILLEGAL_ARGUMENT_ERROR; in TestErrorConditions()
1277 binResult=(uint8_t*)ures_getBinary(binColl, &len, &status); in TestErrorConditions()
1279 log_err("ERROR: ures_getBinary() with status != U_ZERO_ERROR is supposed to fail\n"); in TestErrorConditions()
1282 /*Test ures_getNextResource() with status != U_ZERO_ERROR*/ in TestErrorConditions()
1283 teFillin=ures_getNextResource(teRes, teFillin, &status); in TestErrorConditions()
1288 status=U_ZERO_ERROR; in TestErrorConditions()
1289 teFillin=ures_getNextResource(NULL, teFillin, &status); in TestErrorConditions()
1290 if(teFillin != NULL || status != U_ILLEGAL_ARGUMENT_ERROR){ in TestErrorConditions()
1292 myErrorName(status)); in TestErrorConditions()
1295 teFillin=ures_getByKey(teRes, "tagged_array_in_te_te_IN", teFillin, &status); in TestErrorConditions()
1297 status = U_ILLEGAL_ARGUMENT_ERROR; in TestErrorConditions()
1298 value=(UChar*)ures_getNextString(teFillin, &len, &key, &status); in TestErrorConditions()
1303 status=U_ZERO_ERROR; in TestErrorConditions()
1304 value=(UChar*)ures_getNextString(NULL, &len, &key, &status); in TestErrorConditions()
1305 if(value != NULL || status != U_ILLEGAL_ARGUMENT_ERROR){ in TestErrorConditions()
1307 myErrorName(status)); in TestErrorConditions()
1310 status=U_ZERO_ERROR; in TestErrorConditions()
1311 teFillin=ures_getByKey(teRes, "array_only_in_te", teFillin, &status); in TestErrorConditions()
1312 if(ures_countArrayItems(teRes, "array_only_in_te", &status) != 4) { in TestErrorConditions()
1315 status=U_ILLEGAL_ARGUMENT_ERROR; in TestErrorConditions()
1316 teFillin2=ures_getByIndex(teFillin, 0, teFillin2, &status); in TestErrorConditions()
1321 status=U_ZERO_ERROR; in TestErrorConditions()
1322 teFillin2=ures_getByIndex(NULL, 0, teFillin2, &status); in TestErrorConditions()
1323 if(status != U_ILLEGAL_ARGUMENT_ERROR){ in TestErrorConditions()
1325 myErrorName(status)); in TestErrorConditions()
1328 status=U_ZERO_ERROR; in TestErrorConditions()
1329 teFillin=ures_getByKey(teRes, "array_only_in_te", teFillin, &status); in TestErrorConditions()
1330 status=U_ILLEGAL_ARGUMENT_ERROR; in TestErrorConditions()
1331 value=(UChar*)ures_getStringByIndex(teFillin, 0, &len, &status); in TestErrorConditions()
1336 status=U_ZERO_ERROR; in TestErrorConditions()
1337 value=(UChar*)ures_getStringByIndex(NULL, 0, &len, &status); in TestErrorConditions()
1338 if(value != NULL || status != U_ILLEGAL_ARGUMENT_ERROR){ in TestErrorConditions()
1340 myErrorName(status)); in TestErrorConditions()
1343 status=U_ZERO_ERROR; in TestErrorConditions()
1344 value=(UChar*)ures_getStringByIndex(teFillin, 9999, &len, &status); in TestErrorConditions()
1345 if(value != NULL || status != U_MISSING_RESOURCE_ERROR){ in TestErrorConditions()
1347 myErrorName(status)); in TestErrorConditions()
1350 status=U_ZERO_ERROR; in TestErrorConditions()
1351 if(ures_getInt(NULL, &status) != -1 && status != U_ILLEGAL_ARGUMENT_ERROR){ in TestErrorConditions()
1353 myErrorName(status)); in TestErrorConditions()
1355 /*Test ures_getInt() where status != U_ZERO_ERROR */ in TestErrorConditions()
1356 if(ures_getInt(teRes, &status) != -1){ in TestErrorConditions()
1374 UErrorCode status= U_ZERO_ERROR; in TestGetVersion() local
1387 resB = ures_open(NULL,locName, &status); in TestGetVersion()
1388 if (U_FAILURE(status)) { in TestGetVersion()
1389 …log_err_status(status, "Resource bundle creation for locale %s failed.: %s\n", locName, myErrorNam… in TestGetVersion()
1413 UErrorCode status= U_ZERO_ERROR; in TestGetVersionColl() local
1423 resB = ures_open(U_ICUDATA_COLL,locName, &status); in TestGetVersionColl()
1424 rules = tres_getString(resB,-1,"UCARules",&len, &status); in TestGetVersionColl()
1425 if(!rules || U_FAILURE(status)) { in TestGetVersionColl()
1427 status = U_ZERO_ERROR; in TestGetVersionColl()
1434 locs = ures_openAvailableLocales(U_ICUDATA_COLL, &status); in TestGetVersionColl()
1435 if (U_FAILURE(status)) { in TestGetVersionColl()
1436 … log_err_status(status, "enumeration of %s failed.: %s\n", U_ICUDATA_COLL, myErrorName(status)); in TestGetVersionColl()
1442 resB = ures_open(U_ICUDATA_COLL,locName, &status); in TestGetVersionColl()
1443 if (U_FAILURE(status)) { in TestGetVersionColl()
1444 …rce bundle creation for locale %s:%s failed.: %s\n", U_ICUDATA_COLL, locName, myErrorName(status)); in TestGetVersionColl()
1459 locName = uenum_next(locs, &locLen, &status); in TestGetVersionColl()
1460 if(U_FAILURE(status)) { in TestGetVersionColl()
1461 log_err("uenum_next(locs) error %s\n", u_errorName(status)); in TestGetVersionColl()
1474 UErrorCode status = U_ZERO_ERROR; in TestResourceBundles() local
1475 loadTestData(&status); in TestResourceBundles()
1476 if(U_FAILURE(status)) { in TestResourceBundles()
1477 log_data_err("Could not load testdata.dat, status = %s\n", u_errorName(status)); in TestResourceBundles()
1499 UErrorCode status= U_ZERO_ERROR; in TestConstruction1() local
1516 testdatapath=loadTestData(&status); in TestConstruction1()
1517 if(U_FAILURE(status)) in TestConstruction1()
1519 log_data_err("Could not load testdata.dat %s \n",myErrorName(status)); in TestConstruction1()
1525 empty = ures_open(testdatapath, "testempty", &status); in TestConstruction1()
1526 if(empty == NULL || U_FAILURE(status)) { in TestConstruction1()
1535 log_err("construction of NULL did not succeed : %s \n", myErrorName(status)); in TestConstruction1()
1541 log_err("construction of %s did not succeed : %s \n", locale, myErrorName(status)); in TestConstruction1()
1547 log_err("Something threw an error in TestConstruction(): %s\n", myErrorName(status)); in TestConstruction1()
1595 UErrorCode expected_status,status = U_ZERO_ERROR,expected_resource_status = U_ZERO_ERROR; in testTag() local
1615 testdatapath = loadTestData(&status); in testTag()
1616 if(U_FAILURE(status)) in testTag()
1618 log_data_err("Could not load testdata.dat %s \n",myErrorName(status)); in testTag()
1634 status = U_ZERO_ERROR; in testTag()
1636 theBundle = ures_open(testdatapath, param[i].name, &status); in testTag()
1637 CONFIRM_ErrorCode(status,param[i].expected_constructor_status); in testTag()
1709 status = U_ZERO_ERROR; in testTag()
1712 string=tres_getString(theBundle, -1, tag, &len, &status); in testTag()
1713 if(U_SUCCESS(status)) { in testTag()
1722 log_verbose("%s got %d, expected %d\n", action, status, expected_resource_status); in testTag()
1724 CONFIRM_ErrorCode(status, expected_resource_status); in testTag()
1742 status = U_ZERO_ERROR; in testTag()
1743 array=ures_getByKey(theBundle, tag, array, &status); in testTag()
1744 CONFIRM_ErrorCode(status,expected_resource_status); in testTag()
1745 if (U_SUCCESS(status)) { in testTag()
1756 arrayItem1=ures_getNextResource(array, arrayItem1, &status); in testTag()
1757 if(U_SUCCESS(status)){ in testTag()
1758 CONFIRM_EQ(tres_getString(arrayItem1, -1, NULL, &len, &status),expected_string); in testTag()
1765 CONFIRM_ErrorCode(status, U_MISSING_RESOURCE_ERROR); in testTag()
1783 status = U_ZERO_ERROR; in testTag()
1785 array=ures_getByKey(theBundle, tag, array, &status); in testTag()
1786 if(!U_FAILURE(status)){ in testTag()
1788 t=(UChar*)ures_getStringByIndex(array, idx, &len, &status); in testTag()
1789 if(!U_FAILURE(status)){ in testTag()
1801 CONFIRM_ErrorCode(status,expected_status); in testTag()
1820 status = U_ZERO_ERROR; in testTag()
1821 array2d=ures_getByKey(theBundle, tag, array2d, &status); in testTag()
1823 CONFIRM_ErrorCode(status,expected_resource_status); in testTag()
1824 if (U_SUCCESS(status)) in testTag()
1833 tableRow=ures_getByIndex(array2d, row, tableRow, &status); in testTag()
1834 CONFIRM_ErrorCode(status, expected_resource_status); in testTag()
1835 if(U_SUCCESS(status)){ in testTag()
1848 arrayItem1=ures_getNextResource(tableRow, arrayItem1, &status); in testTag()
1849 if(U_SUCCESS(status)){ in testTag()
1850 … const UChar *stringValue=tres_getString(arrayItem1, -1, NULL, &len, &status); in testTag()
1870 status = U_ZERO_ERROR; in testTag()
1873 array2d=ures_getByKey(theBundle, tag, array2d, &status); in testTag()
1874 if(U_SUCCESS(status)){ in testTag()
1876 tableRow=ures_getByIndex(array2d, row, tableRow, &status); in testTag()
1877 if(U_SUCCESS(status)) { in testTag()
1879 t=(UChar*)ures_getStringByIndex(tableRow, col, &len, &status); in testTag()
1880 if(U_SUCCESS(status)){ in testTag()
1888 CONFIRM_ErrorCode(status,expected_status); in testTag()
1890 if (U_SUCCESS(status)){ in testTag()
1915 status = U_ZERO_ERROR; in testTag()
1917 tags=ures_getByKey(theBundle, tag, tags, &status); in testTag()
1918 CONFIRM_ErrorCode(status, expected_resource_status); in testTag()
1919 if (U_SUCCESS(status)) { in testTag()
1930 tagelement=ures_getByIndex(tags, idx, tagelement, &status); in testTag()
1932 value=(UChar*)ures_getNextString(tagelement, &len, &key, &status); in testTag()
1950 status = U_ZERO_ERROR; in testTag()
1954 tags=ures_getByKey(theBundle, tag, tags, &status); in testTag()
1955 if(U_SUCCESS(status)){ in testTag()
1958 tagelement=ures_getByKey(tags, item_tag, tagelement, &status); in testTag()
1959 if(!U_FAILURE(status)){ in testTag()
1967 t=(UChar*)tres_getString(tagelement, -1, NULL, &len, &status); in testTag()
1968 if(!U_FAILURE(status)){ in testTag()
1973 CONFIRM_ErrorCode(status,U_MISSING_RESOURCE_ERROR); in testTag()
1976 if (status != U_MISSING_RESOURCE_ERROR) { in testTag()
2014 UErrorCode status = U_ZERO_ERROR; in TestPreventFallback() local
2017 testdatapath=loadTestData(&status); in TestPreventFallback()
2018 if(U_FAILURE(status)) in TestPreventFallback()
2020 log_data_err("Could not load testdata.dat %s \n",myErrorName(status)); in TestPreventFallback()
2026 theBundle = ures_open(testdatapath, "te_IN_NE", &status); in TestPreventFallback()
2027 if(U_FAILURE(status)) in TestPreventFallback()
2029 log_data_err("Could not open resource bundle te_IN_NE %s \n",myErrorName(status)); in TestPreventFallback()
2034 …ures_getStringByKeyWithFallback(theBundle, "string_in_te_no_te_IN_fallback", &unused_len, &status); in TestPreventFallback()
2035 if (status != U_MISSING_RESOURCE_ERROR) in TestPreventFallback()
2039 status = U_ZERO_ERROR; in TestPreventFallback()
2042 ures_getStringByKeyWithFallback(theBundle, "string_only_in_te", &unused_len, &status); in TestPreventFallback()
2043 if(U_FAILURE(status)) in TestPreventFallback()
2045 log_err("Expected to find string_only_in_te %s \n",myErrorName(status)); in TestPreventFallback()
2047 status = U_ZERO_ERROR; in TestPreventFallback()
2051 theBundle = ures_open(testdatapath, "te", &status); in TestPreventFallback()
2052 if(U_FAILURE(status)) in TestPreventFallback()
2054 log_data_err("Could not open resource bundle te_IN_NE %s \n",myErrorName(status)); in TestPreventFallback()
2057 …ures_getStringByKeyWithFallback(theBundle, "string_in_te_no_te_IN_fallback", &unused_len, &status); in TestPreventFallback()
2058 if(U_FAILURE(status)) in TestPreventFallback()
2060 log_err("Expected to find string_in_te_no_te_IN_fallback %s \n",myErrorName(status)); in TestPreventFallback()
2062 status = U_ZERO_ERROR; in TestPreventFallback()
2073 UErrorCode status = U_ZERO_ERROR; in TestFallback() local
2080 fr_FR = ures_open(NULL, "fr_FR", &status); in TestFallback()
2081 if(U_FAILURE(status)) in TestFallback()
2083 log_err_status(status, "Couldn't open fr_FR - %s\n", u_errorName(status)); in TestFallback()
2087 status = U_ZERO_ERROR; in TestFallback()
2091 junk = tres_getString(fr_FR, -1, "LocaleID", &resultLen, &status); in TestFallback()
2092 status = U_ZERO_ERROR; in TestFallback()
2093 junk = tres_getString(fr_FR, -1, "LocaleString", &resultLen, &status); in TestFallback()
2094 status = U_ZERO_ERROR; in TestFallback()
2095 junk = tres_getString(fr_FR, -1, "LocaleID", &resultLen, &status); in TestFallback()
2096 status = U_ZERO_ERROR; in TestFallback()
2100 subResource = ures_getByKey(fr_FR, "layout", NULL, &status); in TestFallback()
2101 if(status != U_USING_DEFAULT_WARNING) in TestFallback()
2104 u_errorName(status)); in TestFallback()
2107 status = U_ZERO_ERROR; in TestFallback()
2111 junk = tres_getString(fr_FR, -1, "ExemplarCharacters", &resultLen, &status); in TestFallback()
2112 if(status != U_USING_FALLBACK_WARNING) in TestFallback()
2115 status); in TestFallback()
2118 status = U_ZERO_ERROR; in TestFallback()
2166 UErrorCode status = U_ZERO_ERROR; in TestResourceLevelAliasing() local
2176 testdatapath=loadTestData(&status); in TestResourceLevelAliasing()
2177 if(U_FAILURE(status)) in TestResourceLevelAliasing()
2179 log_data_err("Could not load testdata.dat %s \n",myErrorName(status)); in TestResourceLevelAliasing()
2183 aliasB = ures_open(testdatapath, "testaliases", &status); in TestResourceLevelAliasing()
2185 if(U_FAILURE(status)) in TestResourceLevelAliasing()
2187 log_data_err("Could not load testaliases.res %s \n",myErrorName(status)); in TestResourceLevelAliasing()
2191 tb = ures_getByKey(aliasB, "aaa", tb, &status); in TestResourceLevelAliasing()
2192 if(status != U_TOO_MANY_ALIASES_ERROR) { in TestResourceLevelAliasing()
2196 status = U_ZERO_ERROR; in TestResourceLevelAliasing()
2198 tb = ures_getByKey(aliasB, "aab", tb, &status); in TestResourceLevelAliasing()
2199 if(status != U_TOO_MANY_ALIASES_ERROR) { in TestResourceLevelAliasing()
2202 status = U_ZERO_ERROR; in TestResourceLevelAliasing()
2204 if(U_FAILURE(status) ) { in TestResourceLevelAliasing()
2208 tb = ures_getByKey(aliasB, "nonexisting", tb, &status); in TestResourceLevelAliasing()
2209 if(status != U_MISSING_RESOURCE_ERROR) { in TestResourceLevelAliasing()
2212 status = U_ZERO_ERROR; in TestResourceLevelAliasing()
2215 uk = ures_findResource("ja/calendar/gregorian/DateTimePatterns/2", uk, &status); in TestResourceLevelAliasing()
2216 if((uk == NULL) || U_FAILURE(status)) { in TestResourceLevelAliasing()
2217 …log_err_status(status, "Couldn't findResource('ja/calendar/gregorian/DateTimePatterns/2') err %s\n… in TestResourceLevelAliasing()
2221 sequence = tres_getString(uk, -1, NULL, &seqLen, &status); in TestResourceLevelAliasing()
2223 tb = ures_getByKey(aliasB, "referencingalias", tb, &status); in TestResourceLevelAliasing()
2224 string = tres_getString(tb, -1, NULL, &strLen, &status); in TestResourceLevelAliasing()
2230 string = tres_getString(aliasB, -1, "referencingalias", &strLen, &status); in TestResourceLevelAliasing()
2235 checkStatus(__LINE__, U_ZERO_ERROR, status); in TestResourceLevelAliasing()
2236 tb = ures_getByKey(aliasB, "DateTimePatterns", tb, &status); in TestResourceLevelAliasing()
2237 checkStatus(__LINE__, U_ZERO_ERROR, status); in TestResourceLevelAliasing()
2238 tb = ures_getByIndex(tb, 2, tb, &status); in TestResourceLevelAliasing()
2239 checkStatus(__LINE__, U_ZERO_ERROR, status); in TestResourceLevelAliasing()
2240 string = tres_getString(tb, -1, NULL, &strLen, &status); in TestResourceLevelAliasing()
2241 checkStatus(__LINE__, U_ZERO_ERROR, status); in TestResourceLevelAliasing()
2243 if(U_FAILURE(status)) { in TestResourceLevelAliasing()
2244 log_err("%s trying to get string via separate getters\n", u_errorName(status)); in TestResourceLevelAliasing()
2250 testtypes = ures_open(testdatapath, "testtypes", &status); in TestResourceLevelAliasing()
2253 uk = ures_findSubResource(testtypes, s, uk, &status); in TestResourceLevelAliasing()
2254 sequence = tres_getString(uk, -1, NULL, &seqLen, &status); in TestResourceLevelAliasing()
2256 tb = ures_getByKey(aliasB, "simplealias", tb, &status); in TestResourceLevelAliasing()
2257 string = tres_getString(tb, -1, NULL, &strLen, &status); in TestResourceLevelAliasing()
2259 if(U_FAILURE(status) || seqLen != strLen || u_strncmp(sequence, string, seqLen) != 0) { in TestResourceLevelAliasing()
2265 tb = ures_getByKey(aliasB, "zoneTests", tb, &status); in TestResourceLevelAliasing()
2266 tb = ures_getByKey(tb, "zoneAlias2", tb, &status); in TestResourceLevelAliasing()
2267 string = tres_getString(tb, -1, NULL, &strLen, &status); in TestResourceLevelAliasing()
2269 en = ures_findResource("/ICUDATA-zone/en/zoneStrings/3/0", en, &status); in TestResourceLevelAliasing()
2270 sequence = tres_getString(en, -1, NULL, &seqLen, &status); in TestResourceLevelAliasing()
2272 if(U_FAILURE(status) || seqLen != strLen || u_strncmp(sequence, string, seqLen) != 0) { in TestResourceLevelAliasing()
2296 tb = ures_getByKey(aliasB, "testGetStringByKeyAliasing", tb, &status); in TestResourceLevelAliasing()
2297 if(U_FAILURE(status)) { in TestResourceLevelAliasing()
2298 … log_err("FAIL: Couldn't get testGetStringByKeyAliasing resource: %s\n", u_errorName(status)); in TestResourceLevelAliasing()
2301 result = tres_getString(tb, -1, keys[i], &resultLen, &status); in TestResourceLevelAliasing()
2302 if(U_FAILURE(status)){ in TestResourceLevelAliasing()
2303 …log_err("(1) Fetching the resource with key %s failed. Error: %s\n", keys[i], u_errorName(status)); in TestResourceLevelAliasing()
2312 result = tres_getString(tb, i, NULL, &resultLen, &status); in TestResourceLevelAliasing()
2313 if(U_FAILURE(status)){ in TestResourceLevelAliasing()
2314 …log_err("(2) Fetching the resource with key %s failed. Error: %s\n", keys[i], u_errorName(status)); in TestResourceLevelAliasing()
2323 result = ures_getNextString(tb, &resultLen, &key, &status); in TestResourceLevelAliasing()
2324 if(U_FAILURE(status)){ in TestResourceLevelAliasing()
2325 …log_err("(3) Fetching the resource with key %s failed. Error: %s\n", keys[i], u_errorName(status)); in TestResourceLevelAliasing()
2334 tb = ures_getByKey(aliasB, "testGetStringByIndexAliasing", tb, &status); in TestResourceLevelAliasing()
2335 if(U_FAILURE(status)) { in TestResourceLevelAliasing()
2336 … log_err("FAIL: Couldn't get testGetStringByIndexAliasing resource: %s\n", u_errorName(status)); in TestResourceLevelAliasing()
2339 result = tres_getString(tb, i, NULL, &resultLen, &status); in TestResourceLevelAliasing()
2340 if(U_FAILURE(status)){ in TestResourceLevelAliasing()
2341 … log_err("Fetching the resource with key %s failed. Error: %s\n", keys[i], u_errorName(status)); in TestResourceLevelAliasing()
2350 result = ures_getNextString(tb, &resultLen, &key, &status); in TestResourceLevelAliasing()
2351 if(U_FAILURE(status)){ in TestResourceLevelAliasing()
2352 … log_err("Fetching the resource with key %s failed. Error: %s\n", keys[i], u_errorName(status)); in TestResourceLevelAliasing()
2362 tb = ures_getByKey(aliasB, "testAliasToTree", tb, &status); in TestResourceLevelAliasing()
2363 if(U_FAILURE(status)){ in TestResourceLevelAliasing()
2364 …err("Fetching the resource with key \"testAliasToTree\" failed. Error: %s\n", u_errorName(status)); in TestResourceLevelAliasing()
2379 UErrorCode status = U_ZERO_ERROR; in TestDirectAccess() local
2385 /*const char* testdatapath=loadTestData(&status); in TestDirectAccess()
2386 if(U_FAILURE(status)){ in TestDirectAccess()
2387 log_err("Could not load testdata.dat %s \n",myErrorName(status)); in TestDirectAccess()
2391 t = ures_findResource("/testdata/te/zoneStrings/3/2", t, &status); in TestDirectAccess()
2392 if(U_FAILURE(status)) { in TestDirectAccess()
2393 log_data_err("Couldn't access indexed resource, error %s\n", u_errorName(status)); in TestDirectAccess()
2394 status = U_ZERO_ERROR; in TestDirectAccess()
2401 t = ures_findResource("en/calendar/gregorian/DateTimePatterns/3", t, &status); in TestDirectAccess()
2402 if(U_FAILURE(status)) { in TestDirectAccess()
2403 log_data_err("Couldn't access indexed resource, error %s\n", u_errorName(status)); in TestDirectAccess()
2404 status = U_ZERO_ERROR; in TestDirectAccess()
2412 t = ures_findResource("ja/ExemplarCharacters", t, &status); in TestDirectAccess()
2413 if(U_FAILURE(status)) { in TestDirectAccess()
2414 log_data_err("Couldn't access keyed resource, error %s\n", u_errorName(status)); in TestDirectAccess()
2415 status = U_ZERO_ERROR; in TestDirectAccess()
2423 t2 = ures_open(U_ICUDATA_LANG, "sr", &status); in TestDirectAccess()
2424 if(U_FAILURE(status)) { in TestDirectAccess()
2425 … log_err_status(status, "Couldn't open 'sr' resource bundle, error %s\n", u_errorName(status)); in TestDirectAccess()
2430 if(U_SUCCESS(status)) { in TestDirectAccess()
2433 t = ures_findSubResource(t2, s, t, &status); in TestDirectAccess()
2434 if(U_FAILURE(status)) { in TestDirectAccess()
2435 log_err("Couldn't access keyed resource, error %s\n", u_errorName(status)); in TestDirectAccess()
2436 status = U_ZERO_ERROR; in TestDirectAccess()
2445 t = ures_findResource("root/calendar/islamic-civil/DateTime", t, &status); in TestDirectAccess()
2446 if(U_SUCCESS(status)) { in TestDirectAccess()
2449 status = U_ZERO_ERROR; in TestDirectAccess()
2452 … t = ures_findResource("root/calendar/islamic-civil/eras/abbreviated/0/mikimaus/pera", t, &status); in TestDirectAccess()
2453 if(U_SUCCESS(status)) { in TestDirectAccess()
2456 status = U_ZERO_ERROR; in TestDirectAccess()
2459 t2 = ures_open(NULL, "he", &status); in TestDirectAccess()
2460 t2 = ures_getByKeyWithFallback(t2, "calendar", t2, &status); in TestDirectAccess()
2461 t2 = ures_getByKeyWithFallback(t2, "islamic-civil", t2, &status); in TestDirectAccess()
2462 t2 = ures_getByKeyWithFallback(t2, "DateTime", t2, &status); in TestDirectAccess()
2463 if(U_SUCCESS(status)) { in TestDirectAccess()
2466 status = U_ZERO_ERROR; in TestDirectAccess()
2469 t2 = ures_open(NULL, "he", &status); in TestDirectAccess()
2471 t2 = ures_getByKeyWithFallback(t2, "calendar", t2, &status); in TestDirectAccess()
2472 t2 = ures_getByKeyWithFallback(t2, "islamic-civil", t2, &status); in TestDirectAccess()
2473 t2 = ures_getByKeyWithFallback(t2, "eras", t2, &status); in TestDirectAccess()
2474 if(U_FAILURE(status)) { in TestDirectAccess()
2475 log_err_status(status, "Didn't get Eras. I know they are there!\n"); in TestDirectAccess()
2477 status = U_ZERO_ERROR; in TestDirectAccess()
2480 t2 = ures_open(NULL, "root", &status); in TestDirectAccess()
2481 t2 = ures_getByKeyWithFallback(t2, "calendar", t2, &status); in TestDirectAccess()
2482 t2 = ures_getByKeyWithFallback(t2, "islamic-civil", t2, &status); in TestDirectAccess()
2483 t2 = ures_getByKeyWithFallback(t2, "DateTime", t2, &status); in TestDirectAccess()
2484 if(U_SUCCESS(status)) { in TestDirectAccess()
2487 status = U_ZERO_ERROR; in TestDirectAccess()
2494 UErrorCode status = U_ZERO_ERROR; in TestTicket9804() local
2496 t = ures_open(NULL, "he", &status); in TestTicket9804()
2497 t = ures_getByKeyWithFallback(t, "calendar/islamic-civil/DateTime", t, &status); in TestTicket9804()
2498 if(U_SUCCESS(status)) { in TestTicket9804()
2501 status = U_ZERO_ERROR; in TestTicket9804()
2503 t = ures_open(NULL, "he", &status); in TestTicket9804()
2504 t = ures_getByKeyWithFallback(t, "calendar/islamic-civil/eras", t, &status); in TestTicket9804()
2505 if(U_FAILURE(status)) { in TestTicket9804()
2506 log_err_status(status, "Didn't get Eras. I know they are there!\n"); in TestTicket9804()
2508 const char *locale = ures_getLocaleByType(t, ULOC_ACTUAL_LOCALE, &status); in TestTicket9804()
2513 status = U_ZERO_ERROR; in TestTicket9804()
2522 UErrorCode status = U_ZERO_ERROR; in TestJB3763() local
2523 t = ures_open(NULL, "sr_Latn", &status); in TestJB3763()
2524 t = ures_getByKeyWithFallback(t, "calendar", t, &status); in TestJB3763()
2525 t = ures_getByKeyWithFallback(t, "gregorian", t, &status); in TestJB3763()
2526 t = ures_getByKeyWithFallback(t, "AmPmMarkers", t, &status); in TestJB3763()
2527 if(U_FAILURE(status)) { in TestJB3763()
2528 log_err_status(status, "This resource should be available?\n"); in TestJB3763()
2530 status = U_ZERO_ERROR; in TestJB3763()
2539 UErrorCode status = U_ZERO_ERROR; in TestGetKeywordValues() local
2542 kwVals = ures_getKeywordValues( U_ICUDATA_COLL, "collations", &status); in TestGetKeywordValues()
2546 while((kw=uenum_next(kwVals, NULL, &status))) { in TestGetKeywordValues()
2557 log_err_status(status, "'standard' was not found in the keyword list.\n"); in TestGetKeywordValues()
2560 if(U_FAILURE(status)) { in TestGetKeywordValues()
2561 log_err_status(status, "err %s getting collation values\n", u_errorName(status)); in TestGetKeywordValues()
2563 status = U_ZERO_ERROR; in TestGetKeywordValues()
2566 kwVals = ures_getKeywordValues( "ICUDATA", "calendar", &status); in TestGetKeywordValues()
2570 while((kw=uenum_next(kwVals, NULL, &status))) { in TestGetKeywordValues()
2581 log_err_status(status, "'japanese' was not found in the calendar keyword list.\n"); in TestGetKeywordValues()
2584 if(U_FAILURE(status)) { in TestGetKeywordValues()
2585 log_err_status(status, "err %s getting calendar values\n", u_errorName(status)); in TestGetKeywordValues()
2598 UErrorCode status = U_ZERO_ERROR; in TestGetFunctionalEquivalentOf() local
2602 &gotAvail, truncate, &status); in TestGetFunctionalEquivalentOf()
2603 if(U_FAILURE(status) || (len <= 0)) { in TestGetFunctionalEquivalentOf()
2604 log_err_status(status, "FAIL: got len %d, err %s on #%d: %c\t%s\t%s\n", in TestGetFunctionalEquivalentOf()
2605 len, u_errorName(status), in TestGetFunctionalEquivalentOf()
2683 UErrorCode status = U_ZERO_ERROR; in TestGetFunctionalEquivalent() local
2688 &gotAvail, FALSE, &status); in TestGetFunctionalEquivalent()
2691 if(status == U_MISSING_RESOURCE_ERROR) { in TestGetFunctionalEquivalent()
2695 equivLocale, gotAvail?'t':'f', u_errorName(status)); in TestGetFunctionalEquivalent()
2702 UErrorCode status = U_ZERO_ERROR; in TestXPath() local
2709 const char *testdatapath=loadTestData(&status); in TestXPath()
2710 if(U_FAILURE(status)) in TestXPath()
2712 log_data_err("Could not load testdata.dat %s \n",myErrorName(status)); in TestXPath()
2718 rb = ures_open(testdatapath, "te_IN", &status); in TestXPath()
2719 if(U_FAILURE(status)) { in TestXPath()
2720 log_err("Could not open te_IN (%s)\n", myErrorName(status)); in TestXPath()
2723 alias = ures_getByKey(rb, "rootAliasClient", alias, &status); in TestXPath()
2724 if(U_FAILURE(status)) { in TestXPath()
2725 log_err("Couldn't find the aliased resource (%s)\n", myErrorName(status)); in TestXPath()
2730 result = tres_getString(alias, -1, NULL, &len, &status); in TestXPath()
2731 if(U_FAILURE(status) || result == NULL || u_strcmp(result, expResult)) { in TestXPath()
2732 log_err("Couldn't get correct string value (%s)\n", myErrorName(status)); in TestXPath()
2735 alias = ures_getByKey(rb, "aliasClient", alias, &status); in TestXPath()
2736 if(U_FAILURE(status)) { in TestXPath()
2737 log_err("Couldn't find the aliased resource (%s)\n", myErrorName(status)); in TestXPath()
2742 result = tres_getString(alias, -1, NULL, &len, &status); in TestXPath()
2743 if(U_FAILURE(status) || result == NULL || u_strcmp(result, expResult)) { in TestXPath()
2744 log_err("Couldn't get correct string value (%s)\n", myErrorName(status)); in TestXPath()
2747 alias = ures_getByKey(rb, "nestedRootAliasClient", alias, &status); in TestXPath()
2748 if(U_FAILURE(status)) { in TestXPath()
2749 log_err("Couldn't find the aliased resource (%s)\n", myErrorName(status)); in TestXPath()
2754 result = tres_getString(alias, -1, NULL, &len, &status); in TestXPath()
2755 if(U_FAILURE(status) || result == NULL || u_strcmp(result, expResult)) { in TestXPath()
2756 log_err("Couldn't get correct string value (%s)\n", myErrorName(status)); in TestXPath()
2763 UErrorCode status = U_ZERO_ERROR; in TestCLDRStyleAliases() local
2770 const char *testdatapath=loadTestData(&status); in TestCLDRStyleAliases()
2771 if(U_FAILURE(status)) { in TestCLDRStyleAliases()
2772 log_data_err("Could not load testdata.dat %s \n",myErrorName(status)); in TestCLDRStyleAliases()
2777 rb = ures_open(testdatapath, "te_IN_REVISED", &status); in TestCLDRStyleAliases()
2778 if(U_FAILURE(status)) { in TestCLDRStyleAliases()
2779 log_err("Could not open te_IN (%s)\n", myErrorName(status)); in TestCLDRStyleAliases()
2782 alias = ures_getByKey(rb, "a", alias, &status); in TestCLDRStyleAliases()
2783 if(U_FAILURE(status)) { in TestCLDRStyleAliases()
2784 log_err("Couldn't find the aliased with name \"a\" resource (%s)\n", myErrorName(status)); in TestCLDRStyleAliases()
2793 a = ures_getByKeyWithFallback(alias, resource, a, &status); in TestCLDRStyleAliases()
2794 result = tres_getString(a, -1, NULL, &len, &status); in TestCLDRStyleAliases()
2796 if(U_FAILURE(status) || !result || u_strcmp(result, expected)) { in TestCLDRStyleAliases()
2797 … name \"%s\" resource, exp %s, got %S (%s)\n", resource, expects[i], result, myErrorName(status)); in TestCLDRStyleAliases()
2798 status = U_ZERO_ERROR; in TestCLDRStyleAliases()
2808 UErrorCode status = U_ZERO_ERROR; in TestFallbackCodes() local
2809 const char *testdatapath=loadTestData(&status); in TestFallbackCodes()
2811 UResourceBundle *res = ures_open(testdatapath, "te_IN", &status); in TestFallbackCodes()
2815 r = ures_getByKey(res, "tagged_array_in_Root_te_te_IN", r, &status); in TestFallbackCodes()
2817 status = U_ZERO_ERROR; in TestFallbackCodes()
2818 fall = ures_getByKeyWithFallback(r, "tag2", fall, &status); in TestFallbackCodes()
2820 if(status != U_ZERO_ERROR) { in TestFallbackCodes()
2821 log_data_err("Expected error code to be U_ZERO_ERROR, got %s\n", u_errorName(status)); in TestFallbackCodes()
2822 status = U_ZERO_ERROR; in TestFallbackCodes()
2825 fall = ures_getByKeyWithFallback(r, "tag7", fall, &status); in TestFallbackCodes()
2827 if(status != U_USING_FALLBACK_WARNING) { in TestFallbackCodes()
2828 … log_data_err("Expected error code to be U_USING_FALLBACK_WARNING, got %s\n", u_errorName(status)); in TestFallbackCodes()
2830 status = U_ZERO_ERROR; in TestFallbackCodes()
2832 fall = ures_getByKeyWithFallback(r, "tag1", fall, &status); in TestFallbackCodes()
2834 if(status != U_USING_DEFAULT_WARNING) { in TestFallbackCodes()
2835 … log_data_err("Expected error code to be U_USING_DEFAULT_WARNING, got %s\n", u_errorName(status)); in TestFallbackCodes()
2837 status = U_ZERO_ERROR; in TestFallbackCodes()
2851 log_data_err("Could not load en_US locale. status=%s\n",myErrorName(errorCode)); in TestStackReuse()
2871 UErrorCode *status) { in tres_getString() argument
2884 s16 = ures_getStringByIndex(resB, idx, length, status); in tres_getString()
2886 s16 = ures_getStringByKey(resB, key, length, status); in tres_getString()
2888 s16 = ures_getString(resB, length, status); in tres_getString()
2890 if(U_FAILURE(*status)) { in tres_getString()
2900 s8 = ures_getUTF8StringByIndex(resB, idx, p8, &length8, forceCopy, status); in tres_getString()
2902 s8 = ures_getUTF8StringByKey(resB, key, p8, &length8, forceCopy, status); in tres_getString()
2904 s8 = ures_getUTF8String(resB, p8, &length8, forceCopy, status); in tres_getString()
2906 if(*status == U_INVALID_CHAR_FOUND) { in tres_getString()
2910 if(*status == U_BUFFER_OVERFLOW_ERROR) { in tres_getString()
2911 *status = U_ZERO_ERROR; in tres_getString()
2917 s8 = ures_getUTF8StringByIndex(resB, idx, p8, &length8, forceCopy, status); in tres_getString()
2919 s8 = ures_getUTF8StringByKey(resB, key, p8, &length8, forceCopy, status); in tres_getString()
2921 s8 = ures_getUTF8String(resB, p8, &length8, forceCopy, status); in tres_getString()
2924 if(U_FAILURE(*status)) { in tres_getString()
2986 UErrorCode status; in TestGetUTF8String() local
2988 status = U_ZERO_ERROR; in TestGetUTF8String()
2989 testdatapath = loadTestData(&status); in TestGetUTF8String()
2990 if(U_FAILURE(status)) { in TestGetUTF8String()
2991 log_data_err("Could not load testdata.dat - %s\n", u_errorName(status)); in TestGetUTF8String()
2995 res = ures_open(testdatapath, "", &status); in TestGetUTF8String()
2996 if(U_FAILURE(status)) { in TestGetUTF8String()
2997 log_err("Unable to ures_open(testdata, \"\") - %s\n", u_errorName(status)); in TestGetUTF8String()
3002 status = U_ZERO_ERROR; in TestGetUTF8String()
3004 s8 = ures_getUTF8StringByKey(res, "string_only_in_Root", buffer8, &length8, FALSE, &status); in TestGetUTF8String()
3006 if(status != U_ZERO_ERROR) { in TestGetUTF8String()
3007 …log_err("ures_getUTF8StringByKey(testdata/root string) malfunctioned - %s\n", u_errorName(status)); in TestGetUTF8String()
3011 status = U_ZERO_ERROR; in TestGetUTF8String()
3013 s8 = ures_getUTF8StringByKey(res, "string_only_in_Root", buffer8, &length8, FALSE, &status); in TestGetUTF8String()
3014 if(status != U_ILLEGAL_ARGUMENT_ERROR) { in TestGetUTF8String()
3015 log_err("ures_getUTF8StringByKey(capacity<0) malfunctioned - %s\n", u_errorName(status)); in TestGetUTF8String()
3019 status = U_ZERO_ERROR; in TestGetUTF8String()
3021 s8 = ures_getUTF8StringByKey(res, "string_only_in_Root", NULL, &length8, FALSE, &status); in TestGetUTF8String()
3022 if(status != U_ILLEGAL_ARGUMENT_ERROR) { in TestGetUTF8String()
3023 …log_err("ures_getUTF8StringByKey(dest=NULL capacity>0) malfunctioned - %s\n", u_errorName(status)); in TestGetUTF8String()
3035 UErrorCode status = U_ZERO_ERROR; in TestCLDRVersion() local
3041 ulocdata_getCLDRVersion(cldrVersion, &status); in TestCLDRVersion()
3042 if(U_FAILURE(status)) { in TestCLDRVersion()
3044 log_err_status(status, "FAIL: ulocdata_getCLDRVersion() returned %s\n", u_errorName(status)); in TestCLDRVersion()
3057 status = U_ZERO_ERROR; in TestCLDRVersion()
3058 testdatapath = loadTestData(&status); in TestCLDRVersion()
3059 if(U_FAILURE(status)) { in TestCLDRVersion()
3060 log_data_err("Could not load testdata.dat - %s\n", u_errorName(status)); in TestCLDRVersion()
3064 res = ures_openDirect(testdatapath, "root", &status); in TestCLDRVersion()
3065 if(U_FAILURE(status)) { in TestCLDRVersion()
3066 log_err("Unable to ures_open(testdata, \"\") - %s\n", u_errorName(status in TestCLDRVersion()
3070 ures_getVersionByKey(res, "ExpectCLDRVersionAtLeast", testExpect, &status); in TestCLDRVersion()
3071 ures_getVersionByKey(res, "CurrentCLDRVersion", testCurrent, &status); in TestCLDRVersion()
3073 if(U_FAILURE(status)) { in TestCLDRVersion()
3074 log_err("Unable to get test data for CLDR version - %s\n", u_errorName(status)); in TestCLDRVersion()
3077 if(U_FAILURE(status)) return; in TestCLDRVersion()