Lines Matching refs:status
243 static void checkStatus(int32_t line, UErrorCode expected, UErrorCode status) { in checkStatus() argument
244 if(U_FAILURE(status)) { in checkStatus()
247 if(status != expected) { in checkStatus()
248 …log_err_status(status, "%s:%d: Expected error code %s, got error code %s\n", __FILE__, line, u_err… in checkStatus()
253 UErrorCode status = U_USING_DEFAULT_WARNING; in TestErrorCodes() local
259 r = ures_open(NULL, "ti_ER_ASSAB", &status); in TestErrorCodes()
260 checkStatus(__LINE__, U_USING_FALLBACK_WARNING, status); in TestErrorCodes()
264 status = U_USING_DEFAULT_WARNING; in TestErrorCodes()
265 r = ures_open(NULL, "ti_ER", &status); in TestErrorCodes()
266 checkStatus(__LINE__, U_USING_DEFAULT_WARNING, status); in TestErrorCodes()
270 if(U_SUCCESS(status) && r != NULL) { in TestErrorCodes()
271 status = U_USING_DEFAULT_WARNING; in TestErrorCodes()
272 r2 = ures_getByKey(r, "LocaleScript", NULL, &status); /* LocaleScript lives in ti */ in TestErrorCodes()
273 checkStatus(__LINE__, U_USING_FALLBACK_WARNING, status); in TestErrorCodes()
278 status = U_USING_DEFAULT_WARNING; in TestErrorCodes()
279 r = ures_open(U_ICUDATA_REGION, "ti", &status); in TestErrorCodes()
280 checkStatus(__LINE__, U_USING_DEFAULT_WARNING, status); in TestErrorCodes()
283 if(U_SUCCESS(status) && r != NULL) { in TestErrorCodes()
284 status = U_USING_DEFAULT_WARNING; in TestErrorCodes()
285 r2 = ures_getByKey(r, "Countries", r2, &status); in TestErrorCodes()
286 checkStatus(__LINE__, U_USING_DEFAULT_WARNING, status); in TestErrorCodes()
290 status = U_USING_FALLBACK_WARNING; in TestErrorCodes()
291 r = ures_open(NULL, "nolocale", &status); in TestErrorCodes()
292 checkStatus(__LINE__, U_USING_DEFAULT_WARNING, status); in TestErrorCodes()
299 r = ures_open(U_ICUDATA_COLL, "sr_YU_VOJVODINA", &status); in TestErrorCodes()
300 checkStatus(__LINE__, U_USING_FALLBACK_WARNING, status); in TestErrorCodes()
304 status = U_USING_FALLBACK_WARNING; in TestErrorCodes()
305 r = ures_open(U_ICUDATA_COLL, "sr", &status); in TestErrorCodes()
306 checkStatus(__LINE__, U_USING_FALLBACK_WARNING, status); in TestErrorCodes()
309 if(U_SUCCESS(status) && r != NULL) { in TestErrorCodes()
310 status = U_USING_DEFAULT_WARNING; in TestErrorCodes()
311 r2 = ures_getByKey(r, "collations", NULL, &status); in TestErrorCodes()
312 checkStatus(__LINE__, U_USING_DEFAULT_WARNING, status); in TestErrorCodes()
317 status = U_USING_DEFAULT_WARNING; in TestErrorCodes()
318 r = ures_open(U_ICUDATA_COLL, "sr", &status); in TestErrorCodes()
319 checkStatus(__LINE__, U_USING_DEFAULT_WARNING, status); in TestErrorCodes()
322 if(U_SUCCESS(status) && r != NULL) { in TestErrorCodes()
323 status = U_USING_DEFAULT_WARNING; in TestErrorCodes()
324 r2 = ures_getByKey(r, "collations", r2, &status); in TestErrorCodes()
325 checkStatus(__LINE__, U_USING_DEFAULT_WARNING, status); in TestErrorCodes()
329 status = U_USING_FALLBACK_WARNING; in TestErrorCodes()
330 r = ures_open(U_ICUDATA_COLL, "nolocale", &status); in TestErrorCodes()
331 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()
460 UErrorCode status = U_ZERO_ERROR; in TestNewTypes() local
473 testdatapath=loadTestData(&status); in TestNewTypes()
475 if(U_FAILURE(status)) in TestNewTypes()
477 log_data_err("Could not load testdata.dat %s \n",myErrorName(status)); in TestNewTypes()
481 theBundle = ures_open(testdatapath, "testtypes", &status); in TestNewTypes()
483 empty = tres_getString(theBundle, -1, "emptystring", &len, &status); in TestNewTypes()
488 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestNewTypes()
497 res = ures_getByKey(theBundle, "zerotest", res, &status); in TestNewTypes()
498 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestNewTypes()
500 zeroString=tres_getString(res, -1, NULL, &len, &status); in TestNewTypes()
501 if(U_SUCCESS(status)){ in TestNewTypes()
502 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestNewTypes()
513 res = ures_getByKey(theBundle, "binarytest", res, &status); in TestNewTypes()
514 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestNewTypes()
516 binResult=(uint8_t*)ures_getBinary(res, &len, &status); in TestNewTypes()
517 if(U_SUCCESS(status)){ in TestNewTypes()
518 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestNewTypes()
526 res = ures_getByKey(theBundle, "importtest", res, &status); in TestNewTypes()
527 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestNewTypes()
529 binResult=(uint8_t*)ures_getBinary(res, &len, &status); in TestNewTypes()
530 if(U_SUCCESS(status)){ in TestNewTypes()
531 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestNewTypes()
539 res = ures_getByKey(theBundle, "one", res, &status); in TestNewTypes()
540 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestNewTypes()
542 intResult=ures_getInt(res, &status); in TestNewTypes()
543 uintResult = ures_getUInt(res, &status); in TestNewTypes()
544 if(U_SUCCESS(status)){ in TestNewTypes()
545 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestNewTypes()
551 res = ures_getByKey(theBundle, "minusone", res, &status); in TestNewTypes()
552 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestNewTypes()
554 intResult=ures_getInt(res, &status); in TestNewTypes()
555 uintResult = ures_getUInt(res, &status); in TestNewTypes()
556 if(U_SUCCESS(status)){ in TestNewTypes()
557 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestNewTypes()
564 res = ures_getByKey(theBundle, "plusone", res, &status); in TestNewTypes()
565 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestNewTypes()
567 intResult=ures_getInt(res, &status); in TestNewTypes()
568 uintResult = ures_getUInt(res, &status); in TestNewTypes()
569 if(U_SUCCESS(status)){ in TestNewTypes()
570 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestNewTypes()
575 res = ures_getByKey(theBundle, "onehundredtwentythree", res, &status); in TestNewTypes()
576 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestNewTypes()
578 intResult=ures_getInt(res, &status); in TestNewTypes()
579 if(U_SUCCESS(status)){ in TestNewTypes()
580 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestNewTypes()
586 const UChar* str = tres_getString(theBundle,-1,"testescape",&len,&status); in TestNewTypes()
587 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestNewTypes()
588 if(U_SUCCESS(status)){ in TestNewTypes()
625 got = tres_getString(theBundle,-1,"test_unescaping",&len,&status); in TestNewTypes()
638 status = U_ZERO_ERROR; in TestNewTypes()
642 const UChar* str = tres_getString(theBundle,-1,"test_underscores",&len,&status); in TestNewTypes()
645 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestNewTypes()
657 status = U_ZERO_ERROR; in TestNewTypes()
658 resB = ures_getByKey(theBundle, "collations", resB, &status); in TestNewTypes()
659 resB = ures_getByKey(resB, "standard", resB, &status); in TestNewTypes()
660 str = tres_getString(resB,-1,"Sequence",&strLength,&status); in TestNewTypes()
661 if(!str || U_FAILURE(status)) { in TestNewTypes()
662 log_data_err("Could not load collations from theBundle: %s\n", u_errorName(status)); in TestNewTypes()
681 status = U_ZERO_ERROR; in TestNewTypes()
684 const UChar* str = tres_getString(theBundle, -1, "testincludeUTF",&strLen,&status); in TestNewTypes()
687 if(U_FAILURE(status)){ in TestNewTypes()
688 …rr("Could not get testincludeUTF resource from testtypes bundle. Error: %s\n",u_errorName(status)); in TestNewTypes()
692 UCHARBUF* ucbuf = ucbuf_open(testDataFileName,&cp,FALSE,FALSE,&status); in TestNewTypes()
694 if(U_SUCCESS(status)){ in TestNewTypes()
695 const UChar* buffer = ucbuf_getBuffer(ucbuf,&len,&status); in TestNewTypes()
696 if(U_SUCCESS(status)){ in TestNewTypes()
709 … log_err("ucbuf failed to open %s. Error: %s\n", testDataFileName, u_errorName(status)); in TestNewTypes()
714 …log_err("Could not get riwords.txt (path : %s). Error: %s\n",testDataFileName,u_errorName(status)); in TestNewTypes()
718 status = U_ZERO_ERROR; in TestNewTypes()
721 const UChar* str = tres_getString(theBundle, -1, "testinclude",&strLen,&status); in TestNewTypes()
725 if(U_FAILURE(status)){ in TestNewTypes()
726 …g_err("Could not get testinclude resource from testtypes bundle. Error: %s\n",u_errorName(status)); in TestNewTypes()
730 UCHARBUF* ucbuf = ucbuf_open(testDataFileName,&cp,FALSE,FALSE,&status); in TestNewTypes()
732 if(U_SUCCESS(status)){ in TestNewTypes()
733 const UChar* buffer = ucbuf_getBuffer(ucbuf,&len,&status); in TestNewTypes()
734 if(U_SUCCESS(status)){ in TestNewTypes()
743 … log_err("ucbuf failed to open %s. Error: %s\n", testDataFileName, u_errorName(status)); in TestNewTypes()
747 …("Could not get translit_rules.txt (path : %s). Error: %s\n",testDataFileName,u_errorName(status)); in TestNewTypes()
762 UErrorCode status = U_ZERO_ERROR; in TestEmptyTypes() local
772 testdatapath=loadTestData(&status); in TestEmptyTypes()
773 if(U_FAILURE(status)) in TestEmptyTypes()
775 log_data_err("Could not load testdata.dat %s \n",myErrorName(status)); in TestEmptyTypes()
779 theBundle = ures_open(testdatapath, "testtypes", &status); in TestEmptyTypes()
781 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestEmptyTypes()
789 status = U_ZERO_ERROR; in TestEmptyTypes()
791 res = ures_getByKey(theBundle, "emptyexplicitstring", res, &status); in TestEmptyTypes()
792 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestEmptyTypes()
794 zeroString=tres_getString(res, -1, NULL, &len, &status); in TestEmptyTypes()
795 if(U_SUCCESS(status)){ in TestEmptyTypes()
796 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestEmptyTypes()
804 status = U_ZERO_ERROR; in TestEmptyTypes()
806 res = ures_getByKey(theBundle, "emptystring", res, &status); in TestEmptyTypes()
807 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestEmptyTypes()
809 zeroString=tres_getString(res, -1, NULL, &len, &status); in TestEmptyTypes()
810 if(U_SUCCESS(status)){ in TestEmptyTypes()
811 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestEmptyTypes()
819 status = U_ZERO_ERROR; in TestEmptyTypes()
821 res = ures_getByKey(theBundle, "emptyint", res, &status); in TestEmptyTypes()
822 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestEmptyTypes()
824 intResult=ures_getInt(res, &status); in TestEmptyTypes()
825 if(U_SUCCESS(status)){ in TestEmptyTypes()
826 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestEmptyTypes()
833 status = U_ZERO_ERROR; in TestEmptyTypes()
835 res = ures_getByKey(theBundle, "emptyintv", res, &status); in TestEmptyTypes()
836 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestEmptyTypes()
839 if(U_FAILURE(status)){ in TestEmptyTypes()
840 log_err("Couldn't get emptyintv key %s\n", u_errorName(status)); in TestEmptyTypes()
843 zeroIntVect=ures_getIntVector(res, &len, &status); in TestEmptyTypes()
844 if(!U_SUCCESS(status) || resArray != NULL || len != 0) { in TestEmptyTypes()
849 status = U_ZERO_ERROR; in TestEmptyTypes()
851 res = ures_getByKey(theBundle, "emptybin", res, &status); in TestEmptyTypes()
852 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestEmptyTypes()
855 if(U_FAILURE(status)){ in TestEmptyTypes()
856 log_err("Couldn't get emptybin key %s\n", u_errorName(status)); in TestEmptyTypes()
859 binResult=ures_getBinary(res, &len, &status); in TestEmptyTypes()
860 if(!U_SUCCESS(status) || len != 0) { in TestEmptyTypes()
865 status = U_ZERO_ERROR; in TestEmptyTypes()
867 res = ures_getByKey(theBundle, "emptyarray", res, &status); in TestEmptyTypes()
868 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestEmptyTypes()
871 if(U_FAILURE(status)){ in TestEmptyTypes()
872 log_err("Couldn't get emptyarray key %s\n", u_errorName(status)); in TestEmptyTypes()
875 resArray=ures_getByIndex(res, 0, resArray, &status); in TestEmptyTypes()
876 if(U_SUCCESS(status) || resArray != NULL){ in TestEmptyTypes()
881 status = U_ZERO_ERROR; in TestEmptyTypes()
883 res = ures_getByKey(theBundle, "emptytable", res, &status); in TestEmptyTypes()
884 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestEmptyTypes()
887 if(U_FAILURE(status)){ in TestEmptyTypes()
888 log_err("Couldn't get emptytable key %s\n", u_errorName(status)); in TestEmptyTypes()
891 resArray=ures_getByIndex(res, 0, resArray, &status); in TestEmptyTypes()
892 if(U_SUCCESS(status) || resArray != NULL){ in TestEmptyTypes()
902 UErrorCode status = U_ZERO_ERROR; in TestEmptyBundle() local
906 testdatapath=loadTestData(&status); in TestEmptyBundle()
907 if(U_FAILURE(status)) in TestEmptyBundle()
909 log_data_err("Could not load testdata.dat %s \n",myErrorName(status)); in TestEmptyBundle()
912 resb = ures_open(testdatapath, "testempty", &status); in TestEmptyBundle()
914 if(U_SUCCESS(status)){ in TestEmptyBundle()
915 dResB = ures_getByKey(resb,"test",dResB,&status); in TestEmptyBundle()
916 if(status!= U_MISSING_RESOURCE_ERROR){ in TestEmptyBundle()
918 u_errorName(U_MISSING_RESOURCE_ERROR),u_errorName(status)); in TestEmptyBundle()
926 UErrorCode status=U_ZERO_ERROR; in TestBinaryCollationData() local
941 testdatapath=loadTestData(&status); in TestBinaryCollationData()
942 if(U_FAILURE(status)) in TestBinaryCollationData()
944 log_data_err("Could not load testdata.dat %s \n",myErrorName(status)); in TestBinaryCollationData()
949 teRes=ures_open(testdatapath, locale, &status); in TestBinaryCollationData()
950 if(U_FAILURE(status)){ in TestBinaryCollationData()
951 log_err("ERROR: Failed to get resource for \"te\" with %s", myErrorName(status)); in TestBinaryCollationData()
954 status=U_ZERO_ERROR; in TestBinaryCollationData()
955 coll = ures_getByKey(teRes, "collations", coll, &status); in TestBinaryCollationData()
956 coll = ures_getByKey(coll, "standard", coll, &status); in TestBinaryCollationData()
957 if(U_SUCCESS(status)){ in TestBinaryCollationData()
958 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestBinaryCollationData()
960 binColl=ures_getByKey(coll, "%%CollationBin", binColl, &status); in TestBinaryCollationData()
961 if(U_SUCCESS(status)){ in TestBinaryCollationData()
962 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestBinaryCollationData()
964 binResult=(uint8_t*)ures_getBinary(binColl, &len, &status); in TestBinaryCollationData()
965 if(U_SUCCESS(status)){ in TestBinaryCollationData()
966 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestBinaryCollationData()
985 UErrorCode status=U_ZERO_ERROR; in TestAPI() local
999 testdatapath=loadTestData(&status); in TestAPI()
1000 if(U_FAILURE(status)) in TestAPI()
1002 log_data_err("Could not load testdata.dat %s \n",myErrorName(status)); in TestAPI()
1025 status = U_ZERO_ERROR; in TestAPI()
1026 ures_close(ures_openU(largeBuffer, "root", &status)); in TestAPI()
1027 if(status != U_ILLEGAL_ARGUMENT_ERROR){ in TestAPI()
1028 …r("ERROR: ures_openU() worked when the path is very large. It returned %s\n", myErrorName(status)); in TestAPI()
1031 status = U_ZERO_ERROR; in TestAPI()
1032 ures_close(ures_openU(NULL, "root", &status)); in TestAPI()
1033 if(U_FAILURE(status)){ in TestAPI()
1034 … log_err_status(status, "ERROR: ures_openU() failed path = NULL with %s\n", myErrorName(status)); in TestAPI()
1037 status = U_ILLEGAL_ARGUMENT_ERROR; in TestAPI()
1038 if(ures_openU(NULL, "root", &status) != NULL){ in TestAPI()
1039 log_err("ERROR: ures_openU() worked with error status with %s\n", myErrorName(status)); in TestAPI()
1042 status = U_ZERO_ERROR; in TestAPI()
1043 teRes=ures_openU(utestdatapath, "te", &status); in TestAPI()
1044 if(U_FAILURE(status)){ in TestAPI()
1045 …log_err_status(status, "ERROR: ures_openU() failed path =%s with %s\n", austrdup(utestdatapath), m… in TestAPI()
1050 if(strcmp(ures_getLocale(teRes, &status), "te") != 0){ in TestAPI()
1051 …err("ERROR: ures_getLocale() failed. Expected = te_TE Got = %s\n", ures_getLocale(teRes, &status)); in TestAPI()
1054 teFillin=ures_getByKey(teRes, "tagged_array_in_te_te_IN", teFillin, &status); in TestAPI()
1056 value=(UChar*)ures_getNextString(teFillin, &len, &key, &status); in TestAPI()
1058 value=(UChar*)ures_getNextString(teFillin, &len, &key, &status); in TestAPI()
1059 if(status !=U_INDEX_OUTOFBOUNDS_ERROR){ in TestAPI()
1061 myErrorName(status)); in TestAPI()
1065 status=U_ZERO_ERROR; in TestAPI()
1068 teFillin=ures_getNextResource(teRes, teFillin, &status); in TestAPI()
1069 if(U_FAILURE(status)){ in TestAPI()
1081 teFillin=ures_getByKey(teRes, "string_only_in_te", teFillin, &status); in TestAPI()
1082 teFillin2=ures_getByIndex(teFillin, 0, teFillin2, &status); in TestAPI()
1083 if(U_FAILURE(status)){ in TestAPI()
1086 … if(strcmp(u_austrcpy(convOutput, tres_getString(teFillin2, -1, NULL, &len, &status)), "TE") != 0){ in TestAPI()
1087 status=U_ZERO_ERROR; in TestAPI()
1088 …ource fetched the key=%s, expected \"TE\" \n", austrdup(ures_getString(teFillin2, &len, &status))); in TestAPI()
1095 status=U_ZERO_ERROR; in TestAPI()
1096 ures_openFillIn(teRes, testdatapath, "te", &status); in TestAPI()
1097 if(U_FAILURE(status)){ in TestAPI()
1101 if(strcmp(ures_getLocale(teRes, &status), "te") != 0){ in TestAPI()
1104 ures_getByKey(teRes, "string_only_in_te", teFillin, &status); in TestAPI()
1105 teFillin2=ures_getNextResource(teFillin, teFillin2, &status); in TestAPI()
1109 teFillin2=ures_getNextResource(teFillin, teFillin2, &status); in TestAPI()
1110 if(status !=U_INDEX_OUTOFBOUNDS_ERROR){ in TestAPI()
1112 myErrorName(status)); in TestAPI()
1120 status=U_ZERO_ERROR; in TestAPI()
1121 teRes=ures_open(NULL, "dE_At_NOWHERE_TO_BE_FOUND", &status); in TestAPI()
1122 if(U_FAILURE(status)) { in TestAPI()
1123 …e to open a locale resource bundle from \"dE_At_NOWHERE_TO_BE_FOUND\"(%s)\n", u_errorName(status)); in TestAPI()
1125 if(0!=strcmp("de_AT", ures_getLocale(teRes, &status))) { in TestAPI()
1126 …_getLocale(\"dE_At_NOWHERE_TO_BE_FOUND\")=%s but must be de_AT\n", ures_getLocale(teRes, &status)); in TestAPI()
1132 status=U_ZERO_ERROR; in TestAPI()
1133 teRes=ures_open(NULL, "iW_Il_depRecaTed_HebreW", &status); in TestAPI()
1134 if(U_FAILURE(status)) { in TestAPI()
1135 …ble to open a locale resource bundle from \"iW_Il_depRecaTed_HebreW\"(%s)\n", u_errorName(status)); in TestAPI()
1137 if(0!=strcmp("he_IL", ures_getLocale(teRes, &status))) { in TestAPI()
1138 …es_getLocale(\"iW_Il_depRecaTed_HebreW\")=%s but must be he_IL\n", ures_getLocale(teRes, &status)); in TestAPI()
1146 UErrorCode status=U_ZERO_ERROR; in TestErrorConditions() local
1161 testdatapath = loadTestData(&status); in TestErrorConditions()
1162 if(U_FAILURE(status)) in TestErrorConditions()
1164 log_data_err("Could not load testdata.dat %s \n",myErrorName(status)); in TestErrorConditions()
1173 status=U_ILLEGAL_ARGUMENT_ERROR; in TestErrorConditions()
1174 teRes=ures_openU(utestdatapath, "te", &status); in TestErrorConditions()
1175 if(U_FAILURE(status)){ in TestErrorConditions()
1183 status=U_ZERO_ERROR; in TestErrorConditions()
1184 ures_openFillIn(NULL, testdatapath, "te", &status); in TestErrorConditions()
1185 if(status != U_ILLEGAL_ARGUMENT_ERROR){ in TestErrorConditions()
1187 myErrorName(status)); in TestErrorConditions()
1190 status=U_ZERO_ERROR; in TestErrorConditions()
1191 teRes=ures_openU(utestdatapath, "te", &status); in TestErrorConditions()
1192 if(U_FAILURE(status)){ in TestErrorConditions()
1193 …err("ERROR: ures_openU() failed path =%s with %s\n", austrdup(utestdatapath), myErrorName(status)); in TestErrorConditions()
1196 status=U_ILLEGAL_ARGUMENT_ERROR; in TestErrorConditions()
1197 if(ures_getLocale(teRes, &status) != NULL){ in TestErrorConditions()
1201 status=U_ZERO_ERROR; in TestErrorConditions()
1202 if(ures_getLocale(NULL, &status) != NULL && status != U_ILLEGAL_ARGUMENT_ERROR){ in TestErrorConditions()
1204 myErrorName(status)); in TestErrorConditions()
1207 status=U_ZERO_ERROR; in TestErrorConditions()
1212 status=U_ZERO_ERROR; in TestErrorConditions()
1217 status=U_ZERO_ERROR; in TestErrorConditions()
1222 status=U_ZERO_ERROR; in TestErrorConditions()
1227 status=U_ZERO_ERROR; in TestErrorConditions()
1228 …if(ures_getStringByKey(NULL, "string_only_in_te", &resultLen, &status) != NULL && status != U_ILLE… in TestErrorConditions()
1230 myErrorName(status)); in TestErrorConditions()
1233 status=U_ZERO_ERROR; in TestErrorConditions()
1234 teFillin=ures_getByKey(NULL, "string_only_in_te", teFillin, &status); in TestErrorConditions()
1235 if( teFillin != NULL && status != U_ILLEGAL_ARGUMENT_ERROR){ in TestErrorConditions()
1237 myErrorName(status)); in TestErrorConditions()
1240 teFillin=ures_getByKey(NULL, "string_only_in_te", teFillin, &status); in TestErrorConditions()
1245 status=U_ZERO_ERROR; in TestErrorConditions()
1246 …if(ures_getStringByKey(NULL, "string_only_in_te", &len, &status) != NULL && status != U_ILLEGAL_AR… in TestErrorConditions()
1248 myErrorName(status)); in TestErrorConditions()
1251 if(ures_getStringByKey(teRes, "string_only_in_te", &len, &status) != NULL){ in TestErrorConditions()
1253 myErrorName(status)); in TestErrorConditions()
1256 status=U_ZERO_ERROR; in TestErrorConditions()
1257 if(ures_getString(NULL, &len, &status) != NULL && status != U_ILLEGAL_ARGUMENT_ERROR){ in TestErrorConditions()
1259 myErrorName(status)); in TestErrorConditions()
1262 if(ures_getString(teRes, &len, &status) != NULL){ in TestErrorConditions()
1264 myErrorName(status)); in TestErrorConditions()
1267 status=U_ZERO_ERROR; in TestErrorConditions()
1268 if(ures_getBinary(NULL, &len, &status) != NULL && status != U_ILLEGAL_ARGUMENT_ERROR){ in TestErrorConditions()
1270 myErrorName(status)); in TestErrorConditions()
1273 status=U_ZERO_ERROR; in TestErrorConditions()
1274 coll = ures_getByKey(teRes, "collations", coll, &status); in TestErrorConditions()
1275 coll = ures_getByKey(teRes, "standard", coll, &status); in TestErrorConditions()
1276 binColl=ures_getByKey(coll, "%%CollationBin", binColl, &status); in TestErrorConditions()
1278 status=U_ILLEGAL_ARGUMENT_ERROR; in TestErrorConditions()
1279 binResult=(uint8_t*)ures_getBinary(binColl, &len, &status); in TestErrorConditions()
1285 teFillin=ures_getNextResource(teRes, teFillin, &status); in TestErrorConditions()
1290 status=U_ZERO_ERROR; in TestErrorConditions()
1291 teFillin=ures_getNextResource(NULL, teFillin, &status); in TestErrorConditions()
1292 if(teFillin != NULL || status != U_ILLEGAL_ARGUMENT_ERROR){ in TestErrorConditions()
1294 myErrorName(status)); in TestErrorConditions()
1297 teFillin=ures_getByKey(teRes, "tagged_array_in_te_te_IN", teFillin, &status); in TestErrorConditions()
1299 status = U_ILLEGAL_ARGUMENT_ERROR; in TestErrorConditions()
1300 value=(UChar*)ures_getNextString(teFillin, &len, &key, &status); in TestErrorConditions()
1305 status=U_ZERO_ERROR; in TestErrorConditions()
1306 value=(UChar*)ures_getNextString(NULL, &len, &key, &status); in TestErrorConditions()
1307 if(value != NULL || status != U_ILLEGAL_ARGUMENT_ERROR){ in TestErrorConditions()
1309 myErrorName(status)); in TestErrorConditions()
1312 status=U_ZERO_ERROR; in TestErrorConditions()
1313 teFillin=ures_getByKey(teRes, "array_only_in_te", teFillin, &status); in TestErrorConditions()
1314 if(ures_countArrayItems(teRes, "array_only_in_te", &status) != 4) { in TestErrorConditions()
1317 status=U_ILLEGAL_ARGUMENT_ERROR; in TestErrorConditions()
1318 teFillin2=ures_getByIndex(teFillin, 0, teFillin2, &status); in TestErrorConditions()
1323 status=U_ZERO_ERROR; in TestErrorConditions()
1324 teFillin2=ures_getByIndex(NULL, 0, teFillin2, &status); in TestErrorConditions()
1325 if(status != U_ILLEGAL_ARGUMENT_ERROR){ in TestErrorConditions()
1327 myErrorName(status)); in TestErrorConditions()
1330 status=U_ZERO_ERROR; in TestErrorConditions()
1331 teFillin=ures_getByKey(teRes, "array_only_in_te", teFillin, &status); in TestErrorConditions()
1332 status=U_ILLEGAL_ARGUMENT_ERROR; in TestErrorConditions()
1333 value=(UChar*)ures_getStringByIndex(teFillin, 0, &len, &status); in TestErrorConditions()
1338 status=U_ZERO_ERROR; in TestErrorConditions()
1339 value=(UChar*)ures_getStringByIndex(NULL, 0, &len, &status); in TestErrorConditions()
1340 if(value != NULL || status != U_ILLEGAL_ARGUMENT_ERROR){ in TestErrorConditions()
1342 myErrorName(status)); in TestErrorConditions()
1345 status=U_ZERO_ERROR; in TestErrorConditions()
1346 value=(UChar*)ures_getStringByIndex(teFillin, 9999, &len, &status); in TestErrorConditions()
1347 if(value != NULL || status != U_MISSING_RESOURCE_ERROR){ in TestErrorConditions()
1349 myErrorName(status)); in TestErrorConditions()
1352 status=U_ZERO_ERROR; in TestErrorConditions()
1353 if(ures_getInt(NULL, &status) != -1 && status != U_ILLEGAL_ARGUMENT_ERROR){ in TestErrorConditions()
1355 myErrorName(status)); in TestErrorConditions()
1358 if(ures_getInt(teRes, &status) != -1){ in TestErrorConditions()
1376 UErrorCode status= U_ZERO_ERROR; in TestGetVersion() local
1389 resB = ures_open(NULL,locName, &status); in TestGetVersion()
1390 if (U_FAILURE(status)) { in TestGetVersion()
1391 …log_err_status(status, "Resource bundle creation for locale %s failed.: %s\n", locName, myErrorNam… in TestGetVersion()
1414 UErrorCode status= U_ZERO_ERROR; in TestGetVersionColl() local
1424 locs = ures_openAvailableLocales(U_ICUDATA_COLL, &status); in TestGetVersionColl()
1425 if (U_FAILURE(status)) { in TestGetVersionColl()
1426 … log_err_status(status, "enumeration of %s failed.: %s\n", U_ICUDATA_COLL, myErrorName(status)); in TestGetVersionColl()
1432 resB = ures_open(U_ICUDATA_COLL,locName, &status); in TestGetVersionColl()
1433 if (U_FAILURE(status)) { in TestGetVersionColl()
1434 …rce bundle creation for locale %s:%s failed.: %s\n", U_ICUDATA_COLL, locName, myErrorName(status)); in TestGetVersionColl()
1439 rules = tres_getString(resB,-1,"UCARules",&len, &status); in TestGetVersionColl()
1440 if(!rules || U_FAILURE(status)) { in TestGetVersionColl()
1446 status = U_ZERO_ERROR; in TestGetVersionColl()
1464 } while((locName = uenum_next(locs,&locLen,&status))&&U_SUCCESS(status)); in TestGetVersionColl()
1466 if(U_FAILURE(status)) { in TestGetVersionColl()
1467 log_err("Err %s testing Collation locales.\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, index, &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, index, 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()
2018 UErrorCode status = U_ZERO_ERROR; in TestFallback() local
2025 fr_FR = ures_open(NULL, "fr_FR", &status); in TestFallback()
2026 if(U_FAILURE(status)) in TestFallback()
2028 log_err_status(status, "Couldn't open fr_FR - %s\n", u_errorName(status)); in TestFallback()
2032 status = U_ZERO_ERROR; in TestFallback()
2036 junk = tres_getString(fr_FR, -1, "LocaleID", &resultLen, &status); in TestFallback()
2037 status = U_ZERO_ERROR; in TestFallback()
2038 junk = tres_getString(fr_FR, -1, "LocaleString", &resultLen, &status); in TestFallback()
2039 status = U_ZERO_ERROR; in TestFallback()
2040 junk = tres_getString(fr_FR, -1, "LocaleID", &resultLen, &status); in TestFallback()
2041 status = U_ZERO_ERROR; in TestFallback()
2044 subResource = ures_getByKey(fr_FR, "MeasurementSystem", NULL, &status); in TestFallback()
2045 if(status != U_USING_DEFAULT_WARNING) in TestFallback()
2048 u_errorName(status)); in TestFallback()
2051 status = U_ZERO_ERROR; in TestFallback()
2055 junk = tres_getString(fr_FR, -1, "ExemplarCharacters", &resultLen, &status); in TestFallback()
2056 if(status != U_USING_FALLBACK_WARNING) in TestFallback()
2059 status); in TestFallback()
2062 status = U_ZERO_ERROR; in TestFallback()
2110 UErrorCode status = U_ZERO_ERROR; in TestResourceLevelAliasing() local
2120 testdatapath=loadTestData(&status); in TestResourceLevelAliasing()
2121 if(U_FAILURE(status)) in TestResourceLevelAliasing()
2123 log_data_err("Could not load testdata.dat %s \n",myErrorName(status)); in TestResourceLevelAliasing()
2127 aliasB = ures_open(testdatapath, "testaliases", &status); in TestResourceLevelAliasing()
2129 if(U_FAILURE(status)) in TestResourceLevelAliasing()
2131 log_data_err("Could not load testaliases.res %s \n",myErrorName(status)); in TestResourceLevelAliasing()
2135 tb = ures_getByKey(aliasB, "aaa", tb, &status); in TestResourceLevelAliasing()
2136 if(status != U_TOO_MANY_ALIASES_ERROR) { in TestResourceLevelAliasing()
2140 status = U_ZERO_ERROR; in TestResourceLevelAliasing()
2142 tb = ures_getByKey(aliasB, "aab", tb, &status); in TestResourceLevelAliasing()
2143 if(status != U_TOO_MANY_ALIASES_ERROR) { in TestResourceLevelAliasing()
2146 status = U_ZERO_ERROR; in TestResourceLevelAliasing()
2148 if(U_FAILURE(status) ) { in TestResourceLevelAliasing()
2152 tb = ures_getByKey(aliasB, "nonexisting", tb, &status); in TestResourceLevelAliasing()
2153 if(status != U_MISSING_RESOURCE_ERROR) { in TestResourceLevelAliasing()
2156 status = U_ZERO_ERROR; in TestResourceLevelAliasing()
2159 uk = ures_findResource("ja/LocaleScript/2", uk, &status); in TestResourceLevelAliasing()
2160 if((uk == NULL) || U_FAILURE(status)) { in TestResourceLevelAliasing()
2161 …log_err_status(status, "Couldn't findResource('ja/LocaleScript/2') err %s\n", u_errorName(status)); in TestResourceLevelAliasing()
2165 sequence = tres_getString(uk, -1, NULL, &seqLen, &status); in TestResourceLevelAliasing()
2167 tb = ures_getByKey(aliasB, "referencingalias", tb, &status); in TestResourceLevelAliasing()
2168 string = tres_getString(tb, -1, NULL, &strLen, &status); in TestResourceLevelAliasing()
2174 string = tres_getString(aliasB, -1, "referencingalias", &strLen, &status); in TestResourceLevelAliasing()
2179 checkStatus(__LINE__, U_ZERO_ERROR, status); in TestResourceLevelAliasing()
2180 tb = ures_getByKey(aliasB, "LocaleScript", tb, &status); in TestResourceLevelAliasing()
2181 checkStatus(__LINE__, U_ZERO_ERROR, status); in TestResourceLevelAliasing()
2182 tb = ures_getByIndex(tb, 2, tb, &status); in TestResourceLevelAliasing()
2183 checkStatus(__LINE__, U_ZERO_ERROR, status); in TestResourceLevelAliasing()
2184 string = tres_getString(tb, -1, NULL, &strLen, &status); in TestResourceLevelAliasing()
2185 checkStatus(__LINE__, U_ZERO_ERROR, status); in TestResourceLevelAliasing()
2187 if(U_FAILURE(status)) { in TestResourceLevelAliasing()
2188 log_err("%s trying to get string via separate getters\n", u_errorName(status)); in TestResourceLevelAliasing()
2195 UResourceBundle* ja = ures_open(U_ICUDATA_BRKITR,"ja", &status); in TestResourceLevelAliasing()
2198 ja = ures_getByKey(ja, "boundaries", ja, &status); in TestResourceLevelAliasing()
2199 exp = tres_getString(ja, -1, "word", &expLen, &status); in TestResourceLevelAliasing()
2201 tb = ures_getByKey(aliasB, "boundaries", tb, &status); in TestResourceLevelAliasing()
2202 got = tres_getString(tb, -1, "word", &gotLen, &status); in TestResourceLevelAliasing()
2204 if(U_FAILURE(status)) { in TestResourceLevelAliasing()
2205 log_err("%s trying to read str boundaries\n", u_errorName(status)); in TestResourceLevelAliasing()
2210 status = U_ZERO_ERROR; in TestResourceLevelAliasing()
2213 testtypes = ures_open(testdatapath, "testtypes", &status); in TestResourceLevelAliasing()
2216 uk = ures_findSubResource(testtypes, s, uk, &status); in TestResourceLevelAliasing()
2217 sequence = tres_getString(uk, -1, NULL, &seqLen, &status); in TestResourceLevelAliasing()
2219 tb = ures_getByKey(aliasB, "simplealias", tb, &status); in TestResourceLevelAliasing()
2220 string = tres_getString(tb, -1, NULL, &strLen, &status); in TestResourceLevelAliasing()
2222 if(U_FAILURE(status) || seqLen != strLen || u_strncmp(sequence, string, seqLen) != 0) { in TestResourceLevelAliasing()
2228 tb = ures_getByKey(aliasB, "zoneTests", tb, &status); in TestResourceLevelAliasing()
2229 tb = ures_getByKey(tb, "zoneAlias2", tb, &status); in TestResourceLevelAliasing()
2230 string = tres_getString(tb, -1, NULL, &strLen, &status); in TestResourceLevelAliasing()
2232 en = ures_findResource("/ICUDATA-zone/en/zoneStrings/3/0", en, &status); in TestResourceLevelAliasing()
2233 sequence = tres_getString(en, -1, NULL, &seqLen, &status); in TestResourceLevelAliasing()
2235 if(U_FAILURE(status) || seqLen != strLen || u_strncmp(sequence, string, seqLen) != 0) { in TestResourceLevelAliasing()
2259 tb = ures_getByKey(aliasB, "testGetStringByKeyAliasing", tb, &status); in TestResourceLevelAliasing()
2260 if(U_FAILURE(status)) { in TestResourceLevelAliasing()
2261 … log_err("FAIL: Couldn't get testGetStringByKeyAliasing resource: %s\n", u_errorName(status)); in TestResourceLevelAliasing()
2264 result = tres_getString(tb, -1, keys[i], &resultLen, &status); in TestResourceLevelAliasing()
2265 if(U_FAILURE(status)){ in TestResourceLevelAliasing()
2266 …log_err("(1) Fetching the resource with key %s failed. Error: %s\n", keys[i], u_errorName(status)); in TestResourceLevelAliasing()
2275 result = tres_getString(tb, i, NULL, &resultLen, &status); in TestResourceLevelAliasing()
2276 if(U_FAILURE(status)){ in TestResourceLevelAliasing()
2277 …log_err("(2) Fetching the resource with key %s failed. Error: %s\n", keys[i], u_errorName(status)); in TestResourceLevelAliasing()
2286 result = ures_getNextString(tb, &resultLen, &key, &status); in TestResourceLevelAliasing()
2287 if(U_FAILURE(status)){ in TestResourceLevelAliasing()
2288 …log_err("(3) Fetching the resource with key %s failed. Error: %s\n", keys[i], u_errorName(status)); in TestResourceLevelAliasing()
2297 tb = ures_getByKey(aliasB, "testGetStringByIndexAliasing", tb, &status); in TestResourceLevelAliasing()
2298 if(U_FAILURE(status)) { in TestResourceLevelAliasing()
2299 … log_err("FAIL: Couldn't get testGetStringByIndexAliasing resource: %s\n", u_errorName(status)); in TestResourceLevelAliasing()
2302 result = tres_getString(tb, i, NULL, &resultLen, &status); in TestResourceLevelAliasing()
2303 if(U_FAILURE(status)){ in TestResourceLevelAliasing()
2304 … log_err("Fetching the resource with key %s failed. Error: %s\n", keys[i], u_errorName(status)); in TestResourceLevelAliasing()
2313 result = ures_getNextString(tb, &resultLen, &key, &status); in TestResourceLevelAliasing()
2314 if(U_FAILURE(status)){ in TestResourceLevelAliasing()
2315 … log_err("Fetching the resource with key %s failed. Error: %s\n", keys[i], u_errorName(status)); in TestResourceLevelAliasing()
2325 tb = ures_getByKey(aliasB, "testAliasToTree", tb, &status); in TestResourceLevelAliasing()
2326 if(U_FAILURE(status)){ in TestResourceLevelAliasing()
2327 …err("Fetching the resource with key \"testAliasToTree\" failed. Error: %s\n", u_errorName(status)); in TestResourceLevelAliasing()
2342 UErrorCode status = U_ZERO_ERROR; in TestDirectAccess() local
2354 t = ures_findResource("/testdata/te/zoneStrings/3/2", t, &status); in TestDirectAccess()
2355 if(U_FAILURE(status)) { in TestDirectAccess()
2356 log_data_err("Couldn't access indexed resource, error %s\n", u_errorName(status)); in TestDirectAccess()
2357 status = U_ZERO_ERROR; in TestDirectAccess()
2364 t = ures_findResource("en/calendar/gregorian/DateTimePatterns/3", t, &status); in TestDirectAccess()
2365 if(U_FAILURE(status)) { in TestDirectAccess()
2366 log_data_err("Couldn't access indexed resource, error %s\n", u_errorName(status)); in TestDirectAccess()
2367 status = U_ZERO_ERROR; in TestDirectAccess()
2375 t = ures_findResource("ja/LocaleScript", t, &status); in TestDirectAccess()
2376 if(U_FAILURE(status)) { in TestDirectAccess()
2377 log_data_err("Couldn't access keyed resource, error %s\n", u_errorName(status)); in TestDirectAccess()
2378 status = U_ZERO_ERROR; in TestDirectAccess()
2386 t2 = ures_open(U_ICUDATA_LANG, "sr", &status); in TestDirectAccess()
2387 if(U_FAILURE(status)) { in TestDirectAccess()
2388 … log_err_status(status, "Couldn't open 'sr' resource bundle, error %s\n", u_errorName(status)); in TestDirectAccess()
2393 if(U_SUCCESS(status)) { in TestDirectAccess()
2396 t = ures_findSubResource(t2, s, t, &status); in TestDirectAccess()
2397 if(U_FAILURE(status)) { in TestDirectAccess()
2398 log_err("Couldn't access keyed resource, error %s\n", u_errorName(status)); in TestDirectAccess()
2399 status = U_ZERO_ERROR; in TestDirectAccess()
2408 t = ures_findResource("root/calendar/islamic-civil/DateTime", t, &status); in TestDirectAccess()
2409 if(U_SUCCESS(status)) { in TestDirectAccess()
2412 status = U_ZERO_ERROR; in TestDirectAccess()
2415 … t = ures_findResource("root/calendar/islamic-civil/eras/abbreviated/0/mikimaus/pera", t, &status); in TestDirectAccess()
2416 if(U_SUCCESS(status)) { in TestDirectAccess()
2419 status = U_ZERO_ERROR; in TestDirectAccess()
2422 t2 = ures_open(NULL, "he", &status); in TestDirectAccess()
2423 t2 = ures_getByKeyWithFallback(t2, "calendar", t2, &status); in TestDirectAccess()
2424 t2 = ures_getByKeyWithFallback(t2, "islamic-civil", t2, &status); in TestDirectAccess()
2425 t2 = ures_getByKeyWithFallback(t2, "DateTime", t2, &status); in TestDirectAccess()
2426 if(U_SUCCESS(status)) { in TestDirectAccess()
2429 status = U_ZERO_ERROR; in TestDirectAccess()
2432 t2 = ures_open(NULL, "he", &status); in TestDirectAccess()
2434 t2 = ures_getByKeyWithFallback(t2, "calendar", t2, &status); in TestDirectAccess()
2435 t2 = ures_getByKeyWithFallback(t2, "islamic-civil", t2, &status); in TestDirectAccess()
2436 t2 = ures_getByKeyWithFallback(t2, "eras", t2, &status); in TestDirectAccess()
2437 if(U_FAILURE(status)) { in TestDirectAccess()
2438 log_err_status(status, "Didn't get Eras. I know they are there!\n"); in TestDirectAccess()
2440 status = U_ZERO_ERROR; in TestDirectAccess()
2443 t2 = ures_open(NULL, "root", &status); in TestDirectAccess()
2444 t2 = ures_getByKeyWithFallback(t2, "calendar", t2, &status); in TestDirectAccess()
2445 t2 = ures_getByKeyWithFallback(t2, "islamic-civil", t2, &status); in TestDirectAccess()
2446 t2 = ures_getByKeyWithFallback(t2, "DateTime", t2, &status); in TestDirectAccess()
2447 if(U_SUCCESS(status)) { in TestDirectAccess()
2450 status = U_ZERO_ERROR; in TestDirectAccess()
2461 UErrorCode status = U_ZERO_ERROR; in TestJB3763() local
2462 t = ures_open(NULL, "sr_Latn", &status); in TestJB3763()
2463 t = ures_getByKeyWithFallback(t, "calendar", t, &status); in TestJB3763()
2464 t = ures_getByKeyWithFallback(t, "gregorian", t, &status); in TestJB3763()
2465 t = ures_getByKeyWithFallback(t, "AmPmMarkers", t, &status); in TestJB3763()
2466 if(U_FAILURE(status)) { in TestJB3763()
2467 log_err_status(status, "This resource should be available?\n"); in TestJB3763()
2469 status = U_ZERO_ERROR; in TestJB3763()
2478 UErrorCode status = U_ZERO_ERROR; in TestGetKeywordValues() local
2481 kwVals = ures_getKeywordValues( U_ICUDATA_COLL, "collations", &status); in TestGetKeywordValues()
2485 while((kw=uenum_next(kwVals, NULL, &status))) { in TestGetKeywordValues()
2496 log_err_status(status, "'standard' was not found in the keyword list.\n"); in TestGetKeywordValues()
2499 if(U_FAILURE(status)) { in TestGetKeywordValues()
2500 log_err_status(status, "err %s getting collation values\n", u_errorName(status)); in TestGetKeywordValues()
2502 status = U_ZERO_ERROR; in TestGetKeywordValues()
2505 kwVals = ures_getKeywordValues( "ICUDATA", "calendar", &status); in TestGetKeywordValues()
2509 while((kw=uenum_next(kwVals, NULL, &status))) { in TestGetKeywordValues()
2520 log_err_status(status, "'japanese' was not found in the calendar keyword list.\n"); in TestGetKeywordValues()
2523 if(U_FAILURE(status)) { in TestGetKeywordValues()
2524 log_err_status(status, "err %s getting calendar values\n", u_errorName(status)); in TestGetKeywordValues()
2537 UErrorCode status = U_ZERO_ERROR; in TestGetFunctionalEquivalentOf() local
2541 &gotAvail, truncate, &status); in TestGetFunctionalEquivalentOf()
2542 if(U_FAILURE(status) || (len <= 0)) { in TestGetFunctionalEquivalentOf()
2543 log_err_status(status, "FAIL: got len %d, err %s on #%d: %c\t%s\t%s\n", in TestGetFunctionalEquivalentOf()
2544 len, u_errorName(status), in TestGetFunctionalEquivalentOf()
2633 UErrorCode status = U_ZERO_ERROR; in TestGetFunctionalEquivalent() local
2638 &gotAvail, FALSE, &status); in TestGetFunctionalEquivalent()
2640 if(status == U_MISSING_RESOURCE_ERROR) { in TestGetFunctionalEquivalent()
2644 equivLocale, gotAvail?'t':'f', u_errorName(status)); in TestGetFunctionalEquivalent()
2651 UErrorCode status = U_ZERO_ERROR; in TestXPath() local
2658 const char *testdatapath=loadTestData(&status); in TestXPath()
2659 if(U_FAILURE(status)) in TestXPath()
2661 log_data_err("Could not load testdata.dat %s \n",myErrorName(status)); in TestXPath()
2667 rb = ures_open(testdatapath, "te_IN", &status); in TestXPath()
2668 if(U_FAILURE(status)) { in TestXPath()
2669 log_err("Could not open te_IN (%s)\n", myErrorName(status)); in TestXPath()
2672 alias = ures_getByKey(rb, "rootAliasClient", alias, &status); in TestXPath()
2673 if(U_FAILURE(status)) { in TestXPath()
2674 log_err("Couldn't find the aliased resource (%s)\n", myErrorName(status)); in TestXPath()
2679 result = tres_getString(alias, -1, NULL, &len, &status); in TestXPath()
2680 if(U_FAILURE(status) || result == NULL || u_strcmp(result, expResult)) { in TestXPath()
2681 log_err("Couldn't get correct string value (%s)\n", myErrorName(status)); in TestXPath()
2684 alias = ures_getByKey(rb, "aliasClient", alias, &status); in TestXPath()
2685 if(U_FAILURE(status)) { in TestXPath()
2686 log_err("Couldn't find the aliased resource (%s)\n", myErrorName(status)); in TestXPath()
2691 result = tres_getString(alias, -1, NULL, &len, &status); in TestXPath()
2692 if(U_FAILURE(status) || result == NULL || u_strcmp(result, expResult)) { in TestXPath()
2693 log_err("Couldn't get correct string value (%s)\n", myErrorName(status)); in TestXPath()
2696 alias = ures_getByKey(rb, "nestedRootAliasClient", alias, &status); in TestXPath()
2697 if(U_FAILURE(status)) { in TestXPath()
2698 log_err("Couldn't find the aliased resource (%s)\n", myErrorName(status)); in TestXPath()
2703 result = tres_getString(alias, -1, NULL, &len, &status); in TestXPath()
2704 if(U_FAILURE(status) || result == NULL || u_strcmp(result, expResult)) { in TestXPath()
2705 log_err("Couldn't get correct string value (%s)\n", myErrorName(status)); in TestXPath()
2712 UErrorCode status = U_ZERO_ERROR; in TestCLDRStyleAliases() local
2719 const char *testdatapath=loadTestData(&status); in TestCLDRStyleAliases()
2720 if(U_FAILURE(status)) { in TestCLDRStyleAliases()
2721 log_data_err("Could not load testdata.dat %s \n",myErrorName(status)); in TestCLDRStyleAliases()
2726 rb = ures_open(testdatapath, "te_IN_REVISED", &status); in TestCLDRStyleAliases()
2727 if(U_FAILURE(status)) { in TestCLDRStyleAliases()
2728 log_err("Could not open te_IN (%s)\n", myErrorName(status)); in TestCLDRStyleAliases()
2731 alias = ures_getByKey(rb, "a", alias, &status); in TestCLDRStyleAliases()
2732 if(U_FAILURE(status)) { in TestCLDRStyleAliases()
2733 log_err("Couldn't find the aliased with name \"a\" resource (%s)\n", myErrorName(status)); in TestCLDRStyleAliases()
2742 a = ures_getByKeyWithFallback(alias, resource, a, &status); in TestCLDRStyleAliases()
2743 result = tres_getString(a, -1, NULL, &len, &status); in TestCLDRStyleAliases()
2745 if(U_FAILURE(status) || !result || u_strcmp(result, expected)) { in TestCLDRStyleAliases()
2746 … name \"%s\" resource, exp %s, got %S (%s)\n", resource, expects[i], result, myErrorName(status)); in TestCLDRStyleAliases()
2747 status = U_ZERO_ERROR; in TestCLDRStyleAliases()
2757 UErrorCode status = U_ZERO_ERROR; in TestFallbackCodes() local
2758 const char *testdatapath=loadTestData(&status); in TestFallbackCodes()
2760 UResourceBundle *res = ures_open(testdatapath, "te_IN", &status); in TestFallbackCodes()
2764 r = ures_getByKey(res, "tagged_array_in_Root_te_te_IN", r, &status); in TestFallbackCodes()
2766 status = U_ZERO_ERROR; in TestFallbackCodes()
2767 fall = ures_getByKeyWithFallback(r, "tag2", fall, &status); in TestFallbackCodes()
2769 if(status != U_ZERO_ERROR) { in TestFallbackCodes()
2770 log_data_err("Expected error code to be U_ZERO_ERROR, got %s\n", u_errorName(status)); in TestFallbackCodes()
2771 status = U_ZERO_ERROR; in TestFallbackCodes()
2774 fall = ures_getByKeyWithFallback(r, "tag7", fall, &status); in TestFallbackCodes()
2776 if(status != U_USING_FALLBACK_WARNING) { in TestFallbackCodes()
2777 … log_data_err("Expected error code to be U_USING_FALLBACK_WARNING, got %s\n", u_errorName(status)); in TestFallbackCodes()
2779 status = U_ZERO_ERROR; in TestFallbackCodes()
2781 fall = ures_getByKeyWithFallback(r, "tag1", fall, &status); in TestFallbackCodes()
2783 if(status != U_USING_DEFAULT_WARNING) { in TestFallbackCodes()
2784 … log_data_err("Expected error code to be U_USING_DEFAULT_WARNING, got %s\n", u_errorName(status)); in TestFallbackCodes()
2786 status = U_ZERO_ERROR; in TestFallbackCodes()
2820 UErrorCode *status) { in tres_getString() argument
2833 s16 = ures_getStringByIndex(resB, index, length, status); in tres_getString()
2835 s16 = ures_getStringByKey(resB, key, length, status); in tres_getString()
2837 s16 = ures_getString(resB, length, status); in tres_getString()
2839 if(U_FAILURE(*status)) { in tres_getString()
2849 s8 = ures_getUTF8StringByIndex(resB, index, p8, &length8, forceCopy, status); in tres_getString()
2851 s8 = ures_getUTF8StringByKey(resB, key, p8, &length8, forceCopy, status); in tres_getString()
2853 s8 = ures_getUTF8String(resB, p8, &length8, forceCopy, status); in tres_getString()
2855 if(*status == U_INVALID_CHAR_FOUND) { in tres_getString()
2859 if(*status == U_BUFFER_OVERFLOW_ERROR) { in tres_getString()
2860 *status = U_ZERO_ERROR; in tres_getString()
2866 s8 = ures_getUTF8StringByIndex(resB, index, p8, &length8, forceCopy, status); in tres_getString()
2868 s8 = ures_getUTF8StringByKey(resB, key, p8, &length8, forceCopy, status); in tres_getString()
2870 s8 = ures_getUTF8String(resB, p8, &length8, forceCopy, status); in tres_getString()
2873 if(U_FAILURE(*status)) { in tres_getString()
2935 UErrorCode status; in TestGetUTF8String() local
2937 status = U_ZERO_ERROR; in TestGetUTF8String()
2938 testdatapath = loadTestData(&status); in TestGetUTF8String()
2939 if(U_FAILURE(status)) { in TestGetUTF8String()
2940 log_data_err("Could not load testdata.dat - %s\n", u_errorName(status)); in TestGetUTF8String()
2944 res = ures_open(testdatapath, "", &status); in TestGetUTF8String()
2945 if(U_FAILURE(status)) { in TestGetUTF8String()
2946 log_err("Unable to ures_open(testdata, \"\") - %s\n", u_errorName(status)); in TestGetUTF8String()
2951 status = U_ZERO_ERROR; in TestGetUTF8String()
2953 s8 = ures_getUTF8StringByKey(res, "string_only_in_Root", buffer8, &length8, FALSE, &status); in TestGetUTF8String()
2954 if(status != U_ZERO_ERROR) { in TestGetUTF8String()
2955 …log_err("ures_getUTF8StringByKey(testdata/root string) malfunctioned - %s\n", u_errorName(status)); in TestGetUTF8String()
2959 status = U_ZERO_ERROR; in TestGetUTF8String()
2961 s8 = ures_getUTF8StringByKey(res, "string_only_in_Root", buffer8, &length8, FALSE, &status); in TestGetUTF8String()
2962 if(status != U_ILLEGAL_ARGUMENT_ERROR) { in TestGetUTF8String()
2963 log_err("ures_getUTF8StringByKey(capacity<0) malfunctioned - %s\n", u_errorName(status)); in TestGetUTF8String()
2967 status = U_ZERO_ERROR; in TestGetUTF8String()
2969 s8 = ures_getUTF8StringByKey(res, "string_only_in_Root", NULL, &length8, FALSE, &status); in TestGetUTF8String()
2970 if(status != U_ILLEGAL_ARGUMENT_ERROR) { in TestGetUTF8String()
2971 …log_err("ures_getUTF8StringByKey(dest=NULL capacity>0) malfunctioned - %s\n", u_errorName(status)); in TestGetUTF8String()
2983 UErrorCode status = U_ZERO_ERROR; in TestCLDRVersion() local
2989 ulocdata_getCLDRVersion(cldrVersion, &status); in TestCLDRVersion()
2990 if(U_FAILURE(status)) { in TestCLDRVersion()
2992 log_err_status(status, "FAIL: ulocdata_getCLDRVersion() returned %s\n", u_errorName(status)); in TestCLDRVersion()
3005 status = U_ZERO_ERROR; in TestCLDRVersion()
3006 testdatapath = loadTestData(&status); in TestCLDRVersion()
3007 if(U_FAILURE(status)) { in TestCLDRVersion()
3008 log_data_err("Could not load testdata.dat - %s\n", u_errorName(status)); in TestCLDRVersion()
3012 res = ures_openDirect(testdatapath, "root", &status); in TestCLDRVersion()
3013 if(U_FAILURE(status)) { in TestCLDRVersion()
3014 log_err("Unable to ures_open(testdata, \"\") - %s\n", u_errorName(status in TestCLDRVersion()
3018 ures_getVersionByKey(res, "ExpectCLDRVersionAtLeast", testExpect, &status); in TestCLDRVersion()
3019 ures_getVersionByKey(res, "CurrentCLDRVersion", testCurrent, &status); in TestCLDRVersion()
3021 if(U_FAILURE(status)) { in TestCLDRVersion()
3022 log_err("Unable to get test data for CLDR version - %s\n", u_errorName(status)); in TestCLDRVersion()
3025 if(U_FAILURE(status)) return; in TestCLDRVersion()