Home | History | Annotate | Download | only in cintltst

Lines Matching defs:pBiDi

36 static void doTests(UBiDi *pBiDi, UBiDi *pLine, UBool countRunsFirst);
40 static void doTest(UBiDi *pBiDi, int testNumber, const BiDiTestData *test,
43 static void _testReordering(UBiDi *pBiDi, int testNumber);
47 static void _testManyInverseBidi(UBiDi *pBiDi, UBiDiLevel direction);
49 static void _testInverseBidi(UBiDi *pBiDi, const UChar *src, int32_t srcLength,
97 static const char* inverseBasic(UBiDi *pBiDi, const char *src, int32_t srcLen,
99 static UBool assertRoundTrip(UBiDi *pBiDi, int32_t tc, int32_t outIndex,
103 static UBool checkResultLength(UBiDi *pBiDi, const char *srcChars,
107 static UBool checkMaps(UBiDi *pBiDi, int32_t stringIndex, const char *src,
171 UBiDi *pBiDi, *pLine=NULL;
176 pBiDi=ubidi_openSized(MAXLEN, 0, &errorCode);
177 if(pBiDi!=NULL) {
180 doTests(pBiDi, pLine, FALSE);
181 doTests(pBiDi, pLine, TRUE);
193 if(pBiDi!=NULL) {
194 ubidi_close(pBiDi);
201 doTests(UBiDi *pBiDi, UBiDi *pLine, UBool countRunsFirst) {
212 ubidi_setPara(pBiDi, string, -1, paraLevel, NULL, &errorCode);
215 testNumber, paraLevel, ubidi_getDirection(pBiDi), paraLevel);
218 doTest(pBiDi, testNumber, tests+testNumber, 0, countRunsFirst);
220 ubidi_setLine(pBiDi, lineStart, tests[testNumber].lineLimit, pLine, &errorCode);
1033 doTest(UBiDi *pBiDi, int testNumber, const BiDiTestData *test, int32_t lineStart, UBool countRunsFirst) {
1037 int32_t i, len=ubidi_getLength(pBiDi), logicalIndex, runCount = 0;
1044 runCount = ubidi_countRuns(pBiDi, &errorCode);
1054 _testReordering(pBiDi, testNumber);
1058 i, ubidi_getLevelAt(pBiDi, i), ubidi_getLevelAt(pBiDi, i), levelString,
1060 ubidi_getVisualIndex(pBiDi, i, &errorCode));
1068 log_verbose(" %d", ubidi_getLevelAt(pBiDi, i));
1076 log_verbose(" %d", ubidi_getVisualIndex(pBiDi, i, &errorCode));
1080 if(test->direction!=ubidi_getDirection(pBiDi)) {
1081 log_err("ubidi_getDirection(tests[%d]): wrong direction %d\n", testNumber, ubidi_getDirection(pBiDi));
1084 if(test->resultLevel!=ubidi_getParaLevel(pBiDi)) {
1085 log_err("ubidi_getParaLevel(tests[%d]): wrong paragraph level %d\n", testNumber, ubidi_getParaLevel(pBiDi));
1089 if(levels[i]!=ubidi_getLevelAt(pBiDi, i)) {
1090 log_err("ubidi_getLevelAt(tests[%d], %d): wrong level %d, expected %d\n", testNumber, i, ubidi_getLevelAt(pBiDi, i), levels[i]);
1096 logicalIndex=ubidi_getVisualIndex(pBiDi, i, &errorCode);
1108 runCount=ubidi_countRuns(pBiDi, &errorCode);
1116 level=ubidi_getLevelAt(pBiDi, logicalIndex);
1117 ubidi_getLogicalRun(pBiDi, logicalIndex, &logicalIndex, &level2);
1126 testNumber, ubidi_countRuns(pBiDi, &errorCode));
1133 testNumber, ubidi_countRuns(pBiDi, &errorCode));
1141 _testReordering(UBiDi *pBiDi, int testNumber) {
1147 int32_t i, length=ubidi_getLength(pBiDi),
1148 destLength=ubidi_getResultLength(pBiDi);
1157 ubidi_getLogicalMap(pBiDi, logicalMap1, &errorCode);
1163 ubidi_getVisualMap(pBiDi, visualMap1, &errorCode);
1174 levels=ubidi_getLevels(pBiDi, &errorCode);
1185 runCount=ubidi_countRuns(pBiDi, &errorCode);
1193 odd=(UBool)ubidi_getVisualRun(pBiDi, i, &logicalStart, &runLength);
1264 if(logicalMap1[i]!=ubidi_getVisualIndex(pBiDi, i, &errorCode)) {
1272 if(visualMap1[i]!=ubidi_getLogicalIndex(pBiDi, i, &errorCode)) {
1844 UBiDi* pBidi=ubidi_open();
1853 ubidi_setPara(pBidi, src, srcSize, UBIDI_LTR, NULL, &errorCode);
1857 ubidi_close(pBidi);
1861 if (paraCount!=(count=ubidi_countParagraphs(pBidi))) {
1866 ubidi_getParagraphByIndex(pBidi, i, &paraStart, &paraLimit, NULL, &errorCode);
1875 ubidi_setPara(pBidi, src, srcSize, UBIDI_LTR, NULL, &errorCode);
1879 ubidi_close(pBidi);
1882 if (paraCount!=(count=ubidi_countParagraphs(pBidi))) {
1887 ubidi_getParagraphByIndex(pBidi, i, &paraStart, &paraLimit, NULL, &errorCode);
1895 ubidi_setPara(pBidi, src, srcSize, paraLevels[k], NULL, &errorCode);
1897 paraIndex=ubidi_getParagraph(pBidi, paraBounds[i], NULL, NULL, &gotLevel, &errorCode);
1907 gotLevel=ubidi_getParaLevel(pBidi);
1918 ubidi_setPara(pBidi, src, srcSize, UBIDI_DEFAULT_LTR, NULL, &errorCode);
1919 gotLevel=ubidi_getParaLevel(pBidi);
1929 ubidi_setLine(pBidi, i, k, pLine, &errorCode);
1937 ubidi_setLine(pBidi, i, k, pLine, &errorCode);
1944 ubidi_setPara(pBidi, src, srcSize, UBIDI_RTL, NULL, &errorCode);
1946 gotLevels=ubidi_getLevels(pBidi, &errorCode);
1950 ubidi_close(pBidi);
1962 ubidi_setLine(pBidi, i, k, pLine, &errorCode);
1967 ubidi_close(pBidi);
1975 ubidi_close(pBidi);
1984 orderParagraphsLTR=ubidi_isOrderParagraphsLTR(pBidi);
1988 ubidi_orderParagraphsLTR(pBidi, TRUE);
1989 orderParagraphsLTR=ubidi_isOrderParagraphsLTR(pBidi);
1994 ubidi_setPara(pBidi, src, srcSize, UBIDI_RTL, NULL, &errorCode);
1996 gotLevels=ubidi_getLevels(pBidi, &errorCode);
2007 ubidi_setLine(pBidi, paraStart, paraLimit, pLine, &errorCode);
2029 ubidi_orderParagraphsLTR(pBidi, FALSE);
2030 ubidi_setPara(pBidi, src, srcSize, UBIDI_DEFAULT_RTL, NULL, &errorCode);
2031 gotLevels=ubidi_getLevels(pBidi, &errorCode);
2051 ubidi_orderParagraphsLTR(pBidi, TRUE);
2052 ubidi_setPara(pBidi, src, srcSize, UBIDI_RTL, NULL, &errorCode);
2053 gotLevels=ubidi_getLevels(pBidi, &errorCode);
2070 ubidi_orderParagraphsLTR(pBidi, TRUE);
2077 ubidi_setPara(pBidi, src, srcSize, gotLevel, NULL, &errorCode);
2078 gotLevels=ubidi_getLevels(pBidi, &errorCode);
2094 ubidi_setReorderingMode(pBidi, UBIDI_REORDER_INVERSE_LIKE_DIRECT);
2096 ubidi_setPara(pBidi, src, srcLen, UBIDI_DEFAULT_LTR, NULL, &errorCode);
2097 destLen = ubidi_writeReordered(pBidi, dest, MAXLEN, 0, &errorCode);
2104 ubidi_setPara(pBidi, src, srcLen, UBIDI_DEFAULT_LTR, NULL, &errorCode);
2105 destLen = ubidi_writeReordered(pBidi, dest, MAXLEN, 0, &errorCode);
2114 ubidi_setReorderingMode(pBidi, UBIDI_REORDER_DEFAULT);
2116 ubidi_setPara(pBidi, src, srcLen, UBIDI_LTR, myLevels, &errorCode);
2117 destLen = ubidi_writeReordered(pBidi, dest, MAXLEN, 0, &errorCode);
2123 count = ubidi_countParagraphs(pBidi);
2129 ubidi_close(pBidi);
2134 pBidi = ubidi_open();
2136 ubidi_setPara(pBidi, multiparaTestString, UPRV_LENGTHOF(multiparaTestString),
2140 ubidi_close(pBidi);
2143 gotLevels = ubidi_getLevels(pBidi, &errorCode);
2146 ubidi_close(pBidi);
2156 ubidi_close(pBidi);
2187 UBiDi *pBiDi;
2192 pBiDi=ubidi_open();
2193 if(pBiDi==NULL) {
2202 _testInverseBidi(pBiDi, testCases[i].s, testCases[i].length, 0, &errorCode);
2209 _testInverseBidi(pBiDi, testCases[i].s, testCases[i].length, 1, &errorCode);
2212 _testManyInverseBidi(pBiDi, 0);
2213 _testManyInverseBidi(pBiDi, 1);
2215 ubidi_close(pBiDi);
2240 _testManyInverseBidi(UBiDi *pBiDi, UBiDiLevel direction) {
2259 _testInverseBidi(pBiDi, text, 8, direction, &errorCode);
2266 _testInverseBidi(UBiDi *pBiDi, const UChar *src, int32_t srcLength,
2275 ubidi_setInverse(pBiDi, TRUE);
2276 if (!ubidi_isInverse(pBiDi)) {
2279 ubidi_setPara(pBiDi, src, srcLength, 0, NULL, pErrorCode);
2280 if (src != ubidi_getText(pBiDi)) {
2283 logicalLength=ubidi_writeReordered(pBiDi, logicalDest, UPRV_LENGTHOF(logicalDest),
2286 printUnicode(src, srcLength, ubidi_getLevels(pBiDi, pErrorCode));
2290 ubidi_setInverse(pBiDi, FALSE);
2291 if (ubidi_isInverse(pBiDi)) {
2294 ubidi_setPara(pBiDi, logicalDest, logicalLength, 0, NULL, pErrorCode);
2295 visualLength=ubidi_writeReordered(pBiDi, visualDest, UPRV_LENGTHOF(visualDest),
2307 ubidi_setInverse(pBiDi, TRUE);
2308 ubidi_setPara(pBiDi, visualLTR, ltrLength, 0, NULL, pErrorCode);
2309 logicalLength=ubidi_writeReordered(pBiDi, logicalDest, UPRV_LENGTHOF(logicalDest),
2312 printUnicode(visualLTR, ltrLength, ubidi_getLevels(pBiDi, pErrorCode));
2316 ubidi_setInverse(pBiDi, FALSE);
2317 ubidi_setPara(pBiDi, logicalDest, logicalLength, 0, NULL, pErrorCode);
2318 visualLength=ubidi_writeReordered(pBiDi, visualDest, UPRV_LENGTHOF(visualDest),
2322 printUnicode(logicalDest, logicalLength, ubidi_getLevels(pBiDi, pErrorCode));
3625 const char* mode, const char* option, UBiDi* pBiDi) {
3633 "Levels:", formatLevels(pBiDi, formatChars),
3634 "Reordering mode:", ubidi_getReorderingMode(pBiDi), mode,
3635 "Paragraph level:", ubidi_getParaLevel(pBiDi),
3636 "Reordering option:", ubidi_getReorderingOptions(pBiDi), option);
3644 UBiDi* pBiDi = ubidi_open();
3645 if (pBiDi == NULL) {
3648 return pBiDi;
3940 assertRoundTrip(UBiDi *pBiDi, int32_t tc, int32_t outIndex, const char *srcChars,
4040 ubidi_setReorderingMode(pBiDi, mode); \
4067 ubidi_setReorderingOptions(pBiDi, UBIDI_OPTION_REMOVE_CONTROLS);
4069 ubidi_setPara(pBiDi, dest, destLen, level, NULL, &rc);
4072 destLen2 = ubidi_writeReordered(pBiDi, dest2, MAXLEN, UBIDI_DO_MIRRORING,
4078 checkWhatYouCan(pBiDi, destChars3, destChars2);
4104 if (!checkResultLength(pBiDi, destChars, destChars2, destLen2,
4108 if (outIndex > -1 && !checkMaps(pBiDi, outIndex, srcChars, destChars,
4117 checkResultLength(UBiDi *pBiDi, const char *srcChars, const char *destChars,
4124 pBiDi);
4181 UBiDi *pBiDi = getBiDiObject();
4192 ubidi_close(pBiDi); /* in case this one was allocated */
4195 ubidi_setReorderingMode(pBiDi, UBIDI_REORDER_RUNS_ONLY);
4199 ubidi_setReorderingOptions(pBiDi, option==0 ? UBIDI_OPTION_REMOVE_CONTROLS
4208 ubidi_setPara(pBiDi, src, srcLen, level, NULL, &rc);
4211 destLen = ubidi_writeReordered(pBiDi, dest, MAXLEN, UBIDI_DO_MIRRORING, &rc);
4214 checkWhatYouCan(pBiDi, testCases[i].textIn, destChars);
4218 pBiDi);
4240 pBiDi);
4246 ubidi_setPara(pBiDi, src, 0, UBIDI_LTR, NULL, &rc);
4248 paras = ubidi_countParagraphs(pBiDi);
4253 ubidi_close(pBiDi);
4264 UBiDi *pBiDi = NULL, *pBiDi2 = NULL, *pBiDi3 = NULL;
4275 pBiDi = getBiDiObject();
4279 ubidi_close(pBiDi); /* in case this one was allocated */
4293 ubidi_setReorderingMode(pBiDi, modeValue);
4294 modeBack = ubidi_getReorderingMode(pBiDi);
4302 ubidi_setReorderingOptions(pBiDi, optionValue);
4303 optionBack = ubidi_getReorderingOptions(pBiDi);
4313 ubidi_setPara(pBiDi, src, srcLen, paraLevels[level], NULL, &rc);
4317 destLen = ubidi_writeReordered(pBiDi, dest, MAXLEN,
4323 checkWhatYouCan(pBiDi, srcChars, destChars);
4338 pBiDi)) {
4347 else if (!checkResultLength(pBiDi, srcChars, destChars,
4353 else if (idx > -1 && !checkMaps(pBiDi, idx, srcChars,
4368 ubidi_close(pBiDi);
4373 static const char* inverseBasic(UBiDi *pBiDi, const char *srcChars, int32_t srcLen,
4379 if (pBiDi == NULL || srcChars == NULL) {
4382 ubidi_setReorderingOptions(pBiDi, option);
4384 ubidi_setPara(pBiDi, src, srcLen, level, NULL, &rc);
4388 destLen = ubidi_writeReordered(pBiDi, dest2, MAXLEN,
4393 checkWhatYouCan(pBiDi, srcChars, result);
4434 UBiDi *pBiDi = NULL;
4446 pBiDi = getBiDiObject();
4448 ubidi_orderParagraphsLTR(pBiDi, TRUE);
4461 ubidi_setReorderingOptions(pBiDi, UBIDI_OPTION_STREAMING);
4465 ubidi_setPara(pBiDi, pSrc, len, level, NULL, &rc);
4470 processedLen = ubidi_getProcessedLength(pBiDi);
4472 ubidi_setReorderingOptions(pBiDi, UBIDI_OPTION_DEFAULT);
4476 ubidi_setReorderingOptions(pBiDi, UBIDI_OPTION_STREAMING);
4497 ubidi_close(pBiDi);
4562 UBiDi *pBiDi = NULL;
4571 pBiDi = getBiDiObject();
4572 if(!pBiDi) {
4576 ubidi_getClassCallback(pBiDi, &oldFn, &oldContext);
4579 ubidi_setClassCallback(pBiDi, newFn, textSrc, &oldFn, &oldContext, &rc);
4581 ubidi_close(pBiDi);
4586 ubidi_getClassCallback(pBiDi, &oldFn, &oldContext);
4589 ubidi_setClassCallback(pBiDi, newFn, textSrc, &oldFn, &oldContext, &rc);
4591 ubidi_close(pBiDi);
4597 ubidi_setPara(pBiDi, src, srcLen, UBIDI_LTR, NULL, &rc);
4600 destLen = ubidi_writeReordered(pBiDi, dest, MAXLEN,
4614 ubidi_close(pBiDi);
4637 checkMaps(UBiDi *pBiDi, int32_t stringIndex, const char *src, const char *dest,
4656 ubidi_getLogicalMap(pBiDi, actualLogicalMap, &rc);
4660 srcLen = ubidi_getProcessedLength(pBiDi);
4678 level, ubidi_getParaLevel(pBiDi),
4679 mode, ubidi_getReorderingMode(pBiDi),
4680 option, ubidi_getReorderingOptions(pBiDi),
4685 resLen = ubidi_getResultLength(pBiDi);
4686 ubidi_getVisualMap(pBiDi, actualVisualMap, &rc);
4705 level, ubidi_getParaLevel(pBiDi),
4706 mode, ubidi_getReorderingMode(pBiDi),
4707 option, ubidi_getReorderingOptions(pBiDi),
4713 idx = ubidi_getVisualIndex(pBiDi, i, &rc);
4734 level, ubidi_getParaLevel(pBiDi),
4735 mode, ubidi_getReorderingMode(pBiDi),
4736 option, ubidi_getReorderingOptions(pBiDi),
4742 idx = ubidi_getLogicalIndex(pBiDi, i, &rc);
4763 level, ubidi_getParaLevel(pBiDi),
4764 mode, ubidi_getReorderingMode(pBiDi),
4765 option, ubidi_getReorderingOptions(pBiDi),
4825 UBiDi *pBiDi = NULL;
4835 ubidi_setContext(pBiDi, NULL, 0, NULL, 0, &rc);
4838 pBiDi = getBiDiObject();
4839 ubidi_orderParagraphsLTR(pBiDi, TRUE);
4843 ubidi_setContext(pBiDi, NULL, -2, NULL, 0, &rc);
4847 ubidi_setContext(pBiDi, NULL, 0, NULL, -2, &rc);
4851 ubidi_setContext(pBiDi, NULL, 3, NULL, 0, &rc);
4855 ubidi_setContext(pBiDi, NULL, 0, NULL, 4, &rc);
4867 ubidi_setContext(pBiDi, epilogue, epiLength, prologue, proLength, &rc);
4869 ubidi_setContext(pBiDi, prologue, -1, epilogue, -1, &rc);
4873 ubidi_setPara(pBiDi, src, srcLen, cc.paraLevel, NULL, &rc);
4875 destLen = ubidi_writeReordered(pBiDi, dest, MAXLEN, UBIDI_DO_MIRRORING, &rc);
4888 "Levels:", formatLevels(pBiDi, formatChars),
4889 "Reordering mode:", ubidi_getReorderingMode(pBiDi),
4890 "Paragraph level:", ubidi_getParaLevel(pBiDi),
4891 "Reordering option:", ubidi_getReorderingOptions(pBiDi));
4898 ubidi_close(pBiDi);