• Home
  • Raw
  • Download

Lines Matching refs:pBiDi

39 static void doTests(UBiDi *pBiDi, UBiDi *pLine, UBool countRunsFirst);
43 static void doTest(UBiDi *pBiDi, int testNumber, const BiDiTestData *test,
46 static void _testReordering(UBiDi *pBiDi, int testNumber);
50 static void _testManyInverseBidi(UBiDi *pBiDi, UBiDiLevel direction);
52 static void _testInverseBidi(UBiDi *pBiDi, const UChar *src, int32_t srcLength,
101 static const char* inverseBasic(UBiDi *pBiDi, const char *src, int32_t srcLen,
103 static UBool assertRoundTrip(UBiDi *pBiDi, int32_t tc, int32_t outIndex,
107 static UBool checkResultLength(UBiDi *pBiDi, const char *srcChars,
111 static UBool checkMaps(UBiDi *pBiDi, int32_t stringIndex, const char *src,
176 UBiDi *pBiDi, *pLine=NULL; in testBidi() local
181 pBiDi=ubidi_openSized(MAXLEN, 0, &errorCode); in testBidi()
182 if(pBiDi!=NULL) { in testBidi()
185 doTests(pBiDi, pLine, false); in testBidi()
186 doTests(pBiDi, pLine, true); in testBidi()
198 if(pBiDi!=NULL) { in testBidi()
199 ubidi_close(pBiDi); in testBidi()
206 doTests(UBiDi *pBiDi, UBiDi *pLine, UBool countRunsFirst) { in doTests() argument
217 ubidi_setPara(pBiDi, string, -1, paraLevel, NULL, &errorCode); in doTests()
220 testNumber, paraLevel, ubidi_getDirection(pBiDi), paraLevel); in doTests()
223 doTest(pBiDi, testNumber, tests+testNumber, 0, countRunsFirst); in doTests()
225 ubidi_setLine(pBiDi, lineStart, tests[testNumber].lineLimit, pLine, &errorCode); in doTests()
1043 doTest(UBiDi *pBiDi, int testNumber, const BiDiTestData *test, int32_t lineStart, UBool countRunsFi… in doTest() argument
1047 int32_t i, len=ubidi_getLength(pBiDi), logicalIndex, runCount = 0; in doTest()
1054 runCount = ubidi_countRuns(pBiDi, &errorCode); in doTest()
1064 _testReordering(pBiDi, testNumber); in doTest()
1068 i, ubidi_getLevelAt(pBiDi, i), ubidi_getLevelAt(pBiDi, i), levelString, in doTest()
1070 ubidi_getVisualIndex(pBiDi, i, &errorCode)); in doTest()
1078 log_verbose(" %d", ubidi_getLevelAt(pBiDi, i)); in doTest()
1086 log_verbose(" %d", ubidi_getVisualIndex(pBiDi, i, &errorCode)); in doTest()
1090 if(test->direction!=ubidi_getDirection(pBiDi)) { in doTest()
1091 …_err("ubidi_getDirection(tests[%d]): wrong direction %d\n", testNumber, ubidi_getDirection(pBiDi)); in doTest()
1094 if(test->resultLevel!=ubidi_getParaLevel(pBiDi)) { in doTest()
1095 …ubidi_getParaLevel(tests[%d]): wrong paragraph level %d\n", testNumber, ubidi_getParaLevel(pBiDi)); in doTest()
1099 if(levels[i]!=ubidi_getLevelAt(pBiDi, i)) { in doTest()
1100 …ts[%d], %d): wrong level %d, expected %d\n", testNumber, i, ubidi_getLevelAt(pBiDi, i), levels[i]); in doTest()
1106 logicalIndex=ubidi_getVisualIndex(pBiDi, i, &errorCode); in doTest()
1118 runCount=ubidi_countRuns(pBiDi, &errorCode); in doTest()
1126 level=ubidi_getLevelAt(pBiDi, logicalIndex); in doTest()
1127 ubidi_getLogicalRun(pBiDi, logicalIndex, &logicalIndex, &level2); in doTest()
1136 testNumber, ubidi_countRuns(pBiDi, &errorCode)); in doTest()
1143 testNumber, ubidi_countRuns(pBiDi, &errorCode)); in doTest()
1151 _testReordering(UBiDi *pBiDi, int testNumber) { in _testReordering() argument
1157 int32_t i, length=ubidi_getLength(pBiDi), in _testReordering()
1158 destLength=ubidi_getResultLength(pBiDi); in _testReordering()
1167 ubidi_getLogicalMap(pBiDi, logicalMap1, &errorCode); in _testReordering()
1173 ubidi_getVisualMap(pBiDi, visualMap1, &errorCode); in _testReordering()
1184 levels=ubidi_getLevels(pBiDi, &errorCode); in _testReordering()
1195 runCount=ubidi_countRuns(pBiDi, &errorCode); in _testReordering()
1203 odd=(UBool)ubidi_getVisualRun(pBiDi, i, &logicalStart, &runLength); in _testReordering()
1274 if(logicalMap1[i]!=ubidi_getVisualIndex(pBiDi, i, &errorCode)) { in _testReordering()
1282 if(visualMap1[i]!=ubidi_getLogicalIndex(pBiDi, i, &errorCode)) { in _testReordering()
2198 UBiDi *pBiDi; in testInverse() local
2203 pBiDi=ubidi_open(); in testInverse()
2204 if(pBiDi==NULL) { in testInverse()
2213 _testInverseBidi(pBiDi, testCases[i].s, testCases[i].length, 0, &errorCode); in testInverse()
2220 _testInverseBidi(pBiDi, testCases[i].s, testCases[i].length, 1, &errorCode); in testInverse()
2223 _testManyInverseBidi(pBiDi, 0); in testInverse()
2224 _testManyInverseBidi(pBiDi, 1); in testInverse()
2226 ubidi_close(pBiDi); in testInverse()
2251 _testManyInverseBidi(UBiDi *pBiDi, UBiDiLevel direction) { in _testManyInverseBidi() argument
2270 _testInverseBidi(pBiDi, text, 8, direction, &errorCode); in _testManyInverseBidi()
2277 _testInverseBidi(UBiDi *pBiDi, const UChar *src, int32_t srcLength, in _testInverseBidi() argument
2286 ubidi_setInverse(pBiDi, true); in _testInverseBidi()
2287 if (!ubidi_isInverse(pBiDi)) { in _testInverseBidi()
2290 ubidi_setPara(pBiDi, src, srcLength, 0, NULL, pErrorCode); in _testInverseBidi()
2291 if (src != ubidi_getText(pBiDi)) { in _testInverseBidi()
2294 logicalLength=ubidi_writeReordered(pBiDi, logicalDest, UPRV_LENGTHOF(logicalDest), in _testInverseBidi()
2297 printUnicode(src, srcLength, ubidi_getLevels(pBiDi, pErrorCode)); in _testInverseBidi()
2301 ubidi_setInverse(pBiDi, false); in _testInverseBidi()
2302 if (ubidi_isInverse(pBiDi)) { in _testInverseBidi()
2305 ubidi_setPara(pBiDi, logicalDest, logicalLength, 0, NULL, pErrorCode); in _testInverseBidi()
2306 visualLength=ubidi_writeReordered(pBiDi, visualDest, UPRV_LENGTHOF(visualDest), in _testInverseBidi()
2318 ubidi_setInverse(pBiDi, true); in _testInverseBidi()
2319 ubidi_setPara(pBiDi, visualLTR, ltrLength, 0, NULL, pErrorCode); in _testInverseBidi()
2320 logicalLength=ubidi_writeReordered(pBiDi, logicalDest, UPRV_LENGTHOF(logicalDest), in _testInverseBidi()
2323 printUnicode(visualLTR, ltrLength, ubidi_getLevels(pBiDi, pErrorCode)); in _testInverseBidi()
2327 ubidi_setInverse(pBiDi, false); in _testInverseBidi()
2328 ubidi_setPara(pBiDi, logicalDest, logicalLength, 0, NULL, pErrorCode); in _testInverseBidi()
2329 visualLength=ubidi_writeReordered(pBiDi, visualDest, UPRV_LENGTHOF(visualDest), in _testInverseBidi()
2333 printUnicode(logicalDest, logicalLength, ubidi_getLevels(pBiDi, pErrorCode)); in _testInverseBidi()
3636 const char* mode, const char* option, UBiDi* pBiDi) { in assertStringsEqual() argument
3644 "Levels:", formatLevels(pBiDi, formatChars), in assertStringsEqual()
3645 "Reordering mode:", ubidi_getReorderingMode(pBiDi), mode, in assertStringsEqual()
3646 "Paragraph level:", ubidi_getParaLevel(pBiDi), in assertStringsEqual()
3647 "Reordering option:", ubidi_getReorderingOptions(pBiDi), option); in assertStringsEqual()
3655 UBiDi* pBiDi = ubidi_open(); in getBiDiObject() local
3656 if (pBiDi == NULL) { in getBiDiObject()
3659 return pBiDi; in getBiDiObject()
3951 assertRoundTrip(UBiDi *pBiDi, int32_t tc, int32_t outIndex, const char *srcChars, in assertRoundTrip() argument
4051 ubidi_setReorderingMode(pBiDi, mode); \ in assertRoundTrip()
4078 ubidi_setReorderingOptions(pBiDi, UBIDI_OPTION_REMOVE_CONTROLS); in assertRoundTrip()
4080 ubidi_setPara(pBiDi, dest, destLen, level, NULL, &rc); in assertRoundTrip()
4083 destLen2 = ubidi_writeReordered(pBiDi, dest2, MAXLEN, UBIDI_DO_MIRRORING, in assertRoundTrip()
4089 checkWhatYouCan(pBiDi, destChars3, destChars2); in assertRoundTrip()
4115 if (!checkResultLength(pBiDi, destChars, destChars2, destLen2, in assertRoundTrip()
4119 if (outIndex > -1 && !checkMaps(pBiDi, outIndex, srcChars, destChars, in assertRoundTrip()
4128 checkResultLength(UBiDi *pBiDi, const char *srcChars, const char *destChars, in checkResultLength() argument
4135 actualLen = ubidi_getResultLength(pBiDi); in checkResultLength()
4192 UBiDi *pBiDi = getBiDiObject(); in testReorderRunsOnly() local
4203 ubidi_close(pBiDi); /* in case this one was allocated */ in testReorderRunsOnly()
4206 ubidi_setReorderingMode(pBiDi, UBIDI_REORDER_RUNS_ONLY); in testReorderRunsOnly()
4210 ubidi_setReorderingOptions(pBiDi, option==0 ? UBIDI_OPTION_REMOVE_CONTROLS in testReorderRunsOnly()
4219 ubidi_setPara(pBiDi, src, srcLen, level, NULL, &rc); in testReorderRunsOnly()
4222 destLen = ubidi_writeReordered(pBiDi, dest, MAXLEN, UBIDI_DO_MIRRORING, &rc); in testReorderRunsOnly()
4225 checkWhatYouCan(pBiDi, testCases[i].textIn, destChars); in testReorderRunsOnly()
4229 pBiDi); in testReorderRunsOnly()
4251 pBiDi); in testReorderRunsOnly()
4257 ubidi_setPara(pBiDi, src, 0, UBIDI_LTR, NULL, &rc); in testReorderRunsOnly()
4259 paras = ubidi_countParagraphs(pBiDi); in testReorderRunsOnly()
4264 ubidi_close(pBiDi); in testReorderRunsOnly()
4275 UBiDi *pBiDi = NULL, *pBiDi2 = NULL, *pBiDi3 = NULL; in testReorderingMode() local
4286 pBiDi = getBiDiObject(); in testReorderingMode()
4290 ubidi_close(pBiDi); /* in case this one was allocated */ in testReorderingMode()
4304 ubidi_setReorderingMode(pBiDi, modeValue); in testReorderingMode()
4305 modeBack = ubidi_getReorderingMode(pBiDi); in testReorderingMode()
4313 ubidi_setReorderingOptions(pBiDi, optionValue); in testReorderingMode()
4314 optionBack = ubidi_getReorderingOptions(pBiDi); in testReorderingMode()
4324 ubidi_setPara(pBiDi, src, srcLen, paraLevels[level], NULL, &rc); in testReorderingMode()
4328 destLen = ubidi_writeReordered(pBiDi, dest, MAXLEN, in testReorderingMode()
4334 checkWhatYouCan(pBiDi, srcChars, destChars); in testReorderingMode()
4349 pBiDi)) { in testReorderingMode()
4358 else if (!checkResultLength(pBiDi, srcChars, destChars, in testReorderingMode()
4364 else if (idx > -1 && !checkMaps(pBiDi, idx, srcChars, in testReorderingMode()
4379 ubidi_close(pBiDi); in testReorderingMode()
4384 static const char* inverseBasic(UBiDi *pBiDi, const char *srcChars, int32_t srcLen, in inverseBasic() argument
4390 if (pBiDi == NULL || srcChars == NULL) { in inverseBasic()
4393 ubidi_setReorderingOptions(pBiDi, option); in inverseBasic()
4395 ubidi_setPara(pBiDi, src, srcLen, level, NULL, &rc); in inverseBasic()
4399 destLen = ubidi_writeReordered(pBiDi, dest2, MAXLEN, in inverseBasic()
4404 checkWhatYouCan(pBiDi, srcChars, result); in inverseBasic()
4445 UBiDi *pBiDi = NULL; in testStreaming() local
4457 pBiDi = getBiDiObject(); in testStreaming()
4459 ubidi_orderParagraphsLTR(pBiDi, true); in testStreaming()
4472 ubidi_setReorderingOptions(pBiDi, UBIDI_OPTION_STREAMING); in testStreaming()
4476 ubidi_setPara(pBiDi, pSrc, len, level, NULL, &rc); in testStreaming()
4481 processedLen = ubidi_getProcessedLength(pBiDi); in testStreaming()
4483 ubidi_setReorderingOptions(pBiDi, UBIDI_OPTION_DEFAULT); in testStreaming()
4487 ubidi_setReorderingOptions(pBiDi, UBIDI_OPTION_STREAMING); in testStreaming()
4508 ubidi_close(pBiDi); in testStreaming()
4573 UBiDi *pBiDi = NULL; in testClassOverride() local
4582 pBiDi = getBiDiObject(); in testClassOverride()
4583 if(!pBiDi) { in testClassOverride()
4587 ubidi_getClassCallback(pBiDi, &oldFn, &oldContext); in testClassOverride()
4590 ubidi_setClassCallback(pBiDi, newFn, textSrc, &oldFn, &oldContext, &rc); in testClassOverride()
4592 ubidi_close(pBiDi); in testClassOverride()
4596 if (ubidi_getCustomizedClass(pBiDi, u'A')!=AL || in testClassOverride()
4597 ubidi_getCustomizedClass(pBiDi, u'H')!=R || in testClassOverride()
4598 ubidi_getCustomizedClass(pBiDi, u'^')!=PDF || in testClassOverride()
4599 ubidi_getCustomizedClass(pBiDi, u'~')!=BN) { in testClassOverride()
4606 ubidi_getClassCallback(pBiDi, &oldFn, &oldContext); in testClassOverride()
4609 ubidi_setClassCallback(pBiDi, newFn, textSrc, &oldFn, &oldContext, &rc); in testClassOverride()
4611 ubidi_close(pBiDi); in testClassOverride()
4617 ubidi_setPara(pBiDi, src, srcLen, UBIDI_LTR, NULL, &rc); in testClassOverride()
4620 destLen = ubidi_writeReordered(pBiDi, dest, MAXLEN, in testClassOverride()
4634 ubidi_close(pBiDi); in testClassOverride()
4657 checkMaps(UBiDi *pBiDi, int32_t stringIndex, const char *src, const char *dest, in checkMaps() argument
4676 ubidi_getLogicalMap(pBiDi, actualLogicalMap, &rc); in checkMaps()
4680 srcLen = ubidi_getProcessedLength(pBiDi); in checkMaps()
4698 level, ubidi_getParaLevel(pBiDi), in checkMaps()
4699 mode, ubidi_getReorderingMode(pBiDi), in checkMaps()
4700 option, ubidi_getReorderingOptions(pBiDi), in checkMaps()
4705 resLen = ubidi_getResultLength(pBiDi); in checkMaps()
4706 ubidi_getVisualMap(pBiDi, actualVisualMap, &rc); in checkMaps()
4725 level, ubidi_getParaLevel(pBiDi), in checkMaps()
4726 mode, ubidi_getReorderingMode(pBiDi), in checkMaps()
4727 option, ubidi_getReorderingOptions(pBiDi), in checkMaps()
4733 idx = ubidi_getVisualIndex(pBiDi, i, &rc); in checkMaps()
4754 level, ubidi_getParaLevel(pBiDi), in checkMaps()
4755 mode, ubidi_getReorderingMode(pBiDi), in checkMaps()
4756 option, ubidi_getReorderingOptions(pBiDi), in checkMaps()
4762 idx = ubidi_getLogicalIndex(pBiDi, i, &rc); in checkMaps()
4783 level, ubidi_getParaLevel(pBiDi), in checkMaps()
4784 mode, ubidi_getReorderingMode(pBiDi), in checkMaps()
4785 option, ubidi_getReorderingOptions(pBiDi), in checkMaps()
4845 UBiDi *pBiDi = NULL; in testContext() local
4855 ubidi_setContext(pBiDi, NULL, 0, NULL, 0, &rc); in testContext()
4858 pBiDi = getBiDiObject(); in testContext()
4859 ubidi_orderParagraphsLTR(pBiDi, true); in testContext()
4863 ubidi_setContext(pBiDi, NULL, -2, NULL, 0, &rc); in testContext()
4867 ubidi_setContext(pBiDi, NULL, 0, NULL, -2, &rc); in testContext()
4871 ubidi_setContext(pBiDi, NULL, 3, NULL, 0, &rc); in testContext()
4875 ubidi_setContext(pBiDi, NULL, 0, NULL, 4, &rc); in testContext()
4887 ubidi_setContext(pBiDi, epilogue, epiLength, prologue, proLength, &rc); in testContext()
4889 ubidi_setContext(pBiDi, prologue, -1, epilogue, -1, &rc); in testContext()
4893 ubidi_setPara(pBiDi, src, srcLen, cc.paraLevel, NULL, &rc); in testContext()
4895 destLen = ubidi_writeReordered(pBiDi, dest, MAXLEN, UBIDI_DO_MIRRORING, &rc); in testContext()
4908 "Levels:", formatLevels(pBiDi, formatChars), in testContext()
4909 "Reordering mode:", ubidi_getReorderingMode(pBiDi), in testContext()
4910 "Paragraph level:", ubidi_getParaLevel(pBiDi), in testContext()
4911 "Reordering option:", ubidi_getReorderingOptions(pBiDi)); in testContext()
4918 ubidi_close(pBiDi); in testContext()