Home | History | Annotate | Download | only in intltest

Lines Matching defs:cc

88     ConversionCase cc;
114 cc.caseNr=i;
118 cc.charset=charset;
129 cc.bytes=testCase->getBinary(cc.bytesLength, "bytes", errorCode);
131 cc.unicode=unicode.getBuffer();
132 cc.unicodeLength=unicode.length();
135 cc.offsets=testCase->getIntVector(offsetsLength, "offsets", errorCode);
137 cc.offsets=NULL;
144 cc.finalFlush= 0!=testCase->getInt28("flush", errorCode);
145 cc.fallbacks= 0!=testCase->getInt28("fallbacks", errorCode);
149 cc.outErrorCode=U_INVALID_CHAR_FOUND;
151 cc.outErrorCode=U_ILLEGAL_CHAR_FOUND;
153 cc.outErrorCode=U_TRUNCATED_CHAR_FOUND;
155 cc.outErrorCode=U_ILLEGAL_ESCAPE_SEQUENCE;
157 cc.outErrorCode=U_UNSUPPORTED_ESCAPE_SEQUENCE;
159 cc.outErrorCode=U_ZERO_ERROR;
164 cc.cbopt=cbopt;
187 cc.invalidChars=testCase->getBinary(cc.invalidLength, "invalidChars", errorCode);
195 ToUnicodeCase(cc, callback, option);
209 ConversionCase cc;
236 cc.caseNr=i;
240 cc.charset=charset;
252 cc.unicode=unicode.getBuffer();
253 cc.unicodeLength=unicode.length();
254 cc.bytes=testCase->getBinary(cc.bytesLength, "bytes", errorCode);
257 cc.offsets=testCase->getIntVector(offsetsLength, "offsets", errorCode);
259 cc.offsets=NULL;
260 } else if(offsetsLength!=cc.bytesLength) {
262 i, cc.bytesLength, offsetsLength);
266 cc.finalFlush= 0!=testCase->getInt28("flush", errorCode);
267 cc.fallbacks= 0!=testCase->getInt28("fallbacks", errorCode);
271 cc.outErrorCode=U_INVALID_CHAR_FOUND;
273 cc.outErrorCode=U_ILLEGAL_CHAR_FOUND;
275 cc.outErrorCode=U_TRUNCATED_CHAR_FOUND;
277 cc.outErrorCode=U_ZERO_ERROR;
281 cc.setSub=0; // default: no subchar
291 if(length<=0 || length>=(int32_t)sizeof(cc.subchar)) {
297 cc.subchar[j]=(char)p[j];
300 cc.subchar[j]=0;
301 cc.setSub=1;
310 if(length<0 || length>=LENGTHOF(cc.subString)) {
313 u_memcpy(cc.subString, p, length);
315 cc.subString[length]=0;
316 cc.setSub=-1;
324 cc.cbopt=cbopt;
348 cc.invalidUChars=invalidUChars.getBuffer();
349 cc.invalidLength=invalidUChars.length();
357 FromUnicodeCase(cc, callback, option);
783 stepToUnicode(ConversionCase &cc, UConverter *cnv,
792 source=(const char *)cc.bytes;
794 bytesLimit=source+cc.bytesLength;
807 flush=cc.finalFlush;
863 flush=(UBool)(cc.finalFlush && sourceLimit==bytesLimit);
973 ConversionTest::ToUnicodeCase(ConversionCase &cc, UConverterToUCallback callback, const char *option) {
976 LocalUConverterPointer cnv(cnv_open(cc.charset, errorCode));
979 cc.caseNr, cc.charset, cc.cbopt, cc.fallbacks, cc.finalFlush, errorCode.errorName());
989 cc.caseNr, cc.charset, cc.cbopt, cc.fallbacks, cc.finalFlush, u_errorName(errorCode));
1020 if(step<0 && !cc.finalFlush) {
1027 cc.offsets=NULL;
1034 resultLength=stepToUnicode(cc, cnv.getAlias(),
1039 cc, cnv.getAlias(), steps[i].name,
1041 cc.offsets!=NULL ? resultOffsets : NULL,
1043 if(errorCode.isFailure() || !cc.finalFlush) {
1048 if (cc.offsets != NULL && resultOffsets[resultLength] != -1) {
1050 cc.caseNr, cc.charset, resultLength);
1054 cc.caseNr, cc.charset, resultLength);
1059 while(ok && cc.finalFlush) {
1066 (const char *)cc.bytes, cc.bytesLength,
1069 cc, cnv.getAlias(), "toUChars",
1082 (const char *)cc.bytes, cc.bytesLength,
1088 cc, cnv.getAlias(), "preflight toUChars",
1100 ConversionTest::checkToUnicode(ConversionCase &cc, UConverter *cnv, const char *name,
1118 cc.caseNr, cc.charset, cc.cbopt, cc.fallbacks, cc.finalFlush, name, u_errorName(errorCode));
1123 if(cc.unicodeLength!=resultLength) {
1125 } else if(0!=u_memcmp(cc.unicode, result, cc.unicodeLength)) {
1127 } else if(cc.offsets!=NULL && 0!=memcmp(cc.offsets, resultOffsets, cc.unicodeLength*sizeof(*cc.offsets))) {
1129 } else if(cc.outErrorCode!=resultErrorCode) {
1131 } else if(cc.invalidLength!=resultInvalidLength) {
1133 } else if(0!=memcmp(cc.invalidChars, resultInvalidChars, cc.invalidLength)) {
1146 s=printBytes(cc.bytes, cc.bytesLength, bytesString);
1147 s=printUnicode(cc.unicode, cc.unicodeLength, unicodeString=s);
1149 s=printOffsets(cc.offsets, cc.unicodeLength, offsetsString=s);
1151 s=printBytes(cc.invalidChars, cc.invalidLength, invalidCharsString=s);
1156 cc.caseNr, cc.charset, cc.cbopt, cc.fallbacks, cc.finalFlush, name, (int)(s-buffer));
1168 cc.caseNr, cc.charset, cc.cbopt, cc.fallbacks, cc.finalFlush, name, msg,
1169 bytesString, cc.bytesLength,
1170 unicodeString, cc.unicodeLength,
1174 u_errorName(cc.outErrorCode), u_errorName(resultErrorCode),
1184 stepFromUTF8(ConversionCase &cc,
1195 source=cc.utf8;
1198 utf8Limit=source+cc.utf8Length;
1210 flush=cc.finalFlush;
1282 flush=(UBool)(cc.finalFlush && sourceLimit==utf8Limit);
1290 stepFromUnicode(ConversionCase &cc, UConverter *cnv,
1299 source=cc.unicode;
1301 unicodeLimit=source+cc.unicodeLength;
1313 flush=cc.finalFlush;
1369 flush=(UBool)(cc.finalFlush && sourceLimit==unicodeLimit);
1377 ConversionTest::FromUnicodeCase(ConversionCase &cc, UConverterFromUCallback callback, const char *option) {
1383 cnv=cnv_open(cc.charset, errorCode);
1386 cc.caseNr, cc.charset, cc.cbopt, cc.fallbacks, cc.finalFlush, u_errorName(errorCode));
1396 cc.caseNr, cc.charset, cc.cbopt, cc.fallbacks, cc.finalFlush, u_errorName(errorCode));
1404 ucnv_setFallback(cnv, cc.fallbacks);
1409 if(cc.setSub>0) {
1410 length=(int32_t)strlen(cc.subchar);
1411 ucnv_setSubstChars(cnv, cc.subchar, (int8_t)length, &errorCode);
1414 cc.caseNr, cc.charset, cc.cbopt, cc.fallbacks, cc.finalFlush, u_errorName(errorCode));
1418 } else if(cc.setSub<0) {
1419 ucnv_setSubstString(cnv, cc.subString, -1, &errorCode);
1422 cc.caseNr, cc.charset, cc.cbopt, cc.fallbacks, cc.finalFlush, u_errorName(errorCode));
1430 cc.utf8=utf8;
1431 u_strToUTF8(utf8, LENGTHOF(utf8), &cc.utf8Length,
1432 cc.unicode, cc.unicodeLength,
1438 cc.utf8Length=-1;
1463 resultLength=stepFromUnicode(cc, cnv,
1468 cc, cnv, steps[i].name,
1470 cc.offsets!=NULL ? resultOffsets : NULL,
1472 if(U_FAILURE(errorCode) || !cc.finalFlush) {
1479 cc.caseNr, cc.charset, resultLength);
1483 cc.caseNr, cc.charset, resultLength);
1487 cc.offsets=NULL;
1490 if(cc.utf8Length>=0) {
1492 resultLength=stepFromUTF8(cc, utf8Cnv, cnv,
1496 cc, cnv, steps[i].utf8Name,
1500 if(U_FAILURE(errorCode) || !cc.finalFlush) {
1510 while(ok && cc.finalFlush) {
1517 cc.unicode, cc.unicodeLength,
1520 cc, cnv, "fromUChars",
1533 cc.unicode, cc.unicodeLength,
1539 cc, cnv, "preflight fromUChars",
1551 ConversionTest::checkFromUnicode(ConversionCase &cc, UConverter *cnv, const char *name,
1569 cc.caseNr, cc.charset, cc.cbopt, cc.fallbacks, cc.finalFlush, name, u_errorName(errorCode));
1574 if(cc.bytesLength!=resultLength) {
1576 } else if(0!=memcmp(cc.bytes, result, cc.bytesLength)) {
1578 } else if(cc.offsets!=NULL && 0!=memcmp(cc.offsets, resultOffsets, cc.bytesLength*sizeof(*cc.offsets))) {
1580 } else if(cc.outErrorCode!=resultErrorCode) {
1582 } else if(cc.invalidLength!=resultInvalidLength) {
1584 } else if(0!=u_memcmp(cc.invalidUChars, resultInvalidUChars, cc.invalidLength)) {
1597 s=printUnicode(cc.unicode, cc.unicodeLength, unicodeString);
1598 s=printBytes(cc.bytes, cc.bytesLength, bytesString=s);
1600 s=printOffsets(cc.offsets, cc.bytesLength, offsetsString=s);
1602 s=printUnicode(cc.invalidUChars, cc.invalidLength, invalidCharsString=s);
1607 cc.caseNr, cc.charset, cc.cbopt, cc.fallbacks, cc.finalFlush, name, (int)(s-buffer));
1619 cc.caseNr, cc.charset, cc.cbopt, cc.fallbacks, cc.finalFlush, name, msg,
1620 unicodeString, cc.unicodeLength,
1621 bytesString, cc.bytesLength,
1625 u_errorName(cc.outErrorCode), u_errorName(resultErrorCode),