lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame^] | 1 | /* |
| 2 | * TEST SUITE FOR MB/WC FUNCTIONS IN C LIBRARY |
| 3 | * |
| 4 | * FILE: dat_mbsrtowcs.c |
| 5 | * |
| 6 | * MBSRTOWCS: size_t mbsrtowcs (wchar_t *ws, char **s, size_t n, |
| 7 | * mbstate_t *ps); |
| 8 | */ |
| 9 | |
| 10 | |
| 11 | TST_MBSRTOWCS tst_mbsrtowcs_loc [] = { |
| 12 | { |
| 13 | { Tmbsrtowcs, TST_LOC_de }, |
| 14 | { |
| 15 | { /*----------------- #01 -----------------*/ |
| 16 | { |
| 17 | { |
| 18 | { 1, "üäö", 4, 0,0 }, |
| 19 | { 1, "üäö", 3, 0,0 }, |
| 20 | { 1, "üäö", 2, 0,0 }, |
| 21 | } |
| 22 | }, |
| 23 | { |
| 24 | { |
| 25 | { 0,1,3, { 0x00FC,0x00E4,0x00F6,0x0000 } }, |
| 26 | { 0,1,3, { 0x00FC,0x00E4,0x00F6,0x0000 } }, |
| 27 | { 0,1,2, { 0x00FC,0x00E4,0x00F6,0x0000 } }, |
| 28 | } |
| 29 | } |
| 30 | }, |
| 31 | { /*----------------- #02 -----------------*/ |
| 32 | { |
| 33 | { |
| 34 | { 1, "üäö", 4, 0,0 }, |
| 35 | { 1, "", 1, 0,0 }, |
| 36 | { 0, "üäö", 4, 0,0 }, |
| 37 | } |
| 38 | }, |
| 39 | { |
| 40 | { |
| 41 | { 0,1,3, { 0x00FC,0x00E4,0x00F6,0x0000 } }, |
| 42 | { 0,1,0, { 0x0000 } }, |
| 43 | { 0,1,3, { 0x0000 } }, |
| 44 | } |
| 45 | } |
| 46 | }, |
| 47 | { /*----------------- END -----------------*/ |
| 48 | .is_last = 1 |
| 49 | } |
| 50 | } |
| 51 | }, |
| 52 | |
| 53 | { |
| 54 | { Tmbsrtowcs, TST_LOC_enUS }, |
| 55 | { |
| 56 | { /*----------------- #01 -----------------*/ |
| 57 | { |
| 58 | { |
| 59 | { 1, "ABC", 4, 0,0 }, |
| 60 | { 1, "ABC", 3, 0,0 }, |
| 61 | { 1, "ABC", 2, 0,0 }, |
| 62 | } |
| 63 | }, |
| 64 | { |
| 65 | { |
| 66 | { 0,1,3, { 0x0041,0x0042,0x0043,0x0000 } }, |
| 67 | { 0,1,3, { 0x0041,0x0042,0x0043,0x0000 } }, |
| 68 | { 0,1,2, { 0x0041,0x0042,0x0043,0x0000 } }, |
| 69 | } |
| 70 | } |
| 71 | }, |
| 72 | { /*----------------- #02 -----------------*/ |
| 73 | { |
| 74 | { |
| 75 | { 1, "ABC", 4, 0,0 }, |
| 76 | { 1, "", 1, 0,0 }, |
| 77 | { 0, "ABC", 4, 0,0 }, |
| 78 | } |
| 79 | }, |
| 80 | { |
| 81 | { |
| 82 | { 0,1,3, { 0x0041,0x0042,0x0043,0x0000 } }, |
| 83 | { 0,1,0, { 0x0000 } }, |
| 84 | { 0,1,3, { 0x0000 } }, |
| 85 | } |
| 86 | } |
| 87 | }, |
| 88 | { /*----------------- END -----------------*/ |
| 89 | .is_last = 1 |
| 90 | } |
| 91 | } |
| 92 | }, |
| 93 | |
| 94 | #if 0 |
| 95 | { |
| 96 | { Tmbsrtowcs, TST_LOC_eucJP }, |
| 97 | { |
| 98 | { /*----------------- #01 -----------------*/ |
| 99 | { |
| 100 | { |
| 101 | { 1, "\244\242\244\244\244\246ABC", 7, 0,0 }, |
| 102 | { 1, "\244\242\244\244\244\246ABC", 6, 0,0 }, |
| 103 | { 1, "\244\242\244\244\244\246ABC", 4, 0,0 }, |
| 104 | } |
| 105 | }, |
| 106 | { |
| 107 | { |
| 108 | { 0,1,6, { 0x3042,0x3044,0x3046,0x0041,0x0042,0x0043,0x0000 }}, |
| 109 | { 0,1,6, { 0x3042,0x3044,0x3046,0x0041,0x0042,0x0043,0x0000 }}, |
| 110 | { 0,1,4, { 0x3042,0x3044,0x3046,0x0041,0x0000 } }, |
| 111 | } |
| 112 | } |
| 113 | }, |
| 114 | { /*----------------- #02 -----------------*/ |
| 115 | { |
| 116 | { |
| 117 | { 1, "\244\242\244\244\244\246ABC", 7, 0,0 }, |
| 118 | { 1, "", 1, 0,0 }, |
| 119 | { 0, "\244\242\244\244\244\246ABC", 7, 0,0 }, |
| 120 | } |
| 121 | }, |
| 122 | { |
| 123 | { |
| 124 | { 0,1,6, { 0x3042,0x3044,0x3046,0x0041,0x0042,0x0043,0x0000 }}, |
| 125 | { 0,1,0, { 0x0000 } }, |
| 126 | { 0,1,6, { 0x0000 } }, |
| 127 | } |
| 128 | } |
| 129 | }, |
| 130 | { /*----------------- END -----------------*/ |
| 131 | .is_last = 1 |
| 132 | } |
| 133 | } |
| 134 | }, |
| 135 | #else |
| 136 | { |
| 137 | { Tmbsrtowcs, TST_LOC_ja_UTF8 }, |
| 138 | { |
| 139 | { /*----------------- #01 -----------------*/ |
| 140 | { |
| 141 | { |
| 142 | { 1, "\343\201\202\343\201\204\343\201\206ABC", 7, 0,0 }, |
| 143 | { 1, "\343\201\202\343\201\204\343\201\206ABC", 6, 0,0 }, |
| 144 | { 1, "\343\201\202\343\201\204\343\201\206ABC", 4, 0,0 }, |
| 145 | } |
| 146 | }, |
| 147 | { |
| 148 | { |
| 149 | { 0,1,6, { 0x3042,0x3044,0x3046,0x0041,0x0042,0x0043,0x0000 }}, |
| 150 | { 0,1,6, { 0x3042,0x3044,0x3046,0x0041,0x0042,0x0043,0x0000 }}, |
| 151 | { 0,1,4, { 0x3042,0x3044,0x3046,0x0041,0x0000 } }, |
| 152 | } |
| 153 | } |
| 154 | }, |
| 155 | { /*----------------- #02 -----------------*/ |
| 156 | { |
| 157 | { |
| 158 | { 1, "\343\201\202\343\201\204\343\201\206ABC", 7, 0,0 }, |
| 159 | { 1, "", 1, 0,0 }, |
| 160 | { 0, "\343\201\202\343\201\204\343\201\206ABC", 7, 0,0 }, |
| 161 | } |
| 162 | }, |
| 163 | { |
| 164 | { |
| 165 | { 0,1,6, { 0x3042,0x3044,0x3046,0x0041,0x0042,0x0043,0x0000 }}, |
| 166 | { 0,1,0, { 0x0000 } }, |
| 167 | { 0,1,6, { 0x0000 } }, |
| 168 | } |
| 169 | } |
| 170 | }, |
| 171 | { /*----------------- END -----------------*/ |
| 172 | .is_last = 1 |
| 173 | } |
| 174 | } |
| 175 | }, |
| 176 | #endif |
| 177 | { |
| 178 | { Tmbsrtowcs, TST_LOC_end } |
| 179 | } |
| 180 | }; |