ICU-9024 unit test for Arabic Mathematical Alphabetic Symbols

X-SVN-Rev: 32474
This commit is contained in:
Dina Sayed 2012-09-30 15:31:46 +00:00
parent 46f7e6258a
commit 96c93de55b

View File

@ -68,8 +68,12 @@ static void doArabicShapingTestForBug5421(void);
static void doArabicShapingTestForBug8703(void);
static void doArabicShapingTestForBug9024(void);
static void testReorder(void);
static void testReorderArabicMathSymbols(void);
static void testFailureRecovery(void);
static void testMultipleParagraphs(void);
@ -134,7 +138,8 @@ addComplexTest(TestNode** root) {
addTest(root, doArabicShapingTestForBug5421, "complex/arabic-shaping/bug-5421");
addTest(root, doTailTest, "complex/arabic-shaping/tailtest");
addTest(root, doArabicShapingTestForBug8703, "complex/arabic-shaping/bug-8703");
addTest(root, testReorderArabicMathSymbols, "complex/bidi/bug-9024");
addTest(root, doArabicShapingTestForBug9024, "complex/arabic-shaping/bug-9024");
}
static void
@ -889,6 +894,134 @@ testReorder(void) {
log_verbose("\nExiting TestReorder\n\n");
}
static void
testReorderArabicMathSymbols(void) {
static const UChar logicalOrder[][MAXLEN]={
/* Arabic mathematical Symbols 0x1EE00 - 0x1EE1B */
{0xD83B, 0xDE00, 0xD83B, 0xDE01, 0xD83B, 0xDE02, 0xD83B, 0xDE03, 0x20,
0xD83B, 0xDE24, 0xD83B, 0xDE05, 0xD83B, 0xDE06, 0x20,
0xD83B, 0xDE07, 0xD83B, 0xDE08, 0xD83B, 0xDE09, 0x20,
0xD83B, 0xDE0A, 0xD83B, 0xDE0B, 0xD83B, 0xDE0C, 0xD83B, 0xDE0D, 0x20,
0xD83B, 0xDE0E, 0xD83B, 0xDE0F, 0xD83B, 0xDE10, 0xD83B, 0xDE11, 0x20,
0xD83B, 0xDE12, 0xD83B, 0xDE13, 0xD83B, 0xDE14, 0xD83B, 0xDE15, 0x20,
0xD83B, 0xDE16, 0xD83B, 0xDE17, 0xD83B, 0xDE18, 0x20,
0xD83B, 0xDE19, 0xD83B, 0xDE1A, 0xD83B, 0xDE1B},
/* Arabic mathematical Symbols - Looped Symbols, 0x1EE80 - 0x1EE9B */
{0xD83B, 0xDE80, 0xD83B, 0xDE81, 0xD83B, 0xDE82, 0xD83B, 0xDE83, 0x20,
0xD83B, 0xDE84, 0xD83B, 0xDE85, 0xD83B, 0xDE86, 0x20,
0xD83B, 0xDE87, 0xD83B, 0xDE88, 0xD83B, 0xDE89, 0x20,
0xD83B, 0xDE8B, 0xD83B, 0xDE8C, 0xD83B, 0xDE8D, 0x20,
0xD83B, 0xDE8E, 0xD83B, 0xDE8F, 0xD83B, 0xDE90, 0xD83B, 0xDE91, 0x20,
0xD83B, 0xDE92, 0xD83B, 0xDE93, 0xD83B, 0xDE94, 0xD83B, 0xDE95, 0x20,
0xD83B, 0xDE96, 0xD83B, 0xDE97, 0xD83B, 0xDE98, 0x20,
0xD83B, 0xDE99, 0xD83B, 0xDE9A, 0xD83B, 0xDE9B},
/* Arabic mathematical Symbols - Double-struck Symbols, 0x1EEA1 - 0x1EEBB */
{0xD83B, 0xDEA1, 0xD83B, 0xDEA2, 0xD83B, 0xDEA3, 0x20,
0xD83B, 0xDEA5, 0xD83B, 0xDEA6, 0x20,
0xD83B, 0xDEA7, 0xD83B, 0xDEA8, 0xD83B, 0xDEA9, 0x20,
0xD83B, 0xDEAB, 0xD83B, 0xDEAC, 0xD83B, 0xDEAD, 0x20,
0xD83B, 0xDEAE, 0xD83B, 0xDEAF, 0xD83B, 0xDEB0, 0xD83B, 0xDEB1, 0x20,
0xD83B, 0xDEB2, 0xD83B, 0xDEB3, 0xD83B, 0xDEB4, 0xD83B, 0xDEB5, 0x20,
0xD83B, 0xDEB6, 0xD83B, 0xDEB7, 0xD83B, 0xDEB8, 0x20,
0xD83B, 0xDEB9, 0xD83B, 0xDEBA, 0xD83B, 0xDEBB},
/* Arabic mathematical Symbols - Initial Symbols, 0x1EE21 - 0x1EE3B */
{0xD83B, 0xDE21, 0xD83B, 0xDE22, 0x20,
0xD83B, 0xDE27, 0xD83B, 0xDE29, 0x20,
0xD83B, 0xDE2A, 0xD83B, 0xDE2B, 0xD83B, 0xDE2C, 0xD83B, 0xDE2D, 0x20,
0xD83B, 0xDE2E, 0xD83B, 0xDE2F, 0xD83B, 0xDE30, 0xD83B, 0xDE31, 0x20,
0xD83B, 0xDE32, 0xD83B, 0xDE34, 0xD83B, 0xDE35, 0x20,
0xD83B, 0xDE36, 0xD83B, 0xDE37, 0x20,
0xD83B, 0xDE39, 0xD83B, 0xDE3B},
/* Arabic mathematical Symbols - Tailed Symbols */
{0xD83B, 0xDE42, 0xD83B, 0xDE47, 0xD83B, 0xDE49, 0xD83B, 0xDE4B, 0x20,
0xD83B, 0xDE4D, 0xD83B, 0xDE4E, 0xD83B, 0xDE4F, 0x20,
0xD83B, 0xDE51, 0xD83B, 0xDE52, 0xD83B, 0xDE54, 0xD83B, 0xDE57, 0x20,
0xD83B, 0xDE59, 0xD83B, 0xDE5B, 0xD83B, 0xDE5D, 0xD83B, 0xDE5F}
};
static const UChar visualOrder[][MAXLEN]={
/* Arabic mathematical Symbols 0x1EE00 - 0x1EE1B */
{0xD83B, 0xDE1B, 0xD83B, 0xDE1A, 0xD83B, 0xDE19, 0x20,
0xD83B, 0xDE18, 0xD83B, 0xDE17, 0xD83B, 0xDE16, 0x20,
0xD83B, 0xDE15, 0xD83B, 0xDE14, 0xD83B, 0xDE13, 0xD83B, 0xDE12, 0x20,
0xD83B, 0xDE11, 0xD83B, 0xDE10, 0xD83B, 0xDE0F, 0xD83B, 0xDE0E, 0x20,
0xD83B, 0xDE0D, 0xD83B, 0xDE0C, 0xD83B, 0xDE0B, 0xD83B, 0xDE0A, 0x20,
0xD83B, 0xDE09, 0xD83B, 0xDE08, 0xD83B, 0xDE07, 0x20,
0xD83B, 0xDE06, 0xD83B, 0xDE05, 0xD83B, 0xDE24, 0x20,
0xD83B, 0xDE03, 0xD83B, 0xDE02, 0xD83B, 0xDE01, 0xD83B, 0xDE00},
/* Arabic mathematical Symbols - Looped Symbols, 0x1EE80 - 0x1EE9B */
{0xD83B, 0xDE9B, 0xD83B, 0xDE9A, 0xD83B, 0xDE99, 0x20,
0xD83B, 0xDE98, 0xD83B, 0xDE97, 0xD83B, 0xDE96, 0x20,
0xD83B, 0xDE95, 0xD83B, 0xDE94, 0xD83B, 0xDE93, 0xD83B, 0xDE92, 0x20,
0xD83B, 0xDE91, 0xD83B, 0xDE90, 0xD83B, 0xDE8F, 0xD83B, 0xDE8E, 0x20,
0xD83B, 0xDE8D, 0xD83B, 0xDE8C, 0xD83B, 0xDE8B, 0x20,
0xD83B, 0xDE89, 0xD83B, 0xDE88, 0xD83B, 0xDE87, 0x20,
0xD83B, 0xDE86, 0xD83B, 0xDE85, 0xD83B, 0xDE84, 0x20,
0xD83B, 0xDE83, 0xD83B, 0xDE82, 0xD83B, 0xDE81, 0xD83B, 0xDE80},
/* Arabic mathematical Symbols - Double-struck Symbols, 0x1EEA1 - 0x1EEBB */
{0xD83B, 0xDEBB, 0xD83B, 0xDEBA, 0xD83B, 0xDEB9, 0x20,
0xD83B, 0xDEB8, 0xD83B, 0xDEB7, 0xD83B, 0xDEB6, 0x20,
0xD83B, 0xDEB5, 0xD83B, 0xDEB4, 0xD83B, 0xDEB3, 0xD83B, 0xDEB2, 0x20,
0xD83B, 0xDEB1, 0xD83B, 0xDEB0, 0xD83B, 0xDEAF, 0xD83B, 0xDEAE, 0x20,
0xD83B, 0xDEAD, 0xD83B, 0xDEAC, 0xD83B, 0xDEAB, 0x20,
0xD83B, 0xDEA9, 0xD83B, 0xDEA8, 0xD83B, 0xDEA7, 0x20,
0xD83B, 0xDEA6, 0xD83B, 0xDEA5, 0x20,
0xD83B, 0xDEA3, 0xD83B, 0xDEA2, 0xD83B, 0xDEA1},
/* Arabic mathematical Symbols - Initial Symbols, 0x1EE21 - 0x1EE3B */
{0xD83B, 0xDE3B, 0xD83B, 0xDE39, 0x20,
0xD83B, 0xDE37, 0xD83B, 0xDE36, 0x20,
0xD83B, 0xDE35, 0xD83B, 0xDE34, 0xD83B, 0xDE32, 0x20,
0xD83B, 0xDE31, 0xD83B, 0xDE30, 0xD83B, 0xDE2F, 0xD83B, 0xDE2E, 0x20,
0xD83B, 0xDE2D, 0xD83B, 0xDE2C, 0xD83B, 0xDE2B, 0xD83B, 0xDE2A, 0x20,
0xD83B, 0xDE29, 0xD83B, 0xDE27, 0x20,
0xD83B, 0xDE22, 0xD83B, 0xDE21},
/* Arabic mathematical Symbols - Tailed Symbols */
{0xD83B, 0xDE5F, 0xD83B, 0xDE5D, 0xD83B, 0xDE5B, 0xD83B, 0xDE59, 0x20,
0xD83B, 0xDE57, 0xD83B, 0xDE54, 0xD83B, 0xDE52, 0xD83B, 0xDE51, 0x20,
0xD83B, 0xDE4F, 0xD83B, 0xDE4E, 0xD83B, 0xDE4D, 0x20,
0xD83B, 0xDE4B, 0xD83B, 0xDE49, 0xD83B, 0xDE47, 0xD83B, 0xDE42}
};
char formatChars[MAXLEN];
UErrorCode ec = U_ZERO_ERROR;
UBiDi* bidi = ubidi_open();
int i;
log_verbose("\nEntering TestReorderArabicMathSymbols\n\n");
for(i=0;i<LENGTHOF(logicalOrder);i++){
int32_t srcSize = u_strlen(logicalOrder[i]);
int32_t destSize = srcSize*2;
UChar dest[MAXLEN];
log_verbose("Testing L2V #1 for case %d\n", i);
ec = U_ZERO_ERROR;
ubidi_setPara(bidi,logicalOrder[i],srcSize,UBIDI_DEFAULT_LTR ,NULL,&ec);
if(U_FAILURE(ec)){
log_err("ubidi_setPara(tests[%d], paraLevel %d) failed with errorCode %s\n",
i, UBIDI_DEFAULT_LTR, u_errorName(ec));
}
/* try pre-flighting */
destSize = ubidi_writeReordered(bidi,dest,0,UBIDI_DO_MIRRORING,&ec);
if(ec!=U_BUFFER_OVERFLOW_ERROR){
log_err("Pre-flighting did not give expected error: Expected: U_BUFFER_OVERFLOW_ERROR. Got: %s \n",u_errorName(ec));
}else if(destSize!=srcSize){
log_err("Pre-flighting did not give expected size: Expected: %d. Got: %d \n",srcSize,destSize);
}else{
ec= U_ZERO_ERROR;
}
destSize=ubidi_writeReordered(bidi,dest,destSize+1,UBIDI_DO_MIRRORING,&ec);
if(destSize!=srcSize){
log_err("ubidi_writeReordered() destSize and srcSize do not match\n");
}else if(memcmp(dest, visualOrder[i], destSize*U_SIZEOF_UCHAR)!=0){
log_err("ubidi_writeReordered() did not give expected results for UBIDI_DO_MIRRORING.\n"
"Input : %s\nExpected: %s\nGot : %s\nLevels : %s\nAt Index: %d\n",
logicalOrder[i],visualOrder[i],dest,formatLevels(bidi, formatChars),i);
}
}
ubidi_close(bidi);
log_verbose("\nExiting TestReorderArabicMathSymbols\n\n");
}
static void
doTest(UBiDi *pBiDi, int testNumber, const BiDiTestData *test, int32_t lineStart, UBool countRunsFirst) {
const uint8_t *dirProps=test->text+lineStart;
@ -3020,6 +3153,167 @@ doArabicShapingTestForBug8703(void) {
}
static void
doArabicShapingTestForBug9024(void) {
static const UChar
letters_source1[]={ /* Arabic mathematical Symbols 0x1EE00 - 0x1EE1B */
0xD83B, 0xDE00, 0xD83B, 0xDE01, 0xD83B, 0xDE02, 0xD83B, 0xDE03, 0x20,
0xD83B, 0xDE24, 0xD83B, 0xDE05, 0xD83B, 0xDE06, 0x20,
0xD83B, 0xDE07, 0xD83B, 0xDE08, 0xD83B, 0xDE09, 0x20,
0xD83B, 0xDE0A, 0xD83B, 0xDE0B, 0xD83B, 0xDE0C, 0xD83B, 0xDE0D, 0x20,
0xD83B, 0xDE0E, 0xD83B, 0xDE0F, 0xD83B, 0xDE10, 0xD83B, 0xDE11, 0x20,
0xD83B, 0xDE12, 0xD83B, 0xDE13, 0xD83B, 0xDE14, 0xD83B, 0xDE15, 0x20,
0xD83B, 0xDE16, 0xD83B, 0xDE17, 0xD83B, 0xDE18, 0x20,
0xD83B, 0xDE19, 0xD83B, 0xDE1A, 0xD83B, 0xDE1B
}, letters_source2[]={/* Arabic mathematical Symbols - Looped Symbols, 0x1EE80 - 0x1EE9B */
0xD83B, 0xDE80, 0xD83B, 0xDE81, 0xD83B, 0xDE82, 0xD83B, 0xDE83, 0x20,
0xD83B, 0xDE84, 0xD83B, 0xDE85, 0xD83B, 0xDE86, 0x20,
0xD83B, 0xDE87, 0xD83B, 0xDE88, 0xD83B, 0xDE89, 0x20,
0xD83B, 0xDE8B, 0xD83B, 0xDE8C, 0xD83B, 0xDE8D, 0x20,
0xD83B, 0xDE8E, 0xD83B, 0xDE8F, 0xD83B, 0xDE90, 0xD83B, 0xDE91, 0x20,
0xD83B, 0xDE92, 0xD83B, 0xDE93, 0xD83B, 0xDE94, 0xD83B, 0xDE95, 0x20,
0xD83B, 0xDE96, 0xD83B, 0xDE97, 0xD83B, 0xDE98, 0x20,
0xD83B, 0xDE99, 0xD83B, 0xDE9A, 0xD83B, 0xDE9B
}, letters_source3[]={/* Arabic mathematical Symbols - Double-struck Symbols, 0x1EEA1 - 0x1EEBB */
0xD83B, 0xDEA1, 0xD83B, 0xDEA2, 0xD83B, 0xDEA3, 0x20,
0xD83B, 0xDEA5, 0xD83B, 0xDEA6, 0x20,
0xD83B, 0xDEA7, 0xD83B, 0xDEA8, 0xD83B, 0xDEA9, 0x20,
0xD83B, 0xDEAB, 0xD83B, 0xDEAC, 0xD83B, 0xDEAD, 0x20,
0xD83B, 0xDEAE, 0xD83B, 0xDEAF, 0xD83B, 0xDEB0, 0xD83B, 0xDEB1, 0x20,
0xD83B, 0xDEB2, 0xD83B, 0xDEB3, 0xD83B, 0xDEB4, 0xD83B, 0xDEB5, 0x20,
0xD83B, 0xDEB6, 0xD83B, 0xDEB7, 0xD83B, 0xDEB8, 0x20,
0xD83B, 0xDEB9, 0xD83B, 0xDEBA, 0xD83B, 0xDEBB
}, letters_source4[]={/* Arabic mathematical Symbols - Initial Symbols, 0x1EE21 - 0x1EE3B */
0xD83B, 0xDE21, 0xD83B, 0xDE22, 0x20,
0xD83B, 0xDE27, 0xD83B, 0xDE29, 0x20,
0xD83B, 0xDE2A, 0xD83B, 0xDE2B, 0xD83B, 0xDE2C, 0xD83B, 0xDE2D, 0x20,
0xD83B, 0xDE2E, 0xD83B, 0xDE2F, 0xD83B, 0xDE30, 0xD83B, 0xDE31, 0x20,
0xD83B, 0xDE32, 0xD83B, 0xDE34, 0xD83B, 0xDE35, 0x20,
0xD83B, 0xDE36, 0xD83B, 0xDE37, 0x20,
0xD83B, 0xDE39, 0xD83B, 0xDE3B
}, letters_source5[]={/* Arabic mathematical Symbols - Tailed Symbols */
0xD83B, 0xDE42, 0xD83B, 0xDE47, 0xD83B, 0xDE49, 0xD83B, 0xDE4B, 0x20,
0xD83B, 0xDE4D, 0xD83B, 0xDE4E, 0xD83B, 0xDE4F, 0x20,
0xD83B, 0xDE51, 0xD83B, 0xDE52, 0xD83B, 0xDE54, 0xD83B, 0xDE57, 0x20,
0xD83B, 0xDE59, 0xD83B, 0xDE5B, 0xD83B, 0xDE5D, 0xD83B, 0xDE5F
}, letters_source6[]={/* Arabic mathematical Symbols - Stretched Symbols with 06 range */
0xD83B, 0xDE21, 0x0633, 0xD83B, 0xDE62, 0x0647
}, letters_dest1[]={
0xD83B, 0xDE00, 0xD83B, 0xDE01, 0xD83B, 0xDE02, 0xD83B, 0xDE03, 0x20,
0xD83B, 0xDE24, 0xD83B, 0xDE05, 0xD83B, 0xDE06, 0x20,
0xD83B, 0xDE07, 0xD83B, 0xDE08, 0xD83B, 0xDE09, 0x20,
0xD83B, 0xDE0A, 0xD83B, 0xDE0B, 0xD83B, 0xDE0C, 0xD83B, 0xDE0D, 0x20,
0xD83B, 0xDE0E, 0xD83B, 0xDE0F, 0xD83B, 0xDE10, 0xD83B, 0xDE11, 0x20,
0xD83B, 0xDE12, 0xD83B, 0xDE13, 0xD83B, 0xDE14, 0xD83B, 0xDE15, 0x20,
0xD83B, 0xDE16, 0xD83B, 0xDE17, 0xD83B, 0xDE18, 0x20,
0xD83B, 0xDE19, 0xD83B, 0xDE1A, 0xD83B, 0xDE1B
}, letters_dest2[]={
0xD83B, 0xDE80, 0xD83B, 0xDE81, 0xD83B, 0xDE82, 0xD83B, 0xDE83, 0x20,
0xD83B, 0xDE84, 0xD83B, 0xDE85, 0xD83B, 0xDE86, 0x20,
0xD83B, 0xDE87, 0xD83B, 0xDE88, 0xD83B, 0xDE89, 0x20,
0xD83B, 0xDE8B, 0xD83B, 0xDE8C, 0xD83B, 0xDE8D, 0x20,
0xD83B, 0xDE8E, 0xD83B, 0xDE8F, 0xD83B, 0xDE90, 0xD83B, 0xDE91, 0x20,
0xD83B, 0xDE92, 0xD83B, 0xDE93, 0xD83B, 0xDE94, 0xD83B, 0xDE95, 0x20,
0xD83B, 0xDE96, 0xD83B, 0xDE97, 0xD83B, 0xDE98, 0x20,
0xD83B, 0xDE99, 0xD83B, 0xDE9A, 0xD83B, 0xDE9B
}, letters_dest3[]={
0xD83B, 0xDEA1, 0xD83B, 0xDEA2, 0xD83B, 0xDEA3, 0x20,
0xD83B, 0xDEA5, 0xD83B, 0xDEA6, 0x20,
0xD83B, 0xDEA7, 0xD83B, 0xDEA8, 0xD83B, 0xDEA9, 0x20,
0xD83B, 0xDEAB, 0xD83B, 0xDEAC, 0xD83B, 0xDEAD, 0x20,
0xD83B, 0xDEAE, 0xD83B, 0xDEAF, 0xD83B, 0xDEB0, 0xD83B, 0xDEB1, 0x20,
0xD83B, 0xDEB2, 0xD83B, 0xDEB3, 0xD83B, 0xDEB4, 0xD83B, 0xDEB5, 0x20,
0xD83B, 0xDEB6, 0xD83B, 0xDEB7, 0xD83B, 0xDEB8, 0x20,
0xD83B, 0xDEB9, 0xD83B, 0xDEBA, 0xD83B, 0xDEBB
}, letters_dest4[]={
0xD83B, 0xDE21, 0xD83B, 0xDE22, 0x20,
0xD83B, 0xDE27, 0xD83B, 0xDE29, 0x20,
0xD83B, 0xDE2A, 0xD83B, 0xDE2B, 0xD83B, 0xDE2C, 0xD83B, 0xDE2D, 0x20,
0xD83B, 0xDE2E, 0xD83B, 0xDE2F, 0xD83B, 0xDE30, 0xD83B, 0xDE31, 0x20,
0xD83B, 0xDE32, 0xD83B, 0xDE34, 0xD83B, 0xDE35, 0x20,
0xD83B, 0xDE36, 0xD83B, 0xDE37, 0x20,
0xD83B, 0xDE39, 0xD83B, 0xDE3B
}, letters_dest5[]={
0xD83B, 0xDE42, 0xD83B, 0xDE47, 0xD83B, 0xDE49, 0xD83B, 0xDE4B, 0x20,
0xD83B, 0xDE4D, 0xD83B, 0xDE4E, 0xD83B, 0xDE4F, 0x20,
0xD83B, 0xDE51, 0xD83B, 0xDE52, 0xD83B, 0xDE54, 0xD83B, 0xDE57, 0x20,
0xD83B, 0xDE59, 0xD83B, 0xDE5B, 0xD83B, 0xDE5D, 0xD83B, 0xDE5F
}, letters_dest6[]={
0xD83B, 0xDE21, 0xFEB1, 0xD83B, 0xDE62, 0xFEE9
};
UChar dest[MAXLEN];
UErrorCode errorCode;
int32_t length;
errorCode=U_ZERO_ERROR;
length=u_shapeArabic(letters_source1, LENGTHOF(letters_source1),
dest, LENGTHOF(dest),
U_SHAPE_TEXT_DIRECTION_VISUAL_RTL | U_SHAPE_TASHKEEL_BEGIN | U_SHAPE_LETTERS_SHAPE,
&errorCode);
if(U_FAILURE(errorCode) || length!=LENGTHOF(letters_dest1) || memcmp(dest, letters_dest1, length*U_SIZEOF_UCHAR)!=0) {
log_err("failure in u_shapeArabic(letters_source1)\n");
}
errorCode=U_ZERO_ERROR;
length=u_shapeArabic(letters_source2, LENGTHOF(letters_source2),
dest, LENGTHOF(dest),
U_SHAPE_TEXT_DIRECTION_VISUAL_RTL | U_SHAPE_TASHKEEL_END | U_SHAPE_LETTERS_SHAPE,
&errorCode);
if(U_FAILURE(errorCode) || length!=LENGTHOF(letters_dest2) || memcmp(dest, letters_dest2, length*U_SIZEOF_UCHAR)!=0) {
log_err("failure in u_shapeArabic(letters_source2)\n");
}
errorCode=U_ZERO_ERROR;
length=u_shapeArabic(letters_source3, LENGTHOF(letters_source3),
dest, LENGTHOF(dest),
U_SHAPE_TEXT_DIRECTION_VISUAL_RTL | U_SHAPE_TASHKEEL_RESIZE | U_SHAPE_LETTERS_SHAPE,
&errorCode);
if(U_FAILURE(errorCode) || length!=LENGTHOF(letters_dest3) || memcmp(dest, letters_dest3, length*U_SIZEOF_UCHAR)!=0) {
log_err("failure in u_shapeArabic(letters_source3)\n");
}
errorCode=U_ZERO_ERROR;
length=u_shapeArabic(letters_source4, LENGTHOF(letters_source4),
dest, LENGTHOF(dest),
U_SHAPE_TEXT_DIRECTION_VISUAL_RTL | U_SHAPE_TASHKEEL_REPLACE_BY_TATWEEL | U_SHAPE_LETTERS_SHAPE,
&errorCode);
if(U_FAILURE(errorCode) || length!=LENGTHOF(letters_dest4) || memcmp(dest, letters_dest4, length*U_SIZEOF_UCHAR)!=0) {
log_err("failure in u_shapeArabic(letters_source4)\n");
}
errorCode=U_ZERO_ERROR;
length=u_shapeArabic(letters_source5, LENGTHOF(letters_source5),
dest, LENGTHOF(dest),
U_SHAPE_TEXT_DIRECTION_VISUAL_LTR | U_SHAPE_TASHKEEL_BEGIN | U_SHAPE_LETTERS_SHAPE,
&errorCode);
if(U_FAILURE(errorCode) || length!=LENGTHOF(letters_dest5) || memcmp(dest, letters_dest5, length*U_SIZEOF_UCHAR)!=0) {
log_err("failure in u_shapeArabic(letters_source5)\n");
}
errorCode=U_ZERO_ERROR;
length=u_shapeArabic(letters_source6, LENGTHOF(letters_source6),
dest, LENGTHOF(dest),
U_SHAPE_TEXT_DIRECTION_VISUAL_LTR | U_SHAPE_TASHKEEL_END | U_SHAPE_LETTERS_SHAPE,
&errorCode);
if(U_FAILURE(errorCode) || length!=LENGTHOF(letters_dest6) || memcmp(dest, letters_dest6, length*U_SIZEOF_UCHAR)!=0) {
log_err("failure in u_shapeArabic(letters_source6)\n");
}
}
/* helpers ------------------------------------------------------------------ */
static void initCharFromDirProps(void) {