mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-13 08:53:20 +00:00
ICU-1941 update the test to use iscii
X-SVN-Rev: 9886
This commit is contained in:
parent
d8eb140a0c
commit
33c1b1707b
1 changed files with 18 additions and 12 deletions
|
@ -257,23 +257,28 @@ static void TestDecodedBundle(){
|
|||
UErrorCode error = U_ZERO_ERROR;
|
||||
|
||||
UResourceBundle* resB;
|
||||
int32_t len =0;
|
||||
|
||||
const UChar* srcFromRes;
|
||||
static const UChar src[] = {
|
||||
0x30a7,0x30a8,0x30c9,0x0061,0xFFFD,0x30f3,0x30c0,0x30b0,0x30b3,0x30c5,
|
||||
0x30d5,0x30d9,0x30ca,0x30eb,0x305a,0x304a,0x3049,0x3048,0x3046,
|
||||
0x3044,0x3053,0x3054,0x3064,0x3074,0x3084,0x3093,0x3062,0x3060,
|
||||
0x3080,0x3090,0x30a2,0x30b2,0x30b6,0x30b7,0x30b8,0x30d8,0x30d7,
|
||||
0x30d3,0x30d1,0x0000
|
||||
};
|
||||
|
||||
static const char* src =
|
||||
"\\u0009\\u092f\\u0941\\u0928\\u0947\\u0938\\u094d\\u0915\\u094b .\\u0915\\u0947 .\\u090f\\u0915 .\\u0905\\u0927\\u094d\\u092f\\u092f\\u0928 .\\u0915\\u0947 \\u0905\\u0928\\u0941\\u0938\\u093e\\u0930 1990 \\u0924\\u0915 \\u0915\\u0902\\u092a\\u094d\\u092f\\u0942\\u091f\\u0930-\\u092a\\u094d\\u0930\\u092c\\u0902\\u0927\\u093f\\u0924 \\u0938\\u0942\\u091a\\u0928\\u093e"
|
||||
"\\u092a\\u094d\\u0930\\u0923\\u093e\\u0932\\u0940 .\\u0915\\u0947 .\\u092f\\u094b\\u0917\\u0926\\u093e\\u0928 .\\u0915\\u0947 .\\u092b\\u0932\\u0938\\u094d\\u0935\\u0930\\u0942\\u092a .\\u0935\\u093f\\u0936\\u094d\\u0935 .\\u092e\\u0947\\u0902 .\\u0938\\u093e\\u0932\\u093e\\u0928\\u093e .2200 \\u0905\\u0930\\u092c \\u0930\\u0941\\u092a\\u092f\\u0947 \\u092e\\u0942\\u0932\\u094d\\u092f"
|
||||
"\\u0915\\u0940 .4\\u0935\\u0938\\u094d\\u0924\\u0941\\u0913\\u0902 .4\\u0915\\u093e .4\\u0909\\u0924\\u094d\\u092a\\u093e\\u0926\\u0928 .4\\u0939\\u094b\\u0917\\u093e, .3\\u091c\\u092c\\u0915\\u093f .3\\u0915\\u0902\\u092a\\u094d\\u092f\\u0942\\u091f\\u0930 .3\\u0915\\u093e .3\\u0915\\u0941\\u0932 .3\\u092f\\u094b\\u0917\\u0926\\u093e\\u0928 .3\\u0907\\u0938\\u0938\\u0947"
|
||||
"\\u0915\\u0939\\u093f ./\\u091c\\u094d\\u092f\\u093e\\u0926\\u093e ./\\u0939\\u094b\\u0917\\u093e\\u0964 ./\\u0905\\u0928\\u0941\\u0938\\u0902\\u0927\\u093e\\u0928 ./\\u0915\\u0940 ./\\u091a\\u0930\\u092e \\u0938\\u0940\\u092e\\u093e\\u0913\\u0902 \\u092a\\u0930 \\u092a\\u0939\\u0941\\u0902\\u091a\\u0928\\u0947 \\u0915\\u0947 \\u0932\\u093f\\u090f \\u0915\\u0902\\u092a\\u094d\\u092f\\u0942\\u091f\\u0930"
|
||||
"\\u090f\\u0915 ./\\u0906\\u092e ./\\u091c\\u0930\\u0942\\u0930\\u0924 ./\\u091c\\u0948\\u0938\\u093e \\u092c\\u0928 \\u0917\\u092f\\u093e \\u0939\\u0948\\u0964 \\u092d\\u093e\\u0930\\u0924 \\u092e\\u0947\\u0902 \\u092d\\u0940, \\u0916\\u093e\\u0938\\u0915\\u0930 \\u092e\\u094c\\u091c\\u0942\\u0926\\u093e \\u0938\\u0930\\u0915\\u093e\\u0930"
|
||||
"\\u0928\\u0947, \\u0915\\u0902\\u092a\\u094d\\u092f\\u0942\\u091f\\u0930 \\u0915\\u0947 \\u092a\\u094d\\u0930\\u092f\\u094b\\u0917 \\u092a\\u0930 \\u091c\\u092c\\u0930\\u0926\\u0938\\u094d\\u0924 \\u090f\\u095c \\u0932\\u0917\\u093e\\u092f\\u0940 \\u0939\\u0948, \\u0915\\u093f\\u0902\\u0924\\u0941 \\u0907\\u0938\\u0915\\u0947 \\u0938\\u0930\\u092a\\u091f \\u0926\\u094c\\u095c"
|
||||
"\\u0932\\u0917\\u093e\\u0928\\u0947 .2\\u0915\\u0947 .2\\u0932\\u093f\\u090f .2\\u0915\\u094d\\u092f\\u093e .2\\u0938\\u092a\\u093e\\u091f .2\\u0930\\u093e\\u0938\\u094d\\u0924\\u093e .2\\u0909\\u092a\\u0932\\u092c\\u094d\\u0927 .\\u0939\\u0948, .\\u0905\\u0925\\u0935\\u093e .\\u0935\\u093f\\u0936\\u094d\\u0935 .\\u092e\\u0947\\u0902 .\\u0915\\u0902\\u092a\\u094d\\u092f\\u0942\\u091f\\u0930 .\\u0915\\u0940"
|
||||
"\\u0938\\u092b\\u0932\\u0924\\u093e .3\\u0935 .3\\u0935\\u093f\\u092b\\u0932\\u0924\\u093e .3\\u0938\\u0947 .3\\u0938\\u092c\\u0915 .3\\u0932\\u0947 .3\\u0915\\u0930 .3\\u0915\\u094d\\u092f\\u093e .3\\u0939\\u092e .3\\u0907\\u0938\\u0915\\u093e .3\\u092f\\u0941\\u0915\\u094d\\u0924\\u093f\\u092a\\u0942\\u0930\\u094d\\u0923 .2\\u0935\\u093f\\u0938\\u094d\\u0924\\u093e\\u0930 "
|
||||
"\\u0905\\u092a\\u0947\\u0915\\u094d\\u0937\\u093f\\u0924 \\u0915\\u0930 \\u0938\\u0915\\u0947\\u0902\\u0917\\u0947 ? ";
|
||||
int32_t len = uprv_strlen(src);
|
||||
UChar* uSrc = (UChar*) uprv_malloc(U_SIZEOF_UCHAR * len);
|
||||
|
||||
/* pre-flight */
|
||||
int32_t num =0;
|
||||
const char *testdatapath = loadTestData(&error);
|
||||
|
||||
resB = ures_open(testdatapath, "ja_data", &error);
|
||||
len = u_unescape(src,uSrc, len);
|
||||
resB = ures_open(testdatapath, "iscii", &error);
|
||||
srcFromRes=ures_getStringByKey(resB,"str",&len,&error);
|
||||
if(u_strncmp(srcFromRes,src,len)!=0){
|
||||
if(u_strncmp(srcFromRes,uSrc,len)!=0){
|
||||
log_err("Genrb produced res files after decoding failed\n");
|
||||
}
|
||||
while(num<len ){
|
||||
|
@ -283,6 +288,7 @@ static void TestDecodedBundle(){
|
|||
num++;
|
||||
}
|
||||
ures_close(resB);
|
||||
uprv_free(uSrc);
|
||||
}
|
||||
|
||||
static void TestNewTypes() {
|
||||
|
|
Loading…
Add table
Reference in a new issue