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);
785 stepToUnicode(ConversionCase &cc, UConverter *cnv,
794 source=(const char *)cc.bytes;
796 bytesLimit=source+cc.bytesLength;
809 flush=cc.finalFlush;
865 flush=(UBool)(cc.finalFlush && sourceLimit==bytesLimit);
975 ConversionTest::ToUnicodeCase(ConversionCase &cc, UConverterToUCallback callback, const char *option) {
978 LocalUConverterPointer cnv(cnv_open(cc.charset, errorCode));
981 cc.caseNr, cc.charset, cc.cbopt, cc.fallbacks, cc.finalFlush, errorCode.errorName());
991 cc.caseNr, cc.charset, cc.cbopt, cc.fallbacks, cc.finalFlush, u_errorName(errorCode));
1022 if(step<0 && !cc.finalFlush) {
1029 cc.offsets=NULL;
1036 resultLength=stepToUnicode(cc, cnv.getAlias(),
1041 cc, cnv.getAlias(), steps[i].name,
1043 cc.offsets!=NULL ? resultOffsets : NULL,
1045 if(errorCode.isFailure() || !cc.finalFlush) {
1050 if (cc.offsets != NULL && resultOffsets[resultLength] != -1) {
1052 cc.caseNr, cc.charset, resultLength);
1056 cc.caseNr, cc.charset, resultLength);
1061 while(ok && cc.finalFlush) {
1068 (const char *)cc.bytes, cc.bytesLength,
1071 cc, cnv.getAlias(), "toUChars",
1084 (const char *)cc.bytes, cc.bytesLength,
1090 cc, cnv.getAlias(), "preflight toUChars",
1102 ConversionTest::checkToUnicode(ConversionCase &cc, UConverter *cnv, const char *name,
1120 cc.caseNr, cc.charset, cc.cbopt, cc.fallbacks, cc.finalFlush, name, u_errorName(errorCode));
1125 if(cc.unicodeLength!=resultLength) {
1127 } else if(0!=u_memcmp(cc.unicode, result, cc.unicodeLength)) {
1129 } else if(cc.offsets!=NULL && 0!=memcmp(cc.offsets, resultOffsets, cc.unicodeLength*sizeof(*cc.offsets))) {
1131 } else if(cc.outErrorCode!=resultErrorCode) {
1133 } else if(cc.invalidLength!=resultInvalidLength) {
1135 } else if(0!=memcmp(cc.invalidChars, resultInvalidChars, cc.invalidLength)) {
1148 s=printBytes(cc.bytes, cc.bytesLength, bytesString);
1149 s=printUnicode(cc.unicode, cc.unicodeLength, unicodeString=s);
1151 s=printOffsets(cc.offsets, cc.unicodeLength, offsetsString=s);
1153 s=printBytes(cc.invalidChars, cc.invalidLength, invalidCharsString=s);
1158 cc.caseNr, cc.charset, cc.cbopt, cc.fallbacks, cc.finalFlush, name, (int)(s-buffer));
1170 cc.caseNr, cc.charset, cc.cbopt, cc.fallbacks, cc.finalFlush, name, msg,
1171 bytesString, cc.bytesLength,
1172 unicodeString, cc.unicodeLength,
1176 u_errorName(cc.outErrorCode), u_errorName(resultErrorCode),
1186 stepFromUTF8(ConversionCase &cc,
1197 source=cc.utf8;
1200 utf8Limit=source+cc.utf8Length;
1212 flush=cc.finalFlush;
1284 flush=(UBool)(cc.finalFlush && sourceLimit==utf8Limit);
1292 stepFromUnicode(ConversionCase &cc, UConverter *cnv,
1301 source=cc.unicode;
1303 unicodeLimit=source+cc.unicodeLength;
1315 flush=cc.finalFlush;
1371 flush=(UBool)(cc.finalFlush && sourceLimit==unicodeLimit);
1379 ConversionTest::FromUnicodeCase(ConversionCase &cc, UConverterFromUCallback callback, const char *option) {
1385 cnv=cnv_open(cc.charset, errorCode);
1388 cc.caseNr, cc.charset, cc.cbopt, cc.fallbacks, cc.finalFlush, u_errorName(errorCode));
1398 cc.caseNr, cc.charset, cc.cbopt, cc.fallbacks, cc.finalFlush, u_errorName(errorCode));
1406 ucnv_setFallback(cnv, cc.fallbacks);
1411 if(cc.setSub>0) {
1412 length=(int32_t)strlen(cc.subchar);
1413 ucnv_setSubstChars(cnv, cc.subchar, (int8_t)length, &errorCode);
1416 cc.caseNr, cc.charset, cc.cbopt, cc.fallbacks, cc.finalFlush, u_errorName(errorCode));
1420 } else if(cc.setSub<0) {
1421 ucnv_setSubstString(cnv, cc.subString, -1, &errorCode);
1424 cc.caseNr, cc.charset, cc.cbopt, cc.fallbacks, cc.finalFlush, u_errorName(errorCode));
1432 cc.utf8=utf8;
1433 u_strToUTF8(utf8, LENGTHOF(utf8), &cc.utf8Length,
1434 cc.unicode, cc.unicodeLength,
1440 cc.utf8Length=-1;
1465 resultLength=stepFromUnicode(cc, cnv,
1470 cc, cnv, steps[i].name,
1472 cc.offsets!=NULL ? resultOffsets : NULL,
1474 if(U_FAILURE(errorCode) || !cc.finalFlush) {
1481 cc.caseNr, cc.charset, resultLength);
1485 cc.caseNr, cc.charset, resultLength);
1489 cc.offsets=NULL;
1492 if(cc.utf8Length>=0) {
1494 resultLength=stepFromUTF8(cc, utf8Cnv, cnv,
1498 cc, cnv, steps[i].utf8Name,
1502 if(U_FAILURE(errorCode) || !cc.finalFlush) {
1512 while(ok && cc.finalFlush) {
1519 cc.unicode, cc.unicodeLength,
1522 cc, cnv, "fromUChars",
1535 cc.unicode, cc.unicodeLength,
1541 cc, cnv, "preflight fromUChars",
1553 ConversionTest::checkFromUnicode(ConversionCase &cc, UConverter *cnv, const char *name,
1571 cc.caseNr, cc.charset, cc.cbopt, cc.fallbacks, cc.finalFlush, name, u_errorName(errorCode));
1576 if(cc.bytesLength!=resultLength) {
1578 } else if(0!=memcmp(cc.bytes, result, cc.bytesLength)) {
1580 } else if(cc.offsets!=NULL && 0!=memcmp(cc.offsets, resultOffsets, cc.bytesLength*sizeof(*cc.offsets))) {
1582 } else if(cc.outErrorCode!=resultErrorCode) {
1584 } else if(cc.invalidLength!=resultInvalidLength) {
1586 } else if(0!=u_memcmp(cc.invalidUChars, resultInvalidUChars, cc.invalidLength)) {
1599 s=printUnicode(cc.unicode, cc.unicodeLength, unicodeString);
1600 s=printBytes(cc.bytes, cc.bytesLength, bytesString=s);
1602 s=printOffsets(cc.offsets, cc.bytesLength, offsetsString=s);
1604 s=printUnicode(cc.invalidUChars, cc.invalidLength, invalidCharsString=s);
1609 cc.caseNr, cc.charset, cc.cbopt, cc.fallbacks, cc.finalFlush, name, (int)(s-buffer));
1621 cc.caseNr, cc.charset, cc.cbopt, cc.fallbacks, cc.finalFlush, name, msg,
1622 unicodeString, cc.unicodeLength,
1623 bytesString, cc.bytesLength,
1627 u_errorName(cc.outErrorCode), u_errorName(resultErrorCode),