Lines Matching refs:pBiDi
38 static void doTests(UBiDi *pBiDi, UBiDi *pLine, UBool countRunsFirst);
42 static void doTest(UBiDi *pBiDi, int testNumber, const BiDiTestData *test,
45 static void _testReordering(UBiDi *pBiDi, int testNumber);
49 static void _testManyInverseBidi(UBiDi *pBiDi, UBiDiLevel direction);
51 static void _testInverseBidi(UBiDi *pBiDi, const UChar *src, int32_t srcLength,
100 static const char* inverseBasic(UBiDi *pBiDi, const char *src, int32_t srcLen,
102 static UBool assertRoundTrip(UBiDi *pBiDi, int32_t tc, int32_t outIndex,
106 static UBool checkResultLength(UBiDi *pBiDi, const char *srcChars,
110 static UBool checkMaps(UBiDi *pBiDi, int32_t stringIndex, const char *src,
175 UBiDi *pBiDi, *pLine=NULL; in testBidi() local
180 pBiDi=ubidi_openSized(MAXLEN, 0, &errorCode); in testBidi()
181 if(pBiDi!=NULL) { in testBidi()
184 doTests(pBiDi, pLine, FALSE); in testBidi()
185 doTests(pBiDi, pLine, TRUE); in testBidi()
197 if(pBiDi!=NULL) { in testBidi()
198 ubidi_close(pBiDi); in testBidi()
205 doTests(UBiDi *pBiDi, UBiDi *pLine, UBool countRunsFirst) { in doTests() argument
216 ubidi_setPara(pBiDi, string, -1, paraLevel, NULL, &errorCode); in doTests()
219 testNumber, paraLevel, ubidi_getDirection(pBiDi), paraLevel); in doTests()
222 doTest(pBiDi, testNumber, tests+testNumber, 0, countRunsFirst); in doTests()
224 ubidi_setLine(pBiDi, lineStart, tests[testNumber].lineLimit, pLine, &errorCode); in doTests()
1040 doTest(UBiDi *pBiDi, int testNumber, const BiDiTestData *test, int32_t lineStart, UBool countRunsFi… in doTest() argument
1044 int32_t i, len=ubidi_getLength(pBiDi), logicalIndex, runCount = 0; in doTest()
1051 runCount = ubidi_countRuns(pBiDi, &errorCode); in doTest()
1061 _testReordering(pBiDi, testNumber); in doTest()
1065 i, ubidi_getLevelAt(pBiDi, i), ubidi_getLevelAt(pBiDi, i), levelString, in doTest()
1067 ubidi_getVisualIndex(pBiDi, i, &errorCode)); in doTest()
1075 log_verbose(" %d", ubidi_getLevelAt(pBiDi, i)); in doTest()
1083 log_verbose(" %d", ubidi_getVisualIndex(pBiDi, i, &errorCode)); in doTest()
1087 if(test->direction!=ubidi_getDirection(pBiDi)) { in doTest()
1088 …_err("ubidi_getDirection(tests[%d]): wrong direction %d\n", testNumber, ubidi_getDirection(pBiDi)); in doTest()
1091 if(test->resultLevel!=ubidi_getParaLevel(pBiDi)) { in doTest()
1092 …ubidi_getParaLevel(tests[%d]): wrong paragraph level %d\n", testNumber, ubidi_getParaLevel(pBiDi)); in doTest()
1096 if(levels[i]!=ubidi_getLevelAt(pBiDi, i)) { in doTest()
1097 …ts[%d], %d): wrong level %d, expected %d\n", testNumber, i, ubidi_getLevelAt(pBiDi, i), levels[i]); in doTest()
1103 logicalIndex=ubidi_getVisualIndex(pBiDi, i, &errorCode); in doTest()
1115 runCount=ubidi_countRuns(pBiDi, &errorCode); in doTest()
1123 level=ubidi_getLevelAt(pBiDi, logicalIndex); in doTest()
1124 ubidi_getLogicalRun(pBiDi, logicalIndex, &logicalIndex, &level2); in doTest()
1133 testNumber, ubidi_countRuns(pBiDi, &errorCode)); in doTest()
1140 testNumber, ubidi_countRuns(pBiDi, &errorCode)); in doTest()
1148 _testReordering(UBiDi *pBiDi, int testNumber) { in _testReordering() argument
1154 int32_t i, length=ubidi_getLength(pBiDi), in _testReordering()
1155 destLength=ubidi_getResultLength(pBiDi); in _testReordering()
1164 ubidi_getLogicalMap(pBiDi, logicalMap1, &errorCode); in _testReordering()
1170 ubidi_getVisualMap(pBiDi, visualMap1, &errorCode); in _testReordering()
1181 levels=ubidi_getLevels(pBiDi, &errorCode); in _testReordering()
1192 runCount=ubidi_countRuns(pBiDi, &errorCode); in _testReordering()
1200 odd=(UBool)ubidi_getVisualRun(pBiDi, i, &logicalStart, &runLength); in _testReordering()
1271 if(logicalMap1[i]!=ubidi_getVisualIndex(pBiDi, i, &errorCode)) { in _testReordering()
1279 if(visualMap1[i]!=ubidi_getLogicalIndex(pBiDi, i, &errorCode)) { in _testReordering()
2195 UBiDi *pBiDi; in testInverse() local
2200 pBiDi=ubidi_open(); in testInverse()
2201 if(pBiDi==NULL) { in testInverse()
2210 _testInverseBidi(pBiDi, testCases[i].s, testCases[i].length, 0, &errorCode); in testInverse()
2217 _testInverseBidi(pBiDi, testCases[i].s, testCases[i].length, 1, &errorCode); in testInverse()
2220 _testManyInverseBidi(pBiDi, 0); in testInverse()
2221 _testManyInverseBidi(pBiDi, 1); in testInverse()
2223 ubidi_close(pBiDi); in testInverse()
2248 _testManyInverseBidi(UBiDi *pBiDi, UBiDiLevel direction) { in _testManyInverseBidi() argument
2267 _testInverseBidi(pBiDi, text, 8, direction, &errorCode); in _testManyInverseBidi()
2274 _testInverseBidi(UBiDi *pBiDi, const UChar *src, int32_t srcLength, in _testInverseBidi() argument
2283 ubidi_setInverse(pBiDi, TRUE); in _testInverseBidi()
2284 if (!ubidi_isInverse(pBiDi)) { in _testInverseBidi()
2287 ubidi_setPara(pBiDi, src, srcLength, 0, NULL, pErrorCode); in _testInverseBidi()
2288 if (src != ubidi_getText(pBiDi)) { in _testInverseBidi()
2291 logicalLength=ubidi_writeReordered(pBiDi, logicalDest, UPRV_LENGTHOF(logicalDest), in _testInverseBidi()
2294 printUnicode(src, srcLength, ubidi_getLevels(pBiDi, pErrorCode)); in _testInverseBidi()
2298 ubidi_setInverse(pBiDi, FALSE); in _testInverseBidi()
2299 if (ubidi_isInverse(pBiDi)) { in _testInverseBidi()
2302 ubidi_setPara(pBiDi, logicalDest, logicalLength, 0, NULL, pErrorCode); in _testInverseBidi()
2303 visualLength=ubidi_writeReordered(pBiDi, visualDest, UPRV_LENGTHOF(visualDest), in _testInverseBidi()
2315 ubidi_setInverse(pBiDi, TRUE); in _testInverseBidi()
2316 ubidi_setPara(pBiDi, visualLTR, ltrLength, 0, NULL, pErrorCode); in _testInverseBidi()
2317 logicalLength=ubidi_writeReordered(pBiDi, logicalDest, UPRV_LENGTHOF(logicalDest), in _testInverseBidi()
2320 printUnicode(visualLTR, ltrLength, ubidi_getLevels(pBiDi, pErrorCode)); in _testInverseBidi()
2324 ubidi_setInverse(pBiDi, FALSE); in _testInverseBidi()
2325 ubidi_setPara(pBiDi, logicalDest, logicalLength, 0, NULL, pErrorCode); in _testInverseBidi()
2326 visualLength=ubidi_writeReordered(pBiDi, visualDest, UPRV_LENGTHOF(visualDest), in _testInverseBidi()
2330 printUnicode(logicalDest, logicalLength, ubidi_getLevels(pBiDi, pErrorCode)); in _testInverseBidi()
3633 const char* mode, const char* option, UBiDi* pBiDi) { in assertStringsEqual() argument
3641 "Levels:", formatLevels(pBiDi, formatChars), in assertStringsEqual()
3642 "Reordering mode:", ubidi_getReorderingMode(pBiDi), mode, in assertStringsEqual()
3643 "Paragraph level:", ubidi_getParaLevel(pBiDi), in assertStringsEqual()
3644 "Reordering option:", ubidi_getReorderingOptions(pBiDi), option); in assertStringsEqual()
3652 UBiDi* pBiDi = ubidi_open(); in getBiDiObject() local
3653 if (pBiDi == NULL) { in getBiDiObject()
3656 return pBiDi; in getBiDiObject()
3948 assertRoundTrip(UBiDi *pBiDi, int32_t tc, int32_t outIndex, const char *srcChars, in assertRoundTrip() argument
4048 ubidi_setReorderingMode(pBiDi, mode); \ in assertRoundTrip()
4075 ubidi_setReorderingOptions(pBiDi, UBIDI_OPTION_REMOVE_CONTROLS); in assertRoundTrip()
4077 ubidi_setPara(pBiDi, dest, destLen, level, NULL, &rc); in assertRoundTrip()
4080 destLen2 = ubidi_writeReordered(pBiDi, dest2, MAXLEN, UBIDI_DO_MIRRORING, in assertRoundTrip()
4086 checkWhatYouCan(pBiDi, destChars3, destChars2); in assertRoundTrip()
4112 if (!checkResultLength(pBiDi, destChars, destChars2, destLen2, in assertRoundTrip()
4116 if (outIndex > -1 && !checkMaps(pBiDi, outIndex, srcChars, destChars, in assertRoundTrip()
4125 checkResultLength(UBiDi *pBiDi, const char *srcChars, const char *destChars, in checkResultLength() argument
4132 actualLen = ubidi_getResultLength(pBiDi); in checkResultLength()
4189 UBiDi *pBiDi = getBiDiObject(); in testReorderRunsOnly() local
4200 ubidi_close(pBiDi); /* in case this one was allocated */ in testReorderRunsOnly()
4203 ubidi_setReorderingMode(pBiDi, UBIDI_REORDER_RUNS_ONLY); in testReorderRunsOnly()
4207 ubidi_setReorderingOptions(pBiDi, option==0 ? UBIDI_OPTION_REMOVE_CONTROLS in testReorderRunsOnly()
4216 ubidi_setPara(pBiDi, src, srcLen, level, NULL, &rc); in testReorderRunsOnly()
4219 destLen = ubidi_writeReordered(pBiDi, dest, MAXLEN, UBIDI_DO_MIRRORING, &rc); in testReorderRunsOnly()
4222 checkWhatYouCan(pBiDi, testCases[i].textIn, destChars); in testReorderRunsOnly()
4226 pBiDi); in testReorderRunsOnly()
4248 pBiDi); in testReorderRunsOnly()
4254 ubidi_setPara(pBiDi, src, 0, UBIDI_LTR, NULL, &rc); in testReorderRunsOnly()
4256 paras = ubidi_countParagraphs(pBiDi); in testReorderRunsOnly()
4261 ubidi_close(pBiDi); in testReorderRunsOnly()
4272 UBiDi *pBiDi = NULL, *pBiDi2 = NULL, *pBiDi3 = NULL; in testReorderingMode() local
4283 pBiDi = getBiDiObject(); in testReorderingMode()
4287 ubidi_close(pBiDi); /* in case this one was allocated */ in testReorderingMode()
4301 ubidi_setReorderingMode(pBiDi, modeValue); in testReorderingMode()
4302 modeBack = ubidi_getReorderingMode(pBiDi); in testReorderingMode()
4310 ubidi_setReorderingOptions(pBiDi, optionValue); in testReorderingMode()
4311 optionBack = ubidi_getReorderingOptions(pBiDi); in testReorderingMode()
4321 ubidi_setPara(pBiDi, src, srcLen, paraLevels[level], NULL, &rc); in testReorderingMode()
4325 destLen = ubidi_writeReordered(pBiDi, dest, MAXLEN, in testReorderingMode()
4331 checkWhatYouCan(pBiDi, srcChars, destChars); in testReorderingMode()
4346 pBiDi)) { in testReorderingMode()
4355 else if (!checkResultLength(pBiDi, srcChars, destChars, in testReorderingMode()
4361 else if (idx > -1 && !checkMaps(pBiDi, idx, srcChars, in testReorderingMode()
4376 ubidi_close(pBiDi); in testReorderingMode()
4381 static const char* inverseBasic(UBiDi *pBiDi, const char *srcChars, int32_t srcLen, in inverseBasic() argument
4387 if (pBiDi == NULL || srcChars == NULL) { in inverseBasic()
4390 ubidi_setReorderingOptions(pBiDi, option); in inverseBasic()
4392 ubidi_setPara(pBiDi, src, srcLen, level, NULL, &rc); in inverseBasic()
4396 destLen = ubidi_writeReordered(pBiDi, dest2, MAXLEN, in inverseBasic()
4401 checkWhatYouCan(pBiDi, srcChars, result); in inverseBasic()
4442 UBiDi *pBiDi = NULL; in testStreaming() local
4454 pBiDi = getBiDiObject(); in testStreaming()
4456 ubidi_orderParagraphsLTR(pBiDi, TRUE); in testStreaming()
4469 ubidi_setReorderingOptions(pBiDi, UBIDI_OPTION_STREAMING); in testStreaming()
4473 ubidi_setPara(pBiDi, pSrc, len, level, NULL, &rc); in testStreaming()
4478 processedLen = ubidi_getProcessedLength(pBiDi); in testStreaming()
4480 ubidi_setReorderingOptions(pBiDi, UBIDI_OPTION_DEFAULT); in testStreaming()
4484 ubidi_setReorderingOptions(pBiDi, UBIDI_OPTION_STREAMING); in testStreaming()
4505 ubidi_close(pBiDi); in testStreaming()
4570 UBiDi *pBiDi = NULL; in testClassOverride() local
4579 pBiDi = getBiDiObject(); in testClassOverride()
4580 if(!pBiDi) { in testClassOverride()
4584 ubidi_getClassCallback(pBiDi, &oldFn, &oldContext); in testClassOverride()
4587 ubidi_setClassCallback(pBiDi, newFn, textSrc, &oldFn, &oldContext, &rc); in testClassOverride()
4589 ubidi_close(pBiDi); in testClassOverride()
4594 ubidi_getClassCallback(pBiDi, &oldFn, &oldContext); in testClassOverride()
4597 ubidi_setClassCallback(pBiDi, newFn, textSrc, &oldFn, &oldContext, &rc); in testClassOverride()
4599 ubidi_close(pBiDi); in testClassOverride()
4605 ubidi_setPara(pBiDi, src, srcLen, UBIDI_LTR, NULL, &rc); in testClassOverride()
4608 destLen = ubidi_writeReordered(pBiDi, dest, MAXLEN, in testClassOverride()
4622 ubidi_close(pBiDi); in testClassOverride()
4645 checkMaps(UBiDi *pBiDi, int32_t stringIndex, const char *src, const char *dest, in checkMaps() argument
4664 ubidi_getLogicalMap(pBiDi, actualLogicalMap, &rc); in checkMaps()
4668 srcLen = ubidi_getProcessedLength(pBiDi); in checkMaps()
4686 level, ubidi_getParaLevel(pBiDi), in checkMaps()
4687 mode, ubidi_getReorderingMode(pBiDi), in checkMaps()
4688 option, ubidi_getReorderingOptions(pBiDi), in checkMaps()
4693 resLen = ubidi_getResultLength(pBiDi); in checkMaps()
4694 ubidi_getVisualMap(pBiDi, actualVisualMap, &rc); in checkMaps()
4713 level, ubidi_getParaLevel(pBiDi), in checkMaps()
4714 mode, ubidi_getReorderingMode(pBiDi), in checkMaps()
4715 option, ubidi_getReorderingOptions(pBiDi), in checkMaps()
4721 idx = ubidi_getVisualIndex(pBiDi, i, &rc); in checkMaps()
4742 level, ubidi_getParaLevel(pBiDi), in checkMaps()
4743 mode, ubidi_getReorderingMode(pBiDi), in checkMaps()
4744 option, ubidi_getReorderingOptions(pBiDi), in checkMaps()
4750 idx = ubidi_getLogicalIndex(pBiDi, i, &rc); in checkMaps()
4771 level, ubidi_getParaLevel(pBiDi), in checkMaps()
4772 mode, ubidi_getReorderingMode(pBiDi), in checkMaps()
4773 option, ubidi_getReorderingOptions(pBiDi), in checkMaps()
4833 UBiDi *pBiDi = NULL; in testContext() local
4843 ubidi_setContext(pBiDi, NULL, 0, NULL, 0, &rc); in testContext()
4846 pBiDi = getBiDiObject(); in testContext()
4847 ubidi_orderParagraphsLTR(pBiDi, TRUE); in testContext()
4851 ubidi_setContext(pBiDi, NULL, -2, NULL, 0, &rc); in testContext()
4855 ubidi_setContext(pBiDi, NULL, 0, NULL, -2, &rc); in testContext()
4859 ubidi_setContext(pBiDi, NULL, 3, NULL, 0, &rc); in testContext()
4863 ubidi_setContext(pBiDi, NULL, 0, NULL, 4, &rc); in testContext()
4875 ubidi_setContext(pBiDi, epilogue, epiLength, prologue, proLength, &rc); in testContext()
4877 ubidi_setContext(pBiDi, prologue, -1, epilogue, -1, &rc); in testContext()
4881 ubidi_setPara(pBiDi, src, srcLen, cc.paraLevel, NULL, &rc); in testContext()
4883 destLen = ubidi_writeReordered(pBiDi, dest, MAXLEN, UBIDI_DO_MIRRORING, &rc); in testContext()
4896 "Levels:", formatLevels(pBiDi, formatChars), in testContext()
4897 "Reordering mode:", ubidi_getReorderingMode(pBiDi), in testContext()
4898 "Paragraph level:", ubidi_getParaLevel(pBiDi), in testContext()
4899 "Reordering option:", ubidi_getReorderingOptions(pBiDi)); in testContext()
4906 ubidi_close(pBiDi); in testContext()