• Home
  • Raw
  • Download

Lines Matching refs:status

278 static void checkStatus(int32_t line, UErrorCode expected, UErrorCode status) {  in checkStatus()  argument
279 if(U_FAILURE(status)) { in checkStatus()
282 if(status != expected) { in checkStatus()
283 …log_err_status(status, "%s:%d: Expected error code %s, got error code %s\n", __FILE__, line, u_err… in checkStatus()
288 UErrorCode status = U_USING_DEFAULT_WARNING; in TestErrorCodes() local
294 r = ures_open(NULL, "ti_ER_ASSAB", &status); in TestErrorCodes()
295 checkStatus(__LINE__, U_USING_FALLBACK_WARNING, status); in TestErrorCodes()
299 status = U_USING_DEFAULT_WARNING; in TestErrorCodes()
300 r = ures_open(NULL, "ti_ER", &status); in TestErrorCodes()
301 checkStatus(__LINE__, U_USING_DEFAULT_WARNING, status); in TestErrorCodes()
305 if(U_SUCCESS(status) && r != NULL) { in TestErrorCodes()
306 status = U_USING_DEFAULT_WARNING; in TestErrorCodes()
307 … r2 = ures_getByKey(r, "ExemplarCharacters", NULL, &status); /* ExemplarCharacters lives in ti */ in TestErrorCodes()
308 checkStatus(__LINE__, U_USING_FALLBACK_WARNING, status); in TestErrorCodes()
313 status = U_USING_DEFAULT_WARNING; in TestErrorCodes()
314 r = ures_open(U_ICUDATA_REGION, "ti", &status); in TestErrorCodes()
315 checkStatus(__LINE__, U_USING_DEFAULT_WARNING, status); in TestErrorCodes()
318 status = U_USING_FALLBACK_WARNING; in TestErrorCodes()
319 r = ures_open(NULL, "nolocale", &status); in TestErrorCodes()
320 checkStatus(__LINE__, U_USING_DEFAULT_WARNING, status); in TestErrorCodes()
328 r = ures_open(U_ICUDATA_COLL, "sr_YU_VOJVODINA", &status); in TestErrorCodes()
329 checkStatus(__LINE__, U_USING_FALLBACK_WARNING, status); in TestErrorCodes()
333 status = U_USING_FALLBACK_WARNING; in TestErrorCodes()
334 r = ures_open(U_ICUDATA_COLL, "sr", &status); in TestErrorCodes()
335 checkStatus(__LINE__, U_USING_FALLBACK_WARNING, status); in TestErrorCodes()
338 if(U_SUCCESS(status) && r != NULL) { in TestErrorCodes()
339 status = U_USING_DEFAULT_WARNING; in TestErrorCodes()
340 r2 = ures_getByKey(r, "collations", NULL, &status); in TestErrorCodes()
341 checkStatus(__LINE__, U_USING_DEFAULT_WARNING, status); in TestErrorCodes()
346 status = U_USING_DEFAULT_WARNING; in TestErrorCodes()
347 r = ures_open(U_ICUDATA_COLL, "sr", &status); in TestErrorCodes()
348 checkStatus(__LINE__, U_USING_DEFAULT_WARNING, status); in TestErrorCodes()
351 if(U_SUCCESS(status) && r != NULL) { in TestErrorCodes()
352 status = U_USING_DEFAULT_WARNING; in TestErrorCodes()
353 r2 = ures_getByKey(r, "collations", r2, &status); in TestErrorCodes()
354 checkStatus(__LINE__, U_USING_DEFAULT_WARNING, status); in TestErrorCodes()
358 status = U_USING_FALLBACK_WARNING; in TestErrorCodes()
359 r = ures_open(U_ICUDATA_COLL, "nolocale", &status); in TestErrorCodes()
360 checkStatus(__LINE__, U_USING_DEFAULT_WARNING, status); in TestErrorCodes()
367 UErrorCode status = U_ZERO_ERROR; in TestAliasConflict() local
377 he = ures_open(NULL, "he", &status); in TestAliasConflict()
378 iw = ures_open(NULL, "iw", &status); in TestAliasConflict()
379 if(U_FAILURE(status)) { in TestAliasConflict()
380 log_err_status(status, "Failed to get resource with %s\n", myErrorName(status)); in TestAliasConflict()
383 result = ures_getStringByKey(he, "ExemplarCharacters", &resultLen, &status); in TestAliasConflict()
384 if(U_FAILURE(status) || result == NULL) { in TestAliasConflict()
385 …log_err_status(status, "Failed to get resource ExemplarCharacters with %s\n", myErrorName(status)); in TestAliasConflict()
391 status = U_ZERO_ERROR; in TestAliasConflict()
392 norway = ures_open(NULL, norwayNames[i], &status); in TestAliasConflict()
393 if(U_FAILURE(status)) { in TestAliasConflict()
394 …log_err_status(status, "Failed to get resource with %s for %s\n", myErrorName(status), norwayNames… in TestAliasConflict()
397 realName = ures_getLocale(norway, &status); in TestAliasConflict()
486 UErrorCode status = U_ZERO_ERROR; in TestNewTypes() local
499 testdatapath=loadTestData(&status); in TestNewTypes()
501 if(U_FAILURE(status)) in TestNewTypes()
503 log_data_err("Could not load testdata.dat %s \n",myErrorName(status)); in TestNewTypes()
507 theBundle = ures_open(testdatapath, "testtypes", &status); in TestNewTypes()
509 empty = tres_getString(theBundle, -1, "emptystring", &len, &status); in TestNewTypes()
514 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestNewTypes()
523 res = ures_getByKey(theBundle, "zerotest", res, &status); in TestNewTypes()
524 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestNewTypes()
526 zeroString=tres_getString(res, -1, NULL, &len, &status); in TestNewTypes()
527 if(U_SUCCESS(status)){ in TestNewTypes()
528 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestNewTypes()
539 res = ures_getByKey(theBundle, "binarytest", res, &status); in TestNewTypes()
540 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestNewTypes()
542 binResult=(uint8_t*)ures_getBinary(res, &len, &status); in TestNewTypes()
543 if(U_SUCCESS(status)){ in TestNewTypes()
544 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestNewTypes()
552 res = ures_getByKey(theBundle, "importtest", res, &status); in TestNewTypes()
553 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestNewTypes()
555 binResult=(uint8_t*)ures_getBinary(res, &len, &status); in TestNewTypes()
556 if(U_SUCCESS(status)){ in TestNewTypes()
557 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestNewTypes()
565 res = ures_getByKey(theBundle, "one", res, &status); in TestNewTypes()
566 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestNewTypes()
568 intResult=ures_getInt(res, &status); in TestNewTypes()
569 uintResult = ures_getUInt(res, &status); in TestNewTypes()
570 if(U_SUCCESS(status)){ in TestNewTypes()
571 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestNewTypes()
577 res = ures_getByKey(theBundle, "minusone", res, &status); in TestNewTypes()
578 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestNewTypes()
580 intResult=ures_getInt(res, &status); in TestNewTypes()
581 uintResult = ures_getUInt(res, &status); in TestNewTypes()
582 if(U_SUCCESS(status)){ in TestNewTypes()
583 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestNewTypes()
590 res = ures_getByKey(theBundle, "plusone", res, &status); in TestNewTypes()
591 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestNewTypes()
593 intResult=ures_getInt(res, &status); in TestNewTypes()
594 uintResult = ures_getUInt(res, &status); in TestNewTypes()
595 if(U_SUCCESS(status)){ in TestNewTypes()
596 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestNewTypes()
601 res = ures_getByKey(theBundle, "onehundredtwentythree", res, &status); in TestNewTypes()
602 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestNewTypes()
604 intResult=ures_getInt(res, &status); in TestNewTypes()
605 if(U_SUCCESS(status)){ in TestNewTypes()
606 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestNewTypes()
612 const UChar* str = tres_getString(theBundle,-1,"testescape",&len,&status); in TestNewTypes()
613 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestNewTypes()
614 if(U_SUCCESS(status)){ in TestNewTypes()
651 got = tres_getString(theBundle,-1,"test_unescaping",&len,&status); in TestNewTypes()
664 status = U_ZERO_ERROR; in TestNewTypes()
668 const UChar* str = tres_getString(theBundle,-1,"test_underscores",&len,&status); in TestNewTypes()
671 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestNewTypes()
683 status = U_ZERO_ERROR; in TestNewTypes()
684 resB = ures_getByKey(theBundle, "collations", resB, &status); in TestNewTypes()
685 resB = ures_getByKey(resB, "standard", resB, &status); in TestNewTypes()
686 str = tres_getString(resB,-1,"Sequence",&strLength,&status); in TestNewTypes()
687 if(!str || U_FAILURE(status)) { in TestNewTypes()
688 log_data_err("Could not load collations from theBundle: %s\n", u_errorName(status)); in TestNewTypes()
707 status = U_ZERO_ERROR; in TestNewTypes()
710 const UChar* str = tres_getString(theBundle, -1, "testincludeUTF",&strLen,&status); in TestNewTypes()
713 if(U_FAILURE(status)){ in TestNewTypes()
714 …rr("Could not get testincludeUTF resource from testtypes bundle. Error: %s\n",u_errorName(status)); in TestNewTypes()
718 UCHARBUF* ucbuf = ucbuf_open(testDataFileName,&cp,false,false,&status); in TestNewTypes()
720 if(U_SUCCESS(status)){ in TestNewTypes()
721 const UChar* buffer = ucbuf_getBuffer(ucbuf,&len,&status); in TestNewTypes()
722 if(U_SUCCESS(status)){ in TestNewTypes()
735 … log_err("ucbuf failed to open %s. Error: %s\n", testDataFileName, u_errorName(status)); in TestNewTypes()
740 …log_err("Could not get riwords.txt (path : %s). Error: %s\n",testDataFileName,u_errorName(status)); in TestNewTypes()
744 status = U_ZERO_ERROR; in TestNewTypes()
747 const UChar* str = tres_getString(theBundle, -1, "testinclude",&strLen,&status); in TestNewTypes()
751 if(U_FAILURE(status)){ in TestNewTypes()
752 …g_err("Could not get testinclude resource from testtypes bundle. Error: %s\n",u_errorName(status)); in TestNewTypes()
756 UCHARBUF* ucbuf = ucbuf_open(testDataFileName,&cp,false,false,&status); in TestNewTypes()
758 if(U_SUCCESS(status)){ in TestNewTypes()
759 const UChar* buffer = ucbuf_getBuffer(ucbuf,&len,&status); in TestNewTypes()
760 if(U_SUCCESS(status)){ in TestNewTypes()
769 … log_err("ucbuf failed to open %s. Error: %s\n", testDataFileName, u_errorName(status)); in TestNewTypes()
773 …("Could not get translit_rules.txt (path : %s). Error: %s\n",testDataFileName,u_errorName(status)); in TestNewTypes()
788 UErrorCode status = U_ZERO_ERROR; in TestEmptyTypes() local
798 testdatapath=loadTestData(&status); in TestEmptyTypes()
799 if(U_FAILURE(status)) in TestEmptyTypes()
801 log_data_err("Could not load testdata.dat %s \n",myErrorName(status)); in TestEmptyTypes()
805 theBundle = ures_open(testdatapath, "testtypes", &status); in TestEmptyTypes()
807 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestEmptyTypes()
815 status = U_ZERO_ERROR; in TestEmptyTypes()
817 res = ures_getByKey(theBundle, "emptyexplicitstring", res, &status); in TestEmptyTypes()
818 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestEmptyTypes()
820 zeroString=tres_getString(res, -1, NULL, &len, &status); in TestEmptyTypes()
821 if(U_SUCCESS(status)){ in TestEmptyTypes()
822 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestEmptyTypes()
830 status = U_ZERO_ERROR; in TestEmptyTypes()
832 res = ures_getByKey(theBundle, "emptystring", res, &status); in TestEmptyTypes()
833 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestEmptyTypes()
835 zeroString=tres_getString(res, -1, NULL, &len, &status); in TestEmptyTypes()
836 if(U_SUCCESS(status)){ in TestEmptyTypes()
837 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestEmptyTypes()
845 status = U_ZERO_ERROR; in TestEmptyTypes()
847 res = ures_getByKey(theBundle, "emptyint", res, &status); in TestEmptyTypes()
848 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestEmptyTypes()
850 intResult=ures_getInt(res, &status); in TestEmptyTypes()
851 if(U_SUCCESS(status)){ in TestEmptyTypes()
852 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestEmptyTypes()
859 status = U_ZERO_ERROR; in TestEmptyTypes()
861 res = ures_getByKey(theBundle, "emptyintv", res, &status); in TestEmptyTypes()
862 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestEmptyTypes()
865 if(U_FAILURE(status)){ in TestEmptyTypes()
866 log_err("Couldn't get emptyintv key %s\n", u_errorName(status)); in TestEmptyTypes()
869 zeroIntVect=ures_getIntVector(res, &len, &status); in TestEmptyTypes()
871 if(!U_SUCCESS(status) || resArray != NULL || len != 0) { in TestEmptyTypes()
876 status = U_ZERO_ERROR; in TestEmptyTypes()
878 res = ures_getByKey(theBundle, "emptybin", res, &status); in TestEmptyTypes()
879 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestEmptyTypes()
882 if(U_FAILURE(status)){ in TestEmptyTypes()
883 log_err("Couldn't get emptybin key %s\n", u_errorName(status)); in TestEmptyTypes()
886 binResult=ures_getBinary(res, &len, &status); in TestEmptyTypes()
888 if(!U_SUCCESS(status) || len != 0) { in TestEmptyTypes()
893 status = U_ZERO_ERROR; in TestEmptyTypes()
895 res = ures_getByKey(theBundle, "emptyarray", res, &status); in TestEmptyTypes()
896 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestEmptyTypes()
899 if(U_FAILURE(status)){ in TestEmptyTypes()
900 log_err("Couldn't get emptyarray key %s\n", u_errorName(status)); in TestEmptyTypes()
903 resArray=ures_getByIndex(res, 0, resArray, &status); in TestEmptyTypes()
904 if(U_SUCCESS(status) || resArray != NULL){ in TestEmptyTypes()
909 status = U_ZERO_ERROR; in TestEmptyTypes()
911 res = ures_getByKey(theBundle, "emptytable", res, &status); in TestEmptyTypes()
912 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestEmptyTypes()
915 if(U_FAILURE(status)){ in TestEmptyTypes()
916 log_err("Couldn't get emptytable key %s\n", u_errorName(status)); in TestEmptyTypes()
919 resArray=ures_getByIndex(res, 0, resArray, &status); in TestEmptyTypes()
920 if(U_SUCCESS(status) || resArray != NULL){ in TestEmptyTypes()
930 UErrorCode status = U_ZERO_ERROR; in TestEmptyBundle() local
934 testdatapath=loadTestData(&status); in TestEmptyBundle()
935 if(U_FAILURE(status)) in TestEmptyBundle()
937 log_data_err("Could not load testdata.dat %s \n",myErrorName(status)); in TestEmptyBundle()
940 resb = ures_open(testdatapath, "testempty", &status); in TestEmptyBundle()
942 if(U_SUCCESS(status)){ in TestEmptyBundle()
943 dResB = ures_getByKey(resb,"test",dResB,&status); in TestEmptyBundle()
944 if(status!= U_MISSING_RESOURCE_ERROR){ in TestEmptyBundle()
946 u_errorName(U_MISSING_RESOURCE_ERROR),u_errorName(status)); in TestEmptyBundle()
955 UErrorCode status=U_ZERO_ERROR; in TestBinaryCollationData() local
967 testdatapath=loadTestData(&status); in TestBinaryCollationData()
968 if(U_FAILURE(status)) in TestBinaryCollationData()
970 log_data_err("Could not load testdata.dat %s \n",myErrorName(status)); in TestBinaryCollationData()
975 teRes=ures_open(testdatapath, locale, &status); in TestBinaryCollationData()
976 if(U_FAILURE(status)){ in TestBinaryCollationData()
977 log_err("ERROR: Failed to get resource for \"te\" with %s", myErrorName(status)); in TestBinaryCollationData()
980 status=U_ZERO_ERROR; in TestBinaryCollationData()
981 coll = ures_getByKey(teRes, "collations", coll, &status); in TestBinaryCollationData()
982 coll = ures_getByKey(coll, "standard", coll, &status); in TestBinaryCollationData()
983 if(U_SUCCESS(status)){ in TestBinaryCollationData()
984 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestBinaryCollationData()
986 binColl=ures_getByKey(coll, "%%CollationBin", binColl, &status); in TestBinaryCollationData()
987 if(U_SUCCESS(status)){ in TestBinaryCollationData()
988 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestBinaryCollationData()
990 binResult=(uint8_t*)ures_getBinary(binColl, &len, &status); in TestBinaryCollationData()
992 if(U_SUCCESS(status)){ in TestBinaryCollationData()
993 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestBinaryCollationData()
1012 UErrorCode status=U_ZERO_ERROR; in TestAPI() local
1026 testdatapath=loadTestData(&status); in TestAPI()
1027 if(U_FAILURE(status)) in TestAPI()
1029 log_data_err("Could not load testdata.dat %s \n",myErrorName(status)); in TestAPI()
1052 status = U_ZERO_ERROR; in TestAPI()
1053 ures_close(ures_openU(largeBuffer, "root", &status)); in TestAPI()
1054 if(status != U_ILLEGAL_ARGUMENT_ERROR){ in TestAPI()
1055 …r("ERROR: ures_openU() worked when the path is very large. It returned %s\n", myErrorName(status)); in TestAPI()
1058 status = U_ZERO_ERROR; in TestAPI()
1059 ures_close(ures_openU(NULL, "root", &status)); in TestAPI()
1060 if(U_FAILURE(status)){ in TestAPI()
1061 … log_err_status(status, "ERROR: ures_openU() failed path = NULL with %s\n", myErrorName(status)); in TestAPI()
1064 status = U_ILLEGAL_ARGUMENT_ERROR; in TestAPI()
1065 if(ures_openU(NULL, "root", &status) != NULL){ in TestAPI()
1066 log_err("ERROR: ures_openU() worked with error status with %s\n", myErrorName(status)); in TestAPI()
1069 status = U_ZERO_ERROR; in TestAPI()
1070 teRes=ures_openU(utestdatapath, "te", &status); in TestAPI()
1071 if(U_FAILURE(status)){ in TestAPI()
1072 …log_err_status(status, "ERROR: ures_openU() failed path =%s with %s\n", austrdup(utestdatapath), m… in TestAPI()
1077 if(strcmp(ures_getLocale(teRes, &status), "te") != 0){ in TestAPI()
1078 …err("ERROR: ures_getLocale() failed. Expected = te_TE Got = %s\n", ures_getLocale(teRes, &status)); in TestAPI()
1081 teFillin=ures_getByKey(teRes, "tagged_array_in_te_te_IN", teFillin, &status); in TestAPI()
1083 value=(UChar*)ures_getNextString(teFillin, &len, &key, &status); in TestAPI()
1086 value=(UChar*)ures_getNextString(teFillin, &len, &key, &status); in TestAPI()
1087 if(status !=U_INDEX_OUTOFBOUNDS_ERROR){ in TestAPI()
1089 myErrorName(status)); in TestAPI()
1093 status=U_ZERO_ERROR; in TestAPI()
1096 teFillin=ures_getNextResource(teRes, teFillin, &status); in TestAPI()
1097 if(U_FAILURE(status)){ in TestAPI()
1109 teFillin=ures_getByKey(teRes, "string_only_in_te", teFillin, &status); in TestAPI()
1110 teFillin2=ures_getByIndex(teFillin, 0, teFillin2, &status); in TestAPI()
1111 if(U_FAILURE(status)){ in TestAPI()
1114 … if(strcmp(u_austrcpy(convOutput, tres_getString(teFillin2, -1, NULL, &len, &status)), "TE") != 0){ in TestAPI()
1115 status=U_ZERO_ERROR; in TestAPI()
1116 …ource fetched the key=%s, expected \"TE\" \n", austrdup(ures_getString(teFillin2, &len, &status))); in TestAPI()
1123 status=U_ZERO_ERROR; in TestAPI()
1124 ures_openFillIn(teRes, testdatapath, "te", &status); in TestAPI()
1125 if(U_FAILURE(status)){ in TestAPI()
1129 if(strcmp(ures_getLocale(teRes, &status), "te") != 0){ in TestAPI()
1132 ures_getByKey(teRes, "string_only_in_te", teFillin, &status); in TestAPI()
1133 teFillin2=ures_getNextResource(teFillin, teFillin2, &status); in TestAPI()
1137 teFillin2=ures_getNextResource(teFillin, teFillin2, &status); in TestAPI()
1138 if(status !=U_INDEX_OUTOFBOUNDS_ERROR){ in TestAPI()
1140 myErrorName(status)); in TestAPI()
1148 status=U_ZERO_ERROR; in TestAPI()
1149 teRes=ures_open(NULL, "dE_At_NOWHERE_TO_BE_FOUND", &status); in TestAPI()
1150 if(U_FAILURE(status)) { in TestAPI()
1151 …e to open a locale resource bundle from \"dE_At_NOWHERE_TO_BE_FOUND\"(%s)\n", u_errorName(status)); in TestAPI()
1153 if(0!=strcmp("de_AT", ures_getLocale(teRes, &status))) { in TestAPI()
1154 …_getLocale(\"dE_At_NOWHERE_TO_BE_FOUND\")=%s but must be de_AT\n", ures_getLocale(teRes, &status)); in TestAPI()
1160 status=U_ZERO_ERROR; in TestAPI()
1161 teRes=ures_open(NULL, "iW_Il_depRecaTed_HebreW", &status); in TestAPI()
1162 if(U_FAILURE(status)) { in TestAPI()
1163 …ble to open a locale resource bundle from \"iW_Il_depRecaTed_HebreW\"(%s)\n", u_errorName(status)); in TestAPI()
1165 if(0!=strcmp("he_IL", ures_getLocale(teRes, &status))) { in TestAPI()
1166 …es_getLocale(\"iW_Il_depRecaTed_HebreW\")=%s but must be he_IL\n", ures_getLocale(teRes, &status)); in TestAPI()
1174 UErrorCode status=U_ZERO_ERROR; in TestErrorConditions() local
1189 testdatapath = loadTestData(&status); in TestErrorConditions()
1190 if(U_FAILURE(status)) in TestErrorConditions()
1192 log_data_err("Could not load testdata.dat %s \n",myErrorName(status)); in TestErrorConditions()
1201 status=U_ILLEGAL_ARGUMENT_ERROR; in TestErrorConditions()
1202 teRes=ures_openU(utestdatapath, "te", &status); in TestErrorConditions()
1203 if(U_FAILURE(status)){ in TestErrorConditions()
1211 status=U_ZERO_ERROR; in TestErrorConditions()
1212 ures_openFillIn(NULL, testdatapath, "te", &status); in TestErrorConditions()
1213 if(status != U_ILLEGAL_ARGUMENT_ERROR){ in TestErrorConditions()
1215 myErrorName(status)); in TestErrorConditions()
1219 status=U_ZERO_ERROR; in TestErrorConditions()
1220 ures_openDirectFillIn(NULL, testdatapath, "te", &status); in TestErrorConditions()
1221 if(status != U_ILLEGAL_ARGUMENT_ERROR){ in TestErrorConditions()
1223 myErrorName(status)); in TestErrorConditions()
1226 status=U_ZERO_ERROR; in TestErrorConditions()
1227 teRes=ures_openU(utestdatapath, "te", &status); in TestErrorConditions()
1228 if(U_FAILURE(status)){ in TestErrorConditions()
1229 …err("ERROR: ures_openU() failed path =%s with %s\n", austrdup(utestdatapath), myErrorName(status)); in TestErrorConditions()
1232 status=U_ILLEGAL_ARGUMENT_ERROR; in TestErrorConditions()
1233 if(ures_getLocale(teRes, &status) != NULL){ in TestErrorConditions()
1237 status=U_ZERO_ERROR; in TestErrorConditions()
1238 if(ures_getLocale(NULL, &status) != NULL && status != U_ILLEGAL_ARGUMENT_ERROR){ in TestErrorConditions()
1240 myErrorName(status)); in TestErrorConditions()
1243 status=U_ZERO_ERROR; in TestErrorConditions()
1248 status=U_ZERO_ERROR; in TestErrorConditions()
1253 status=U_ZERO_ERROR; in TestErrorConditions()
1258 status=U_ZERO_ERROR; in TestErrorConditions()
1263 status=U_ZERO_ERROR; in TestErrorConditions()
1264 …if(ures_getStringByKey(NULL, "string_only_in_te", &resultLen, &status) != NULL && status != U_ILLE… in TestErrorConditions()
1266 myErrorName(status)); in TestErrorConditions()
1269 status=U_ZERO_ERROR; in TestErrorConditions()
1270 teFillin=ures_getByKey(NULL, "string_only_in_te", teFillin, &status); in TestErrorConditions()
1271 if( teFillin != NULL && status != U_ILLEGAL_ARGUMENT_ERROR){ in TestErrorConditions()
1273 myErrorName(status)); in TestErrorConditions()
1276 teFillin=ures_getByKey(NULL, "string_only_in_te", teFillin, &status); in TestErrorConditions()
1281 status=U_ZERO_ERROR; in TestErrorConditions()
1282 …if(ures_getStringByKey(NULL, "string_only_in_te", &len, &status) != NULL && status != U_ILLEGAL_AR… in TestErrorConditions()
1284 myErrorName(status)); in TestErrorConditions()
1287 if(ures_getStringByKey(teRes, "string_only_in_te", &len, &status) != NULL){ in TestErrorConditions()
1289 myErrorName(status)); in TestErrorConditions()
1292 status=U_ZERO_ERROR; in TestErrorConditions()
1293 if(ures_getString(NULL, &len, &status) != NULL && status != U_ILLEGAL_ARGUMENT_ERROR){ in TestErrorConditions()
1295 myErrorName(status)); in TestErrorConditions()
1298 if(ures_getString(teRes, &len, &status) != NULL){ in TestErrorConditions()
1300 myErrorName(status)); in TestErrorConditions()
1303 status=U_ZERO_ERROR; in TestErrorConditions()
1304 if(ures_getBinary(NULL, &len, &status) != NULL && status != U_ILLEGAL_ARGUMENT_ERROR){ in TestErrorConditions()
1306 myErrorName(status)); in TestErrorConditions()
1309 status=U_ZERO_ERROR; in TestErrorConditions()
1310 coll = ures_getByKey(teRes, "collations", coll, &status); in TestErrorConditions()
1311 coll = ures_getByKey(teRes, "standard", coll, &status); in TestErrorConditions()
1312 binColl=ures_getByKey(coll, "%%CollationBin", binColl, &status); in TestErrorConditions()
1314 status=U_ILLEGAL_ARGUMENT_ERROR; in TestErrorConditions()
1315 binResult=(uint8_t*)ures_getBinary(binColl, &len, &status); in TestErrorConditions()
1321 teFillin=ures_getNextResource(teRes, teFillin, &status); in TestErrorConditions()
1326 status=U_ZERO_ERROR; in TestErrorConditions()
1327 teFillin=ures_getNextResource(NULL, teFillin, &status); in TestErrorConditions()
1328 if(teFillin != NULL || status != U_ILLEGAL_ARGUMENT_ERROR){ in TestErrorConditions()
1330 myErrorName(status)); in TestErrorConditions()
1333 teFillin=ures_getByKey(teRes, "tagged_array_in_te_te_IN", teFillin, &status); in TestErrorConditions()
1335 status = U_ILLEGAL_ARGUMENT_ERROR; in TestErrorConditions()
1336 value=(UChar*)ures_getNextString(teFillin, &len, &key, &status); in TestErrorConditions()
1341 status=U_ZERO_ERROR; in TestErrorConditions()
1342 value=(UChar*)ures_getNextString(NULL, &len, &key, &status); in TestErrorConditions()
1343 if(value != NULL || status != U_ILLEGAL_ARGUMENT_ERROR){ in TestErrorConditions()
1345 myErrorName(status)); in TestErrorConditions()
1348 status=U_ZERO_ERROR; in TestErrorConditions()
1349 teFillin=ures_getByKey(teRes, "array_only_in_te", teFillin, &status); in TestErrorConditions()
1350 if(ures_countArrayItems(teRes, "array_only_in_te", &status) != 4) { in TestErrorConditions()
1353 status=U_ILLEGAL_ARGUMENT_ERROR; in TestErrorConditions()
1354 teFillin2=ures_getByIndex(teFillin, 0, teFillin2, &status); in TestErrorConditions()
1359 status=U_ZERO_ERROR; in TestErrorConditions()
1360 teFillin2=ures_getByIndex(NULL, 0, teFillin2, &status); in TestErrorConditions()
1361 if(status != U_ILLEGAL_ARGUMENT_ERROR){ in TestErrorConditions()
1363 myErrorName(status)); in TestErrorConditions()
1366 status=U_ZERO_ERROR; in TestErrorConditions()
1367 teFillin=ures_getByKey(teRes, "array_only_in_te", teFillin, &status); in TestErrorConditions()
1368 status=U_ILLEGAL_ARGUMENT_ERROR; in TestErrorConditions()
1369 value=(UChar*)ures_getStringByIndex(teFillin, 0, &len, &status); in TestErrorConditions()
1374 status=U_ZERO_ERROR; in TestErrorConditions()
1375 value=(UChar*)ures_getStringByIndex(NULL, 0, &len, &status); in TestErrorConditions()
1376 if(value != NULL || status != U_ILLEGAL_ARGUMENT_ERROR){ in TestErrorConditions()
1378 myErrorName(status)); in TestErrorConditions()
1381 status=U_ZERO_ERROR; in TestErrorConditions()
1382 value=(UChar*)ures_getStringByIndex(teFillin, 9999, &len, &status); in TestErrorConditions()
1383 if(value != NULL || status != U_MISSING_RESOURCE_ERROR){ in TestErrorConditions()
1385 myErrorName(status)); in TestErrorConditions()
1388 status=U_ZERO_ERROR; in TestErrorConditions()
1389 if(ures_getInt(NULL, &status) != -1 && status != U_ILLEGAL_ARGUMENT_ERROR){ in TestErrorConditions()
1391 myErrorName(status)); in TestErrorConditions()
1394 if(ures_getInt(teRes, &status) != -1){ in TestErrorConditions()
1412 UErrorCode status= U_ZERO_ERROR; in TestGetVersion() local
1425 resB = ures_open(NULL,locName, &status); in TestGetVersion()
1426 if (U_FAILURE(status)) { in TestGetVersion()
1427 …log_err_status(status, "Resource bundle creation for locale %s failed.: %s\n", locName, myErrorNam… in TestGetVersion()
1451 UErrorCode status= U_ZERO_ERROR; in TestGetVersionColl() local
1461 resB = ures_open(U_ICUDATA_COLL,locName, &status); in TestGetVersionColl()
1462 rules = tres_getString(resB,-1,"UCARules",&len, &status); in TestGetVersionColl()
1463 if(!rules || U_FAILURE(status)) { in TestGetVersionColl()
1465 status = U_ZERO_ERROR; in TestGetVersionColl()
1472 locs = ures_openAvailableLocales(U_ICUDATA_COLL, &status); in TestGetVersionColl()
1473 if (U_FAILURE(status)) { in TestGetVersionColl()
1474 … log_err_status(status, "enumeration of %s failed.: %s\n", U_ICUDATA_COLL, myErrorName(status)); in TestGetVersionColl()
1480 resB = ures_open(U_ICUDATA_COLL,locName, &status); in TestGetVersionColl()
1481 if (U_FAILURE(status)) { in TestGetVersionColl()
1482 …rce bundle creation for locale %s:%s failed.: %s\n", U_ICUDATA_COLL, locName, myErrorName(status)); in TestGetVersionColl()
1497 locName = uenum_next(locs, &locLen, &status); in TestGetVersionColl()
1498 if(U_FAILURE(status)) { in TestGetVersionColl()
1499 log_err("uenum_next(locs) error %s\n", u_errorName(status)); in TestGetVersionColl()
1521 UErrorCode status = U_ZERO_ERROR; in TestResourceBundles() local
1522 loadTestData(&status); in TestResourceBundles()
1523 if(U_FAILURE(status)) { in TestResourceBundles()
1524 log_data_err("Could not load testdata.dat, status = %s\n", u_errorName(status)); in TestResourceBundles()
1555 UErrorCode status= U_ZERO_ERROR; in TestConstruction1() local
1572 testdatapath=loadTestData(&status); in TestConstruction1()
1573 if(U_FAILURE(status)) in TestConstruction1()
1575 log_data_err("Could not load testdata.dat %s \n",myErrorName(status)); in TestConstruction1()
1581 empty = ures_open(testdatapath, "testempty", &status); in TestConstruction1()
1582 if(empty == NULL || U_FAILURE(status)) { in TestConstruction1()
1591 log_err("construction of NULL did not succeed : %s \n", myErrorName(status)); in TestConstruction1()
1597 log_err("construction of %s did not succeed : %s \n", locale, myErrorName(status)); in TestConstruction1()
1603 log_err("Something threw an error in TestConstruction(): %s\n", myErrorName(status)); in TestConstruction1()
1651 UErrorCode expected_status,status = U_ZERO_ERROR,expected_resource_status = U_ZERO_ERROR; in testTag() local
1671 testdatapath = loadTestData(&status); in testTag()
1672 if(U_FAILURE(status)) in testTag()
1674 log_data_err("Could not load testdata.dat %s \n",myErrorName(status)); in testTag()
1690 status = U_ZERO_ERROR; in testTag()
1692 theBundle = ures_open(testdatapath, param[i].name, &status); in testTag()
1693 CONFIRM_ErrorCode(status,param[i].expected_constructor_status); in testTag()
1765 status = U_ZERO_ERROR; in testTag()
1768 string=tres_getString(theBundle, -1, tag, &len, &status); in testTag()
1769 if(U_SUCCESS(status)) { in testTag()
1778 log_verbose("%s got %d, expected %d\n", action, status, expected_resource_status); in testTag()
1780 CONFIRM_ErrorCode(status, expected_resource_status); in testTag()
1798 status = U_ZERO_ERROR; in testTag()
1799 array=ures_getByKey(theBundle, tag, array, &status); in testTag()
1800 CONFIRM_ErrorCode(status,expected_resource_status); in testTag()
1801 if (U_SUCCESS(status)) { in testTag()
1812 arrayItem1=ures_getNextResource(array, arrayItem1, &status); in testTag()
1813 if(U_SUCCESS(status)){ in testTag()
1814 CONFIRM_EQ(tres_getString(arrayItem1, -1, NULL, &len, &status),expected_string); in testTag()
1821 CONFIRM_ErrorCode(status, U_MISSING_RESOURCE_ERROR); in testTag()
1839 status = U_ZERO_ERROR; in testTag()
1841 array=ures_getByKey(theBundle, tag, array, &status); in testTag()
1842 if(!U_FAILURE(status)){ in testTag()
1844 t=(UChar*)ures_getStringByIndex(array, idx, &len, &status); in testTag()
1845 if(!U_FAILURE(status)){ in testTag()
1857 CONFIRM_ErrorCode(status,expected_status); in testTag()
1876 status = U_ZERO_ERROR; in testTag()
1877 array2d=ures_getByKey(theBundle, tag, array2d, &status); in testTag()
1879 CONFIRM_ErrorCode(status,expected_resource_status); in testTag()
1880 if (U_SUCCESS(status)) in testTag()
1889 tableRow=ures_getByIndex(array2d, row, tableRow, &status); in testTag()
1890 CONFIRM_ErrorCode(status, expected_resource_status); in testTag()
1891 if(U_SUCCESS(status)){ in testTag()
1904 arrayItem1=ures_getNextResource(tableRow, arrayItem1, &status); in testTag()
1905 if(U_SUCCESS(status)){ in testTag()
1906 … const UChar *stringValue=tres_getString(arrayItem1, -1, NULL, &len, &status); in testTag()
1926 status = U_ZERO_ERROR; in testTag()
1929 array2d=ures_getByKey(theBundle, tag, array2d, &status); in testTag()
1930 if(U_SUCCESS(status)){ in testTag()
1932 tableRow=ures_getByIndex(array2d, row, tableRow, &status); in testTag()
1933 if(U_SUCCESS(status)) { in testTag()
1935 t=(UChar*)ures_getStringByIndex(tableRow, col, &len, &status); in testTag()
1936 if(U_SUCCESS(status)){ in testTag()
1944 CONFIRM_ErrorCode(status,expected_status); in testTag()
1946 if (U_SUCCESS(status)){ in testTag()
1971 status = U_ZERO_ERROR; in testTag()
1973 tags=ures_getByKey(theBundle, tag, tags, &status); in testTag()
1974 CONFIRM_ErrorCode(status, expected_resource_status); in testTag()
1975 if (U_SUCCESS(status)) { in testTag()
1986 tagelement=ures_getByIndex(tags, idx, tagelement, &status); in testTag()
1988 value=(UChar*)ures_getNextString(tagelement, &len, &key, &status); in testTag()
2006 status = U_ZERO_ERROR; in testTag()
2010 tags=ures_getByKey(theBundle, tag, tags, &status); in testTag()
2011 if(U_SUCCESS(status)){ in testTag()
2014 tagelement=ures_getByKey(tags, item_tag, tagelement, &status); in testTag()
2015 if(!U_FAILURE(status)){ in testTag()
2023 t=(UChar*)tres_getString(tagelement, -1, NULL, &len, &status); in testTag()
2024 if(!U_FAILURE(status)){ in testTag()
2029 CONFIRM_ErrorCode(status,U_MISSING_RESOURCE_ERROR); in testTag()
2032 if (status != U_MISSING_RESOURCE_ERROR) { in testTag()
2070 UErrorCode status = U_ZERO_ERROR; in TestPreventFallback() local
2073 testdatapath=loadTestData(&status); in TestPreventFallback()
2074 if(U_FAILURE(status)) in TestPreventFallback()
2076 log_data_err("Could not load testdata.dat %s \n",myErrorName(status)); in TestPreventFallback()
2082 theBundle = ures_open(testdatapath, "te_IN_NE", &status); in TestPreventFallback()
2083 if(U_FAILURE(status)) in TestPreventFallback()
2085 log_data_err("Could not open resource bundle te_IN_NE %s \n",myErrorName(status)); in TestPreventFallback()
2090 …ures_getStringByKeyWithFallback(theBundle, "string_in_te_no_te_IN_fallback", &unused_len, &status); in TestPreventFallback()
2091 if (status != U_MISSING_RESOURCE_ERROR) in TestPreventFallback()
2095 status = U_ZERO_ERROR; in TestPreventFallback()
2098 ures_getStringByKeyWithFallback(theBundle, "string_only_in_te", &unused_len, &status); in TestPreventFallback()
2099 if(U_FAILURE(status)) in TestPreventFallback()
2101 log_err("Expected to find string_only_in_te %s \n",myErrorName(status)); in TestPreventFallback()
2103 status = U_ZERO_ERROR; in TestPreventFallback()
2107 theBundle = ures_open(testdatapath, "te", &status); in TestPreventFallback()
2108 if(U_FAILURE(status)) in TestPreventFallback()
2110 log_data_err("Could not open resource bundle te_IN_NE %s \n",myErrorName(status)); in TestPreventFallback()
2113 …ures_getStringByKeyWithFallback(theBundle, "string_in_te_no_te_IN_fallback", &unused_len, &status); in TestPreventFallback()
2114 if(U_FAILURE(status)) in TestPreventFallback()
2116 log_err("Expected to find string_in_te_no_te_IN_fallback %s \n",myErrorName(status)); in TestPreventFallback()
2118 status = U_ZERO_ERROR; in TestPreventFallback()
2129 UErrorCode status = U_ZERO_ERROR; in TestFallback() local
2136 fr_FR = ures_open(NULL, "fr_FR", &status); in TestFallback()
2137 if(U_FAILURE(status)) in TestFallback()
2139 log_err_status(status, "Couldn't open fr_FR - %s\n", u_errorName(status)); in TestFallback()
2143 status = U_ZERO_ERROR; in TestFallback()
2147 junk = tres_getString(fr_FR, -1, "LocaleID", &resultLen, &status); in TestFallback()
2148 status = U_ZERO_ERROR; in TestFallback()
2149 junk = tres_getString(fr_FR, -1, "LocaleString", &resultLen, &status); in TestFallback()
2150 status = U_ZERO_ERROR; in TestFallback()
2151 junk = tres_getString(fr_FR, -1, "LocaleID", &resultLen, &status); in TestFallback()
2152 status = U_ZERO_ERROR; in TestFallback()
2156 subResource = ures_getByKey(fr_FR, "layout", NULL, &status); in TestFallback()
2157 if(status != U_USING_DEFAULT_WARNING) in TestFallback()
2160 u_errorName(status)); in TestFallback()
2163 status = U_ZERO_ERROR; in TestFallback()
2167 junk = tres_getString(fr_FR, -1, "ExemplarCharacters", &resultLen, &status); in TestFallback()
2168 if(status != U_USING_FALLBACK_WARNING) in TestFallback()
2171 status); in TestFallback()
2174 status = U_ZERO_ERROR; in TestFallback()
2223 UErrorCode status = U_ZERO_ERROR; in TestResourceLevelAliasing() local
2233 testdatapath=loadTestData(&status); in TestResourceLevelAliasing()
2234 if(U_FAILURE(status)) in TestResourceLevelAliasing()
2236 log_data_err("Could not load testdata.dat %s \n",myErrorName(status)); in TestResourceLevelAliasing()
2240 aliasB = ures_open(testdatapath, "testaliases", &status); in TestResourceLevelAliasing()
2242 if(U_FAILURE(status)) in TestResourceLevelAliasing()
2244 log_data_err("Could not load testaliases.res %s \n",myErrorName(status)); in TestResourceLevelAliasing()
2248 tb = ures_getByKey(aliasB, "aaa", tb, &status); in TestResourceLevelAliasing()
2249 if(status != U_TOO_MANY_ALIASES_ERROR) { in TestResourceLevelAliasing()
2253 status = U_ZERO_ERROR; in TestResourceLevelAliasing()
2255 tb = ures_getByKey(aliasB, "aab", tb, &status); in TestResourceLevelAliasing()
2256 if(status != U_TOO_MANY_ALIASES_ERROR) { in TestResourceLevelAliasing()
2259 status = U_ZERO_ERROR; in TestResourceLevelAliasing()
2261 if(U_FAILURE(status) ) { in TestResourceLevelAliasing()
2265 tb = ures_getByKey(aliasB, "nonexisting", tb, &status); in TestResourceLevelAliasing()
2266 if(status != U_MISSING_RESOURCE_ERROR) { in TestResourceLevelAliasing()
2269 status = U_ZERO_ERROR; in TestResourceLevelAliasing()
2272 uk = ures_findResource("ja/calendar/gregorian/DateTimePatterns/2", uk, &status); in TestResourceLevelAliasing()
2273 if((uk == NULL) || U_FAILURE(status)) { in TestResourceLevelAliasing()
2274 …log_err_status(status, "Couldn't findResource('ja/calendar/gregorian/DateTimePatterns/2') err %s\n… in TestResourceLevelAliasing()
2278 sequence = tres_getString(uk, -1, NULL, &seqLen, &status); in TestResourceLevelAliasing()
2280 tb = ures_getByKey(aliasB, "referencingalias", tb, &status); in TestResourceLevelAliasing()
2281 string = tres_getString(tb, -1, NULL, &strLen, &status); in TestResourceLevelAliasing()
2287 string = tres_getString(aliasB, -1, "referencingalias", &strLen, &status); in TestResourceLevelAliasing()
2292 checkStatus(__LINE__, U_ZERO_ERROR, status); in TestResourceLevelAliasing()
2293 tb = ures_getByKey(aliasB, "DateTimePatterns", tb, &status); in TestResourceLevelAliasing()
2294 checkStatus(__LINE__, U_ZERO_ERROR, status); in TestResourceLevelAliasing()
2295 tb = ures_getByIndex(tb, 2, tb, &status); in TestResourceLevelAliasing()
2296 checkStatus(__LINE__, U_ZERO_ERROR, status); in TestResourceLevelAliasing()
2297 string = tres_getString(tb, -1, NULL, &strLen, &status); in TestResourceLevelAliasing()
2298 checkStatus(__LINE__, U_ZERO_ERROR, status); in TestResourceLevelAliasing()
2300 if(U_FAILURE(status)) { in TestResourceLevelAliasing()
2301 log_err("%s trying to get string via separate getters\n", u_errorName(status)); in TestResourceLevelAliasing()
2307 testtypes = ures_open(testdatapath, "testtypes", &status); in TestResourceLevelAliasing()
2310 uk = ures_findSubResource(testtypes, s, uk, &status); in TestResourceLevelAliasing()
2311 sequence = tres_getString(uk, -1, NULL, &seqLen, &status); in TestResourceLevelAliasing()
2313 tb = ures_getByKey(aliasB, "simplealias", tb, &status); in TestResourceLevelAliasing()
2314 string = tres_getString(tb, -1, NULL, &strLen, &status); in TestResourceLevelAliasing()
2316 if(U_FAILURE(status) || seqLen != strLen || u_strncmp(sequence, string, seqLen) != 0) { in TestResourceLevelAliasing()
2322 en = ures_findResource("/ICUDATA-zone/en/zoneStrings/3/0", en, &status); in TestResourceLevelAliasing()
2324 if(status != U_MISSING_RESOURCE_ERROR) { in TestResourceLevelAliasing()
2327 status = U_ZERO_ERROR; in TestResourceLevelAliasing()
2349 tb = ures_getByKey(aliasB, "testGetStringByKeyAliasing", tb, &status); in TestResourceLevelAliasing()
2350 if(U_FAILURE(status)) { in TestResourceLevelAliasing()
2351 … log_err("FAIL: Couldn't get testGetStringByKeyAliasing resource: %s\n", u_errorName(status)); in TestResourceLevelAliasing()
2354 result = tres_getString(tb, -1, keys[i], &resultLen, &status); in TestResourceLevelAliasing()
2355 if(U_FAILURE(status)){ in TestResourceLevelAliasing()
2356 …log_err("(1) Fetching the resource with key %s failed. Error: %s\n", keys[i], u_errorName(status)); in TestResourceLevelAliasing()
2365 result = tres_getString(tb, i, NULL, &resultLen, &status); in TestResourceLevelAliasing()
2366 if(U_FAILURE(status)){ in TestResourceLevelAliasing()
2367 …log_err("(2) Fetching the resource with key %s failed. Error: %s\n", keys[i], u_errorName(status)); in TestResourceLevelAliasing()
2376 result = ures_getNextString(tb, &resultLen, &key, &status); in TestResourceLevelAliasing()
2377 if(U_FAILURE(status)){ in TestResourceLevelAliasing()
2378 …log_err("(3) Fetching the resource with key %s failed. Error: %s\n", keys[i], u_errorName(status)); in TestResourceLevelAliasing()
2387 tb = ures_getByKey(aliasB, "testGetStringByIndexAliasing", tb, &status); in TestResourceLevelAliasing()
2388 if(U_FAILURE(status)) { in TestResourceLevelAliasing()
2389 … log_err("FAIL: Couldn't get testGetStringByIndexAliasing resource: %s\n", u_errorName(status)); in TestResourceLevelAliasing()
2392 result = tres_getString(tb, i, NULL, &resultLen, &status); in TestResourceLevelAliasing()
2393 if(U_FAILURE(status)){ in TestResourceLevelAliasing()
2394 … log_err("Fetching the resource with key %s failed. Error: %s\n", keys[i], u_errorName(status)); in TestResourceLevelAliasing()
2403 result = ures_getNextString(tb, &resultLen, &key, &status); in TestResourceLevelAliasing()
2404 if(U_FAILURE(status)){ in TestResourceLevelAliasing()
2405 … log_err("Fetching the resource with key %s failed. Error: %s\n", keys[i], u_errorName(status)); in TestResourceLevelAliasing()
2415 tb = ures_getByKey(aliasB, "testAliasToTree", tb, &status); in TestResourceLevelAliasing()
2416 if(U_FAILURE(status)){ in TestResourceLevelAliasing()
2417 …err("Fetching the resource with key \"testAliasToTree\" failed. Error: %s\n", u_errorName(status)); in TestResourceLevelAliasing()
2432 UErrorCode status = U_ZERO_ERROR; in TestDirectAccess() local
2444 t = ures_findResource("/testdata/te/zoneStrings/3/2", t, &status); in TestDirectAccess()
2445 if(U_FAILURE(status)) { in TestDirectAccess()
2446 log_data_err("Couldn't access indexed resource, error %s\n", u_errorName(status)); in TestDirectAccess()
2447 status = U_ZERO_ERROR; in TestDirectAccess()
2454 t = ures_findResource("en/calendar/gregorian/DateTimePatterns/3", t, &status); in TestDirectAccess()
2455 if(U_FAILURE(status)) { in TestDirectAccess()
2456 log_data_err("Couldn't access indexed resource, error %s\n", u_errorName(status)); in TestDirectAccess()
2457 status = U_ZERO_ERROR; in TestDirectAccess()
2465 t = ures_findResource("ja/ExemplarCharacters", t, &status); in TestDirectAccess()
2466 if(U_FAILURE(status)) { in TestDirectAccess()
2467 log_data_err("Couldn't access keyed resource, error %s\n", u_errorName(status)); in TestDirectAccess()
2468 status = U_ZERO_ERROR; in TestDirectAccess()
2476 t2 = ures_open(U_ICUDATA_LANG, "sr", &status); in TestDirectAccess()
2477 if(U_FAILURE(status)) { in TestDirectAccess()
2478 … log_err_status(status, "Couldn't open 'sr' resource bundle, error %s\n", u_errorName(status)); in TestDirectAccess()
2483 if(U_SUCCESS(status)) { in TestDirectAccess()
2486 t = ures_findSubResource(t2, s, t, &status); in TestDirectAccess()
2487 if(U_FAILURE(status)) { in TestDirectAccess()
2488 log_err("Couldn't access keyed resource, error %s\n", u_errorName(status)); in TestDirectAccess()
2489 status = U_ZERO_ERROR; in TestDirectAccess()
2498 t = ures_findResource("root/calendar/islamic-civil/DateTime", t, &status); in TestDirectAccess()
2499 if(U_SUCCESS(status)) { in TestDirectAccess()
2502 status = U_ZERO_ERROR; in TestDirectAccess()
2505 … t = ures_findResource("root/calendar/islamic-civil/eras/abbreviated/0/mikimaus/pera", t, &status); in TestDirectAccess()
2506 if(U_SUCCESS(status)) { in TestDirectAccess()
2509 status = U_ZERO_ERROR; in TestDirectAccess()
2512 t2 = ures_open(NULL, "he", &status); in TestDirectAccess()
2513 t2 = ures_getByKeyWithFallback(t2, "calendar", t2, &status); in TestDirectAccess()
2514 t2 = ures_getByKeyWithFallback(t2, "islamic-civil", t2, &status); in TestDirectAccess()
2515 t2 = ures_getByKeyWithFallback(t2, "DateTime", t2, &status); in TestDirectAccess()
2516 if(U_SUCCESS(status)) { in TestDirectAccess()
2519 status = U_ZERO_ERROR; in TestDirectAccess()
2522 t2 = ures_open(NULL, "he", &status); in TestDirectAccess()
2524 t2 = ures_getByKeyWithFallback(t2, "calendar", t2, &status); in TestDirectAccess()
2525 t2 = ures_getByKeyWithFallback(t2, "islamic-civil", t2, &status); in TestDirectAccess()
2526 t2 = ures_getByKeyWithFallback(t2, "eras", t2, &status); in TestDirectAccess()
2527 if(U_FAILURE(status)) { in TestDirectAccess()
2528 log_err_status(status, "Didn't get Eras. I know they are there!\n"); in TestDirectAccess()
2530 status = U_ZERO_ERROR; in TestDirectAccess()
2533 t2 = ures_open(NULL, "root", &status); in TestDirectAccess()
2534 t2 = ures_getByKeyWithFallback(t2, "calendar", t2, &status); in TestDirectAccess()
2535 t2 = ures_getByKeyWithFallback(t2, "islamic-civil", t2, &status); in TestDirectAccess()
2536 t2 = ures_getByKeyWithFallback(t2, "DateTime", t2, &status); in TestDirectAccess()
2537 if(U_SUCCESS(status)) { in TestDirectAccess()
2540 status = U_ZERO_ERROR; in TestDirectAccess()
2547 UErrorCode status = U_ZERO_ERROR; in TestTicket9804() local
2549 t = ures_open(NULL, "he", &status); in TestTicket9804()
2550 t = ures_getByKeyWithFallback(t, "calendar/islamic-civil/DateTime", t, &status); in TestTicket9804()
2551 if(U_SUCCESS(status)) { in TestTicket9804()
2554 status = U_ZERO_ERROR; in TestTicket9804()
2556 t = ures_open(NULL, "he", &status); in TestTicket9804()
2557 t = ures_getByKeyWithFallback(t, "calendar/islamic-civil/eras", t, &status); in TestTicket9804()
2558 if(U_FAILURE(status)) { in TestTicket9804()
2559 log_err_status(status, "Didn't get Eras. I know they are there!\n"); in TestTicket9804()
2561 const char *locale = ures_getLocaleByType(t, ULOC_ACTUAL_LOCALE, &status); in TestTicket9804()
2566 status = U_ZERO_ERROR; in TestTicket9804()
2575 UErrorCode status = U_ZERO_ERROR; in TestJB3763() local
2576 t = ures_open(NULL, "sr_Latn", &status); in TestJB3763()
2577 t = ures_getByKeyWithFallback(t, "calendar", t, &status); in TestJB3763()
2578 t = ures_getByKeyWithFallback(t, "gregorian", t, &status); in TestJB3763()
2579 t = ures_getByKeyWithFallback(t, "AmPmMarkers", t, &status); in TestJB3763()
2580 if(U_FAILURE(status)) { in TestJB3763()
2581 log_err_status(status, "This resource should be available?\n"); in TestJB3763()
2583 status = U_ZERO_ERROR; in TestJB3763()
2592 UErrorCode status = U_ZERO_ERROR; in TestGetKeywordValues() local
2595 kwVals = ures_getKeywordValues( U_ICUDATA_COLL, "collations", &status); in TestGetKeywordValues()
2599 while((kw=uenum_next(kwVals, NULL, &status))) { in TestGetKeywordValues()
2610 log_err_status(status, "'standard' was not found in the keyword list.\n"); in TestGetKeywordValues()
2613 if(U_FAILURE(status)) { in TestGetKeywordValues()
2614 log_err_status(status, "err %s getting collation values\n", u_errorName(status)); in TestGetKeywordValues()
2616 status = U_ZERO_ERROR; in TestGetKeywordValues()
2619 kwVals = ures_getKeywordValues( "ICUDATA", "calendar", &status); in TestGetKeywordValues()
2623 while((kw=uenum_next(kwVals, NULL, &status))) { in TestGetKeywordValues()
2634 log_err_status(status, "'japanese' was not found in the calendar keyword list.\n"); in TestGetKeywordValues()
2637 if(U_FAILURE(status)) { in TestGetKeywordValues()
2638 log_err_status(status, "err %s getting calendar values\n", u_errorName(status)); in TestGetKeywordValues()
2651 UErrorCode status = U_ZERO_ERROR; in TestGetFunctionalEquivalentOf() local
2655 &gotAvail, truncate, &status); in TestGetFunctionalEquivalentOf()
2656 if(U_FAILURE(status) || (len <= 0)) { in TestGetFunctionalEquivalentOf()
2657 log_err_status(status, "FAIL: got len %d, err %s on #%d: %c\t%s\t%s\n", in TestGetFunctionalEquivalentOf()
2658 len, u_errorName(status), in TestGetFunctionalEquivalentOf()
2737 UErrorCode status = U_ZERO_ERROR; in TestGetFunctionalEquivalent() local
2742 &gotAvail, false, &status); in TestGetFunctionalEquivalent()
2745 if(status == U_MISSING_RESOURCE_ERROR) { in TestGetFunctionalEquivalent()
2749 equivLocale, gotAvail?'t':'f', u_errorName(status)); in TestGetFunctionalEquivalent()
2756 UErrorCode status = U_ZERO_ERROR; in TestXPath() local
2763 const char *testdatapath=loadTestData(&status); in TestXPath()
2764 if(U_FAILURE(status)) in TestXPath()
2766 log_data_err("Could not load testdata.dat %s \n",myErrorName(status)); in TestXPath()
2772 rb = ures_open(testdatapath, "te_IN", &status); in TestXPath()
2773 if(U_FAILURE(status)) { in TestXPath()
2774 log_err("Could not open te_IN (%s)\n", myErrorName(status)); in TestXPath()
2777 alias = ures_getByKey(rb, "rootAliasClient", alias, &status); in TestXPath()
2778 if(U_FAILURE(status)) { in TestXPath()
2779 log_err("Couldn't find the aliased resource (%s)\n", myErrorName(status)); in TestXPath()
2784 result = tres_getString(alias, -1, NULL, &len, &status); in TestXPath()
2785 if(U_FAILURE(status) || result == NULL || u_strcmp(result, expResult)) { in TestXPath()
2786 log_err("Couldn't get correct string value (%s)\n", myErrorName(status)); in TestXPath()
2789 alias = ures_getByKey(rb, "aliasClient", alias, &status); in TestXPath()
2790 if(U_FAILURE(status)) { in TestXPath()
2791 log_err("Couldn't find the aliased resource (%s)\n", myErrorName(status)); in TestXPath()
2796 result = tres_getString(alias, -1, NULL, &len, &status); in TestXPath()
2797 if(U_FAILURE(status) || result == NULL || u_strcmp(result, expResult)) { in TestXPath()
2798 log_err("Couldn't get correct string value (%s)\n", myErrorName(status)); in TestXPath()
2801 alias = ures_getByKey(rb, "nestedRootAliasClient", alias, &status); in TestXPath()
2802 if(U_FAILURE(status)) { in TestXPath()
2803 log_err("Couldn't find the aliased resource (%s)\n", myErrorName(status)); in TestXPath()
2808 result = tres_getString(alias, -1, NULL, &len, &status); in TestXPath()
2809 if(U_FAILURE(status) || result == NULL || u_strcmp(result, expResult)) { in TestXPath()
2810 log_err("Couldn't get correct string value (%s)\n", myErrorName(status)); in TestXPath()
2817 UErrorCode status = U_ZERO_ERROR; in TestCLDRStyleAliases() local
2824 const char *testdatapath=loadTestData(&status); in TestCLDRStyleAliases()
2825 if(U_FAILURE(status)) { in TestCLDRStyleAliases()
2826 log_data_err("Could not load testdata.dat %s \n",myErrorName(status)); in TestCLDRStyleAliases()
2831 rb = ures_open(testdatapath, "te_IN_REVISED", &status); in TestCLDRStyleAliases()
2832 if(U_FAILURE(status)) { in TestCLDRStyleAliases()
2833 log_err("Could not open te_IN (%s)\n", myErrorName(status)); in TestCLDRStyleAliases()
2836 alias = ures_getByKey(rb, "a", alias, &status); in TestCLDRStyleAliases()
2837 if(U_FAILURE(status)) { in TestCLDRStyleAliases()
2838 log_err("Couldn't find the aliased with name \"a\" resource (%s)\n", myErrorName(status)); in TestCLDRStyleAliases()
2847 a = ures_getByKeyWithFallback(alias, resource, a, &status); in TestCLDRStyleAliases()
2848 result = tres_getString(a, -1, NULL, &len, &status); in TestCLDRStyleAliases()
2850 if(U_FAILURE(status) || !result || u_strcmp(result, expected)) { in TestCLDRStyleAliases()
2851 … name \"%s\" resource, exp %s, got %S (%s)\n", resource, expects[i], result, myErrorName(status)); in TestCLDRStyleAliases()
2852 status = U_ZERO_ERROR; in TestCLDRStyleAliases()
2862 UErrorCode status = U_ZERO_ERROR; in TestFallbackCodes() local
2863 const char *testdatapath=loadTestData(&status); in TestFallbackCodes()
2865 UResourceBundle *res = ures_open(testdatapath, "te_IN", &status); in TestFallbackCodes()
2869 r = ures_getByKey(res, "tagged_array_in_Root_te_te_IN", r, &status); in TestFallbackCodes()
2871 status = U_ZERO_ERROR; in TestFallbackCodes()
2872 fall = ures_getByKeyWithFallback(r, "tag2", fall, &status); in TestFallbackCodes()
2874 if(status != U_ZERO_ERROR) { in TestFallbackCodes()
2875 log_data_err("Expected error code to be U_ZERO_ERROR, got %s\n", u_errorName(status)); in TestFallbackCodes()
2876 status = U_ZERO_ERROR; in TestFallbackCodes()
2879 fall = ures_getByKeyWithFallback(r, "tag7", fall, &status); in TestFallbackCodes()
2881 if(status != U_USING_FALLBACK_WARNING) { in TestFallbackCodes()
2882 … log_data_err("Expected error code to be U_USING_FALLBACK_WARNING, got %s\n", u_errorName(status)); in TestFallbackCodes()
2884 status = U_ZERO_ERROR; in TestFallbackCodes()
2886 fall = ures_getByKeyWithFallback(r, "tag1", fall, &status); in TestFallbackCodes()
2888 if(status != U_USING_DEFAULT_WARNING) { in TestFallbackCodes()
2889 … log_data_err("Expected error code to be U_USING_DEFAULT_WARNING, got %s\n", u_errorName(status)); in TestFallbackCodes()
2891 status = U_ZERO_ERROR; in TestFallbackCodes()
2908 UErrorCode *status) { in tres_getString() argument
2921 s16 = ures_getStringByIndex(resB, idx, length, status); in tres_getString()
2923 s16 = ures_getStringByKey(resB, key, length, status); in tres_getString()
2925 s16 = ures_getString(resB, length, status); in tres_getString()
2927 if(U_FAILURE(*status)) { in tres_getString()
2937 s8 = ures_getUTF8StringByIndex(resB, idx, p8, &length8, forceCopy, status); in tres_getString()
2939 s8 = ures_getUTF8StringByKey(resB, key, p8, &length8, forceCopy, status); in tres_getString()
2941 s8 = ures_getUTF8String(resB, p8, &length8, forceCopy, status); in tres_getString()
2943 if(*status == U_INVALID_CHAR_FOUND) { in tres_getString()
2947 if(*status == U_BUFFER_OVERFLOW_ERROR) { in tres_getString()
2948 *status = U_ZERO_ERROR; in tres_getString()
2954 s8 = ures_getUTF8StringByIndex(resB, idx, p8, &length8, forceCopy, status); in tres_getString()
2956 s8 = ures_getUTF8StringByKey(resB, key, p8, &length8, forceCopy, status); in tres_getString()
2958 s8 = ures_getUTF8String(resB, p8, &length8, forceCopy, status); in tres_getString()
2961 if(U_FAILURE(*status)) { in tres_getString()
3023 UErrorCode status; in TestGetUTF8String() local
3025 status = U_ZERO_ERROR; in TestGetUTF8String()
3026 testdatapath = loadTestData(&status); in TestGetUTF8String()
3027 if(U_FAILURE(status)) { in TestGetUTF8String()
3028 log_data_err("Could not load testdata.dat - %s\n", u_errorName(status)); in TestGetUTF8String()
3032 res = ures_open(testdatapath, "", &status); in TestGetUTF8String()
3033 if(U_FAILURE(status)) { in TestGetUTF8String()
3034 log_err("Unable to ures_open(testdata, \"\") - %s\n", u_errorName(status)); in TestGetUTF8String()
3039 status = U_ZERO_ERROR; in TestGetUTF8String()
3041 s8 = ures_getUTF8StringByKey(res, "string_only_in_Root", buffer8, &length8, false, &status); in TestGetUTF8String()
3043 if(status != U_ZERO_ERROR) { in TestGetUTF8String()
3044 …log_err("ures_getUTF8StringByKey(testdata/root string) malfunctioned - %s\n", u_errorName(status)); in TestGetUTF8String()
3048 status = U_ZERO_ERROR; in TestGetUTF8String()
3050 s8 = ures_getUTF8StringByKey(res, "string_only_in_Root", buffer8, &length8, false, &status); in TestGetUTF8String()
3051 if(status != U_ILLEGAL_ARGUMENT_ERROR) { in TestGetUTF8String()
3052 log_err("ures_getUTF8StringByKey(capacity<0) malfunctioned - %s\n", u_errorName(status)); in TestGetUTF8String()
3056 status = U_ZERO_ERROR; in TestGetUTF8String()
3058 s8 = ures_getUTF8StringByKey(res, "string_only_in_Root", NULL, &length8, false, &status); in TestGetUTF8String()
3059 if(status != U_ILLEGAL_ARGUMENT_ERROR) { in TestGetUTF8String()
3060 …log_err("ures_getUTF8StringByKey(dest=NULL capacity>0) malfunctioned - %s\n", u_errorName(status)); in TestGetUTF8String()
3072 UErrorCode status = U_ZERO_ERROR; in TestCLDRVersion() local
3078 ulocdata_getCLDRVersion(cldrVersion, &status); in TestCLDRVersion()
3079 if(U_FAILURE(status)) { in TestCLDRVersion()
3081 log_err_status(status, "FAIL: ulocdata_getCLDRVersion() returned %s\n", u_errorName(status)); in TestCLDRVersion()
3094 status = U_ZERO_ERROR; in TestCLDRVersion()
3095 testdatapath = loadTestData(&status); in TestCLDRVersion()
3096 if(U_FAILURE(status)) { in TestCLDRVersion()
3097 log_data_err("Could not load testdata.dat - %s\n", u_errorName(status)); in TestCLDRVersion()
3101 res = ures_openDirect(testdatapath, "root", &status); in TestCLDRVersion()
3102 if(U_FAILURE(status)) { in TestCLDRVersion()
3103 log_err("Unable to ures_open(testdata, \"\") - %s\n", u_errorName(status in TestCLDRVersion()
3107 ures_getVersionByKey(res, "ExpectCLDRVersionAtLeast", testExpect, &status); in TestCLDRVersion()
3108 ures_getVersionByKey(res, "CurrentCLDRVersion", testCurrent, &status); in TestCLDRVersion()
3110 if(U_FAILURE(status)) { in TestCLDRVersion()
3111 log_err("Unable to get test data for CLDR version - %s\n", u_errorName(status)); in TestCLDRVersion()
3114 if(U_FAILURE(status)) return; in TestCLDRVersion()