Lines Matching refs:source
28 static void TestNextUChar(UConverter* cnv, const char* source, const char* limit, const int32_t results[], const char* message);
29 static void TestNextUCharError(UConverter* cnv, const char* source, const char* limit, UErrorCode expected, const char* message);
159 TestNextUChar(UConverter* cnv, const char* source, const char* limit, const int32_t results[], const char* message)
162 const char* s=(char*)source;
189 TestNextUCharError(UConverter* cnv, const char* source, const char* limit, UErrorCode expected, const char* message)
191 const char* s=(char*)source;
363 static ETestConvertResult testConvertFromU( const UChar *source, int sourceLen, const uint8_t *expect, int expectLen,
405 src = source;
411 realSourceEnd = source + sourceLen;
427 log_verbose("calling fromUnicode @ SOURCE:%08lx to %08lx TARGET: %08lx to %08lx, flush=%s\n", src,sourceLimit, targ,end, doFlush?"TRUE":"FALSE");
508 printUSeqErr(source, sourceLen);
520 static ETestConvertResult testConvertToU( const uint8_t *source, int sourcelen, const UChar *expect, int expectlen,
563 src = (const char *)source;
596 (UBool)(srcLimit == realSourceEnd), /* flush if we're at the end of hte source data */
659 for(i=0; i<(src-(const char *)source); i++) {
660 log_err("%X,", (unsigned char)source[i]);
1675 const char* source = NULL;
1679 source = data[i];
1680 enc = ucnv_detectUnicodeSignature(source, -1 , &signatureLength, &err);
1682 log_err("ucnv_detectUnicodeSignature failed for source : %s at index :%i. Error: %s\n", source,i,u_errorName(err));
1686 log_err("ucnv_detectUnicodeSignature failed for source : %s at index :%i. Expected: %s. Got: %s\n",source,i,expected[i],enc);
1690 log_err("ucnv_detectUnicodeSignature failed for source : %s at index :%i.Expected Length: %i. Got length: %i\n",source,i,signatureLength,expectedLength[i]);
1788 const char* source = NULL;
1792 source = data[i];
1794 enc = ucnv_detectUnicodeSignature(source, sourceLength , &signatureLength, &err);
1796 log_err("ucnv_detectUnicodeSignature test2 failed for source : %s at index :%i. Error: %s\n", source,i,u_errorName(err));
1801 log_err("ucnv_detectUnicodeSignature test2 failed for source : %s at index :%i. Expected: %s. Got: %s\n",source,i,expected[i],enc);
1806 source : %s at index :%i.Expected Length: %i. Got length: %i\n",source,i,signatureLength,expectedLength[i]);
1838 const char *source=(const char *)in, *limit=(const char *)in+sizeof(in);
1845 TestNextUChar(cnv, source, limit, results, "UTF-7");
1846 /* Test the condition when source >= sourceLimit */
1847 TestNextUCharError(cnv, source, source, U_INDEX_OUTOFBOUNDS_ERROR, "sourceLimit <= source");
1881 const char *source=(const char *)in, *limit=(const char *)in+sizeof(in);
1888 TestNextUChar(cnv, source, limit, results, "IMAP-mailbox-name");
1889 /* Test the condition when source >= sourceLimit */
1890 TestNextUCharError(cnv, source, source, U_INDEX_OUTOFBOUNDS_ERROR, "sourceLimit <= source");
1943 const char *source=(const char *)in,*limit=(const char *)in+sizeof(in);
1950 TestNextUChar(cnv, source, limit, results, "UTF-8");
1951 /* Test the condition when source >= sourceLimit */
1952 TestNextUCharError(cnv, source, source, U_INDEX_OUTOFBOUNDS_ERROR, "sourceLimit <= source");
1956 source=(const char *)in2;
1958 TestNextUChar(cnv, source, limit, results2, "UTF-8");
2014 const char *source=(const char *)in,*limit=(const char *)in+sizeof(in);
2021 TestNextUChar(cnv, source, limit, results, "CESU-8");
2022 /* Test the condition when source >= sourceLimit */
2023 TestNextUCharError(cnv, source, source, U_INDEX_OUTOFBOUNDS_ERROR, "sourceLimit <= source");
2027 source=(const char *)in2;
2029 TestNextUChar(cnv, source, limit, results2, "CESU-8");
2065 const char *source, *limit;
2074 source=(const char *)in1, limit=(const char *)in1+sizeof(in1);
2075 TestNextUChar(cnv, source, limit, results1, "UTF-16");
2077 source=(const char *)in2, limit=(const char *)in2+sizeof(in2);
2079 TestNextUChar(cnv, source, limit, results2, "UTF-16");
2081 source=(const char *)in3, limit=(const char *)in3+sizeof(in3);
2083 TestNextUChar(cnv, source, limit, results3, "UTF-16");
2085 /* Test the condition when source >= sourceLimit */
2087 TestNextUCharError(cnv, source, source, U_INDEX_OUTOFBOUNDS_ERROR, "sourceLimit <= source");
2114 const char *source=(const char *)in, *limit=(const char *)in+sizeof(in);
2121 TestNextUChar(cnv, source, limit, results, "UTF-16BE");
2122 /* Test the condition when source >= sourceLimit */
2123 TestNextUCharError(cnv, source, source, U_INDEX_OUTOFBOUNDS_ERROR, "sourceLimit <= source");
2168 const char *source=(const char *)in, *limit=(const char *)in+sizeof(in);
2175 TestNextUChar(cnv, source, limit, results, "UTF-16LE");
2176 /* Test the condition when source >= sourceLimit */
2177 TestNextUCharError(cnv, source, source, U_INDEX_OUTOFBOUNDS_ERROR, "sourceLimit <= source");
2233 const char *source, *limit;
2242 source=(const char *)in1, limit=(const char *)in1+sizeof(in1);
2243 TestNextUChar(cnv, source, limit, results1, "UTF-32");
2245 source=(const char *)in2, limit=(const char *)in2+sizeof(in2);
2247 TestNextUChar(cnv, source, limit, results2, "UTF-32");
2249 source=(const char *)in3, limit=(const char *)in3+sizeof(in3);
2251 TestNextUChar(cnv, source, limit, results3, "UTF-32");
2253 /* Test the condition when source >= sourceLimit */
2255 TestNextUCharError(cnv, source, source, U_INDEX_OUTOFBOUNDS_ERROR, "sourceLimit <= source");
2310 const char *source=(const char *)in, *limit=(const char *)in+sizeof(in);
2317 TestNextUChar(cnv, source, limit, results, "UTF-32BE");
2319 /* Test the condition when source >= sourceLimit */
2320 TestNextUCharError(cnv, source, source, U_INDEX_OUTOFBOUNDS_ERROR, "sourceLimit <= source");
2324 source=(const char *)in2;
2326 TestNextUChar(cnv, source, limit, results2, "UTF-32BE");
2381 const char *source=(const char *)in, *limit=(const char *)in+sizeof(in);
2388 TestNextUChar(cnv, source, limit, results, "UTF-32LE");
2390 /* Test the condition when source >= sourceLimit */
2391 TestNextUCharError(cnv, source, source, U_INDEX_OUTOFBOUNDS_ERROR, "sourceLimit <= source");
2395 source=(const char *)in2;
2397 TestNextUChar(cnv, source, limit, results2, "UTF-32LE");
2512 const char *source=(const char *)in;
2521 TestNextUChar(cnv, source, limit, results, "LATIN_1");
2522 /* Test the condition when source >= sourceLimit */
2523 TestNextUCharError(cnv, source, source, U_INDEX_OUTOFBOUNDS_ERROR, "sourceLimit <= source");
2545 const char *source=(const char *)in, *limit=(const char *)in+sizeof(in);
2552 TestNextUChar(cnv, source, limit, results, "SBCS(x-mac-turkish)");
2553 /* Test the condition when source >= sourceLimit */
2554 TestNextUCharError(cnv, source, source, U_INDEX_OUTOFBOUNDS_ERROR, "sourceLimit <= source");
2559 TestNextUCharError(cnv, illegalsource, illegalsource+sizeof(illegalsource), U_INVALID_CHAR_FOUND, "source has a illegal characte");
2587 const char *source=(const char *)in, *limit=(const char *)in+sizeof(in);
2595 TestNextUChar(cnv, source, limit, results, "DBCS(@ibm9027)");
2596 /* Test the condition when source >= sourceLimit */
2597 TestNextUCharError(cnv, source, source, U_INDEX_OUTOFBOUNDS_ERROR, "sourceLimit <= source");
2638 const char *source=(const char *)in, *limit=(const char *)in+sizeof(in);
2646 TestNextUChar(cnv, source, limit, results, "MBCS(ibm-1363)");
2647 /* Test the condition when source >= sourceLimit */
2648 TestNextUCharError(cnv, source, source, U_INDEX_OUTOFBOUNDS_ERROR, "sourceLimit <= source");
2673 const uint8_t *source = sourceData;
2686 ucnv_toUnicode(cnv, &target, targetLim, &source, sourceLim, NULL, TRUE, &status);
2688 log_info("After convert: target@%d, source@%d, status%s\n",
2689 target-targetBuf, source-sourceData, u_errorName(status));
2698 c1=ucnv_getNextUChar(cnv, &source, sourceLim, &status);
2699 log_verbose("c1: U+%04X, source@%d, status %s\n", c1, source-sourceData, u_errorName(status));
2701 c2=ucnv_getNextUChar(cnv, &source, sourceLim, &status);
2702 log_verbose("c2: U+%04X, source@%d, status %s\n", c2, source-sourceData, u_errorName(status));
2704 c3=ucnv_getNextUChar(cnv, &source, sourceLim, &status);
2705 log_verbose("c3: U+%04X, source@%d, status %s\n", c3, source-sourceData, u_errorName(status));
2746 const char *source=(const char *)in, *limit=(const char *)in+sizeof(in);
2755 TestNextUChar(cnv, source, limit, results, "ISO_2022");
2757 /* Test the condition when source >= sourceLimit */
2758 TestNextUCharError(cnv, source, source-1, U_ILLEGAL_ARGUMENT_ERROR, "sourceLimit < source");
2759 TestNextUCharError(cnv, source, source, U_INDEX_OUTOFBOUNDS_ERROR, "sourceLimit <= source");
2777 TestSmallTargetBuffer(const uint16_t* source, const UChar* sourceLimit,UConverter* cnv){
2796 uSource = (UChar*) source;
2834 uSource = source;
2836 for(len=0;len<(int)(source - sourceLimit);len++){
2846 static void TestToAndFromUChars(const uint16_t* source, const UChar* sourceLimit,UConverter* cnv){
2861 uSource = source;
2880 uSource = source;
2893 static void TestSmallSourceBuffer(const uint16_t* source, const UChar* sourceLimit,UConverter* cnv){
2914 uSource = (UChar*) source;
2956 uSource = source;
2958 for(;len<(int)(source - sourceLimit);len++){
2968 TestGetNextUChar2022(UConverter* cnv, const char* source, const char* limit,
2971 const char* s=(char*)source;
3005 const UChar*source = in;
3022 &source,
3023 source+3,
3049 &source,
3050 source,
3773 char source[] = { 0x1b,0x24,0x42,0x3d,0x45,0x1b,0x28,0x4a,0x0d,0x0a,
3784 const char* csource=source;
3793 ucnv_toUnicode(conv,&utarget,utargetLimit,&csource,csource+sizeof(source),NULL,TRUE,&err);
4154 static const char* source = "\x1b\x24\x29\x43\x6b\x6b\x6e\x6e\x6a\x68\x70\x6f\x69\x75\x79\x71\x77\x65\x68\x67\x0A"
4166 ucnv_toUnicode(kr,&target,targetLimit,&source,source+uprv_strlen(source),NULL,TRUE,&errorCode);
4178 ucnv_toUnicode(kr,&target,targetLimit,&source,source+uprv_strlen(source),NULL,TRUE,&errorCode);
4655 const char *source=(const char *)in, *limit=(const char *)in+sizeof(in);
4662 TestNextUChar(cnv, source, limit, results, "EBCDIC_STATEFUL(ibm-930)");
4664 /* Test the condition when source >= sourceLimit */
4665 TestNextUCharError(cnv, source, source, U_INDEX_OUTOFBOUNDS_ERROR, "sourceLimit <= source");
4667 /*Test for the condition where source > sourcelimit after consuming the shift chracter */
4679 source=(const char*)in2;
4681 TestNextUChar(cnv,source,limit,results2,"EBCDIC_STATEFUL(ibm-930),seq#2");
4731 /* const char *source=(const char *)in,*limit=(const char *)in+sizeof(in); */
4946 const char *source=(const char *)pszLMBCS;
4962 while(source<limit) {
4963 sourceStart=source;
4964 uniChar=ucnv_getNextUChar(cnv, &source, source + (off[1] - off[0]), &errorCode);
4968 } else if(source-sourceStart != off[1] - off[0] || uniChar != *results) {
4970 uniChar, (source-sourceStart), *results, *off);
5064 /* Small source buffer testing, LMBCS -> Unicode */
5134 /* negative source request should always return U_ILLEGAL_ARGUMENT_ERROR */
5138 log_err("Unexpected Error on negative source request to ucnv_fromUnicode: %s\n", u_errorName(errorCode));
5144 log_err("Unexpected Error on negative source request to ucnv_toUnicode: %s\n", u_errorName(errorCode));
5151 log_err("Unexpected Error on negative source request to ucnv_getNextUChar: %s\n", u_errorName(errorCode));
5155 /* 0 byte source request - no error, no pointer movement */
5159 log_err("0 byte source request: unexpected error: %s\n", u_errorName(errorCode));
5163 log_err("Unexpected pointer move in 0 byte source request \n");
5165 /*0 byte source request - GetNextUChar : error & value == fffe or ffff */
5169 log_err("Unexpected Error on 0-byte source request to ucnv_getnextUChar: %s\n", u_errorName(errorCode));
5173 log_err("Unexpected value on 0-byte source request to ucnv_getnextUChar \n");
5463 const char* source = data;
5473 ucnv_toUnicode(conv, &target, targetLimit, &source, sourceLimit, NULL, TRUE, &status);
5516 const char* source = data;
5519 ucnv_toUnicode(conv, &target, targetLimit, &source, sourceLimit, NULL, TRUE, &status);