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_mbrtowc.c |
| 5 | * |
| 6 | * MBTOWC: size_t mbrtowc (wchar_t *pwc, char *s, size_t n, |
| 7 | * mbstate_t *ps); |
| 8 | */ |
| 9 | |
| 10 | #include <limits.h> |
| 11 | |
| 12 | /* Note: |
| 13 | assumes en_US = en_US.ascii |
| 14 | */ |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | TST_MBRTOWC tst_mbrtowc_loc [] = { |
| 20 | { |
| 21 | { Tmbrtowc, TST_LOC_de }, |
| 22 | { |
| 23 | { /*----------------- #01 -----------------*/ |
| 24 | { |
| 25 | { |
| 26 | { 1, 1, "ÄÖÜ", 1, 0, 0 }, |
| 27 | { 1, 1, "ÄÖÜ", 2, 0, 0 }, |
| 28 | { 1, 1, "ÄÖÜ", USE_MBCURMAX, 0, 0 }, |
| 29 | } |
| 30 | }, |
| 31 | { |
| 32 | { |
| 33 | { 0, 1, 1, 0x00C4 }, |
| 34 | { 0, 1, 1, 0x00C4 }, |
| 35 | { 0, 1, 1, 0x00C4 }, |
| 36 | } |
| 37 | } |
| 38 | }, |
| 39 | { /*----------------- #02 -----------------*/ |
| 40 | { |
| 41 | { |
| 42 | { 1, 1, "ÄÖÜ", 1, 0, 0 }, |
| 43 | { 1, 1, "ÄÖÜ", 2, 0, 0 }, |
| 44 | { 1, 1, "ÄÖÜ", USE_MBCURMAX, 0, 0 }, |
| 45 | } |
| 46 | }, |
| 47 | { |
| 48 | { |
| 49 | { 0, 1, 1, 0x00C4 }, |
| 50 | { 0, 1, 1, 0x00C4 }, |
| 51 | { 0, 1, 1, 0x00C4 }, |
| 52 | } |
| 53 | } |
| 54 | }, |
| 55 | { .is_last = 1 } |
| 56 | } |
| 57 | }, |
| 58 | #if 0 |
| 59 | /* XXX: These tests don't make sense to me. */ |
| 60 | { |
| 61 | { Tmbrtowc, TST_LOC_enUS }, |
| 62 | { |
| 63 | { /*----------------- #01 -----------------*/ |
| 64 | { |
| 65 | { |
| 66 | { 1, 1, "ÄÖÜ", 1, 0, 0 }, |
| 67 | { 1, 1, "ÄÖÜ", 2, 0, 0 }, |
| 68 | { 1, 1, "ÄÖÜ", USE_MBCURMAX, 0, 0 }, |
| 69 | } |
| 70 | }, |
| 71 | { |
| 72 | { |
| 73 | { 0, 1, 1, 0x00C4 }, |
| 74 | { 0, 1, 1, 0x00C4 }, |
| 75 | { 0, 1, 1, 0x00C4 }, |
| 76 | } |
| 77 | } |
| 78 | }, |
| 79 | { /*----------------- #02 -----------------*/ |
| 80 | { |
| 81 | { |
| 82 | { 1, 1, "ÄÖÜ", 1, 0, 0 }, |
| 83 | { 1, 1, "ÄÖÜ", 2, 0, 0 }, |
| 84 | { 1, 1, "ÄÖÜ", USE_MBCURMAX, 0, 0 }, |
| 85 | } |
| 86 | }, |
| 87 | { |
| 88 | { |
| 89 | { 0, 1, 1, 0x00C4 }, |
| 90 | { 0, 1, 1, 0x00C4 }, |
| 91 | { 0, 1, 1, 0x00C4 }, |
| 92 | } |
| 93 | } |
| 94 | }, |
| 95 | { .is_last = 1 } |
| 96 | } |
| 97 | }, |
| 98 | { |
| 99 | { Tmbrtowc, TST_LOC_eucJP }, |
| 100 | { |
| 101 | { /*----------------- #01 -----------------*/ |
| 102 | { |
| 103 | { |
| 104 | { 1, 1, "ÄÖÜ", 1, 0, 0 }, |
| 105 | { 1, 1, "ÄÖÜ", 2, 0, 0 }, |
| 106 | { 1, 1, "ÄÖÜ", USE_MBCURMAX, 0, 0 }, |
| 107 | } |
| 108 | }, |
| 109 | { |
| 110 | { |
| 111 | { 0, 1, 1, 0x00C4 }, |
| 112 | { 0, 1, 1, 0x00C4 }, |
| 113 | { 0, 1, 1, 0x00C4 }, |
| 114 | } |
| 115 | } |
| 116 | }, |
| 117 | { /*----------------- #02 -----------------*/ |
| 118 | { |
| 119 | { |
| 120 | { 1, 1, "ÄÖÜ", 1, 0, 0 }, |
| 121 | { 1, 1, "ÄÖÜ", 2, 0, 0 }, |
| 122 | { 1, 1, "ÄÖÜ", USE_MBCURMAX, 0, 0 }, |
| 123 | } |
| 124 | }, |
| 125 | { |
| 126 | { |
| 127 | { 0, 1, 1, 0x00C4 }, |
| 128 | { 0, 1, 1, 0x00C4 }, |
| 129 | { 0, 1, 1, 0x00C4 }, |
| 130 | } |
| 131 | } |
| 132 | }, |
| 133 | { .is_last = 1 } |
| 134 | } |
| 135 | }, |
| 136 | #endif |
| 137 | { |
| 138 | { Tmbrtowc, TST_LOC_end } |
| 139 | } |
| 140 | }; |