Lines Matching defs:cc
91 ConversionCase cc;
117 cc.caseNr=i;
121 cc.charset=charset;
132 cc.bytes=testCase->getBinary(cc.bytesLength, "bytes", errorCode);
134 cc.unicode=unicode.getBuffer();
135 cc.unicodeLength=unicode.length();
138 cc.offsets=testCase->getIntVector(offsetsLength, "offsets", errorCode);
140 cc.offsets=NULL;
147 cc.finalFlush= 0!=testCase->getInt28("flush", errorCode);
148 cc.fallbacks= 0!=testCase->getInt28("fallbacks", errorCode);
152 cc.outErrorCode=U_INVALID_CHAR_FOUND;
154 cc.outErrorCode=U_ILLEGAL_CHAR_FOUND;
156 cc.outErrorCode=U_TRUNCATED_CHAR_FOUND;
158 cc.outErrorCode=U_ILLEGAL_ESCAPE_SEQUENCE;
160 cc.outErrorCode=U_UNSUPPORTED_ESCAPE_SEQUENCE;
162 cc.outErrorCode=U_ZERO_ERROR;
167 cc.cbopt=cbopt;
190 cc.invalidChars=testCase->getBinary(cc.invalidLength, "invalidChars", errorCode);
198 ToUnicodeCase(cc, callback, option);
212 ConversionCase cc;
239 cc.caseNr=i;
243 cc.charset=charset;
255 cc.unicode=unicode.getBuffer();
256 cc.unicodeLength=unicode.length();
257 cc.bytes=testCase->getBinary(cc.bytesLength, "bytes", errorCode);
260 cc.offsets=testCase->getIntVector(offsetsLength, "offsets", errorCode);
262 cc.offsets=NULL;
263 } else if(offsetsLength!=cc.bytesLength) {
265 i, cc.bytesLength, offsetsLength);
269 cc.finalFlush= 0!=testCase->getInt28("flush", errorCode);
270 cc.fallbacks= 0!=testCase->getInt28("fallbacks", errorCode);
274 cc.outErrorCode=U_INVALID_CHAR_FOUND;
276 cc.outErrorCode=U_ILLEGAL_CHAR_FOUND;
278 cc.outErrorCode=U_TRUNCATED_CHAR_FOUND;
280 cc.outErrorCode=U_ZERO_ERROR;
284 cc.setSub=0; // default: no subchar
294 if(length<=0 || length>=(int32_t)sizeof(cc.subchar)) {
300 cc.subchar[j]=(char)p[j];
303 cc.subchar[j]=0;
304 cc.setSub=1;
313 if(length<0 || length>=UPRV_LENGTHOF(cc.subString)) {
316 u_memcpy(cc.subString, p, length);
318 cc.subString[length]=0;
319 cc.setSub=-1;
327 cc.cbopt=cbopt;
351 cc.invalidUChars=invalidUChars.getBuffer();
352 cc.invalidLength=invalidUChars.length();
360 FromUnicodeCase(cc, callback, option);
859 stepToUnicode(ConversionCase &cc, UConverter *cnv,
868 source=(const char *)cc.bytes;
870 bytesLimit=source+cc.bytesLength;
883 flush=cc.finalFlush;
939 flush=(UBool)(cc.finalFlush && sourceLimit==bytesLimit);
1049 ConversionTest::ToUnicodeCase(ConversionCase &cc, UConverterToUCallback callback, const char *option) {
1052 LocalUConverterPointer cnv(cnv_open(cc.charset, errorCode));
1055 cc.caseNr, cc.charset, cc.cbopt, cc.fallbacks, cc.finalFlush, errorCode.errorName());
1065 cc.caseNr, cc.charset, cc.cbopt, cc.fallbacks, cc.finalFlush, u_errorName(errorCode));
1096 if(step<0 && !cc.finalFlush) {
1103 cc.offsets=NULL;
1110 resultLength=stepToUnicode(cc, cnv.getAlias(),
1115 cc, cnv.getAlias(), steps[i].name,
1117 cc.offsets!=NULL ? resultOffsets : NULL,
1119 if(errorCode.isFailure() || !cc.finalFlush) {
1124 if (cc.offsets != NULL && resultOffsets[resultLength] != -1) {
1126 cc.caseNr, cc.charset, resultLength);
1130 cc.caseNr, cc.charset, resultLength);
1135 while(ok && cc.finalFlush) {
1142 (const char *)cc.bytes, cc.bytesLength,
1145 cc, cnv.getAlias(), "toUChars",
1158 (const char *)cc.bytes, cc.bytesLength,
1164 cc, cnv.getAlias(), "preflight toUChars",
1176 ConversionTest::checkToUnicode(ConversionCase &cc, UConverter *cnv, const char *name,
1194 cc.caseNr, cc.charset, cc.cbopt, cc.fallbacks, cc.finalFlush, name, u_errorName(errorCode));
1199 if(cc.unicodeLength!=resultLength) {
1201 } else if(0!=u_memcmp(cc.unicode, result, cc.unicodeLength)) {
1203 } else if(cc.offsets!=NULL && 0!=memcmp(cc.offsets, resultOffsets, cc.unicodeLength*sizeof(*cc.offsets))) {
1205 } else if(cc.outErrorCode!=resultErrorCode) {
1207 } else if(cc.invalidLength!=resultInvalidLength) {
1209 } else if(0!=memcmp(cc.invalidChars, resultInvalidChars, cc.invalidLength)) {
1222 s=printBytes(cc.bytes, cc.bytesLength, bytesString);
1223 s=printUnicode(cc.unicode, cc.unicodeLength, unicodeString=s);
1225 s=printOffsets(cc.offsets, cc.unicodeLength, offsetsString=s);
1227 s=printBytes(cc.invalidChars, cc.invalidLength, invalidCharsString=s);
1232 cc.caseNr, cc.charset, cc.cbopt, cc.fallbacks, cc.finalFlush, name, (int)(s-buffer));
1244 cc.caseNr, cc.charset, cc.cbopt, cc.fallbacks, cc.finalFlush, name, msg,
1245 bytesString, cc.bytesLength,
1246 unicodeString, cc.unicodeLength,
1250 u_errorName(cc.outErrorCode), u_errorName(resultErrorCode),
1260 stepFromUTF8(ConversionCase &cc,
1271 source=cc.utf8;
1274 utf8Limit=source+cc.utf8Length;
1286 flush=cc.finalFlush;
1358 flush=(UBool)(cc.finalFlush && sourceLimit==utf8Limit);
1366 stepFromUnicode(ConversionCase &cc, UConverter *cnv,
1375 source=cc.unicode;
1377 unicodeLimit=source+cc.unicodeLength;
1389 flush=cc.finalFlush;
1445 flush=(UBool)(cc.finalFlush && sourceLimit==unicodeLimit);
1453 ConversionTest::FromUnicodeCase(ConversionCase &cc, UConverterFromUCallback callback, const char *option) {
1459 cnv=cnv_open(cc.charset, errorCode);
1462 cc.caseNr, cc.charset, cc.cbopt, cc.fallbacks, cc.finalFlush, u_errorName(errorCode));
1472 cc.caseNr, cc.charset, cc.cbopt, cc.fallbacks, cc.finalFlush, u_errorName(errorCode));
1480 ucnv_setFallback(cnv, cc.fallbacks);
1485 if(cc.setSub>0) {
1486 length=(int32_t)strlen(cc.subchar);
1487 ucnv_setSubstChars(cnv, cc.subchar, (int8_t)length, &errorCode);
1490 cc.caseNr, cc.charset, cc.cbopt, cc.fallbacks, cc.finalFlush, u_errorName(errorCode));
1494 } else if(cc.setSub<0) {
1495 ucnv_setSubstString(cnv, cc.subString, -1, &errorCode);
1498 cc.caseNr, cc.charset, cc.cbopt, cc.fallbacks, cc.finalFlush, u_errorName(errorCode));
1506 cc.utf8=utf8;
1507 u_strToUTF8(utf8, UPRV_LENGTHOF(utf8), &cc.utf8Length,
1508 cc.unicode, cc.unicodeLength,
1514 cc.utf8Length=-1;
1539 resultLength=stepFromUnicode(cc, cnv,
1544 cc, cnv, steps[i].name,
1546 cc.offsets!=NULL ? resultOffsets : NULL,
1548 if(U_FAILURE(errorCode) || !cc.finalFlush) {
1555 cc.caseNr, cc.charset, resultLength);
1559 cc.caseNr, cc.charset, resultLength);
1563 cc.offsets=NULL;
1566 if(cc.utf8Length>=0) {
1568 resultLength=stepFromUTF8(cc, utf8Cnv, cnv,
1572 cc, cnv, steps[i].utf8Name,
1576 if(U_FAILURE(errorCode) || !cc.finalFlush) {
1586 while(ok && cc.finalFlush) {
1593 cc.unicode, cc.unicodeLength,
1596 cc, cnv, "fromUChars",
1609 cc.unicode, cc.unicodeLength,
1615 cc, cnv, "preflight fromUChars",
1627 ConversionTest::checkFromUnicode(ConversionCase &cc, UConverter *cnv, const char *name,
1645 cc.caseNr, cc.charset, cc.cbopt, cc.fallbacks, cc.finalFlush, name, u_errorName(errorCode));
1650 if(cc.bytesLength!=resultLength) {
1652 } else if(0!=memcmp(cc.bytes, result, cc.bytesLength)) {
1654 } else if(cc.offsets!=NULL && 0!=memcmp(cc.offsets, resultOffsets, cc.bytesLength*sizeof(*cc.offsets))) {
1656 } else if(cc.outErrorCode!=resultErrorCode) {
1658 } else if(cc.invalidLength!=resultInvalidLength) {
1660 } else if(0!=u_memcmp(cc.invalidUChars, resultInvalidUChars, cc.invalidLength)) {
1673 s=printUnicode(cc.unicode, cc.unicodeLength, unicodeString);
1674 s=printBytes(cc.bytes, cc.bytesLength, bytesString=s);
1676 s=printOffsets(cc.offsets, cc.bytesLength, offsetsString=s);
1678 s=printUnicode(cc.invalidUChars, cc.invalidLength, invalidCharsString=s);
1683 cc.caseNr, cc.charset, cc.cbopt, cc.fallbacks, cc.finalFlush, name, (int)(s-buffer));
1695 cc.caseNr, cc.charset, cc.cbopt, cc.fallbacks, cc.finalFlush, name, msg,
1696 unicodeString, cc.unicodeLength,
1697 bytesString, cc.bytesLength,
1701 u_errorName(cc.outErrorCode), u_errorName(resultErrorCode),