/********************************************************************
* COPYRIGHT:
- * Copyright (c) 1997-2001, International Business Machines Corporation and
+ * Copyright (c) 1997-2007, International Business Machines Corporation and
* others. All Rights Reserved.
********************************************************************/
/* file name: cbididat.c
#include "unicode/ubidi.h"
#include "cbiditst.h"
-const char *
-dirPropNames[dirPropCount]={
+const char * const
+dirPropNames[U_CHAR_DIRECTION_COUNT]={
"L", "R", "EN", "ES", "ET", "AN", "CS", "B", "S", "WS", "ON",
"LRE", "LRO", "AL", "RLE", "RLO", "PDF", "NSM", "BN"
};
-const UChar
-charFromDirProp[dirPropCount]={
+UChar
+charFromDirProp[U_CHAR_DIRECTION_COUNT]={
/* L R EN ES ET AN CS B S WS ON */
0x61, 0x5d0, 0x30, 0x2f, 0x25, 0x660, 0x2c, 0xa, 0x9, 0x20, 0x26,
/* LRE LRO AL RLE RLO PDF NSM BN */
2
};
-BiDiTestData
+static const uint8_t
+testText16[]={
+ L, L, L, WS, L, L, L, WS, L, L, L
+};
+
+static const UBiDiLevel
+testLevels21[]={
+ 2, 2, 2, 2, 2, 2, 2, 1
+};
+
+static const uint8_t
+testVisualMap20[]={
+ 1, 2, 3, 4, 5, 6, 7, 0
+};
+
+static const uint8_t
+testText17[]={
+ R, R, R, WS, R, R, R, WS, R, R, R
+};
+
+static const UBiDiLevel
+testLevels22[]={
+ 1, 1, 1, 1, 1, 1, 1, 0
+};
+
+static const uint8_t
+testVisualMap21[]={
+ 6, 5, 4, 3, 2, 1, 0, 7
+};
+
+static const uint8_t
+testTextXX[]={
+ L
+};
+
+static const UBiDiLevel
+testLevelsXX[]={
+ 2
+};
+
+static const uint8_t
+testVisualMapXX[]={
+ 0
+};
+
+const BiDiTestData
tests[]={
{testText1, ARRAY_LENGTH(testText1), UBIDI_DEFAULT_LTR, -1, -1,
UBIDI_LTR, 0,
testLevels19, testVisualMap19},
{testText15, ARRAY_LENGTH(testText15), UBIDI_DEFAULT_LTR, 2, 3,
UBIDI_LTR, 2,
- testLevels20, testVisualMap19}
+ testLevels20, testVisualMap19},
+ {testText16, ARRAY_LENGTH(testText16), UBIDI_RTL, 0, 8,
+ UBIDI_MIXED, 1,
+ testLevels21, testVisualMap20},
+ {testText17, ARRAY_LENGTH(testText17), UBIDI_LTR, 0, 8,
+ UBIDI_MIXED, 0,
+ testLevels22, testVisualMap21},
+ {testTextXX, ARRAY_LENGTH(testTextXX), UBIDI_RTL, -1, -1,
+ UBIDI_MIXED, 1, testLevelsXX, testVisualMapXX}
};
-int
+const int
bidiTestCount=ARRAY_LENGTH(tests);