Lines Matching refs:pBiDi
37 static void doTests(UBiDi *pBiDi, UBiDi *pLine, UBool countRunsFirst);
41 static void doTest(UBiDi *pBiDi, int testNumber, const BiDiTestData *test,
44 static void _testReordering(UBiDi *pBiDi, int testNumber);
48 static void _testManyInverseBidi(UBiDi *pBiDi, UBiDiLevel direction);
50 static void _testInverseBidi(UBiDi *pBiDi, const UChar *src, int32_t srcLength,
86 static const char* inverseBasic(UBiDi *pBiDi, const char *src, int32_t srcLen,
88 static UBool assertRoundTrip(UBiDi *pBiDi, int32_t tc, int32_t outIndex,
92 static UBool checkResultLength(UBiDi *pBiDi, const char *srcChars,
96 static UBool checkMaps(UBiDi *pBiDi, int32_t stringIndex, const char *src,
155 UBiDi *pBiDi, *pLine=NULL; in testBidi() local
160 pBiDi=ubidi_openSized(MAXLEN, 0, &errorCode); in testBidi()
161 if(pBiDi!=NULL) { in testBidi()
164 doTests(pBiDi, pLine, FALSE); in testBidi()
165 doTests(pBiDi, pLine, TRUE); in testBidi()
177 if(pBiDi!=NULL) { in testBidi()
178 ubidi_close(pBiDi); in testBidi()
185 doTests(UBiDi *pBiDi, UBiDi *pLine, UBool countRunsFirst) { in doTests() argument
196 ubidi_setPara(pBiDi, string, -1, paraLevel, NULL, &errorCode); in doTests()
199 testNumber, paraLevel, ubidi_getDirection(pBiDi), paraLevel); in doTests()
202 doTest(pBiDi, testNumber, tests+testNumber, 0, countRunsFirst); in doTests()
204 ubidi_setLine(pBiDi, lineStart, tests[testNumber].lineLimit, pLine, &errorCode); in doTests()
889 doTest(UBiDi *pBiDi, int testNumber, const BiDiTestData *test, int32_t lineStart, UBool countRunsFi… in doTest() argument
893 int32_t i, len=ubidi_getLength(pBiDi), logicalIndex, runCount = 0; in doTest()
900 runCount = ubidi_countRuns(pBiDi, &errorCode); in doTest()
910 _testReordering(pBiDi, testNumber); in doTest()
914 i, ubidi_getLevelAt(pBiDi, i), ubidi_getLevelAt(pBiDi, i), levelString, in doTest()
916 ubidi_getVisualIndex(pBiDi, i, &errorCode)); in doTest()
924 log_verbose(" %d", ubidi_getLevelAt(pBiDi, i)); in doTest()
932 log_verbose(" %d", ubidi_getVisualIndex(pBiDi, i, &errorCode)); in doTest()
936 if(test->direction!=ubidi_getDirection(pBiDi)) { in doTest()
937 …_err("ubidi_getDirection(tests[%d]): wrong direction %d\n", testNumber, ubidi_getDirection(pBiDi)); in doTest()
940 if(test->resultLevel!=ubidi_getParaLevel(pBiDi)) { in doTest()
941 …ubidi_getParaLevel(tests[%d]): wrong paragraph level %d\n", testNumber, ubidi_getParaLevel(pBiDi)); in doTest()
945 if(levels[i]!=ubidi_getLevelAt(pBiDi, i)) { in doTest()
946 …ts[%d], %d): wrong level %d, expected %d\n", testNumber, i, ubidi_getLevelAt(pBiDi, i), levels[i]); in doTest()
952 logicalIndex=ubidi_getVisualIndex(pBiDi, i, &errorCode); in doTest()
964 runCount=ubidi_countRuns(pBiDi, &errorCode); in doTest()
972 level=ubidi_getLevelAt(pBiDi, logicalIndex); in doTest()
973 ubidi_getLogicalRun(pBiDi, logicalIndex, &logicalIndex, &level2); in doTest()
982 testNumber, ubidi_countRuns(pBiDi, &errorCode)); in doTest()
989 testNumber, ubidi_countRuns(pBiDi, &errorCode)); in doTest()
997 _testReordering(UBiDi *pBiDi, int testNumber) { in _testReordering() argument
1003 int32_t i, length=ubidi_getLength(pBiDi), in _testReordering()
1004 destLength=ubidi_getResultLength(pBiDi); in _testReordering()
1013 ubidi_getLogicalMap(pBiDi, logicalMap1, &errorCode); in _testReordering()
1019 ubidi_getVisualMap(pBiDi, visualMap1, &errorCode); in _testReordering()
1030 levels=ubidi_getLevels(pBiDi, &errorCode); in _testReordering()
1041 runCount=ubidi_countRuns(pBiDi, &errorCode); in _testReordering()
1049 odd=(UBool)ubidi_getVisualRun(pBiDi, i, &logicalStart, &runLength); in _testReordering()
1120 if(logicalMap1[i]!=ubidi_getVisualIndex(pBiDi, i, &errorCode)) { in _testReordering()
1128 if(visualMap1[i]!=ubidi_getLogicalIndex(pBiDi, i, &errorCode)) { in _testReordering()
2043 UBiDi *pBiDi; in testInverse() local
2048 pBiDi=ubidi_open(); in testInverse()
2049 if(pBiDi==NULL) { in testInverse()
2058 _testInverseBidi(pBiDi, testCases[i].s, testCases[i].length, 0, &errorCode); in testInverse()
2065 _testInverseBidi(pBiDi, testCases[i].s, testCases[i].length, 1, &errorCode); in testInverse()
2068 _testManyInverseBidi(pBiDi, 0); in testInverse()
2069 _testManyInverseBidi(pBiDi, 1); in testInverse()
2071 ubidi_close(pBiDi); in testInverse()
2096 _testManyInverseBidi(UBiDi *pBiDi, UBiDiLevel direction) { in _testManyInverseBidi() argument
2115 _testInverseBidi(pBiDi, text, 8, direction, &errorCode); in _testManyInverseBidi()
2122 _testInverseBidi(UBiDi *pBiDi, const UChar *src, int32_t srcLength, in _testInverseBidi() argument
2131 ubidi_setInverse(pBiDi, TRUE); in _testInverseBidi()
2132 if (!ubidi_isInverse(pBiDi)) { in _testInverseBidi()
2135 ubidi_setPara(pBiDi, src, srcLength, 0, NULL, pErrorCode); in _testInverseBidi()
2136 if (src != ubidi_getText(pBiDi)) { in _testInverseBidi()
2139 logicalLength=ubidi_writeReordered(pBiDi, logicalDest, LENGTHOF(logicalDest), in _testInverseBidi()
2142 printUnicode(src, srcLength, ubidi_getLevels(pBiDi, pErrorCode)); in _testInverseBidi()
2146 ubidi_setInverse(pBiDi, FALSE); in _testInverseBidi()
2147 if (ubidi_isInverse(pBiDi)) { in _testInverseBidi()
2150 ubidi_setPara(pBiDi, logicalDest, logicalLength, 0, NULL, pErrorCode); in _testInverseBidi()
2151 visualLength=ubidi_writeReordered(pBiDi, visualDest, LENGTHOF(visualDest), in _testInverseBidi()
2163 ubidi_setInverse(pBiDi, TRUE); in _testInverseBidi()
2164 ubidi_setPara(pBiDi, visualLTR, ltrLength, 0, NULL, pErrorCode); in _testInverseBidi()
2165 logicalLength=ubidi_writeReordered(pBiDi, logicalDest, LENGTHOF(logicalDest), in _testInverseBidi()
2168 printUnicode(visualLTR, ltrLength, ubidi_getLevels(pBiDi, pErrorCode)); in _testInverseBidi()
2172 ubidi_setInverse(pBiDi, FALSE); in _testInverseBidi()
2173 ubidi_setPara(pBiDi, logicalDest, logicalLength, 0, NULL, pErrorCode); in _testInverseBidi()
2174 visualLength=ubidi_writeReordered(pBiDi, visualDest, LENGTHOF(visualDest), in _testInverseBidi()
2178 printUnicode(logicalDest, logicalLength, ubidi_getLevels(pBiDi, pErrorCode)); in _testInverseBidi()
2952 const char* mode, const char* option, UBiDi* pBiDi) { in assertStringsEqual() argument
2960 "Levels:", formatLevels(pBiDi, formatChars), in assertStringsEqual()
2961 "Reordering mode:", ubidi_getReorderingMode(pBiDi), mode, in assertStringsEqual()
2962 "Paragraph level:", ubidi_getParaLevel(pBiDi), in assertStringsEqual()
2963 "Reordering option:", ubidi_getReorderingOptions(pBiDi), option); in assertStringsEqual()
2971 UBiDi* pBiDi = ubidi_open(); in getBiDiObject() local
2972 if (pBiDi == NULL) { in getBiDiObject()
2975 return pBiDi; in getBiDiObject()
3267 assertRoundTrip(UBiDi *pBiDi, int32_t tc, int32_t outIndex, const char *srcChars, in assertRoundTrip() argument
3367 ubidi_setReorderingMode(pBiDi, mode); \ in assertRoundTrip()
3394 ubidi_setReorderingOptions(pBiDi, UBIDI_OPTION_REMOVE_CONTROLS); in assertRoundTrip()
3396 ubidi_setPara(pBiDi, dest, destLen, level, NULL, &rc); in assertRoundTrip()
3399 destLen2 = ubidi_writeReordered(pBiDi, dest2, MAXLEN, UBIDI_DO_MIRRORING, in assertRoundTrip()
3405 checkWhatYouCan(pBiDi, destChars3, destChars2); in assertRoundTrip()
3431 if (!checkResultLength(pBiDi, destChars, destChars2, destLen2, in assertRoundTrip()
3435 if (outIndex > -1 && !checkMaps(pBiDi, outIndex, srcChars, destChars, in assertRoundTrip()
3444 checkResultLength(UBiDi *pBiDi, const char *srcChars, const char *destChars, in checkResultLength() argument
3451 actualLen = ubidi_getResultLength(pBiDi); in checkResultLength()
3508 UBiDi *pBiDi = getBiDiObject(); in testReorderRunsOnly() local
3519 ubidi_close(pBiDi); /* in case this one was allocated */ in testReorderRunsOnly()
3522 ubidi_setReorderingMode(pBiDi, UBIDI_REORDER_RUNS_ONLY); in testReorderRunsOnly()
3526 ubidi_setReorderingOptions(pBiDi, option==0 ? UBIDI_OPTION_REMOVE_CONTROLS in testReorderRunsOnly()
3535 ubidi_setPara(pBiDi, src, srcLen, level, NULL, &rc); in testReorderRunsOnly()
3538 destLen = ubidi_writeReordered(pBiDi, dest, MAXLEN, UBIDI_DO_MIRRORING, &rc); in testReorderRunsOnly()
3541 checkWhatYouCan(pBiDi, testCases[i].textIn, destChars); in testReorderRunsOnly()
3545 pBiDi); in testReorderRunsOnly()
3567 pBiDi); in testReorderRunsOnly()
3573 ubidi_setPara(pBiDi, src, 0, UBIDI_LTR, NULL, &rc); in testReorderRunsOnly()
3575 paras = ubidi_countParagraphs(pBiDi); in testReorderRunsOnly()
3580 ubidi_close(pBiDi); in testReorderRunsOnly()
3591 UBiDi *pBiDi = NULL, *pBiDi2 = NULL, *pBiDi3 = NULL; in testReorderingMode() local
3602 pBiDi = getBiDiObject(); in testReorderingMode()
3606 ubidi_close(pBiDi); /* in case this one was allocated */ in testReorderingMode()
3620 ubidi_setReorderingMode(pBiDi, modeValue); in testReorderingMode()
3621 modeBack = ubidi_getReorderingMode(pBiDi); in testReorderingMode()
3629 ubidi_setReorderingOptions(pBiDi, optionValue); in testReorderingMode()
3630 optionBack = ubidi_getReorderingOptions(pBiDi); in testReorderingMode()
3640 ubidi_setPara(pBiDi, src, srcLen, paraLevels[level], NULL, &rc); in testReorderingMode()
3644 destLen = ubidi_writeReordered(pBiDi, dest, MAXLEN, in testReorderingMode()
3650 checkWhatYouCan(pBiDi, srcChars, destChars); in testReorderingMode()
3665 pBiDi)) { in testReorderingMode()
3674 else if (!checkResultLength(pBiDi, srcChars, destChars, in testReorderingMode()
3680 else if (index > -1 && !checkMaps(pBiDi, index, srcChars, in testReorderingMode()
3695 ubidi_close(pBiDi); in testReorderingMode()
3700 static const char* inverseBasic(UBiDi *pBiDi, const char *srcChars, int32_t srcLen, in inverseBasic() argument
3706 if (pBiDi == NULL || src == NULL) { in inverseBasic()
3709 ubidi_setReorderingOptions(pBiDi, option); in inverseBasic()
3711 ubidi_setPara(pBiDi, src, srcLen, level, NULL, &rc); in inverseBasic()
3715 destLen = ubidi_writeReordered(pBiDi, dest2, MAXLEN, in inverseBasic()
3720 checkWhatYouCan(pBiDi, srcChars, result); in inverseBasic()
3761 UBiDi *pBiDi = NULL; in testStreaming() local
3773 pBiDi = getBiDiObject(); in testStreaming()
3775 ubidi_orderParagraphsLTR(pBiDi, TRUE); in testStreaming()
3788 ubidi_setReorderingOptions(pBiDi, UBIDI_OPTION_STREAMING); in testStreaming()
3792 ubidi_setPara(pBiDi, pSrc, len, level, NULL, &rc); in testStreaming()
3797 processedLen = ubidi_getProcessedLength(pBiDi); in testStreaming()
3799 ubidi_setReorderingOptions(pBiDi, UBIDI_OPTION_DEFAULT); in testStreaming()
3803 ubidi_setReorderingOptions(pBiDi, UBIDI_OPTION_STREAMING); in testStreaming()
3824 ubidi_close(pBiDi); in testStreaming()
3889 UBiDi *pBiDi = NULL; in testClassOverride() local
3898 pBiDi = getBiDiObject(); in testClassOverride()
3899 if(!pBiDi) { in testClassOverride()
3903 ubidi_getClassCallback(pBiDi, &oldFn, &oldContext); in testClassOverride()
3906 ubidi_setClassCallback(pBiDi, newFn, textSrc, &oldFn, &oldContext, &rc); in testClassOverride()
3908 ubidi_close(pBiDi); in testClassOverride()
3913 ubidi_getClassCallback(pBiDi, &oldFn, &oldContext); in testClassOverride()
3916 ubidi_setClassCallback(pBiDi, newFn, textSrc, &oldFn, &oldContext, &rc); in testClassOverride()
3918 ubidi_close(pBiDi); in testClassOverride()
3924 ubidi_setPara(pBiDi, src, srcLen, UBIDI_LTR, NULL, &rc); in testClassOverride()
3927 destLen = ubidi_writeReordered(pBiDi, dest, MAXLEN, in testClassOverride()
3941 ubidi_close(pBiDi); in testClassOverride()
3964 checkMaps(UBiDi *pBiDi, int32_t stringIndex, const char *src, const char *dest, in checkMaps() argument
3983 ubidi_getLogicalMap(pBiDi, actualLogicalMap, &rc); in checkMaps()
3987 srcLen = ubidi_getProcessedLength(pBiDi); in checkMaps()
4005 level, ubidi_getParaLevel(pBiDi), in checkMaps()
4006 mode, ubidi_getReorderingMode(pBiDi), in checkMaps()
4007 option, ubidi_getReorderingOptions(pBiDi), in checkMaps()
4012 resLen = ubidi_getResultLength(pBiDi); in checkMaps()
4013 ubidi_getVisualMap(pBiDi, actualVisualMap, &rc); in checkMaps()
4032 level, ubidi_getParaLevel(pBiDi), in checkMaps()
4033 mode, ubidi_getReorderingMode(pBiDi), in checkMaps()
4034 option, ubidi_getReorderingOptions(pBiDi), in checkMaps()
4040 index = ubidi_getVisualIndex(pBiDi, i, &rc); in checkMaps()
4061 level, ubidi_getParaLevel(pBiDi), in checkMaps()
4062 mode, ubidi_getReorderingMode(pBiDi), in checkMaps()
4063 option, ubidi_getReorderingOptions(pBiDi), in checkMaps()
4069 index = ubidi_getLogicalIndex(pBiDi, i, &rc); in checkMaps()
4090 level, ubidi_getParaLevel(pBiDi), in checkMaps()
4091 mode, ubidi_getReorderingMode(pBiDi), in checkMaps()
4092 option, ubidi_getReorderingOptions(pBiDi), in checkMaps()
4152 UBiDi *pBiDi = NULL; in testContext() local
4162 ubidi_setContext(pBiDi, NULL, 0, NULL, 0, &rc); in testContext()
4165 pBiDi = getBiDiObject(); in testContext()
4166 ubidi_orderParagraphsLTR(pBiDi, TRUE); in testContext()
4170 ubidi_setContext(pBiDi, NULL, -2, NULL, 0, &rc); in testContext()
4174 ubidi_setContext(pBiDi, NULL, 0, NULL, -2, &rc); in testContext()
4178 ubidi_setContext(pBiDi, NULL, 3, NULL, 0, &rc); in testContext()
4182 ubidi_setContext(pBiDi, NULL, 0, NULL, 4, &rc); in testContext()
4194 ubidi_setContext(pBiDi, epilogue, epiLength, prologue, proLength, &rc); in testContext()
4196 ubidi_setContext(pBiDi, prologue, -1, epilogue, -1, &rc); in testContext()
4200 ubidi_setPara(pBiDi, src, srcLen, cc.paraLevel, NULL, &rc); in testContext()
4202 destLen = ubidi_writeReordered(pBiDi, dest, MAXLEN, UBIDI_DO_MIRRORING, &rc); in testContext()
4215 "Levels:", formatLevels(pBiDi, formatChars), in testContext()
4216 "Reordering mode:", ubidi_getReorderingMode(pBiDi), in testContext()
4217 "Paragraph level:", ubidi_getParaLevel(pBiDi), in testContext()
4218 "Reordering option:", ubidi_getReorderingOptions(pBiDi)); in testContext()
4225 ubidi_close(pBiDi); in testContext()