Lines Matching refs:errorCode
54 UErrorCode errorCode=U_ZERO_ERROR; in ConversionTest() local
55 utf8Cnv=ucnv_open("UTF-8", &errorCode); in ConversionTest()
56 ucnv_setToUCallBack(utf8Cnv, UCNV_TO_U_CALLBACK_STOP, NULL, NULL, NULL, &errorCode); in ConversionTest()
57 if(U_FAILURE(errorCode)) { in ConversionTest()
98 UErrorCode errorCode; in TestToUnicode() local
101 errorCode=U_ZERO_ERROR; in TestToUnicode()
102 dataModule=TestDataModule::getTestDataModule("conversion", *this, errorCode); in TestToUnicode()
103 if(U_SUCCESS(errorCode)) { in TestToUnicode()
104 testData=dataModule->createTestData("toUnicode", errorCode); in TestToUnicode()
105 if(U_SUCCESS(errorCode)) { in TestToUnicode()
106 for(i=0; testData->nextCase(testCase, errorCode); ++i) { in TestToUnicode()
107 if(U_FAILURE(errorCode)) { in TestToUnicode()
109 i, u_errorName(errorCode)); in TestToUnicode()
110 errorCode=U_ZERO_ERROR; in TestToUnicode()
116 s=testCase->getString("charset", errorCode); in TestToUnicode()
129 cc.bytes=testCase->getBinary(cc.bytesLength, "bytes", errorCode); in TestToUnicode()
130 unicode=testCase->getString("unicode", errorCode); in TestToUnicode()
135 cc.offsets=testCase->getIntVector(offsetsLength, "offsets", errorCode); in TestToUnicode()
141 errorCode=U_ILLEGAL_ARGUMENT_ERROR; in TestToUnicode()
144 cc.finalFlush= 0!=testCase->getInt28("flush", errorCode); in TestToUnicode()
145 cc.fallbacks= 0!=testCase->getInt28("fallbacks", errorCode); in TestToUnicode()
147 s=testCase->getString("errorCode", errorCode); in TestToUnicode()
162 s=testCase->getString("callback", errorCode); in TestToUnicode()
187 cc.invalidChars=testCase->getBinary(cc.invalidLength, "invalidChars", errorCode); in TestToUnicode()
189 if(U_FAILURE(errorCode)) { in TestToUnicode()
191 i, u_errorName(errorCode)); in TestToUnicode()
192 errorCode=U_ZERO_ERROR; in TestToUnicode()
220 UErrorCode errorCode; in TestFromUnicode() local
223 errorCode=U_ZERO_ERROR; in TestFromUnicode()
224 dataModule=TestDataModule::getTestDataModule("conversion", *this, errorCode); in TestFromUnicode()
225 if(U_SUCCESS(errorCode)) { in TestFromUnicode()
226 testData=dataModule->createTestData("fromUnicode", errorCode); in TestFromUnicode()
227 if(U_SUCCESS(errorCode)) { in TestFromUnicode()
228 for(i=0; testData->nextCase(testCase, errorCode); ++i) { in TestFromUnicode()
229 if(U_FAILURE(errorCode)) { in TestFromUnicode()
231 i, u_errorName(errorCode)); in TestFromUnicode()
232 errorCode=U_ZERO_ERROR; in TestFromUnicode()
238 s=testCase->getString("charset", errorCode); in TestFromUnicode()
251 unicode=testCase->getString("unicode", errorCode); in TestFromUnicode()
254 cc.bytes=testCase->getBinary(cc.bytesLength, "bytes", errorCode); in TestFromUnicode()
257 cc.offsets=testCase->getIntVector(offsetsLength, "offsets", errorCode); in TestFromUnicode()
263 errorCode=U_ILLEGAL_ARGUMENT_ERROR; in TestFromUnicode()
266 cc.finalFlush= 0!=testCase->getInt28("flush", errorCode); in TestFromUnicode()
267 cc.fallbacks= 0!=testCase->getInt28("fallbacks", errorCode); in TestFromUnicode()
269 s=testCase->getString("errorCode", errorCode); in TestFromUnicode()
280 s=testCase->getString("callback", errorCode); in TestFromUnicode()
292 errorCode=U_ILLEGAL_ARGUMENT_ERROR; in TestFromUnicode()
311 errorCode=U_ILLEGAL_ARGUMENT_ERROR; in TestFromUnicode()
347 invalidUChars=testCase->getString("invalidUChars", errorCode); in TestFromUnicode()
351 if(U_FAILURE(errorCode)) { in TestFromUnicode()
353 i, u_errorName(errorCode)); in TestFromUnicode()
354 errorCode=U_ZERO_ERROR; in TestFromUnicode()
385 UErrorCode errorCode; in TestGetUnicodeSet() local
388 errorCode=U_ZERO_ERROR; in TestGetUnicodeSet()
389 dataModule=TestDataModule::getTestDataModule("conversion", *this, errorCode); in TestGetUnicodeSet()
390 if(U_SUCCESS(errorCode)) { in TestGetUnicodeSet()
391 testData=dataModule->createTestData("getUnicodeSet", errorCode); in TestGetUnicodeSet()
392 if(U_SUCCESS(errorCode)) { in TestGetUnicodeSet()
393 for(i=0; testData->nextCase(testCase, errorCode); ++i) { in TestGetUnicodeSet()
394 if(U_FAILURE(errorCode)) { in TestGetUnicodeSet()
396 i, u_errorName(errorCode)); in TestGetUnicodeSet()
397 errorCode=U_ZERO_ERROR; in TestGetUnicodeSet()
401 s=testCase->getString("charset", errorCode); in TestGetUnicodeSet()
413 map=testCase->getString("map", errorCode); in TestGetUnicodeSet()
414 mapnot=testCase->getString("mapnot", errorCode); in TestGetUnicodeSet()
416 which=testCase->getInt28("which", errorCode); in TestGetUnicodeSet()
418 if(U_FAILURE(errorCode)) { in TestGetUnicodeSet()
420 i, u_errorName(errorCode)); in TestGetUnicodeSet()
421 errorCode=U_ZERO_ERROR; in TestGetUnicodeSet()
430 mapSet.applyPattern(map, pos, 0, NULL, errorCode); in TestGetUnicodeSet()
431 if(U_FAILURE(errorCode) || pos.getIndex()!=map.length()) { in TestGetUnicodeSet()
434 … i, u_errorName(errorCode), pos.getErrorIndex(), pos.getIndex(), map.char32At(pos.getIndex())); in TestGetUnicodeSet()
435 errorCode=U_ZERO_ERROR; in TestGetUnicodeSet()
440 mapnotSet.applyPattern(mapnot, pos, 0, NULL, errorCode); in TestGetUnicodeSet()
441 if(U_FAILURE(errorCode) || pos.getIndex()!=mapnot.length()) { in TestGetUnicodeSet()
444 … i, u_errorName(errorCode), pos.getErrorIndex(), pos.getIndex(), mapnot.char32At(pos.getIndex())); in TestGetUnicodeSet()
445 errorCode=U_ZERO_ERROR; in TestGetUnicodeSet()
451 cnv.adoptInstead(cnv_open(charset, errorCode)); in TestGetUnicodeSet()
452 if(U_FAILURE(errorCode)) { in TestGetUnicodeSet()
453 … errcheckln(errorCode, "error opening \"%s\" for conversion/getUnicodeSet test case %d - %s", in TestGetUnicodeSet()
454 charset, i, u_errorName(errorCode)); in TestGetUnicodeSet()
455 errorCode=U_ZERO_ERROR; in TestGetUnicodeSet()
459 … ucnv_getUnicodeSet(cnv.getAlias(), cnvSetPtr->toUSet(), (UConverterUnicodeSet)which, &errorCode); in TestGetUnicodeSet()
461 if(U_FAILURE(errorCode)) { in TestGetUnicodeSet()
463 charset, i, u_errorName(errorCode)); in TestGetUnicodeSet()
464 errorCode=U_ZERO_ERROR; in TestGetUnicodeSet()
584 UErrorCode errorCode=U_ZERO_ERROR; in TestGetUnicodeSet2() local
585 cnv.adoptInstead(cnv_open(cnvNames[i], errorCode)); in TestGetUnicodeSet2()
586 if(U_FAILURE(errorCode)) { in TestGetUnicodeSet2()
587 … errcheckln(errorCode, "failed to open converter %s - %s", cnvNames[i], u_errorName(errorCode)); in TestGetUnicodeSet2()
591 … ucnv_setFromUCallBack(cnv.getAlias(), getUnicodeSetCallback, &expected, NULL, NULL, &errorCode); in TestGetUnicodeSet2()
592 if(U_FAILURE(errorCode)) { in TestGetUnicodeSet2()
593 … errln("failed to set the callback on converter %s - %s", cnvNames[i], u_errorName(errorCode)); in TestGetUnicodeSet2()
607 …v.getAlias(), &t, buffer+sizeof(buffer), (const UChar **)&s, s0+s0Length, NULL, flush, &errorCode); in TestGetUnicodeSet2()
608 if(U_FAILURE(errorCode)) { in TestGetUnicodeSet2()
609 if(errorCode==U_BUFFER_OVERFLOW_ERROR) { in TestGetUnicodeSet2()
610 errorCode=U_ZERO_ERROR; in TestGetUnicodeSet2()
618 ucnv_getUnicodeSet(cnv.getAlias(), set.toUSet(), which, &errorCode); in TestGetUnicodeSet2()
681 ConversionTest::cnv_open(const char *name, UErrorCode &errorCode) { in cnv_open() argument
688 return ucnv_openPackage(loadTestData(errorCode), name+1, &errorCode); in cnv_open()
690 return ucnv_open(name, &errorCode); in cnv_open()
977 IcuTestErrorCode errorCode(*this, "ToUnicodeCase"); in ToUnicodeCase() local
978 LocalUConverterPointer cnv(cnv_open(cc.charset, errorCode)); in ToUnicodeCase()
979 if(errorCode.isFailure()) { in ToUnicodeCase()
980 errcheckln(errorCode, "toUnicode[%d](%s cb=\"%s\" fb=%d flush=%d) ucnv_open() failed - %s", in ToUnicodeCase()
981 … cc.caseNr, cc.charset, cc.cbopt, cc.fallbacks, cc.finalFlush, errorCode.errorName()); in ToUnicodeCase()
982 errorCode.reset(); in ToUnicodeCase()
988 ucnv_setToUCallBack(cnv.getAlias(), callback, option, NULL, NULL, errorCode); in ToUnicodeCase()
989 if(U_FAILURE(errorCode)) { in ToUnicodeCase()
991 … cc.caseNr, cc.charset, cc.cbopt, cc.fallbacks, cc.finalFlush, u_errorName(errorCode)); in ToUnicodeCase()
1035 errorCode.reset(); in ToUnicodeCase()
1039 step, errorCode); in ToUnicodeCase()
1044 errorCode); in ToUnicodeCase()
1045 if(errorCode.isFailure() || !cc.finalFlush) { in ToUnicodeCase()
1065 errorCode.reset(); in ToUnicodeCase()
1069 errorCode); in ToUnicodeCase()
1074 errorCode); in ToUnicodeCase()
1081 errorCode.reset(); in ToUnicodeCase()
1085 errorCode); in ToUnicodeCase()
1086 … if(errorCode.get()==U_STRING_NOT_TERMINATED_WARNING || errorCode.get()==U_BUFFER_OVERFLOW_ERROR) { in ToUnicodeCase()
1087 errorCode.reset(); in ToUnicodeCase()
1093 errorCode); in ToUnicodeCase()
1097 errorCode.reset(); // all errors have already been reported in ToUnicodeCase()
1108 UErrorCode errorCode; in checkToUnicode() local
1115 errorCode=U_ZERO_ERROR; in checkToUnicode()
1117 ucnv_getInvalidChars(cnv, resultInvalidChars, &resultInvalidLength, &errorCode); in checkToUnicode()
1118 if(U_FAILURE(errorCode)) { in checkToUnicode()
1120 … cc.caseNr, cc.charset, cc.cbopt, cc.fallbacks, cc.finalFlush, name, u_errorName(errorCode)); in checkToUnicode()
1381 UErrorCode errorCode; in FromUnicodeCase() local
1384 errorCode=U_ZERO_ERROR; in FromUnicodeCase()
1385 cnv=cnv_open(cc.charset, errorCode); in FromUnicodeCase()
1386 if(U_FAILURE(errorCode)) { in FromUnicodeCase()
1387 … errcheckln(errorCode, "fromUnicode[%d](%s cb=\"%s\" fb=%d flush=%d) ucnv_open() failed - %s", in FromUnicodeCase()
1388 … cc.caseNr, cc.charset, cc.cbopt, cc.fallbacks, cc.finalFlush, u_errorName(errorCode)); in FromUnicodeCase()
1395 ucnv_setFromUCallBack(cnv, callback, option, NULL, NULL, &errorCode); in FromUnicodeCase()
1396 if(U_FAILURE(errorCode)) { in FromUnicodeCase()
1398 … cc.caseNr, cc.charset, cc.cbopt, cc.fallbacks, cc.finalFlush, u_errorName(errorCode)); in FromUnicodeCase()
1413 ucnv_setSubstChars(cnv, cc.subchar, (int8_t)length, &errorCode); in FromUnicodeCase()
1414 if(U_FAILURE(errorCode)) { in FromUnicodeCase()
1416 … cc.caseNr, cc.charset, cc.cbopt, cc.fallbacks, cc.finalFlush, u_errorName(errorCode)); in FromUnicodeCase()
1421 ucnv_setSubstString(cnv, cc.subString, -1, &errorCode); in FromUnicodeCase()
1422 if(U_FAILURE(errorCode)) { in FromUnicodeCase()
1424 … cc.caseNr, cc.charset, cc.cbopt, cc.fallbacks, cc.finalFlush, u_errorName(errorCode)); in FromUnicodeCase()
1435 &errorCode); in FromUnicodeCase()
1436 if(U_FAILURE(errorCode)) { in FromUnicodeCase()
1464 errorCode=U_ZERO_ERROR; in FromUnicodeCase()
1468 step, &errorCode); in FromUnicodeCase()
1473 errorCode); in FromUnicodeCase()
1474 if(U_FAILURE(errorCode) || !cc.finalFlush) { in FromUnicodeCase()
1493 errorCode=U_ZERO_ERROR; in FromUnicodeCase()
1496 step, &errorCode); in FromUnicodeCase()
1501 errorCode); in FromUnicodeCase()
1502 if(U_FAILURE(errorCode) || !cc.finalFlush) { in FromUnicodeCase()
1516 errorCode=U_ZERO_ERROR; in FromUnicodeCase()
1520 &errorCode); in FromUnicodeCase()
1525 errorCode); in FromUnicodeCase()
1532 errorCode=U_ZERO_ERROR; in FromUnicodeCase()
1536 &errorCode); in FromUnicodeCase()
1537 if(errorCode==U_STRING_NOT_TERMINATED_WARNING || errorCode==U_BUFFER_OVERFLOW_ERROR) { in FromUnicodeCase()
1538 errorCode=U_ZERO_ERROR; in FromUnicodeCase()
1544 errorCode); in FromUnicodeCase()
1559 UErrorCode errorCode; in checkFromUnicode() local
1566 errorCode=U_ZERO_ERROR; in checkFromUnicode()
1568 ucnv_getInvalidUChars(cnv, resultInvalidUChars, &resultInvalidLength, &errorCode); in checkFromUnicode()
1569 if(U_FAILURE(errorCode)) { in checkFromUnicode()
1571 … cc.caseNr, cc.charset, cc.cbopt, cc.fallbacks, cc.finalFlush, name, u_errorName(errorCode)); in checkFromUnicode()