Lines Matching refs:cnv
400 UConverter *cnv=NULL; in TestConvert() local
402 cnv=ucnv_open("ibm-949,Madhu", &err); in TestConvert()
406 ucnv_close(cnv); in TestConvert()
671 UConverter *cnv=ucnv_open("ISO_2022", &err); in TestConvert() local
675 c=ucnv_getNextUChar(cnv, &source, limit, &err); in TestConvert()
679 ucnv_reset(cnv); in TestConvert()
680 ucnv_close(cnv); in TestConvert()
1179 UConverter *cnv; in TestAlias() local
1187 cnv = ucnv_open(name, &status); in TestAlias()
1194 if (strcmp(ucnv_getName(cnv, &status), name) != 0 in TestAlias()
1198 name, ucnv_getName(cnv, &status)); in TestAlias()
1201 ucnv_close(cnv); in TestAlias()
1691 UConverter * cnv, *cnv2; in TestConvertSafeClone() local
1709 cnv = ucnv_open(names[0], &err); in TestConvertSafeClone()
1715 if (NULL != ucnv_safeClone(cnv, buffer[0], &bufferSize, NULL)) in TestConvertSafeClone()
1721 … if (NULL != ucnv_safeClone(cnv, buffer[0], &bufferSize, &err) || err != U_MEMORY_ALLOCATION_ERROR) in TestConvertSafeClone()
1728 if (NULL == (cnv2 = ucnv_safeClone(cnv, buffer[0], NULL, &err)) || U_FAILURE(err)) in TestConvertSafeClone()
1737 …if (NULL != ucnv_safeClone(cnv, buffer[0], &bufferSize, &err) || U_FAILURE(err) || bufferSize <= 0) in TestConvertSafeClone()
1747 if (NULL == (cnv2 = ucnv_safeClone(cnv, buffer[0], &bufferSize, &err)) || U_FAILURE(err)) in TestConvertSafeClone()
1757 …if (NULL == (cnv2 = ucnv_safeClone(cnv, NULL, &bufferSize, &err)) || err != U_SAFECLONE_ALLOCATED_… in TestConvertSafeClone()
1769 …if (NULL == (cnv2 = ucnv_safeClone(cnv, NULL, &bufferSize, &err)) || err != U_SAFECLONE_ALLOCATED_… in TestConvertSafeClone()
1785 ucnv_close(cnv); in TestConvertSafeClone()
1797 cnv = ucnv_open(names[idx], &err); in TestConvertSafeClone()
1806 ucnv_safeClone(cnv, NULL, &actualSizes[idx], &err); in TestConvertSafeClone()
1816 cnv2 = ucnv_safeClone(cnv, buffer[1], &bufferSize, &err); in TestConvertSafeClone()
1819 ucnv_close(cnv); in TestConvertSafeClone()
1891 UConverter *cnv; in TestCCSID() local
1900 cnv=ucnv_openCCSID(ccsid, UCNV_IBM, &errorCode); in TestCCSID()
1906 if(ccsid!=ucnv_getCCSID(cnv, &errorCode)) { in TestCCSID()
1907 … log_err("error: ucnv_getCCSID(ucnv_openCCSID(%ld))=%ld\n", ccsid, ucnv_getCCSID(cnv, &errorCode)); in TestCCSID()
1911 if(ccsid != 1392 && UCNV_IBM!=ucnv_getPlatform(cnv, &errorCode)) { in TestCCSID()
1912 … ucnv_getPlatform(ucnv_openCCSID(%ld))=%ld!=UCNV_IBM\n", ccsid, ucnv_getPlatform(cnv, &errorCode)); in TestCCSID()
1915 ucnv_close(cnv); in TestCCSID()
2447 static UBool getTestChar(UConverter *cnv, const char *converterName, in getTestChar() argument
2463 ucnv_getUnicodeSet(cnv, set, UCNV_ROUNDTRIP_SET, &errorCode); in getTestChar()
2474 ucnv_fromUnicode(cnv, in getTestChar()
2482 ucnv_fromUnicode(cnv, in getTestChar()
2495 static void testFromTruncatedUTF8(UConverter *utf8Cnv, UConverter *cnv, const char *converterName, in testFromTruncatedUTF8() argument
2539 ucnv_convertEx(cnv, utf8Cnv, in testFromTruncatedUTF8()
2561 static void testFromBadUTF8(UConverter *utf8Cnv, UConverter *cnv, const char *converterName, in testFromBadUTF8() argument
2603 convertExMultiStreaming(utf8Cnv, cnv, in testFromBadUTF8()
2622 UConverter *utf8Cnv, *cnv; in TestConvertExFromUTF8() local
2639 cnv=ucnv_open(converterNames[i], &errorCode); in TestConvertExFromUTF8()
2644 …if(!getTestChar(cnv, converterNames[i], charUTF8, &charUTF8Length, char0, &char0Length, char1, &ch… in TestConvertExFromUTF8()
2647 …testFromTruncatedUTF8(utf8Cnv, cnv, converterNames[i], charUTF8, charUTF8Length, char0, char0Lengt… in TestConvertExFromUTF8()
2648 …testFromBadUTF8(utf8Cnv, cnv, converterNames[i], charUTF8, charUTF8Length, char0, char0Length, cha… in TestConvertExFromUTF8()
2649 ucnv_close(cnv); in TestConvertExFromUTF8()
2665 UConverter *utf8Cnv, *cnv; in TestConvertExFromUTF8_C5F0() local
2698 cnv=ucnv_open(converterNames[i], &errorCode); in TestConvertExFromUTF8_C5F0()
2699 ucnv_setFromUCallBack(cnv, UCNV_FROM_U_CALLBACK_ESCAPE, UCNV_ESCAPE_XML_DEC, in TestConvertExFromUTF8_C5F0()
2723 cnv, utf8Cnv, in TestConvertExFromUTF8_C5F0()
2734 ucnv_close(cnv); in TestConvertExFromUTF8_C5F0()
2768 UConverter *cnv; in TestConvertAlgorithmic() local
2774 cnv=ucnv_open("Shift-JIS", &errorCode); in TestConvertAlgorithmic()
2777 ucnv_close(cnv); in TestConvertAlgorithmic()
2793 …length=ucnv_fromAlgorithmic(cnv, UCNV_UTF8, target, sizeof(shiftJIS), (const char *)utf8, sizeof(u… in TestConvertAlgorithmic()
2805 length=ucnv_toAlgorithmic(UCNV_UTF8, cnv, target, sizeof(target), shiftJISNUL, -1, &errorCode); in TestConvertAlgorithmic()
2816 length=ucnv_toAlgorithmic(UCNV_UTF8, cnv, target, sizeof(target), shiftJISNUL, 0, &errorCode); in TestConvertAlgorithmic()
2826 length=ucnv_fromAlgorithmic(cnv, UCNV_UTF16, target, 0, (const char *)utf16, 2, &errorCode); in TestConvertAlgorithmic()
2836 length=ucnv_fromAlgorithmic(cnv, UCNV_UTF32, target, 0, (const char *)utf32, 4, &errorCode); in TestConvertAlgorithmic()
2847 length=ucnv_fromAlgorithmic(cnv, UCNV_UTF16, target, 0, (const char *)utf16, 2, &errorCode); in TestConvertAlgorithmic()
2854 length=ucnv_fromAlgorithmic(cnv, UCNV_UTF16, target, 0, NULL, 2, &errorCode); in TestConvertAlgorithmic()
2861 …length=ucnv_fromAlgorithmic(cnv, (UConverterType)99, target, 0, (const char *)utf16, 2, &errorCode… in TestConvertAlgorithmic()
2865 ucnv_close(cnv); in TestConvertAlgorithmic()
2923 UConverter *cnv = cnv_open(converter[idx].name, &status); in TestLMBCSMaxChar() local
2927 if (converter[idx].maxSize != ucnv_getMaxCharSize(cnv)) { in TestLMBCSMaxChar()
2929 converter[idx].name, converter[idx].maxSize, ucnv_getMaxCharSize(cnv)); in TestLMBCSMaxChar()
2931 ucnv_close(cnv); in TestLMBCSMaxChar()
2943 UConverter *cnv; in TestJ1968() local
2953 cnv = ucnv_openU(myConvNameU, &err); in TestJ1968()
2954 if (cnv || err != U_ILLEGAL_ARGUMENT_ERROR) { in TestJ1968()
2960 cnv = ucnv_openU(myConvNameU, &err); in TestJ1968()
2961 if (cnv || err != U_ILLEGAL_ARGUMENT_ERROR) { in TestJ1968()
2967 cnv = ucnv_openU(myConvNameU, &err); in TestJ1968()
2968 if (cnv || err != U_FILE_ACCESS_ERROR) { in TestJ1968()
2976 cnv = ucnv_open(myConvName, &err); in TestJ1968()
2977 if (cnv || err != U_ILLEGAL_ARGUMENT_ERROR) { in TestJ1968()
2983 cnv = ucnv_open(myConvName, &err); in TestJ1968()
2984 if (cnv || err != U_ILLEGAL_ARGUMENT_ERROR) { in TestJ1968()
2990 cnv = ucnv_open(myConvName, &err); in TestJ1968()
2991 if (cnv || err != U_FILE_ACCESS_ERROR) { in TestJ1968()
2998 cnv = ucnv_open(myConvName, &err); in TestJ1968()
2999 if (cnv || err != U_ILLEGAL_ARGUMENT_ERROR) { in TestJ1968()
3006 cnv = ucnv_open(myConvName, &err); in TestJ1968()
3007 if (cnv || err != U_FILE_ACCESS_ERROR) { in TestJ1968()
3013 cnv = ucnv_open(myConvName, &err); in TestJ1968()
3014 if (cnv || err != U_ILLEGAL_ARGUMENT_ERROR) { in TestJ1968()
3020 cnv = ucnv_open(myConvName, &err); in TestJ1968()
3021 if (cnv || err != U_FILE_ACCESS_ERROR) { in TestJ1968()
3050 UConverter *cnv, *swapCnv; in testSwap() local
3061 cnv=ucnv_open(name, &errorCode); in testSwap()
3083 …ucnv_fromUnicode(cnv, &pc, normal+UPRV_LENGTHOF(normal), &pcu, text+UPRV_LENGTHOF(text), NULL, TRU… in testSwap()
3121 …ucnv_toUnicode(cnv, &pu, uNormal+UPRV_LENGTHOF(uNormal), (const char **)&pc, normal+normalLength, … in testSwap()
3158 ucnv_close(cnv); in testSwap()
3203 UConverter* cnv = ucnv_openPackage(loadTestData(&status), "test3", &status); in TestFromUCountPending() local
3215 ucnv_reset(cnv); in TestFromUCountPending()
3216 ucnv_fromUnicode(cnv,&target, targetLimit, &source, sourceLimit, NULL, FALSE, &status); in TestFromUCountPending()
3217 len = ucnv_fromUCountPending(cnv, &status); in TestFromUCountPending()
3250 ucnv_reset(cnv); in TestFromUCountPending()
3251 ucnv_fromUnicode(cnv,&target, targetLimit, &source, sourceLimit, NULL, FALSE, &status); in TestFromUCountPending()
3252 len = ucnv_fromUCountPending(cnv, &status); in TestFromUCountPending()
3262 ucnv_fromUnicode(cnv,&target, targetLimit, &source, sourceLimit, NULL, FALSE, &status); in TestFromUCountPending()
3263 len = ucnv_fromUCountPending(cnv, &status); in TestFromUCountPending()
3273 ucnv_fromUnicode(cnv,&target, targetLimit, &source, sourceLimit, NULL, FALSE, &status); in TestFromUCountPending()
3278 len = ucnv_fromUCountPending(cnv, &status); in TestFromUCountPending()
3287 ucnv_close(cnv); in TestFromUCountPending()
3308 UConverter* cnv = ucnv_openPackage(loadTestData(&status), "test3", &status); in TestToUCountPending() local
3313 ucnv_setToUCallBack(cnv, UCNV_TO_U_CALLBACK_STOP, NULL, oldToUAction, NULL, &status); in TestToUCountPending()
3321 ucnv_reset(cnv); in TestToUCountPending()
3322 ucnv_toUnicode(cnv, &target, targetLimit, &source, sourceLimit, NULL, FALSE, &status); in TestToUCountPending()
3323 len = ucnv_toUCountPending(cnv,&status); in TestToUCountPending()
3334 ucnv_close(cnv); in TestToUCountPending()
3358 cnv = ucnv_openPackage(loadTestData(&status), "test4", &status); in TestToUCountPending()
3363 ucnv_setToUCallBack(cnv, UCNV_TO_U_CALLBACK_STOP, NULL, oldToUAction, NULL, &status); in TestToUCountPending()
3364 ucnv_toUnicode(cnv,&target, targetLimit, &source, sourceLimit, NULL, FALSE, &status); in TestToUCountPending()
3365 len = ucnv_toUCountPending(cnv,&status); in TestToUCountPending()
3374 ucnv_toUnicode(cnv,&target, targetLimit, &source, sourceLimit, NULL, FALSE, &status); in TestToUCountPending()
3375 len = ucnv_toUCountPending(cnv,&status); in TestToUCountPending()
3386 ucnv_toUnicode(cnv,&target, targetLimit, &source, sourceLimit, NULL, FALSE, &status); in TestToUCountPending()
3391 len = ucnv_toUCountPending(cnv,&status); in TestToUCountPending()
3399 ucnv_close(cnv); in TestToUCountPending()
3406 UConverter *cnv; in TestOneDefaultNameChange() local
3412 cnv=ucnv_open(NULL, &status); in TestOneDefaultNameChange()
3413 if (U_FAILURE(status) || cnv == NULL) { in TestOneDefaultNameChange()
3417 if(strcmp(ucnv_getName(cnv, &status), expected)==0) in TestOneDefaultNameChange()
3421 ucnv_close(cnv); in TestOneDefaultNameChange()
3509 UConverter *cnv; in TestSubstString() local
3516 cnv=ucnv_open("UTF-16", &errorCode); in TestSubstString()
3521 length=ucnv_fromUChars(cnv, buffer, (int32_t)sizeof(buffer), surrogate, 1, &errorCode); in TestSubstString()
3522 ucnv_close(cnv); in TestSubstString()
3531 cnv=ucnv_open("UTF-32", &errorCode); in TestSubstString()
3536 length=ucnv_fromUChars(cnv, buffer, (int32_t)sizeof(buffer), surrogate, 1, &errorCode); in TestSubstString()
3537 ucnv_close(cnv); in TestSubstString()
3547 cnv=ucnv_open("ISO-8859-1", &errorCode); in TestSubstString()
3552 ucnv_setSubstString(cnv, sub, UPRV_LENGTHOF(sub), &errorCode); in TestSubstString()
3557 ucnv_getSubstChars(cnv, buffer, &len8, &errorCode); in TestSubstString()
3563 ucnv_close(cnv); in TestSubstString()
3567 cnv=ucnv_open("HZ", &errorCode); in TestSubstString()
3572 ucnv_setSubstString(cnv, sub, UPRV_LENGTHOF(sub), &errorCode); in TestSubstString()
3577 ucnv_getSubstChars(cnv, buffer, &len8, &errorCode); in TestSubstString()
3583 ucnv_close(cnv); in TestSubstString()
3595 UConverter *cnv; in InvalidArguments() local
3604 cnv=ucnv_open("UTF-8", &errorCode); in InvalidArguments()
3612 …ucnv_fromUnicode(cnv, &charsPtr, charsPtr, (const UChar **)&ucharsPtr, ucharsBadPtr, NULL, TRUE, &… in InvalidArguments()
3619 …ucnv_fromUnicode(cnv, &charsPtr, charsPtr, (const UChar **)&ucharsBadPtr, ucharsPtr, NULL, TRUE, &… in InvalidArguments()
3626 …ucnv_toUnicode(cnv, &ucharsPtr, ucharsBadPtr, (const char **)&charsPtr, charsPtr, NULL, TRUE, &err… in InvalidArguments()
3633 …ucnv_toUnicode(cnv, &ucharsBadPtr, ucharsPtr, (const char **)&charsPtr, charsPtr, NULL, TRUE, &err… in InvalidArguments()
3644 ucnv_close(cnv); in InvalidArguments()
3659 UConverter *cnv = ucnv_open(names[i], &errorCode); in TestGetName() local
3661 const char *name = ucnv_getName(cnv, &errorCode); in TestGetName()
3666 ucnv_close(cnv); in TestGetName()
3702 UConverter *cnv = ucnv_open(names[i], &errorCode); in TestUTFBOM() local
3709 length = ucnv_fromUChars(cnv, bytes, (int32_t)sizeof(bytes), a16, 1, &errorCode); in TestUTFBOM()
3715 ucnv_close(cnv); in TestUTFBOM()