1 /* 2 * TEST SUITE FOR MB/WC FUNCTIONS IN CLIBRARY 3 * 4 * FILE: dat_wcsxfrm.c 5 * 6 * WCSXFRM: size_t wcsxfrm (char *s1, const char s2, size_t n); 7 */ 8 9 /* 10 * NOTE: 11 * 12 * Return value and errno value are checked only for 2nd string: 13 * org2[]; n1 and n2 don't mean bytes to be translated. 14 * It means a buffer size including a null character. 15 * Results of this test depens on results of wcscoll(). 16 * If you got errors, check both test results. 17 */ 18 19 20 TST_WCSXFRM tst_wcsxfrm_loc [] = { 21 22 { 23 { Twcsxfrm, TST_LOC_de }, 24 { 25 { /*inp*/ { { 0x00C1,0x0000 }, { 0x00C1,0x0000 }, 7, 7 }, /* #01 */ 26 /*exp*/ { 0, 0,0, }, 27 }, 28 { /*inp*/ { { 0x0042,0x0000 }, { 0x0061,0x0000 }, 7, 7 }, /* #02 */ 29 /*exp*/ { 0, 0,0, }, 30 }, 31 { /*inp*/ { { 0x0061,0x0000 }, { 0x0042,0x0000 }, 7, 7 }, /* #03 */ 32 /*exp*/ { 0, 0,0, }, 33 }, 34 { /*inp*/ { { 0x00E4,0x0000 }, { 0x00DC,0x0000 }, 7, 7 }, /* #04 */ 35 /*exp*/ { 0, 0,0, }, 36 }, 37 { /*inp*/ { { 0x00DC,0x0000 }, { 0x00E4,0x0000 }, 7, 7 }, /* #05 */ 38 /*exp*/ { 0, 0,0, }, 39 }, 40 { .is_last = 1 } 41 } 42 }, 43 { 44 { Twcsxfrm, TST_LOC_enUS }, 45 { 46 { /*inp*/ { { 0x0041,0x0000 }, { 0x0041,0x0000 }, 7, 7 }, /* #01 */ 47 /*exp*/ { 0, 0,0, }, 48 }, 49 { /*inp*/ { { 0x0042,0x0000 }, { 0x0061,0x0000 }, 7, 7 }, /* #02 */ 50 /*exp*/ { 0, 0,0, }, 51 }, 52 { /*inp*/ { { 0x0061,0x0000 }, { 0x0042,0x0000 }, 7, 7 }, /* #03 */ 53 /*exp*/ { 0, 0,0, }, 54 }, 55 { /*inp*/ { { 0x0000,0x0000 }, { 0x0000,0x0000 }, 7, 7 }, /* #04 */ 56 /*exp*/ { 0, 0,0, }, 57 }, 58 #ifdef NO_WAIVER 59 { /* <WAIVER> x 2 */ 60 /*inp*/ { { 0x3061,0x0000 }, { 0xFF42,0x0000 }, 7, 7 }, /* #05 */ 61 /* <WAIVER> */ 62 /*exp*/ { EINVAL, 1,(size_t)-1, }, 63 }, 64 #endif 65 { .is_last = 1 } 66 } 67 }, 68 { 69 #if 0 70 { Twcsxfrm, TST_LOC_eucJP }, /* need more test data ! */ 71 #else 72 { Twcsxfrm, TST_LOC_ja_UTF8 }, /* need more test data ! */ 73 #endif 74 { 75 { /*inp*/ { { 0x3041,0x0000 }, { 0x3041,0x0000 }, 7, 7 }, /* #01 */ 76 /*exp*/ { 0, 0,0, }, 77 }, 78 { /*inp*/ { { 0x0042,0x0000 }, { 0x0061,0x0000 }, 7, 7 }, /* #02 */ 79 /*exp*/ { 0, 0,0, }, 80 }, 81 { /*inp*/ { { 0x0061,0x0000 }, { 0x0042,0x0000 }, 7, 7 }, /* #03 */ 82 /*exp*/ { 0, 0,0, }, 83 }, 84 { /*inp*/ { { 0x30A2,0x0000 }, { 0xFF71,0x0000 }, 7, 7 }, /* #04 */ 85 /*exp*/ { 0, 0,0, }, 86 }, 87 { /*inp*/ { { 0xFF71,0x0000 }, { 0x30A2,0x0000 }, 7, 7 }, /* #05 */ 88 /*exp*/ { 0, 0,0, }, 89 }, 90 #ifdef NO_WAIVER 91 /* <WAIVER> x 2 */ 92 { /*inp*/ { { 0x008E,0x0000 }, { 0x008F,0x0000 }, 7, 7 }, /* #06 */ 93 /*exp*/ { EINVAL, 1,(size_t)-1, }, 94 }, 95 #endif 96 { .is_last = 1 } 97 } 98 }, 99 { 100 { Twcsxfrm, TST_LOC_end } 101 } 102 }; 103