Lines Matching full:status
250 static void checkStatus(int32_t line, UErrorCode expected, UErrorCode status) { in checkStatus() argument
251 if(U_FAILURE(status)) { in checkStatus()
254 if(status != expected) { in checkStatus()
255 …log_err_status(status, "%s:%d: Expected error code %s, got error code %s\n", __FILE__, line, u_err… in checkStatus()
260 UErrorCode status = U_USING_DEFAULT_WARNING; in TestErrorCodes() local
266 r = ures_open(NULL, "ti_ER_ASSAB", &status); in TestErrorCodes()
267 checkStatus(__LINE__, U_USING_FALLBACK_WARNING, status); in TestErrorCodes()
270 /* this bundle should return zero error, so it shouldn't change the status */ in TestErrorCodes()
271 status = U_USING_DEFAULT_WARNING; in TestErrorCodes()
272 r = ures_open(NULL, "ti_ER", &status); in TestErrorCodes()
273 checkStatus(__LINE__, U_USING_DEFAULT_WARNING, status); in TestErrorCodes()
277 if(U_SUCCESS(status) && r != NULL) { in TestErrorCodes()
278 status = U_USING_DEFAULT_WARNING; in TestErrorCodes()
279 … r2 = ures_getByKey(r, "ExemplarCharacters", NULL, &status); /* ExemplarCharacters lives in ti */ in TestErrorCodes()
280 checkStatus(__LINE__, U_USING_FALLBACK_WARNING, status); in TestErrorCodes()
284 /* this bundle should return zero error, so it shouldn't change the status */ in TestErrorCodes()
285 status = U_USING_DEFAULT_WARNING; in TestErrorCodes()
286 r = ures_open(U_ICUDATA_REGION, "ti", &status); in TestErrorCodes()
287 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()
300 r = ures_open(U_ICUDATA_COLL, "sr_YU_VOJVODINA", &status); in TestErrorCodes()
301 checkStatus(__LINE__, U_USING_FALLBACK_WARNING, status); in TestErrorCodes()
304 /* this bundle should return zero error, so it shouldn't change the status */ in TestErrorCodes()
305 status = U_USING_FALLBACK_WARNING; in TestErrorCodes()
306 r = ures_open(U_ICUDATA_COLL, "sr", &status); in TestErrorCodes()
307 checkStatus(__LINE__, U_USING_FALLBACK_WARNING, status); in TestErrorCodes()
310 if(U_SUCCESS(status) && r != NULL) { in TestErrorCodes()
311 status = U_USING_DEFAULT_WARNING; in TestErrorCodes()
312 r2 = ures_getByKey(r, "collations", NULL, &status); in TestErrorCodes()
313 checkStatus(__LINE__, U_USING_DEFAULT_WARNING, status); in TestErrorCodes()
317 /* this bundle should return zero error, so it shouldn't change the status */ in TestErrorCodes()
318 status = U_USING_DEFAULT_WARNING; in TestErrorCodes()
319 r = ures_open(U_ICUDATA_COLL, "sr", &status); in TestErrorCodes()
320 checkStatus(__LINE__, U_USING_DEFAULT_WARNING, status); in TestErrorCodes()
323 if(U_SUCCESS(status) && r != NULL) { in TestErrorCodes()
324 status = U_USING_DEFAULT_WARNING; in TestErrorCodes()
325 r2 = ures_getByKey(r, "collations", r2, &status); in TestErrorCodes()
326 checkStatus(__LINE__, U_USING_DEFAULT_WARNING, status); in TestErrorCodes()
330 status = U_USING_FALLBACK_WARNING; in TestErrorCodes()
331 r = ures_open(U_ICUDATA_COLL, "nolocale", &status); in TestErrorCodes()
332 checkStatus(__LINE__, U_USING_DEFAULT_WARNING, status); in TestErrorCodes()
339 UErrorCode status = U_ZERO_ERROR; in TestAliasConflict() local
349 he = ures_open(NULL, "he", &status); in TestAliasConflict()
350 iw = ures_open(NULL, "iw", &status); in TestAliasConflict()
351 if(U_FAILURE(status)) { in TestAliasConflict()
352 log_err_status(status, "Failed to get resource with %s\n", myErrorName(status)); in TestAliasConflict()
355 result = ures_getStringByKey(he, "ExemplarCharacters", &resultLen, &status); in TestAliasConflict()
356 if(U_FAILURE(status) || result == NULL) { in TestAliasConflict()
357 …log_err_status(status, "Failed to get resource ExemplarCharacters with %s\n", myErrorName(status)); in TestAliasConflict()
363 status = U_ZERO_ERROR; in TestAliasConflict()
364 norway = ures_open(NULL, norwayNames[i], &status); in TestAliasConflict()
365 if(U_FAILURE(status)) { in TestAliasConflict()
366 …log_err_status(status, "Failed to get resource with %s for %s\n", myErrorName(status), norwayNames… in TestAliasConflict()
369 realName = ures_getLocale(norway, &status); in TestAliasConflict()
458 UErrorCode status = U_ZERO_ERROR; in TestNewTypes() local
471 testdatapath=loadTestData(&status); in TestNewTypes()
473 if(U_FAILURE(status)) in TestNewTypes()
475 log_data_err("Could not load testdata.dat %s \n",myErrorName(status)); in TestNewTypes()
479 theBundle = ures_open(testdatapath, "testtypes", &status); in TestNewTypes()
481 empty = tres_getString(theBundle, -1, "emptystring", &len, &status); in TestNewTypes()
486 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestNewTypes()
495 res = ures_getByKey(theBundle, "zerotest", res, &status); in TestNewTypes()
496 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestNewTypes()
498 zeroString=tres_getString(res, -1, NULL, &len, &status); in TestNewTypes()
499 if(U_SUCCESS(status)){ in TestNewTypes()
500 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestNewTypes()
511 res = ures_getByKey(theBundle, "binarytest", res, &status); in TestNewTypes()
512 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestNewTypes()
514 binResult=(uint8_t*)ures_getBinary(res, &len, &status); in TestNewTypes()
515 if(U_SUCCESS(status)){ in TestNewTypes()
516 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestNewTypes()
524 res = ures_getByKey(theBundle, "importtest", res, &status); in TestNewTypes()
525 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestNewTypes()
527 binResult=(uint8_t*)ures_getBinary(res, &len, &status); in TestNewTypes()
528 if(U_SUCCESS(status)){ in TestNewTypes()
529 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestNewTypes()
537 res = ures_getByKey(theBundle, "one", res, &status); in TestNewTypes()
538 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestNewTypes()
540 intResult=ures_getInt(res, &status); in TestNewTypes()
541 uintResult = ures_getUInt(res, &status); in TestNewTypes()
542 if(U_SUCCESS(status)){ in TestNewTypes()
543 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestNewTypes()
549 res = ures_getByKey(theBundle, "minusone", res, &status); in TestNewTypes()
550 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestNewTypes()
552 intResult=ures_getInt(res, &status); in TestNewTypes()
553 uintResult = ures_getUInt(res, &status); in TestNewTypes()
554 if(U_SUCCESS(status)){ in TestNewTypes()
555 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestNewTypes()
562 res = ures_getByKey(theBundle, "plusone", res, &status); in TestNewTypes()
563 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestNewTypes()
565 intResult=ures_getInt(res, &status); in TestNewTypes()
566 uintResult = ures_getUInt(res, &status); in TestNewTypes()
567 if(U_SUCCESS(status)){ in TestNewTypes()
568 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestNewTypes()
573 res = ures_getByKey(theBundle, "onehundredtwentythree", res, &status); in TestNewTypes()
574 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestNewTypes()
576 intResult=ures_getInt(res, &status); in TestNewTypes()
577 if(U_SUCCESS(status)){ in TestNewTypes()
578 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestNewTypes()
584 const UChar* str = tres_getString(theBundle,-1,"testescape",&len,&status); in TestNewTypes()
585 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestNewTypes()
586 if(U_SUCCESS(status)){ in TestNewTypes()
623 got = tres_getString(theBundle,-1,"test_unescaping",&len,&status); in TestNewTypes()
636 status = U_ZERO_ERROR; in TestNewTypes()
640 const UChar* str = tres_getString(theBundle,-1,"test_underscores",&len,&status); in TestNewTypes()
643 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestNewTypes()
655 status = U_ZERO_ERROR; in TestNewTypes()
656 resB = ures_getByKey(theBundle, "collations", resB, &status); in TestNewTypes()
657 resB = ures_getByKey(resB, "standard", resB, &status); in TestNewTypes()
658 str = tres_getString(resB,-1,"Sequence",&strLength,&status); in TestNewTypes()
659 if(!str || U_FAILURE(status)) { in TestNewTypes()
660 log_data_err("Could not load collations from theBundle: %s\n", u_errorName(status)); in TestNewTypes()
679 status = U_ZERO_ERROR; in TestNewTypes()
682 const UChar* str = tres_getString(theBundle, -1, "testincludeUTF",&strLen,&status); in TestNewTypes()
685 if(U_FAILURE(status)){ in TestNewTypes()
686 …rr("Could not get testincludeUTF resource from testtypes bundle. Error: %s\n",u_errorName(status)); in TestNewTypes()
690 UCHARBUF* ucbuf = ucbuf_open(testDataFileName,&cp,FALSE,FALSE,&status); in TestNewTypes()
692 if(U_SUCCESS(status)){ in TestNewTypes()
693 const UChar* buffer = ucbuf_getBuffer(ucbuf,&len,&status); in TestNewTypes()
694 if(U_SUCCESS(status)){ in TestNewTypes()
707 … log_err("ucbuf failed to open %s. Error: %s\n", testDataFileName, u_errorName(status)); in TestNewTypes()
712 …log_err("Could not get riwords.txt (path : %s). Error: %s\n",testDataFileName,u_errorName(status)); in TestNewTypes()
716 status = U_ZERO_ERROR; in TestNewTypes()
719 const UChar* str = tres_getString(theBundle, -1, "testinclude",&strLen,&status); in TestNewTypes()
723 if(U_FAILURE(status)){ in TestNewTypes()
724 …g_err("Could not get testinclude resource from testtypes bundle. Error: %s\n",u_errorName(status)); in TestNewTypes()
728 UCHARBUF* ucbuf = ucbuf_open(testDataFileName,&cp,FALSE,FALSE,&status); in TestNewTypes()
730 if(U_SUCCESS(status)){ in TestNewTypes()
731 const UChar* buffer = ucbuf_getBuffer(ucbuf,&len,&status); in TestNewTypes()
732 if(U_SUCCESS(status)){ in TestNewTypes()
741 … log_err("ucbuf failed to open %s. Error: %s\n", testDataFileName, u_errorName(status)); in TestNewTypes()
745 …("Could not get translit_rules.txt (path : %s). Error: %s\n",testDataFileName,u_errorName(status)); in TestNewTypes()
760 UErrorCode status = U_ZERO_ERROR; in TestEmptyTypes() local
770 testdatapath=loadTestData(&status); in TestEmptyTypes()
771 if(U_FAILURE(status)) in TestEmptyTypes()
773 log_data_err("Could not load testdata.dat %s \n",myErrorName(status)); in TestEmptyTypes()
777 theBundle = ures_open(testdatapath, "testtypes", &status); in TestEmptyTypes()
779 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestEmptyTypes()
787 status = U_ZERO_ERROR; in TestEmptyTypes()
789 res = ures_getByKey(theBundle, "emptyexplicitstring", res, &status); in TestEmptyTypes()
790 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestEmptyTypes()
792 zeroString=tres_getString(res, -1, NULL, &len, &status); in TestEmptyTypes()
793 if(U_SUCCESS(status)){ in TestEmptyTypes()
794 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestEmptyTypes()
802 status = U_ZERO_ERROR; in TestEmptyTypes()
804 res = ures_getByKey(theBundle, "emptystring", res, &status); in TestEmptyTypes()
805 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestEmptyTypes()
807 zeroString=tres_getString(res, -1, NULL, &len, &status); in TestEmptyTypes()
808 if(U_SUCCESS(status)){ in TestEmptyTypes()
809 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestEmptyTypes()
817 status = U_ZERO_ERROR; in TestEmptyTypes()
819 res = ures_getByKey(theBundle, "emptyint", res, &status); in TestEmptyTypes()
820 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestEmptyTypes()
822 intResult=ures_getInt(res, &status); in TestEmptyTypes()
823 if(U_SUCCESS(status)){ in TestEmptyTypes()
824 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestEmptyTypes()
831 status = U_ZERO_ERROR; in TestEmptyTypes()
833 res = ures_getByKey(theBundle, "emptyintv", res, &status); in TestEmptyTypes()
834 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestEmptyTypes()
837 if(U_FAILURE(status)){ in TestEmptyTypes()
838 log_err("Couldn't get emptyintv key %s\n", u_errorName(status)); in TestEmptyTypes()
841 zeroIntVect=ures_getIntVector(res, &len, &status); in TestEmptyTypes()
843 if(!U_SUCCESS(status) || resArray != NULL || len != 0) { in TestEmptyTypes()
848 status = U_ZERO_ERROR; in TestEmptyTypes()
850 res = ures_getByKey(theBundle, "emptybin", res, &status); in TestEmptyTypes()
851 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestEmptyTypes()
854 if(U_FAILURE(status)){ in TestEmptyTypes()
855 log_err("Couldn't get emptybin key %s\n", u_errorName(status)); in TestEmptyTypes()
858 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()
927 UErrorCode status=U_ZERO_ERROR; in TestBinaryCollationData() local
939 testdatapath=loadTestData(&status); in TestBinaryCollationData()
940 if(U_FAILURE(status)) in TestBinaryCollationData()
942 log_data_err("Could not load testdata.dat %s \n",myErrorName(status)); in TestBinaryCollationData()
947 teRes=ures_open(testdatapath, locale, &status); in TestBinaryCollationData()
948 if(U_FAILURE(status)){ in TestBinaryCollationData()
949 log_err("ERROR: Failed to get resource for \"te\" with %s", myErrorName(status)); in TestBinaryCollationData()
952 status=U_ZERO_ERROR; in TestBinaryCollationData()
953 coll = ures_getByKey(teRes, "collations", coll, &status); in TestBinaryCollationData()
954 coll = ures_getByKey(coll, "standard", coll, &status); in TestBinaryCollationData()
955 if(U_SUCCESS(status)){ in TestBinaryCollationData()
956 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestBinaryCollationData()
958 binColl=ures_getByKey(coll, "%%CollationBin", binColl, &status); in TestBinaryCollationData()
959 if(U_SUCCESS(status)){ in TestBinaryCollationData()
960 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestBinaryCollationData()
962 binResult=(uint8_t*)ures_getBinary(binColl, &len, &status); in TestBinaryCollationData()
964 if(U_SUCCESS(status)){ in TestBinaryCollationData()
965 CONFIRM_ErrorCode(status, U_ZERO_ERROR); in TestBinaryCollationData()
984 UErrorCode status=U_ZERO_ERROR; in TestAPI() local
998 testdatapath=loadTestData(&status); in TestAPI()
999 if(U_FAILURE(status)) in TestAPI()
1001 log_data_err("Could not load testdata.dat %s \n",myErrorName(status)); in TestAPI()
1024 status = U_ZERO_ERROR; in TestAPI()
1025 ures_close(ures_openU(largeBuffer, "root", &status)); in TestAPI()
1026 if(status != U_ILLEGAL_ARGUMENT_ERROR){ in TestAPI()
1027 …r("ERROR: ures_openU() worked when the path is very large. It returned %s\n", myErrorName(status)); in TestAPI()
1030 status = U_ZERO_ERROR; in TestAPI()
1031 ures_close(ures_openU(NULL, "root", &status)); in TestAPI()
1032 if(U_FAILURE(status)){ in TestAPI()
1033 … log_err_status(status, "ERROR: ures_openU() failed path = NULL with %s\n", myErrorName(status)); in TestAPI()
1036 status = U_ILLEGAL_ARGUMENT_ERROR; in TestAPI()
1037 if(ures_openU(NULL, "root", &status) != NULL){ in TestAPI()
1038 log_err("ERROR: ures_openU() worked with error status with %s\n", myErrorName(status)); in TestAPI()
1041 status = U_ZERO_ERROR; in TestAPI()
1042 teRes=ures_openU(utestdatapath, "te", &status); in TestAPI()
1043 if(U_FAILURE(status)){ in TestAPI()
1044 …log_err_status(status, "ERROR: ures_openU() failed path =%s with %s\n", austrdup(utestdatapath), m… in TestAPI()
1049 if(strcmp(ures_getLocale(teRes, &status), "te") != 0){ in TestAPI()
1050 …err("ERROR: ures_getLocale() failed. Expected = te_TE Got = %s\n", ures_getLocale(teRes, &status)); in TestAPI()
1053 teFillin=ures_getByKey(teRes, "tagged_array_in_te_te_IN", teFillin, &status); in TestAPI()
1055 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()
1171 /*Test ures_openU with status != U_ZERO_ERROR*/ in TestErrorConditions()
1172 log_verbose("Testing ures_openU() with status != U_ZERO_ERROR.....\n"); 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()
1176 …log_verbose("ures_openU() failed as expected path =%s with status != U_ZERO_ERROR\n", testdatapath… in TestErrorConditions()
1178 …log_err("ERROR: ures_openU() is supposed to fail path =%s with status != U_ZERO_ERROR\n", austrdup… 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()
1189 /*Test ures_getLocale() with status != U_ZERO_ERROR*/ 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()
1239 /*Test ures_getByKey() with status != U_ZERO_ERROR*/ 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()
1250 /*Test ures_getStringByKey() with status != U_ZERO_ERROR*/ in TestErrorConditions()
1251 if(ures_getStringByKey(teRes, "string_only_in_te", &len, &status) != NULL){ in TestErrorConditions()
1252 …log_err("ERROR: ures_getStringByKey is supposed to fail when status != U_ZERO_ERROR. Expected: err… 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()
1261 /*Test ures_getString() with status != U_ZERO_ERROR*/ in TestErrorConditions()
1262 if(ures_getString(teRes, &len, &status) != NULL){ in TestErrorConditions()
1263 …log_err("ERROR: ures_getString is supposed to fail when status != U_ZERO_ERROR. Expected: errorCod… 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()
1272 /*Test ures_getBinary(0 status != U_ILLEGAL_ARGUMENT_ERROR*/ 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()
1281 log_err("ERROR: ures_getBinary() with status != U_ZERO_ERROR is supposed to fail\n"); in TestErrorConditions()
1284 /*Test ures_getNextResource() with status != U_ZERO_ERROR*/ 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()
1357 /*Test ures_getInt() where status != U_ZERO_ERROR */ 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()
1415 UErrorCode status= U_ZERO_ERROR; in TestGetVersionColl() local
1425 resB = ures_open(U_ICUDATA_COLL,locName, &status); in TestGetVersionColl()
1426 rules = tres_getString(resB,-1,"UCARules",&len, &status); in TestGetVersionColl()
1427 if(!rules || U_FAILURE(status)) { in TestGetVersionColl()
1429 status = U_ZERO_ERROR; in TestGetVersionColl()
1436 locs = ures_openAvailableLocales(U_ICUDATA_COLL, &status); in TestGetVersionColl()
1437 if (U_FAILURE(status)) { in TestGetVersionColl()
1438 … log_err_status(status, "enumeration of %s failed.: %s\n", U_ICUDATA_COLL, myErrorName(status)); in TestGetVersionColl()
1444 resB = ures_open(U_ICUDATA_COLL,locName, &status); in TestGetVersionColl()
1445 if (U_FAILURE(status)) { in TestGetVersionColl()
1446 …rce bundle creation for locale %s:%s failed.: %s\n", U_ICUDATA_COLL, locName, myErrorName(status)); in TestGetVersionColl()
1461 locName = uenum_next(locs, &locLen, &status); in TestGetVersionColl()
1462 if(U_FAILURE(status)) { in TestGetVersionColl()
1463 log_err("uenum_next(locs) error %s\n", u_errorName(status)); in TestGetVersionColl()
1476 UErrorCode status = U_ZERO_ERROR; in TestResourceBundles() local
1477 loadTestData(&status); in TestResourceBundles()
1478 if(U_FAILURE(status)) { in TestResourceBundles()
1479 log_data_err("Could not load testdata.dat, status = %s\n", u_errorName(status)); in TestResourceBundles()
1501 UErrorCode status= U_ZERO_ERROR; in TestConstruction1() local
1518 testdatapath=loadTestData(&status); in TestConstruction1()
1519 if(U_FAILURE(status)) in TestConstruction1()
1521 log_data_err("Could not load testdata.dat %s \n",myErrorName(status)); in TestConstruction1()
1527 empty = ures_open(testdatapath, "testempty", &status); in TestConstruction1()
1528 if(empty == NULL || U_FAILURE(status)) { in TestConstruction1()
1537 log_err("construction of NULL did not succeed : %s \n", myErrorName(status)); in TestConstruction1()
1543 log_err("construction of %s did not succeed : %s \n", locale, myErrorName(status)); in TestConstruction1()
1549 log_err("Something threw an error in TestConstruction(): %s\n", myErrorName(status)); in TestConstruction1()
1597 UErrorCode expected_status,status = U_ZERO_ERROR,expected_resource_status = U_ZERO_ERROR; in testTag() local
1617 testdatapath = loadTestData(&status); in testTag()
1618 if(U_FAILURE(status)) in testTag()
1620 log_data_err("Could not load testdata.dat %s \n",myErrorName(status)); in testTag()
1636 status = U_ZERO_ERROR; in testTag()
1638 theBundle = ures_open(testdatapath, param[i].name, &status); in testTag()
1639 CONFIRM_ErrorCode(status,param[i].expected_constructor_status); in testTag()
1711 status = U_ZERO_ERROR; in testTag()
1714 string=tres_getString(theBundle, -1, tag, &len, &status); in testTag()
1715 if(U_SUCCESS(status)) { in testTag()
1724 log_verbose("%s got %d, expected %d\n", action, status, expected_resource_status); in testTag()
1726 CONFIRM_ErrorCode(status, expected_resource_status); in testTag()
1744 status = U_ZERO_ERROR; in testTag()
1745 array=ures_getByKey(theBundle, tag, array, &status); in testTag()
1746 CONFIRM_ErrorCode(status,expected_resource_status); in testTag()
1747 if (U_SUCCESS(status)) { in testTag()
1758 arrayItem1=ures_getNextResource(array, arrayItem1, &status); in testTag()
1759 if(U_SUCCESS(status)){ in testTag()
1760 CONFIRM_EQ(tres_getString(arrayItem1, -1, NULL, &len, &status),expected_string); in testTag()
1767 CONFIRM_ErrorCode(status, U_MISSING_RESOURCE_ERROR); in testTag()
1785 status = U_ZERO_ERROR; in testTag()
1787 array=ures_getByKey(theBundle, tag, array, &status); in testTag()
1788 if(!U_FAILURE(status)){ in testTag()
1790 t=(UChar*)ures_getStringByIndex(array, idx, &len, &status); in testTag()
1791 if(!U_FAILURE(status)){ in testTag()
1803 CONFIRM_ErrorCode(status,expected_status); in testTag()
1822 status = U_ZERO_ERROR; in testTag()
1823 array2d=ures_getByKey(theBundle, tag, array2d, &status); in testTag()
1825 CONFIRM_ErrorCode(status,expected_resource_status); in testTag()
1826 if (U_SUCCESS(status)) in testTag()
1835 tableRow=ures_getByIndex(array2d, row, tableRow, &status); in testTag()
1836 CONFIRM_ErrorCode(status, expected_resource_status); in testTag()
1837 if(U_SUCCESS(status)){ in testTag()
1850 arrayItem1=ures_getNextResource(tableRow, arrayItem1, &status); in testTag()
1851 if(U_SUCCESS(status)){ in testTag()
1852 … const UChar *stringValue=tres_getString(arrayItem1, -1, NULL, &len, &status); in testTag()
1872 status = U_ZERO_ERROR; in testTag()
1875 array2d=ures_getByKey(theBundle, tag, array2d, &status); in testTag()
1876 if(U_SUCCESS(status)){ in testTag()
1878 tableRow=ures_getByIndex(array2d, row, tableRow, &status); in testTag()
1879 if(U_SUCCESS(status)) { in testTag()
1881 t=(UChar*)ures_getStringByIndex(tableRow, col, &len, &status); in testTag()
1882 if(U_SUCCESS(status)){ in testTag()
1890 CONFIRM_ErrorCode(status,expected_status); in testTag()
1892 if (U_SUCCESS(status)){ in testTag()
1917 status = U_ZERO_ERROR; in testTag()
1919 tags=ures_getByKey(theBundle, tag, tags, &status); in testTag()
1920 CONFIRM_ErrorCode(status, expected_resource_status); in testTag()
1921 if (U_SUCCESS(status)) { in testTag()
1932 tagelement=ures_getByIndex(tags, idx, tagelement, &status); in testTag()
1934 value=(UChar*)ures_getNextString(tagelement, &len, &key, &status); in testTag()
1952 status = U_ZERO_ERROR; in testTag()
1956 tags=ures_getByKey(theBundle, tag, tags, &status); in testTag()
1957 if(U_SUCCESS(status)){ in testTag()
1960 tagelement=ures_getByKey(tags, item_tag, tagelement, &status); in testTag()
1961 if(!U_FAILURE(status)){ in testTag()
1969 t=(UChar*)tres_getString(tagelement, -1, NULL, &len, &status); in testTag()
1970 if(!U_FAILURE(status)){ in testTag()
1975 CONFIRM_ErrorCode(status,U_MISSING_RESOURCE_ERROR); in testTag()
1978 if (status != U_MISSING_RESOURCE_ERROR) { in testTag()
2016 UErrorCode status = U_ZERO_ERROR; in TestPreventFallback() local
2019 testdatapath=loadTestData(&status); in TestPreventFallback()
2020 if(U_FAILURE(status)) in TestPreventFallback()
2022 log_data_err("Could not load testdata.dat %s \n",myErrorName(status)); in TestPreventFallback()
2028 theBundle = ures_open(testdatapath, "te_IN_NE", &status); in TestPreventFallback()
2029 if(U_FAILURE(status)) in TestPreventFallback()
2031 log_data_err("Could not open resource bundle te_IN_NE %s \n",myErrorName(status)); in TestPreventFallback()
2036 …ures_getStringByKeyWithFallback(theBundle, "string_in_te_no_te_IN_fallback", &unused_len, &status); in TestPreventFallback()
2037 if (status != U_MISSING_RESOURCE_ERROR) in TestPreventFallback()
2041 status = U_ZERO_ERROR; in TestPreventFallback()
2044 ures_getStringByKeyWithFallback(theBundle, "string_only_in_te", &unused_len, &status); in TestPreventFallback()
2045 if(U_FAILURE(status)) in TestPreventFallback()
2047 log_err("Expected to find string_only_in_te %s \n",myErrorName(status)); in TestPreventFallback()
2049 status = U_ZERO_ERROR; in TestPreventFallback()
2053 theBundle = ures_open(testdatapath, "te", &status); in TestPreventFallback()
2054 if(U_FAILURE(status)) in TestPreventFallback()
2056 log_data_err("Could not open resource bundle te_IN_NE %s \n",myErrorName(status)); in TestPreventFallback()
2059 …ures_getStringByKeyWithFallback(theBundle, "string_in_te_no_te_IN_fallback", &unused_len, &status); in TestPreventFallback()
2060 if(U_FAILURE(status)) in TestPreventFallback()
2062 log_err("Expected to find string_in_te_no_te_IN_fallback %s \n",myErrorName(status)); in TestPreventFallback()
2064 status = U_ZERO_ERROR; in TestPreventFallback()
2075 UErrorCode status = U_ZERO_ERROR; in TestFallback() local
2082 fr_FR = ures_open(NULL, "fr_FR", &status); in TestFallback()
2083 if(U_FAILURE(status)) in TestFallback()
2085 log_err_status(status, "Couldn't open fr_FR - %s\n", u_errorName(status)); in TestFallback()
2089 status = U_ZERO_ERROR; in TestFallback()
2093 junk = tres_getString(fr_FR, -1, "LocaleID", &resultLen, &status); in TestFallback()
2094 status = U_ZERO_ERROR; in TestFallback()
2095 junk = tres_getString(fr_FR, -1, "LocaleString", &resultLen, &status); in TestFallback()
2096 status = U_ZERO_ERROR; in TestFallback()
2097 junk = tres_getString(fr_FR, -1, "LocaleID", &resultLen, &status); in TestFallback()
2098 status = U_ZERO_ERROR; in TestFallback()
2102 subResource = ures_getByKey(fr_FR, "layout", NULL, &status); in TestFallback()
2103 if(status != U_USING_DEFAULT_WARNING) in TestFallback()
2106 u_errorName(status)); in TestFallback()
2109 status = U_ZERO_ERROR; in TestFallback()
2113 junk = tres_getString(fr_FR, -1, "ExemplarCharacters", &resultLen, &status); in TestFallback()
2114 if(status != U_USING_FALLBACK_WARNING) in TestFallback()
2117 status); in TestFallback()
2120 status = U_ZERO_ERROR; in TestFallback()
2168 UErrorCode status = U_ZERO_ERROR; in TestResourceLevelAliasing() local
2178 testdatapath=loadTestData(&status); in TestResourceLevelAliasing()
2179 if(U_FAILURE(status)) in TestResourceLevelAliasing()
2181 log_data_err("Could not load testdata.dat %s \n",myErrorName(status)); in TestResourceLevelAliasing()
2185 aliasB = ures_open(testdatapath, "testaliases", &status); in TestResourceLevelAliasing()
2187 if(U_FAILURE(status)) in TestResourceLevelAliasing()
2189 log_data_err("Could not load testaliases.res %s \n",myErrorName(status)); in TestResourceLevelAliasing()
2193 tb = ures_getByKey(aliasB, "aaa", tb, &status); in TestResourceLevelAliasing()
2194 if(status != U_TOO_MANY_ALIASES_ERROR) { in TestResourceLevelAliasing()
2198 status = U_ZERO_ERROR; in TestResourceLevelAliasing()
2200 tb = ures_getByKey(aliasB, "aab", tb, &status); in TestResourceLevelAliasing()
2201 if(status != U_TOO_MANY_ALIASES_ERROR) { in TestResourceLevelAliasing()
2204 status = U_ZERO_ERROR; in TestResourceLevelAliasing()
2206 if(U_FAILURE(status) ) { in TestResourceLevelAliasing()
2210 tb = ures_getByKey(aliasB, "nonexisting", tb, &status); in TestResourceLevelAliasing()
2211 if(status != U_MISSING_RESOURCE_ERROR) { in TestResourceLevelAliasing()
2214 status = U_ZERO_ERROR; in TestResourceLevelAliasing()
2217 uk = ures_findResource("ja/calendar/gregorian/DateTimePatterns/2", uk, &status); in TestResourceLevelAliasing()
2218 if((uk == NULL) || U_FAILURE(status)) { in TestResourceLevelAliasing()
2219 …log_err_status(status, "Couldn't findResource('ja/calendar/gregorian/DateTimePatterns/2') err %s\n… in TestResourceLevelAliasing()
2223 sequence = tres_getString(uk, -1, NULL, &seqLen, &status); in TestResourceLevelAliasing()
2225 tb = ures_getByKey(aliasB, "referencingalias", tb, &status); in TestResourceLevelAliasing()
2226 string = tres_getString(tb, -1, NULL, &strLen, &status); in TestResourceLevelAliasing()
2232 string = tres_getString(aliasB, -1, "referencingalias", &strLen, &status); in TestResourceLevelAliasing()
2237 checkStatus(__LINE__, U_ZERO_ERROR, status); in TestResourceLevelAliasing()
2238 tb = ures_getByKey(aliasB, "DateTimePatterns", tb, &status); in TestResourceLevelAliasing()
2239 checkStatus(__LINE__, U_ZERO_ERROR, status); in TestResourceLevelAliasing()
2240 tb = ures_getByIndex(tb, 2, tb, &status); in TestResourceLevelAliasing()
2241 checkStatus(__LINE__, U_ZERO_ERROR, status); in TestResourceLevelAliasing()
2242 string = tres_getString(tb, -1, NULL, &strLen, &status); in TestResourceLevelAliasing()
2243 checkStatus(__LINE__, U_ZERO_ERROR, status); in TestResourceLevelAliasing()
2245 if(U_FAILURE(status)) { in TestResourceLevelAliasing()
2246 log_err("%s trying to get string via separate getters\n", u_errorName(status)); in TestResourceLevelAliasing()
2252 testtypes = ures_open(testdatapath, "testtypes", &status); in TestResourceLevelAliasing()
2255 uk = ures_findSubResource(testtypes, s, uk, &status); in TestResourceLevelAliasing()
2256 sequence = tres_getString(uk, -1, NULL, &seqLen, &status); in TestResourceLevelAliasing()
2258 tb = ures_getByKey(aliasB, "simplealias", tb, &status); in TestResourceLevelAliasing()
2259 string = tres_getString(tb, -1, NULL, &strLen, &status); in TestResourceLevelAliasing()
2261 if(U_FAILURE(status) || seqLen != strLen || u_strncmp(sequence, string, seqLen) != 0) { in TestResourceLevelAliasing()
2267 tb = ures_getByKey(aliasB, "zoneTests", tb, &status); in TestResourceLevelAliasing()
2268 tb = ures_getByKey(tb, "zoneAlias2", tb, &status); in TestResourceLevelAliasing()
2269 string = tres_getString(tb, -1, NULL, &strLen, &status); in TestResourceLevelAliasing()
2271 en = ures_findResource("/ICUDATA-zone/en/zoneStrings/3/0", en, &status); in TestResourceLevelAliasing()
2272 sequence = tres_getString(en, -1, NULL, &seqLen, &status); in TestResourceLevelAliasing()
2274 if(U_FAILURE(status) || seqLen != strLen || u_strncmp(sequence, string, seqLen) != 0) { in TestResourceLevelAliasing()
2298 tb = ures_getByKey(aliasB, "testGetStringByKeyAliasing", tb, &status); in TestResourceLevelAliasing()
2299 if(U_FAILURE(status)) { in TestResourceLevelAliasing()
2300 … log_err("FAIL: Couldn't get testGetStringByKeyAliasing resource: %s\n", u_errorName(status)); in TestResourceLevelAliasing()
2303 result = tres_getString(tb, -1, keys[i], &resultLen, &status); in TestResourceLevelAliasing()
2304 if(U_FAILURE(status)){ in TestResourceLevelAliasing()
2305 …log_err("(1) Fetching the resource with key %s failed. Error: %s\n", keys[i], u_errorName(status)); in TestResourceLevelAliasing()
2314 result = tres_getString(tb, i, NULL, &resultLen, &status); in TestResourceLevelAliasing()
2315 if(U_FAILURE(status)){ in TestResourceLevelAliasing()
2316 …log_err("(2) Fetching the resource with key %s failed. Error: %s\n", keys[i], u_errorName(status)); in TestResourceLevelAliasing()
2325 result = ures_getNextString(tb, &resultLen, &key, &status); in TestResourceLevelAliasing()
2326 if(U_FAILURE(status)){ in TestResourceLevelAliasing()
2327 …log_err("(3) Fetching the resource with key %s failed. Error: %s\n", keys[i], u_errorName(status)); in TestResourceLevelAliasing()
2336 tb = ures_getByKey(aliasB, "testGetStringByIndexAliasing", tb, &status); in TestResourceLevelAliasing()
2337 if(U_FAILURE(status)) { in TestResourceLevelAliasing()
2338 … log_err("FAIL: Couldn't get testGetStringByIndexAliasing resource: %s\n", u_errorName(status)); in TestResourceLevelAliasing()
2341 result = tres_getString(tb, i, NULL, &resultLen, &status); in TestResourceLevelAliasing()
2342 if(U_FAILURE(status)){ in TestResourceLevelAliasing()
2343 … log_err("Fetching the resource with key %s failed. Error: %s\n", keys[i], u_errorName(status)); in TestResourceLevelAliasing()
2352 result = ures_getNextString(tb, &resultLen, &key, &status); in TestResourceLevelAliasing()
2353 if(U_FAILURE(status)){ in TestResourceLevelAliasing()
2354 … log_err("Fetching the resource with key %s failed. Error: %s\n", keys[i], u_errorName(status)); in TestResourceLevelAliasing()
2364 tb = ures_getByKey(aliasB, "testAliasToTree", tb, &status); in TestResourceLevelAliasing()
2365 if(U_FAILURE(status)){ in TestResourceLevelAliasing()
2366 …err("Fetching the resource with key \"testAliasToTree\" failed. Error: %s\n", u_errorName(status)); in TestResourceLevelAliasing()
2381 UErrorCode status = U_ZERO_ERROR; in TestDirectAccess() local
2387 /*const char* testdatapath=loadTestData(&status); in TestDirectAccess()
2388 if(U_FAILURE(status)){ in TestDirectAccess()
2389 log_err("Could not load testdata.dat %s \n",myErrorName(status)); in TestDirectAccess()
2393 t = ures_findResource("/testdata/te/zoneStrings/3/2", t, &status); in TestDirectAccess()
2394 if(U_FAILURE(status)) { in TestDirectAccess()
2395 log_data_err("Couldn't access indexed resource, error %s\n", u_errorName(status)); in TestDirectAccess()
2396 status = U_ZERO_ERROR; in TestDirectAccess()
2403 t = ures_findResource("en/calendar/gregorian/DateTimePatterns/3", t, &status); in TestDirectAccess()
2404 if(U_FAILURE(status)) { in TestDirectAccess()
2405 log_data_err("Couldn't access indexed resource, error %s\n", u_errorName(status)); in TestDirectAccess()
2406 status = U_ZERO_ERROR; in TestDirectAccess()
2414 t = ures_findResource("ja/ExemplarCharacters", t, &status); in TestDirectAccess()
2415 if(U_FAILURE(status)) { in TestDirectAccess()
2416 log_data_err("Couldn't access keyed resource, error %s\n", u_errorName(status)); in TestDirectAccess()
2417 status = U_ZERO_ERROR; in TestDirectAccess()
2425 t2 = ures_open(U_ICUDATA_LANG, "sr", &status); in TestDirectAccess()
2426 if(U_FAILURE(status)) { in TestDirectAccess()
2427 … log_err_status(status, "Couldn't open 'sr' resource bundle, error %s\n", u_errorName(status)); in TestDirectAccess()
2432 if(U_SUCCESS(status)) { in TestDirectAccess()
2435 t = ures_findSubResource(t2, s, t, &status); in TestDirectAccess()
2436 if(U_FAILURE(status)) { in TestDirectAccess()
2437 log_err("Couldn't access keyed resource, error %s\n", u_errorName(status)); in TestDirectAccess()
2438 status = U_ZERO_ERROR; in TestDirectAccess()
2447 t = ures_findResource("root/calendar/islamic-civil/DateTime", t, &status); in TestDirectAccess()
2448 if(U_SUCCESS(status)) { in TestDirectAccess()
2451 status = U_ZERO_ERROR; in TestDirectAccess()
2454 … t = ures_findResource("root/calendar/islamic-civil/eras/abbreviated/0/mikimaus/pera", t, &status); in TestDirectAccess()
2455 if(U_SUCCESS(status)) { in TestDirectAccess()
2458 status = U_ZERO_ERROR; in TestDirectAccess()
2461 t2 = ures_open(NULL, "he", &status); in TestDirectAccess()
2462 t2 = ures_getByKeyWithFallback(t2, "calendar", t2, &status); in TestDirectAccess()
2463 t2 = ures_getByKeyWithFallback(t2, "islamic-civil", t2, &status); in TestDirectAccess()
2464 t2 = ures_getByKeyWithFallback(t2, "DateTime", t2, &status); in TestDirectAccess()
2465 if(U_SUCCESS(status)) { in TestDirectAccess()
2468 status = U_ZERO_ERROR; in TestDirectAccess()
2471 t2 = ures_open(NULL, "he", &status); in TestDirectAccess()
2473 t2 = ures_getByKeyWithFallback(t2, "calendar", t2, &status); in TestDirectAccess()
2474 t2 = ures_getByKeyWithFallback(t2, "islamic-civil", t2, &status); in TestDirectAccess()
2475 t2 = ures_getByKeyWithFallback(t2, "eras", t2, &status); in TestDirectAccess()
2476 if(U_FAILURE(status)) { in TestDirectAccess()
2477 log_err_status(status, "Didn't get Eras. I know they are there!\n"); in TestDirectAccess()
2479 status = U_ZERO_ERROR; in TestDirectAccess()
2482 t2 = ures_open(NULL, "root", &status); in TestDirectAccess()
2483 t2 = ures_getByKeyWithFallback(t2, "calendar", t2, &status); in TestDirectAccess()
2484 t2 = ures_getByKeyWithFallback(t2, "islamic-civil", t2, &status); in TestDirectAccess()
2485 t2 = ures_getByKeyWithFallback(t2, "DateTime", t2, &status); in TestDirectAccess()
2486 if(U_SUCCESS(status)) { in TestDirectAccess()
2489 status = U_ZERO_ERROR; in TestDirectAccess()
2496 UErrorCode status = U_ZERO_ERROR; in TestTicket9804() local
2498 t = ures_open(NULL, "he", &status); in TestTicket9804()
2499 t = ures_getByKeyWithFallback(t, "calendar/islamic-civil/DateTime", t, &status); in TestTicket9804()
2500 if(U_SUCCESS(status)) { in TestTicket9804()
2503 status = U_ZERO_ERROR; in TestTicket9804()
2505 t = ures_open(NULL, "he", &status); in TestTicket9804()
2506 t = ures_getByKeyWithFallback(t, "calendar/islamic-civil/eras", t, &status); in TestTicket9804()
2507 if(U_FAILURE(status)) { in TestTicket9804()
2508 log_err_status(status, "Didn't get Eras. I know they are there!\n"); in TestTicket9804()
2510 const char *locale = ures_getLocaleByType(t, ULOC_ACTUAL_LOCALE, &status); in TestTicket9804()
2515 status = U_ZERO_ERROR; in TestTicket9804()
2524 UErrorCode status = U_ZERO_ERROR; in TestJB3763() local
2525 t = ures_open(NULL, "sr_Latn", &status); in TestJB3763()
2526 t = ures_getByKeyWithFallback(t, "calendar", t, &status); in TestJB3763()
2527 t = ures_getByKeyWithFallback(t, "gregorian", t, &status); in TestJB3763()
2528 t = ures_getByKeyWithFallback(t, "AmPmMarkers", t, &status); in TestJB3763()
2529 if(U_FAILURE(status)) { in TestJB3763()
2530 log_err_status(status, "This resource should be available?\n"); in TestJB3763()
2532 status = U_ZERO_ERROR; in TestJB3763()
2541 UErrorCode status = U_ZERO_ERROR; in TestGetKeywordValues() local
2544 kwVals = ures_getKeywordValues( U_ICUDATA_COLL, "collations", &status); in TestGetKeywordValues()
2548 while((kw=uenum_next(kwVals, NULL, &status))) { in TestGetKeywordValues()
2559 log_err_status(status, "'standard' was not found in the keyword list.\n"); in TestGetKeywordValues()
2562 if(U_FAILURE(status)) { in TestGetKeywordValues()
2563 log_err_status(status, "err %s getting collation values\n", u_errorName(status)); in TestGetKeywordValues()
2565 status = U_ZERO_ERROR; in TestGetKeywordValues()
2568 kwVals = ures_getKeywordValues( "ICUDATA", "calendar", &status); in TestGetKeywordValues()
2572 while((kw=uenum_next(kwVals, NULL, &status))) { in TestGetKeywordValues()
2583 log_err_status(status, "'japanese' was not found in the calendar keyword list.\n"); in TestGetKeywordValues()
2586 if(U_FAILURE(status)) { in TestGetKeywordValues()
2587 log_err_status(status, "err %s getting calendar values\n", u_errorName(status)); in TestGetKeywordValues()
2600 UErrorCode status = U_ZERO_ERROR; in TestGetFunctionalEquivalentOf() local
2604 &gotAvail, truncate, &status); in TestGetFunctionalEquivalentOf()
2605 if(U_FAILURE(status) || (len <= 0)) { in TestGetFunctionalEquivalentOf()
2606 log_err_status(status, "FAIL: got len %d, err %s on #%d: %c\t%s\t%s\n", in TestGetFunctionalEquivalentOf()
2607 len, u_errorName(status), in TestGetFunctionalEquivalentOf()
2685 UErrorCode status = U_ZERO_ERROR; in TestGetFunctionalEquivalent() local
2690 &gotAvail, FALSE, &status); in TestGetFunctionalEquivalent()
2693 if(status == U_MISSING_RESOURCE_ERROR) { in TestGetFunctionalEquivalent()
2697 equivLocale, gotAvail?'t':'f', u_errorName(status)); in TestGetFunctionalEquivalent()
2704 UErrorCode status = U_ZERO_ERROR; in TestXPath() local
2711 const char *testdatapath=loadTestData(&status); in TestXPath()
2712 if(U_FAILURE(status)) in TestXPath()
2714 log_data_err("Could not load testdata.dat %s \n",myErrorName(status)); in TestXPath()
2720 rb = ures_open(testdatapath, "te_IN", &status); in TestXPath()
2721 if(U_FAILURE(status)) { in TestXPath()
2722 log_err("Could not open te_IN (%s)\n", myErrorName(status)); in TestXPath()
2725 alias = ures_getByKey(rb, "rootAliasClient", alias, &status); in TestXPath()
2726 if(U_FAILURE(status)) { in TestXPath()
2727 log_err("Couldn't find the aliased resource (%s)\n", myErrorName(status)); in TestXPath()
2732 result = tres_getString(alias, -1, NULL, &len, &status); in TestXPath()
2733 if(U_FAILURE(status) || result == NULL || u_strcmp(result, expResult)) { in TestXPath()
2734 log_err("Couldn't get correct string value (%s)\n", myErrorName(status)); in TestXPath()
2737 alias = ures_getByKey(rb, "aliasClient", alias, &status); in TestXPath()
2738 if(U_FAILURE(status)) { in TestXPath()
2739 log_err("Couldn't find the aliased resource (%s)\n", myErrorName(status)); in TestXPath()
2744 result = tres_getString(alias, -1, NULL, &len, &status); in TestXPath()
2745 if(U_FAILURE(status) || result == NULL || u_strcmp(result, expResult)) { in TestXPath()
2746 log_err("Couldn't get correct string value (%s)\n", myErrorName(status)); in TestXPath()
2749 alias = ures_getByKey(rb, "nestedRootAliasClient", alias, &status); in TestXPath()
2750 if(U_FAILURE(status)) { in TestXPath()
2751 log_err("Couldn't find the aliased resource (%s)\n", myErrorName(status)); in TestXPath()
2756 result = tres_getString(alias, -1, NULL, &len, &status); in TestXPath()
2757 if(U_FAILURE(status) || result == NULL || u_strcmp(result, expResult)) { in TestXPath()
2758 log_err("Couldn't get correct string value (%s)\n", myErrorName(status)); in TestXPath()
2765 UErrorCode status = U_ZERO_ERROR; in TestCLDRStyleAliases() local
2772 const char *testdatapath=loadTestData(&status); in TestCLDRStyleAliases()
2773 if(U_FAILURE(status)) { in TestCLDRStyleAliases()
2774 log_data_err("Could not load testdata.dat %s \n",myErrorName(status)); in TestCLDRStyleAliases()
2779 rb = ures_open(testdatapath, "te_IN_REVISED", &status); in TestCLDRStyleAliases()
2780 if(U_FAILURE(status)) { in TestCLDRStyleAliases()
2781 log_err("Could not open te_IN (%s)\n", myErrorName(status)); in TestCLDRStyleAliases()
2784 alias = ures_getByKey(rb, "a", alias, &status); in TestCLDRStyleAliases()
2785 if(U_FAILURE(status)) { in TestCLDRStyleAliases()
2786 log_err("Couldn't find the aliased with name \"a\" resource (%s)\n", myErrorName(status)); in TestCLDRStyleAliases()
2795 a = ures_getByKeyWithFallback(alias, resource, a, &status); in TestCLDRStyleAliases()
2796 result = tres_getString(a, -1, NULL, &len, &status); in TestCLDRStyleAliases()
2798 if(U_FAILURE(status) || !result || u_strcmp(result, expected)) { in TestCLDRStyleAliases()
2799 … name \"%s\" resource, exp %s, got %S (%s)\n", resource, expects[i], result, myErrorName(status)); in TestCLDRStyleAliases()
2800 status = U_ZERO_ERROR; in TestCLDRStyleAliases()
2810 UErrorCode status = U_ZERO_ERROR; in TestFallbackCodes() local
2811 const char *testdatapath=loadTestData(&status); in TestFallbackCodes()
2813 UResourceBundle *res = ures_open(testdatapath, "te_IN", &status); in TestFallbackCodes()
2817 r = ures_getByKey(res, "tagged_array_in_Root_te_te_IN", r, &status); in TestFallbackCodes()
2819 status = U_ZERO_ERROR; in TestFallbackCodes()
2820 fall = ures_getByKeyWithFallback(r, "tag2", fall, &status); in TestFallbackCodes()
2822 if(status != U_ZERO_ERROR) { in TestFallbackCodes()
2823 log_data_err("Expected error code to be U_ZERO_ERROR, got %s\n", u_errorName(status)); in TestFallbackCodes()
2824 status = U_ZERO_ERROR; in TestFallbackCodes()
2827 fall = ures_getByKeyWithFallback(r, "tag7", fall, &status); in TestFallbackCodes()
2829 if(status != U_USING_FALLBACK_WARNING) { in TestFallbackCodes()
2830 … log_data_err("Expected error code to be U_USING_FALLBACK_WARNING, got %s\n", u_errorName(status)); in TestFallbackCodes()
2832 status = U_ZERO_ERROR; in TestFallbackCodes()
2834 fall = ures_getByKeyWithFallback(r, "tag1", fall, &status); in TestFallbackCodes()
2836 if(status != U_USING_DEFAULT_WARNING) { in TestFallbackCodes()
2837 … log_data_err("Expected error code to be U_USING_DEFAULT_WARNING, got %s\n", u_errorName(status)); in TestFallbackCodes()
2839 status = U_ZERO_ERROR; in TestFallbackCodes()
2853 log_data_err("Could not load en_US locale. status=%s\n",myErrorName(errorCode)); in TestStackReuse()
2873 UErrorCode *status) { in tres_getString() argument
2886 s16 = ures_getStringByIndex(resB, idx, length, status); in tres_getString()
2888 s16 = ures_getStringByKey(resB, key, length, status); in tres_getString()
2890 s16 = ures_getString(resB, length, status); in tres_getString()
2892 if(U_FAILURE(*status)) { in tres_getString()
2902 s8 = ures_getUTF8StringByIndex(resB, idx, p8, &length8, forceCopy, status); in tres_getString()
2904 s8 = ures_getUTF8StringByKey(resB, key, p8, &length8, forceCopy, status); in tres_getString()
2906 s8 = ures_getUTF8String(resB, p8, &length8, forceCopy, status); in tres_getString()
2908 if(*status == U_INVALID_CHAR_FOUND) { in tres_getString()
2912 if(*status == U_BUFFER_OVERFLOW_ERROR) { in tres_getString()
2913 *status = U_ZERO_ERROR; in tres_getString()
2919 s8 = ures_getUTF8StringByIndex(resB, idx, p8, &length8, forceCopy, status); in tres_getString()
2921 s8 = ures_getUTF8StringByKey(resB, key, p8, &length8, forceCopy, status); in tres_getString()
2923 s8 = ures_getUTF8String(resB, p8, &length8, forceCopy, status); in tres_getString()
2926 if(U_FAILURE(*status)) { in tres_getString()
2988 UErrorCode status; in TestGetUTF8String() local
2990 status = U_ZERO_ERROR; in TestGetUTF8String()
2991 testdatapath = loadTestData(&status); in TestGetUTF8String()
2992 if(U_FAILURE(status)) { in TestGetUTF8String()
2993 log_data_err("Could not load testdata.dat - %s\n", u_errorName(status)); in TestGetUTF8String()
2997 res = ures_open(testdatapath, "", &status); in TestGetUTF8String()
2998 if(U_FAILURE(status)) { in TestGetUTF8String()
2999 log_err("Unable to ures_open(testdata, \"\") - %s\n", u_errorName(status)); in TestGetUTF8String()
3004 status = U_ZERO_ERROR; in TestGetUTF8String()
3006 s8 = ures_getUTF8StringByKey(res, "string_only_in_Root", buffer8, &length8, FALSE, &status); in TestGetUTF8String()
3008 if(status != U_ZERO_ERROR) { in TestGetUTF8String()
3009 …log_err("ures_getUTF8StringByKey(testdata/root string) malfunctioned - %s\n", u_errorName(status)); in TestGetUTF8String()
3013 status = U_ZERO_ERROR; in TestGetUTF8String()
3015 s8 = ures_getUTF8StringByKey(res, "string_only_in_Root", buffer8, &length8, FALSE, &status); in TestGetUTF8String()
3016 if(status != U_ILLEGAL_ARGUMENT_ERROR) { in TestGetUTF8String()
3017 log_err("ures_getUTF8StringByKey(capacity<0) malfunctioned - %s\n", u_errorName(status)); in TestGetUTF8String()
3021 status = U_ZERO_ERROR; in TestGetUTF8String()
3023 s8 = ures_getUTF8StringByKey(res, "string_only_in_Root", NULL, &length8, FALSE, &status); in TestGetUTF8String()
3024 if(status != U_ILLEGAL_ARGUMENT_ERROR) { in TestGetUTF8String()
3025 …log_err("ures_getUTF8StringByKey(dest=NULL capacity>0) malfunctioned - %s\n", u_errorName(status)); in TestGetUTF8String()
3037 UErrorCode status = U_ZERO_ERROR; in TestCLDRVersion() local
3043 ulocdata_getCLDRVersion(cldrVersion, &status); in TestCLDRVersion()
3044 if(U_FAILURE(status)) { in TestCLDRVersion()
3046 log_err_status(status, "FAIL: ulocdata_getCLDRVersion() returned %s\n", u_errorName(status)); in TestCLDRVersion()
3059 status = U_ZERO_ERROR; in TestCLDRVersion()
3060 testdatapath = loadTestData(&status); in TestCLDRVersion()
3061 if(U_FAILURE(status)) { in TestCLDRVersion()
3062 log_data_err("Could not load testdata.dat - %s\n", u_errorName(status)); in TestCLDRVersion()
3066 res = ures_openDirect(testdatapath, "root", &status); in TestCLDRVersion()
3067 if(U_FAILURE(status)) { in TestCLDRVersion()
3068 log_err("Unable to ures_open(testdata, \"\") - %s\n", u_errorName(status in TestCLDRVersion()
3072 ures_getVersionByKey(res, "ExpectCLDRVersionAtLeast", testExpect, &status); in TestCLDRVersion()
3073 ures_getVersionByKey(res, "CurrentCLDRVersion", testCurrent, &status); in TestCLDRVersion()
3075 if(U_FAILURE(status)) { in TestCLDRVersion()
3076 log_err("Unable to get test data for CLDR version - %s\n", u_errorName(status)); in TestCLDRVersion()
3079 if(U_FAILURE(status)) return; in TestCLDRVersion()