Lines Matching refs:cnv
402 UConverter *cnv=NULL; in TestConvert() local
404 cnv=ucnv_open("ibm-949,Madhu", &err); in TestConvert()
408 ucnv_close(cnv); in TestConvert()
673 UConverter *cnv=ucnv_open("ISO_2022", &err); in TestConvert() local
677 c=ucnv_getNextUChar(cnv, &source, limit, &err); in TestConvert()
681 ucnv_reset(cnv); in TestConvert()
682 ucnv_close(cnv); in TestConvert()
1183 UConverter *cnv; in TestAlias() local
1191 cnv = ucnv_open(name, &status); in TestAlias()
1198 if (strcmp(ucnv_getName(cnv, &status), name) != 0 in TestAlias()
1202 name, ucnv_getName(cnv, &status)); in TestAlias()
1205 ucnv_close(cnv); in TestAlias()
1695 UConverter * cnv, *cnv2; in TestConvertSafeClone() local
1713 cnv = ucnv_open(names[0], &err); in TestConvertSafeClone()
1719 if (NULL != ucnv_safeClone(cnv, buffer[0], &bufferSize, NULL)) in TestConvertSafeClone()
1725 … if (NULL != ucnv_safeClone(cnv, buffer[0], &bufferSize, &err) || err != U_MEMORY_ALLOCATION_ERROR) in TestConvertSafeClone()
1732 if (NULL == (cnv2 = ucnv_safeClone(cnv, buffer[0], NULL, &err)) || U_FAILURE(err)) in TestConvertSafeClone()
1741 …if (NULL != ucnv_safeClone(cnv, buffer[0], &bufferSize, &err) || U_FAILURE(err) || bufferSize <= 0) in TestConvertSafeClone()
1751 if (NULL == (cnv2 = ucnv_safeClone(cnv, buffer[0], &bufferSize, &err)) || U_FAILURE(err)) in TestConvertSafeClone()
1761 …if (NULL == (cnv2 = ucnv_safeClone(cnv, NULL, &bufferSize, &err)) || err != U_SAFECLONE_ALLOCATED_… in TestConvertSafeClone()
1773 …if (NULL == (cnv2 = ucnv_safeClone(cnv, NULL, &bufferSize, &err)) || err != U_SAFECLONE_ALLOCATED_… in TestConvertSafeClone()
1789 ucnv_close(cnv); in TestConvertSafeClone()
1801 cnv = ucnv_open(names[idx], &err); in TestConvertSafeClone()
1810 ucnv_safeClone(cnv, NULL, &actualSizes[idx], &err); in TestConvertSafeClone()
1820 cnv2 = ucnv_safeClone(cnv, buffer[1], &bufferSize, &err); in TestConvertSafeClone()
1823 ucnv_close(cnv); in TestConvertSafeClone()
1895 UConverter *cnv; in TestCCSID() local
1904 cnv=ucnv_openCCSID(ccsid, UCNV_IBM, &errorCode); in TestCCSID()
1910 if(ccsid!=ucnv_getCCSID(cnv, &errorCode)) { in TestCCSID()
1911 … log_err("error: ucnv_getCCSID(ucnv_openCCSID(%ld))=%ld\n", ccsid, ucnv_getCCSID(cnv, &errorCode)); in TestCCSID()
1915 if(ccsid != 1392 && UCNV_IBM!=ucnv_getPlatform(cnv, &errorCode)) { in TestCCSID()
1916 … ucnv_getPlatform(ucnv_openCCSID(%ld))=%ld!=UCNV_IBM\n", ccsid, ucnv_getPlatform(cnv, &errorCode)); in TestCCSID()
1919 ucnv_close(cnv); in TestCCSID()
2446 static UBool getTestChar(UConverter *cnv, const char *converterName, in getTestChar() argument
2462 ucnv_getUnicodeSet(cnv, set, UCNV_ROUNDTRIP_SET, &errorCode); in getTestChar()
2473 ucnv_fromUnicode(cnv, in getTestChar()
2481 ucnv_fromUnicode(cnv, in getTestChar()
2494 static void testFromTruncatedUTF8(UConverter *utf8Cnv, UConverter *cnv, const char *converterName, in testFromTruncatedUTF8() argument
2538 ucnv_convertEx(cnv, utf8Cnv, in testFromTruncatedUTF8()
2560 static void testFromBadUTF8(UConverter *utf8Cnv, UConverter *cnv, const char *converterName, in testFromBadUTF8() argument
2602 convertExMultiStreaming(utf8Cnv, cnv, in testFromBadUTF8()
2621 UConverter *utf8Cnv, *cnv; in TestConvertExFromUTF8() local
2638 cnv=ucnv_open(converterNames[i], &errorCode); in TestConvertExFromUTF8()
2643 …if(!getTestChar(cnv, converterNames[i], charUTF8, &charUTF8Length, char0, &char0Length, char1, &ch… in TestConvertExFromUTF8()
2646 …testFromTruncatedUTF8(utf8Cnv, cnv, converterNames[i], charUTF8, charUTF8Length, char0, char0Lengt… in TestConvertExFromUTF8()
2647 …testFromBadUTF8(utf8Cnv, cnv, converterNames[i], charUTF8, charUTF8Length, char0, char0Length, cha… in TestConvertExFromUTF8()
2648 ucnv_close(cnv); in TestConvertExFromUTF8()
2664 UConverter *utf8Cnv, *cnv; in TestConvertExFromUTF8_C5F0() local
2697 cnv=ucnv_open(converterNames[i], &errorCode); in TestConvertExFromUTF8_C5F0()
2698 ucnv_setFromUCallBack(cnv, UCNV_FROM_U_CALLBACK_ESCAPE, UCNV_ESCAPE_XML_DEC, in TestConvertExFromUTF8_C5F0()
2722 cnv, utf8Cnv, in TestConvertExFromUTF8_C5F0()
2733 ucnv_close(cnv); in TestConvertExFromUTF8_C5F0()
2765 UConverter *cnv; in TestConvertAlgorithmic() local
2771 cnv=ucnv_open("Shift-JIS", &errorCode); in TestConvertAlgorithmic()
2774 ucnv_close(cnv); in TestConvertAlgorithmic()
2790 …length=ucnv_fromAlgorithmic(cnv, UCNV_UTF8, target, sizeof(shiftJIS), (const char *)utf8, sizeof(u… in TestConvertAlgorithmic()
2802 length=ucnv_toAlgorithmic(UCNV_UTF8, cnv, target, sizeof(target), shiftJISNUL, -1, &errorCode); in TestConvertAlgorithmic()
2813 length=ucnv_toAlgorithmic(UCNV_UTF8, cnv, target, sizeof(target), shiftJISNUL, 0, &errorCode); in TestConvertAlgorithmic()
2823 length=ucnv_fromAlgorithmic(cnv, UCNV_UTF16, target, 0, (const char *)utf16, 2, &errorCode); in TestConvertAlgorithmic()
2832 length=ucnv_fromAlgorithmic(cnv, UCNV_UTF32, target, 0, (const char *)utf32, 4, &errorCode); in TestConvertAlgorithmic()
2842 length=ucnv_fromAlgorithmic(cnv, UCNV_UTF16, target, 0, (const char *)utf16, 2, &errorCode); in TestConvertAlgorithmic()
2849 length=ucnv_fromAlgorithmic(cnv, UCNV_UTF16, target, 0, NULL, 2, &errorCode); in TestConvertAlgorithmic()
2856 …length=ucnv_fromAlgorithmic(cnv, (UConverterType)99, target, 0, (const char *)utf16, 2, &errorCode… in TestConvertAlgorithmic()
2860 ucnv_close(cnv); in TestConvertAlgorithmic()
2918 UConverter *cnv = cnv_open(converter[idx].name, &status); in TestLMBCSMaxChar() local
2922 if (converter[idx].maxSize != ucnv_getMaxCharSize(cnv)) { in TestLMBCSMaxChar()
2924 converter[idx].name, converter[idx].maxSize, ucnv_getMaxCharSize(cnv)); in TestLMBCSMaxChar()
2926 ucnv_close(cnv); in TestLMBCSMaxChar()
2938 UConverter *cnv; in TestJ1968() local
2948 cnv = ucnv_openU(myConvNameU, &err); in TestJ1968()
2949 if (cnv || err != U_ILLEGAL_ARGUMENT_ERROR) { in TestJ1968()
2955 cnv = ucnv_openU(myConvNameU, &err); in TestJ1968()
2956 if (cnv || err != U_ILLEGAL_ARGUMENT_ERROR) { in TestJ1968()
2962 cnv = ucnv_openU(myConvNameU, &err); in TestJ1968()
2963 if (cnv || err != U_FILE_ACCESS_ERROR) { in TestJ1968()
2971 cnv = ucnv_open(myConvName, &err); in TestJ1968()
2972 if (cnv || err != U_ILLEGAL_ARGUMENT_ERROR) { in TestJ1968()
2978 cnv = ucnv_open(myConvName, &err); in TestJ1968()
2979 if (cnv || err != U_ILLEGAL_ARGUMENT_ERROR) { in TestJ1968()
2985 cnv = ucnv_open(myConvName, &err); in TestJ1968()
2986 if (cnv || err != U_FILE_ACCESS_ERROR) { in TestJ1968()
2993 cnv = ucnv_open(myConvName, &err); in TestJ1968()
2994 if (cnv || err != U_ILLEGAL_ARGUMENT_ERROR) { in TestJ1968()
3001 cnv = ucnv_open(myConvName, &err); in TestJ1968()
3002 if (cnv || err != U_FILE_ACCESS_ERROR) { in TestJ1968()
3008 cnv = ucnv_open(myConvName, &err); in TestJ1968()
3009 if (cnv || err != U_ILLEGAL_ARGUMENT_ERROR) { in TestJ1968()
3015 cnv = ucnv_open(myConvName, &err); in TestJ1968()
3016 if (cnv || err != U_FILE_ACCESS_ERROR) { in TestJ1968()
3045 UConverter *cnv, *swapCnv; in testSwap() local
3056 cnv=ucnv_open(name, &errorCode); in testSwap()
3078 …ucnv_fromUnicode(cnv, &pc, normal+LENGTHOF(normal), &pcu, text+LENGTHOF(text), NULL, TRUE, &errorC… in testSwap()
3116 …ucnv_toUnicode(cnv, &pu, uNormal+LENGTHOF(uNormal), (const char **)&pc, normal+normalLength, NULL,… in testSwap()
3153 ucnv_close(cnv); in testSwap()
3198 UConverter* cnv = ucnv_openPackage(loadTestData(&status), "test3", &status); in TestFromUCountPending() local
3210 ucnv_reset(cnv); in TestFromUCountPending()
3211 ucnv_fromUnicode(cnv,&target, targetLimit, &source, sourceLimit, NULL, FALSE, &status); in TestFromUCountPending()
3212 len = ucnv_fromUCountPending(cnv, &status); in TestFromUCountPending()
3245 ucnv_reset(cnv); in TestFromUCountPending()
3246 ucnv_fromUnicode(cnv,&target, targetLimit, &source, sourceLimit, NULL, FALSE, &status); in TestFromUCountPending()
3247 len = ucnv_fromUCountPending(cnv, &status); in TestFromUCountPending()
3257 ucnv_fromUnicode(cnv,&target, targetLimit, &source, sourceLimit, NULL, FALSE, &status); in TestFromUCountPending()
3258 len = ucnv_fromUCountPending(cnv, &status); in TestFromUCountPending()
3268 ucnv_fromUnicode(cnv,&target, targetLimit, &source, sourceLimit, NULL, FALSE, &status); in TestFromUCountPending()
3273 len = ucnv_fromUCountPending(cnv, &status); in TestFromUCountPending()
3282 ucnv_close(cnv); in TestFromUCountPending()
3303 UConverter* cnv = ucnv_openPackage(loadTestData(&status), "test3", &status); in TestToUCountPending() local
3308 ucnv_setToUCallBack(cnv, UCNV_TO_U_CALLBACK_STOP, NULL, oldToUAction, NULL, &status); in TestToUCountPending()
3316 ucnv_reset(cnv); in TestToUCountPending()
3317 ucnv_toUnicode(cnv, &target, targetLimit, &source, sourceLimit, NULL, FALSE, &status); in TestToUCountPending()
3318 len = ucnv_toUCountPending(cnv,&status); in TestToUCountPending()
3329 ucnv_close(cnv); in TestToUCountPending()
3353 cnv = ucnv_openPackage(loadTestData(&status), "test4", &status); in TestToUCountPending()
3358 ucnv_setToUCallBack(cnv, UCNV_TO_U_CALLBACK_STOP, NULL, oldToUAction, NULL, &status); in TestToUCountPending()
3359 ucnv_toUnicode(cnv,&target, targetLimit, &source, sourceLimit, NULL, FALSE, &status); in TestToUCountPending()
3360 len = ucnv_toUCountPending(cnv,&status); in TestToUCountPending()
3369 ucnv_toUnicode(cnv,&target, targetLimit, &source, sourceLimit, NULL, FALSE, &status); in TestToUCountPending()
3370 len = ucnv_toUCountPending(cnv,&status); in TestToUCountPending()
3381 ucnv_toUnicode(cnv,&target, targetLimit, &source, sourceLimit, NULL, FALSE, &status); in TestToUCountPending()
3386 len = ucnv_toUCountPending(cnv,&status); in TestToUCountPending()
3394 ucnv_close(cnv); in TestToUCountPending()
3401 UConverter *cnv; in TestOneDefaultNameChange() local
3407 cnv=ucnv_open(NULL, &status); in TestOneDefaultNameChange()
3408 if (U_FAILURE(status) || cnv == NULL) { in TestOneDefaultNameChange()
3412 if(strcmp(ucnv_getName(cnv, &status), expected)==0) in TestOneDefaultNameChange()
3416 ucnv_close(cnv); in TestOneDefaultNameChange()
3504 UConverter *cnv; in TestSubstString() local
3511 cnv=ucnv_open("UTF-16", &errorCode); in TestSubstString()
3516 length=ucnv_fromUChars(cnv, buffer, (int32_t)sizeof(buffer), surrogate, 1, &errorCode); in TestSubstString()
3517 ucnv_close(cnv); in TestSubstString()
3526 cnv=ucnv_open("UTF-32", &errorCode); in TestSubstString()
3531 length=ucnv_fromUChars(cnv, buffer, (int32_t)sizeof(buffer), surrogate, 1, &errorCode); in TestSubstString()
3532 ucnv_close(cnv); in TestSubstString()
3542 cnv=ucnv_open("ISO-8859-1", &errorCode); in TestSubstString()
3547 ucnv_setSubstString(cnv, sub, LENGTHOF(sub), &errorCode); in TestSubstString()
3552 ucnv_getSubstChars(cnv, buffer, &len8, &errorCode); in TestSubstString()
3558 ucnv_close(cnv); in TestSubstString()
3562 cnv=ucnv_open("HZ", &errorCode); in TestSubstString()
3567 ucnv_setSubstString(cnv, sub, LENGTHOF(sub), &errorCode); in TestSubstString()
3572 ucnv_getSubstChars(cnv, buffer, &len8, &errorCode); in TestSubstString()
3578 ucnv_close(cnv); in TestSubstString()
3590 UConverter *cnv; in InvalidArguments() local
3599 cnv=ucnv_open("UTF-8", &errorCode); in InvalidArguments()
3607 …ucnv_fromUnicode(cnv, &charsPtr, charsPtr, (const UChar **)&ucharsPtr, ucharsBadPtr, NULL, TRUE, &… in InvalidArguments()
3614 …ucnv_fromUnicode(cnv, &charsPtr, charsPtr, (const UChar **)&ucharsBadPtr, ucharsPtr, NULL, TRUE, &… in InvalidArguments()
3621 …ucnv_toUnicode(cnv, &ucharsPtr, ucharsBadPtr, (const char **)&charsPtr, charsPtr, NULL, TRUE, &err… in InvalidArguments()
3628 …ucnv_toUnicode(cnv, &ucharsBadPtr, ucharsPtr, (const char **)&charsPtr, charsPtr, NULL, TRUE, &err… in InvalidArguments()
3639 ucnv_close(cnv); in InvalidArguments()
3654 UConverter *cnv = ucnv_open(names[i], &errorCode); in TestGetName() local
3656 const char *name = ucnv_getName(cnv, &errorCode); in TestGetName()
3661 ucnv_close(cnv); in TestGetName()
3697 UConverter *cnv = ucnv_open(names[i], &errorCode); in TestUTFBOM() local
3704 length = ucnv_fromUChars(cnv, bytes, (int32_t)sizeof(bytes), a16, 1, &errorCode); in TestUTFBOM()
3710 ucnv_close(cnv); in TestUTFBOM()