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,
99 static const char* inverseBasic(UBiDi *pBiDi, const char *src, int32_t srcLen,
101 static UBool assertRoundTrip(UBiDi *pBiDi, int32_t tc, int32_t outIndex,
105 static UBool checkResultLength(UBiDi *pBiDi, const char *srcChars,
109 static UBool checkMaps(UBiDi *pBiDi, int32_t stringIndex, const char *src,
173 UBiDi *pBiDi, *pLine=NULL; in testBidi() local
178 pBiDi=ubidi_openSized(MAXLEN, 0, &errorCode); in testBidi()
179 if(pBiDi!=NULL) { in testBidi()
182 doTests(pBiDi, pLine, FALSE); in testBidi()
183 doTests(pBiDi, pLine, TRUE); in testBidi()
195 if(pBiDi!=NULL) { in testBidi()
196 ubidi_close(pBiDi); in testBidi()
203 doTests(UBiDi *pBiDi, UBiDi *pLine, UBool countRunsFirst) { in doTests() argument
214 ubidi_setPara(pBiDi, string, -1, paraLevel, NULL, &errorCode); in doTests()
217 testNumber, paraLevel, ubidi_getDirection(pBiDi), paraLevel); in doTests()
220 doTest(pBiDi, testNumber, tests+testNumber, 0, countRunsFirst); in doTests()
222 ubidi_setLine(pBiDi, lineStart, tests[testNumber].lineLimit, pLine, &errorCode); in doTests()
1035 doTest(UBiDi *pBiDi, int testNumber, const BiDiTestData *test, int32_t lineStart, UBool countRunsFi… in doTest() argument
1039 int32_t i, len=ubidi_getLength(pBiDi), logicalIndex, runCount = 0; in doTest()
1046 runCount = ubidi_countRuns(pBiDi, &errorCode); in doTest()
1056 _testReordering(pBiDi, testNumber); in doTest()
1060 i, ubidi_getLevelAt(pBiDi, i), ubidi_getLevelAt(pBiDi, i), levelString, in doTest()
1062 ubidi_getVisualIndex(pBiDi, i, &errorCode)); in doTest()
1070 log_verbose(" %d", ubidi_getLevelAt(pBiDi, i)); in doTest()
1078 log_verbose(" %d", ubidi_getVisualIndex(pBiDi, i, &errorCode)); in doTest()
1082 if(test->direction!=ubidi_getDirection(pBiDi)) { in doTest()
1083 …_err("ubidi_getDirection(tests[%d]): wrong direction %d\n", testNumber, ubidi_getDirection(pBiDi)); in doTest()
1086 if(test->resultLevel!=ubidi_getParaLevel(pBiDi)) { in doTest()
1087 …ubidi_getParaLevel(tests[%d]): wrong paragraph level %d\n", testNumber, ubidi_getParaLevel(pBiDi)); in doTest()
1091 if(levels[i]!=ubidi_getLevelAt(pBiDi, i)) { in doTest()
1092 …ts[%d], %d): wrong level %d, expected %d\n", testNumber, i, ubidi_getLevelAt(pBiDi, i), levels[i]); in doTest()
1098 logicalIndex=ubidi_getVisualIndex(pBiDi, i, &errorCode); in doTest()
1110 runCount=ubidi_countRuns(pBiDi, &errorCode); in doTest()
1118 level=ubidi_getLevelAt(pBiDi, logicalIndex); in doTest()
1119 ubidi_getLogicalRun(pBiDi, logicalIndex, &logicalIndex, &level2); in doTest()
1128 testNumber, ubidi_countRuns(pBiDi, &errorCode)); in doTest()
1135 testNumber, ubidi_countRuns(pBiDi, &errorCode)); in doTest()
1143 _testReordering(UBiDi *pBiDi, int testNumber) { in _testReordering() argument
1149 int32_t i, length=ubidi_getLength(pBiDi), in _testReordering()
1150 destLength=ubidi_getResultLength(pBiDi); in _testReordering()
1159 ubidi_getLogicalMap(pBiDi, logicalMap1, &errorCode); in _testReordering()
1165 ubidi_getVisualMap(pBiDi, visualMap1, &errorCode); in _testReordering()
1176 levels=ubidi_getLevels(pBiDi, &errorCode); in _testReordering()
1187 runCount=ubidi_countRuns(pBiDi, &errorCode); in _testReordering()
1195 odd=(UBool)ubidi_getVisualRun(pBiDi, i, &logicalStart, &runLength); in _testReordering()
1266 if(logicalMap1[i]!=ubidi_getVisualIndex(pBiDi, i, &errorCode)) { in _testReordering()
1274 if(visualMap1[i]!=ubidi_getLogicalIndex(pBiDi, i, &errorCode)) { in _testReordering()
2189 UBiDi *pBiDi; in testInverse() local
2194 pBiDi=ubidi_open(); in testInverse()
2195 if(pBiDi==NULL) { in testInverse()
2204 _testInverseBidi(pBiDi, testCases[i].s, testCases[i].length, 0, &errorCode); in testInverse()
2211 _testInverseBidi(pBiDi, testCases[i].s, testCases[i].length, 1, &errorCode); in testInverse()
2214 _testManyInverseBidi(pBiDi, 0); in testInverse()
2215 _testManyInverseBidi(pBiDi, 1); in testInverse()
2217 ubidi_close(pBiDi); in testInverse()
2242 _testManyInverseBidi(UBiDi *pBiDi, UBiDiLevel direction) { in _testManyInverseBidi() argument
2261 _testInverseBidi(pBiDi, text, 8, direction, &errorCode); in _testManyInverseBidi()
2268 _testInverseBidi(UBiDi *pBiDi, const UChar *src, int32_t srcLength, in _testInverseBidi() argument
2277 ubidi_setInverse(pBiDi, TRUE); in _testInverseBidi()
2278 if (!ubidi_isInverse(pBiDi)) { in _testInverseBidi()
2281 ubidi_setPara(pBiDi, src, srcLength, 0, NULL, pErrorCode); in _testInverseBidi()
2282 if (src != ubidi_getText(pBiDi)) { in _testInverseBidi()
2285 logicalLength=ubidi_writeReordered(pBiDi, logicalDest, UPRV_LENGTHOF(logicalDest), in _testInverseBidi()
2288 printUnicode(src, srcLength, ubidi_getLevels(pBiDi, pErrorCode)); in _testInverseBidi()
2292 ubidi_setInverse(pBiDi, FALSE); in _testInverseBidi()
2293 if (ubidi_isInverse(pBiDi)) { in _testInverseBidi()
2296 ubidi_setPara(pBiDi, logicalDest, logicalLength, 0, NULL, pErrorCode); in _testInverseBidi()
2297 visualLength=ubidi_writeReordered(pBiDi, visualDest, UPRV_LENGTHOF(visualDest), in _testInverseBidi()
2309 ubidi_setInverse(pBiDi, TRUE); in _testInverseBidi()
2310 ubidi_setPara(pBiDi, visualLTR, ltrLength, 0, NULL, pErrorCode); in _testInverseBidi()
2311 logicalLength=ubidi_writeReordered(pBiDi, logicalDest, UPRV_LENGTHOF(logicalDest), in _testInverseBidi()
2314 printUnicode(visualLTR, ltrLength, ubidi_getLevels(pBiDi, pErrorCode)); in _testInverseBidi()
2318 ubidi_setInverse(pBiDi, FALSE); in _testInverseBidi()
2319 ubidi_setPara(pBiDi, logicalDest, logicalLength, 0, NULL, pErrorCode); in _testInverseBidi()
2320 visualLength=ubidi_writeReordered(pBiDi, visualDest, UPRV_LENGTHOF(visualDest), in _testInverseBidi()
2324 printUnicode(logicalDest, logicalLength, ubidi_getLevels(pBiDi, pErrorCode)); in _testInverseBidi()
3627 const char* mode, const char* option, UBiDi* pBiDi) { in assertStringsEqual() argument
3635 "Levels:", formatLevels(pBiDi, formatChars), in assertStringsEqual()
3636 "Reordering mode:", ubidi_getReorderingMode(pBiDi), mode, in assertStringsEqual()
3637 "Paragraph level:", ubidi_getParaLevel(pBiDi), in assertStringsEqual()
3638 "Reordering option:", ubidi_getReorderingOptions(pBiDi), option); in assertStringsEqual()
3646 UBiDi* pBiDi = ubidi_open(); in getBiDiObject() local
3647 if (pBiDi == NULL) { in getBiDiObject()
3650 return pBiDi; in getBiDiObject()
3942 assertRoundTrip(UBiDi *pBiDi, int32_t tc, int32_t outIndex, const char *srcChars, in assertRoundTrip() argument
4042 ubidi_setReorderingMode(pBiDi, mode); \ in assertRoundTrip()
4069 ubidi_setReorderingOptions(pBiDi, UBIDI_OPTION_REMOVE_CONTROLS); in assertRoundTrip()
4071 ubidi_setPara(pBiDi, dest, destLen, level, NULL, &rc); in assertRoundTrip()
4074 destLen2 = ubidi_writeReordered(pBiDi, dest2, MAXLEN, UBIDI_DO_MIRRORING, in assertRoundTrip()
4080 checkWhatYouCan(pBiDi, destChars3, destChars2); in assertRoundTrip()
4106 if (!checkResultLength(pBiDi, destChars, destChars2, destLen2, in assertRoundTrip()
4110 if (outIndex > -1 && !checkMaps(pBiDi, outIndex, srcChars, destChars, in assertRoundTrip()
4119 checkResultLength(UBiDi *pBiDi, const char *srcChars, const char *destChars, in checkResultLength() argument
4126 actualLen = ubidi_getResultLength(pBiDi); in checkResultLength()
4183 UBiDi *pBiDi = getBiDiObject(); in testReorderRunsOnly() local
4194 ubidi_close(pBiDi); /* in case this one was allocated */ in testReorderRunsOnly()
4197 ubidi_setReorderingMode(pBiDi, UBIDI_REORDER_RUNS_ONLY); in testReorderRunsOnly()
4201 ubidi_setReorderingOptions(pBiDi, option==0 ? UBIDI_OPTION_REMOVE_CONTROLS in testReorderRunsOnly()
4210 ubidi_setPara(pBiDi, src, srcLen, level, NULL, &rc); in testReorderRunsOnly()
4213 destLen = ubidi_writeReordered(pBiDi, dest, MAXLEN, UBIDI_DO_MIRRORING, &rc); in testReorderRunsOnly()
4216 checkWhatYouCan(pBiDi, testCases[i].textIn, destChars); in testReorderRunsOnly()
4220 pBiDi); in testReorderRunsOnly()
4242 pBiDi); in testReorderRunsOnly()
4248 ubidi_setPara(pBiDi, src, 0, UBIDI_LTR, NULL, &rc); in testReorderRunsOnly()
4250 paras = ubidi_countParagraphs(pBiDi); in testReorderRunsOnly()
4255 ubidi_close(pBiDi); in testReorderRunsOnly()
4266 UBiDi *pBiDi = NULL, *pBiDi2 = NULL, *pBiDi3 = NULL; in testReorderingMode() local
4277 pBiDi = getBiDiObject(); in testReorderingMode()
4281 ubidi_close(pBiDi); /* in case this one was allocated */ in testReorderingMode()
4295 ubidi_setReorderingMode(pBiDi, modeValue); in testReorderingMode()
4296 modeBack = ubidi_getReorderingMode(pBiDi); in testReorderingMode()
4304 ubidi_setReorderingOptions(pBiDi, optionValue); in testReorderingMode()
4305 optionBack = ubidi_getReorderingOptions(pBiDi); in testReorderingMode()
4315 ubidi_setPara(pBiDi, src, srcLen, paraLevels[level], NULL, &rc); in testReorderingMode()
4319 destLen = ubidi_writeReordered(pBiDi, dest, MAXLEN, in testReorderingMode()
4325 checkWhatYouCan(pBiDi, srcChars, destChars); in testReorderingMode()
4340 pBiDi)) { in testReorderingMode()
4349 else if (!checkResultLength(pBiDi, srcChars, destChars, in testReorderingMode()
4355 else if (idx > -1 && !checkMaps(pBiDi, idx, srcChars, in testReorderingMode()
4370 ubidi_close(pBiDi); in testReorderingMode()
4375 static const char* inverseBasic(UBiDi *pBiDi, const char *srcChars, int32_t srcLen, in inverseBasic() argument
4381 if (pBiDi == NULL || srcChars == NULL) { in inverseBasic()
4384 ubidi_setReorderingOptions(pBiDi, option); in inverseBasic()
4386 ubidi_setPara(pBiDi, src, srcLen, level, NULL, &rc); in inverseBasic()
4390 destLen = ubidi_writeReordered(pBiDi, dest2, MAXLEN, in inverseBasic()
4395 checkWhatYouCan(pBiDi, srcChars, result); in inverseBasic()
4436 UBiDi *pBiDi = NULL; in testStreaming() local
4448 pBiDi = getBiDiObject(); in testStreaming()
4450 ubidi_orderParagraphsLTR(pBiDi, TRUE); in testStreaming()
4463 ubidi_setReorderingOptions(pBiDi, UBIDI_OPTION_STREAMING); in testStreaming()
4467 ubidi_setPara(pBiDi, pSrc, len, level, NULL, &rc); in testStreaming()
4472 processedLen = ubidi_getProcessedLength(pBiDi); in testStreaming()
4474 ubidi_setReorderingOptions(pBiDi, UBIDI_OPTION_DEFAULT); in testStreaming()
4478 ubidi_setReorderingOptions(pBiDi, UBIDI_OPTION_STREAMING); in testStreaming()
4499 ubidi_close(pBiDi); in testStreaming()
4564 UBiDi *pBiDi = NULL; in testClassOverride() local
4573 pBiDi = getBiDiObject(); in testClassOverride()
4574 if(!pBiDi) { in testClassOverride()
4578 ubidi_getClassCallback(pBiDi, &oldFn, &oldContext); in testClassOverride()
4581 ubidi_setClassCallback(pBiDi, newFn, textSrc, &oldFn, &oldContext, &rc); in testClassOverride()
4583 ubidi_close(pBiDi); in testClassOverride()
4588 ubidi_getClassCallback(pBiDi, &oldFn, &oldContext); in testClassOverride()
4591 ubidi_setClassCallback(pBiDi, newFn, textSrc, &oldFn, &oldContext, &rc); in testClassOverride()
4593 ubidi_close(pBiDi); in testClassOverride()
4599 ubidi_setPara(pBiDi, src, srcLen, UBIDI_LTR, NULL, &rc); in testClassOverride()
4602 destLen = ubidi_writeReordered(pBiDi, dest, MAXLEN, in testClassOverride()
4616 ubidi_close(pBiDi); in testClassOverride()
4639 checkMaps(UBiDi *pBiDi, int32_t stringIndex, const char *src, const char *dest, in checkMaps() argument
4658 ubidi_getLogicalMap(pBiDi, actualLogicalMap, &rc); in checkMaps()
4662 srcLen = ubidi_getProcessedLength(pBiDi); in checkMaps()
4680 level, ubidi_getParaLevel(pBiDi), in checkMaps()
4681 mode, ubidi_getReorderingMode(pBiDi), in checkMaps()
4682 option, ubidi_getReorderingOptions(pBiDi), in checkMaps()
4687 resLen = ubidi_getResultLength(pBiDi); in checkMaps()
4688 ubidi_getVisualMap(pBiDi, actualVisualMap, &rc); in checkMaps()
4707 level, ubidi_getParaLevel(pBiDi), in checkMaps()
4708 mode, ubidi_getReorderingMode(pBiDi), in checkMaps()
4709 option, ubidi_getReorderingOptions(pBiDi), in checkMaps()
4715 idx = ubidi_getVisualIndex(pBiDi, i, &rc); in checkMaps()
4736 level, ubidi_getParaLevel(pBiDi), in checkMaps()
4737 mode, ubidi_getReorderingMode(pBiDi), in checkMaps()
4738 option, ubidi_getReorderingOptions(pBiDi), in checkMaps()
4744 idx = ubidi_getLogicalIndex(pBiDi, i, &rc); in checkMaps()
4765 level, ubidi_getParaLevel(pBiDi), in checkMaps()
4766 mode, ubidi_getReorderingMode(pBiDi), in checkMaps()
4767 option, ubidi_getReorderingOptions(pBiDi), in checkMaps()
4827 UBiDi *pBiDi = NULL; in testContext() local
4837 ubidi_setContext(pBiDi, NULL, 0, NULL, 0, &rc); in testContext()
4840 pBiDi = getBiDiObject(); in testContext()
4841 ubidi_orderParagraphsLTR(pBiDi, TRUE); in testContext()
4845 ubidi_setContext(pBiDi, NULL, -2, NULL, 0, &rc); in testContext()
4849 ubidi_setContext(pBiDi, NULL, 0, NULL, -2, &rc); in testContext()
4853 ubidi_setContext(pBiDi, NULL, 3, NULL, 0, &rc); in testContext()
4857 ubidi_setContext(pBiDi, NULL, 0, NULL, 4, &rc); in testContext()
4869 ubidi_setContext(pBiDi, epilogue, epiLength, prologue, proLength, &rc); in testContext()
4871 ubidi_setContext(pBiDi, prologue, -1, epilogue, -1, &rc); in testContext()
4875 ubidi_setPara(pBiDi, src, srcLen, cc.paraLevel, NULL, &rc); in testContext()
4877 destLen = ubidi_writeReordered(pBiDi, dest, MAXLEN, UBIDI_DO_MIRRORING, &rc); in testContext()
4890 "Levels:", formatLevels(pBiDi, formatChars), in testContext()
4891 "Reordering mode:", ubidi_getReorderingMode(pBiDi), in testContext()
4892 "Paragraph level:", ubidi_getParaLevel(pBiDi), in testContext()
4893 "Reordering option:", ubidi_getReorderingOptions(pBiDi)); in testContext()
4900 ubidi_close(pBiDi); in testContext()