1 /* 2 * TEST SUITE FOR MB/WC FUNCTIONS IN C LIBRARY 3 * 4 * FILE: dat_mbstowcs.c 5 * 6 * MBSTOWCS: size_t mbstowcs (wchar_t *ws, char *s, size_t n); 7 */ 8 9 #include <limits.h> 10 11 TST_MBSTOWCS tst_mbstowcs_loc [] = { 12 { 13 { Tmbstowcs, TST_LOC_de }, 14 { 15 { /*----------------- #01 -----------------*/ 16 { 17 { 18 { 1, 1, "ABC", 4 }, 19 { 1, 1, "ABC", 3 }, 20 { 1, 1, "ABC", 2 }, 21 } 22 }, 23 { 24 { 25 { 0,1,3, { 0x0041,0x0042,0x0043,0x0000 } }, 26 { 0,1,3, { 0x0041,0x0042,0x0043,0x0000 } }, 27 { 0,1,2, { 0x0041,0x0042,0x0043,0x0000 } }, 28 } 29 } 30 }, 31 { /*----------------- #02 -----------------*/ 32 { 33 { 34 { 1, 1, "ABC", 4 }, 35 { 1, 1, "", 1 }, 36 { 0, 1, "ABC", 4 }, 37 } 38 }, 39 { 40 { 41 { 0,1,3, { 0x0041,0x0042,0x0043,0x0000 } }, 42 { 0,1,0, { 0x0000 } }, 43 { 0,1,3, { 0x0000 } }, 44 } 45 } 46 }, 47 { .is_last = 1 } 48 } 49 }, 50 { 51 { Tmbstowcs, TST_LOC_enUS }, 52 { 53 { /*----------------- #01 -----------------*/ 54 { 55 { 56 { 1, 1, "ABC", 4 }, 57 { 1, 1, "ABC", 3 }, 58 { 1, 1, "ABC", 2 }, 59 } 60 }, 61 { 62 { 63 { 0,1,3, { 0x0041,0x0042,0x0043,0x0000 } }, 64 { 0,1,3, { 0x0041,0x0042,0x0043,0x0000 } }, 65 { 0,1,2, { 0x0041,0x0042,0x0043,0x0000 } }, 66 } 67 } 68 }, 69 { /*----------------- #02 -----------------*/ 70 { 71 { 72 { 1, 1, "ABC", 4 }, 73 { 1, 1, "", 1 }, 74 { 0, 1, "ABC", 4 }, 75 } 76 }, 77 { 78 { 79 { 0,1,3, { 0x0041,0x0042,0x0043,0x0000 } }, 80 { 0,1,0, { 0x0000 } }, 81 { 0,1,3, { 0x0000 } }, 82 } 83 } 84 }, 85 { .is_last = 1 } 86 } 87 }, 88 { 89 { Tmbstowcs, TST_LOC_eucJP }, 90 { 91 { /*----------------- #01 -----------------*/ 92 { 93 { 94 { 1, 1, "\244\242\244\244\244\246ABC", 7 }, 95 { 1, 1, "\244\242\244\244\244\246ABC", 6 }, 96 { 1, 1, "\244\242\244\244\244\246ABC", 4 }, 97 } 98 }, 99 { 100 { 101 { 0,1,6, { 0x3042,0x3044,0x3046,0x0041,0x0042,0x0043,0x0000 }}, 102 { 0,1,6, { 0x3042,0x3044,0x3046,0x0041,0x0042,0x0043,0x0000 }}, 103 { 0,1,4, { 0x3042,0x3044,0x3046,0x0041,0x0000 } }, 104 } 105 } 106 }, 107 { /*----------------- #02 -----------------*/ 108 { 109 { 110 { 1, 1, "\244\242\244\244\244\246ABC", 4 }, 111 { 1, 1, "", 1 }, 112 { 0, 1, "\244\242\244\244\244\246ABC", 0 }, 113 } 114 }, 115 { 116 { 117 { 0,1,4, { 0x3042,0x3044,0x3046,0x0041,0x0000 } }, 118 { 0,1,0, { 0x0000 } }, 119 { 0,1,6, { 0x0000 } }, 120 } 121 } 122 }, 123 { .is_last = 1 } 124 } 125 }, 126 { 127 { Tmbstowcs, TST_LOC_end } 128 } 129 }; 130