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_wcscspn.c |
| 5 | * |
| 6 | * WCSCSPN: size_t wcscspn (const wchar_t *ws1, const wchar_t *ws2); |
| 7 | */ |
| 8 | |
| 9 | |
| 10 | TST_WCSCSPN tst_wcscspn_loc [] = { |
| 11 | |
| 12 | { { Twcscspn, TST_LOC_de }, |
| 13 | { |
| 14 | { /*input.*/ { { 0x00D1,0x00D2,0x00D3,0x0000 }, |
| 15 | { 0x00D1,0x0000 }, }, /* #1 */ |
| 16 | /*expect*/ { 0,1,0, }, |
| 17 | }, |
| 18 | { /*input.*/ { { 0x00D1,0x00D2,0x00D3,0x0000 }, |
| 19 | { 0x00D2,0x0000 }, }, /* #2 */ |
| 20 | /*expect*/ { 0,1,1, }, |
| 21 | }, |
| 22 | { /*input.*/ { { 0x00D1,0x00D2,0x00D3,0x0000 }, |
| 23 | { 0x00D3,0x0000 }, }, /* #3 */ |
| 24 | /*expect*/ { 0,1,2, }, |
| 25 | }, |
| 26 | { /*input.*/ { { 0x00D1,0x00D2,0x00D3,0x0000 }, |
| 27 | { 0x00D2,0x00D3,0x0000 }, }, /* #4 */ |
| 28 | /*expect*/ { 0,1,1, }, |
| 29 | }, |
| 30 | { /*input.*/ { { 0x00D1,0x00D2,0x00D3,0x0000 }, |
| 31 | { 0x00D2,0x00D3,0x00D4,0x0000 }, }, /* #5 */ |
| 32 | /*expect*/ { 0,1,1, }, |
| 33 | }, |
| 34 | { /*input.*/ { { 0x00D1,0x00D2,0x00D3,0x0000 }, |
| 35 | { 0x00D3,0x00D4,0x00D5,0x0000 }, }, /* #6 */ |
| 36 | /*expect*/ { 0,1,2, }, |
| 37 | }, |
| 38 | { /*input.*/ { { 0x00D1,0x00D2,0x00D3,0x0000 }, |
| 39 | { 0x00D1,0x00D2,0x00D3,0x0000 }, }, /* #7 */ |
| 40 | /*expect*/ { 0,1,0, }, |
| 41 | }, |
| 42 | { /*input.*/ { { 0x0000,0x00D2,0x00D3,0x0000 }, |
| 43 | { 0x00D2,0x000 }, }, /* #8 */ |
| 44 | /*expect*/ { 0,1,0, }, |
| 45 | }, |
| 46 | { /*input.*/ { { 0x00D1,0x00D2,0x00D3,0x0000 }, |
| 47 | { 0x0000,0x00D2,0x00D3,0x0000 }, }, /* #9 */ |
| 48 | /*expect*/ { 0,1,3, }, |
| 49 | }, |
| 50 | { /*input.*/ { { 0x00D1,0x00D2,0x0000 }, |
| 51 | { 0x00D1,0x00D2,0x00D3,0x0000 }, }, /* #10 */ |
| 52 | /*expect*/ { 0,1,0, }, |
| 53 | }, |
| 54 | { /*input.*/ { { 0x00D1,0x00D2,0x0000 }, |
| 55 | { 0x00D1,0x00D3,0x00D4,0x0000 }, }, /* #11 */ |
| 56 | /*expect*/ { 0,1,0, }, |
| 57 | }, |
| 58 | { .is_last = 1 } |
| 59 | } |
| 60 | }, |
| 61 | { { Twcscspn, TST_LOC_enUS }, |
| 62 | { |
| 63 | { /*input.*/ { { 0x0041,0x0042,0x0043,0x0000 }, |
| 64 | { 0x0041,0x0000 }, }, /* #1 */ |
| 65 | /*expect*/ { 0,1,0, }, |
| 66 | }, |
| 67 | { /*input.*/ { { 0x0041,0x0042,0x0043,0x0000 }, |
| 68 | { 0x0042,0x0000 }, }, /* #2 */ |
| 69 | /*expect*/ { 0,1,1, }, |
| 70 | }, |
| 71 | { /*input.*/ { { 0x0041,0x0042,0x0043,0x0000 }, |
| 72 | { 0x0043,0x0000 }, }, /* #3 */ |
| 73 | /*expect*/ { 0,1,2, }, |
| 74 | }, |
| 75 | { /*input.*/ { { 0x0041,0x0042,0x0043,0x0000 }, |
| 76 | { 0x0042,0x0043,0x0000 }, }, /* #4 */ |
| 77 | /*expect*/ { 0,1,1, }, |
| 78 | }, |
| 79 | { /*input.*/ { { 0x0041,0x0042,0x0043,0x0000 }, |
| 80 | { 0x0042,0x0043,0x0044,0x0000 }, }, /* #5 */ |
| 81 | /*expect*/ { 0,1,1, }, |
| 82 | }, |
| 83 | { /*input.*/ { { 0x0041,0x0042,0x0043,0x0000 }, |
| 84 | { 0x0043,0x0044,0x0045,0x0000 }, }, /* #6 */ |
| 85 | /*expect*/ { 0,1,2, }, |
| 86 | }, |
| 87 | { /*input.*/ { { 0x0041,0x0042,0x0043,0x0000 }, |
| 88 | { 0x0041,0x0042,0x0043,0x0000 }, }, /* #7 */ |
| 89 | /*expect*/ { 0,1,0, }, |
| 90 | }, |
| 91 | { /*input.*/ { { 0x0000,0x0042,0x0043,0x0000 }, |
| 92 | { 0x0042,0x000 }, }, /* #8 */ |
| 93 | /*expect*/ { 0,1,0, }, |
| 94 | }, |
| 95 | { /*input.*/ { { 0x0041,0x0042,0x0043,0x0000 }, |
| 96 | { 0x0000,0x0042,0x0043,0x0000 }, }, /* #9 */ |
| 97 | /*expect*/ { 0,1,3, }, |
| 98 | }, |
| 99 | { /*input.*/ { { 0x0041,0x0042,0x0000 }, |
| 100 | { 0x0041,0x0042,0x0043,0x0000 }, }, /* #10 */ |
| 101 | /*expect*/ { 0,1,0, }, |
| 102 | }, |
| 103 | { /*input.*/ { { 0x0041,0x0042,0x0000 }, |
| 104 | { 0x0041,0x0043,0x0044,0x0000 }, }, /* #11 */ |
| 105 | /*expect*/ { 0,1,0, }, |
| 106 | }, |
| 107 | { .is_last = 1 } |
| 108 | } |
| 109 | }, |
| 110 | #if 0 |
| 111 | { { Twcscspn, TST_LOC_eucJP }, |
| 112 | #else |
| 113 | { { Twcscspn, TST_LOC_ja_UTF8 }, |
| 114 | #endif |
| 115 | { |
| 116 | { /*input.*/ { { 0x3041,0x3042,0x0043,0x0000 }, |
| 117 | { 0x3041,0x0000 }, }, /* #1 */ |
| 118 | /*expect*/ { 0,1,0, }, |
| 119 | }, |
| 120 | { /*input.*/ { { 0x3041,0x3042,0x0043,0x0000 }, |
| 121 | { 0x3042,0x0000 }, }, /* #2 */ |
| 122 | /*expect*/ { 0,1,1, }, |
| 123 | }, |
| 124 | { /*input.*/ { { 0x3041,0x3042,0x3043,0x0000 }, |
| 125 | { 0x3043,0x0000 }, }, /* #3 */ |
| 126 | /*expect*/ { 0,1,2, }, |
| 127 | }, |
| 128 | { /*input.*/ { { 0x3041,0x3042,0x3043,0x0000 }, |
| 129 | { 0x3042,0x3043,0x0000 }, }, /* #4 */ |
| 130 | /*expect*/ { 0,1,1, }, |
| 131 | }, |
| 132 | { /*input.*/ { { 0x3041,0x3042,0x3043,0x0000 }, |
| 133 | { 0x3042,0x3043,0x3044,0x0000 }, }, /* #5 */ |
| 134 | /*expect*/ { 0,1,1, }, |
| 135 | }, |
| 136 | { /*input.*/ { { 0x3041,0x3042,0x3043,0x0000 }, |
| 137 | { 0x3043,0x3044,0x3045,0x0000 }, }, /* #6 */ |
| 138 | /*expect*/ { 0,1,2, }, |
| 139 | }, |
| 140 | { /*input.*/ { { 0x3041,0x3042,0x3043,0x0000 }, |
| 141 | { 0x3041,0x3042,0x3043,0x0000 }, }, /* #7 */ |
| 142 | /*expect*/ { 0,1,0, }, |
| 143 | }, |
| 144 | { /*input.*/ { { 0x0000,0x3042,0x3043,0x0000 }, |
| 145 | { 0x3042,0x0000 }, }, /* #8 */ |
| 146 | /*expect*/ { 0,1,0, }, |
| 147 | }, |
| 148 | { /*input.*/ { { 0x3041,0x3042,0x3043,0x0000 }, |
| 149 | { 0x0000,0x3042,0x3043,0x0000 }, }, /* #9 */ |
| 150 | /*expect*/ { 0,1,3, }, |
| 151 | }, |
| 152 | { /*input.*/ { { 0x3041,0x3042,0x0000 }, |
| 153 | { 0x3041,0x3042,0x3043,0x0000 }, }, /* #10 */ |
| 154 | /*expect*/ { 0,1,0, }, |
| 155 | }, |
| 156 | { /*input.*/ { { 0x3041,0x3042,0x0000 }, |
| 157 | { 0x3041,0x3043,0x3044,0x0000 }, }, /* #11 */ |
| 158 | /*expect*/ { 0,1,0, }, |
| 159 | }, |
| 160 | { .is_last = 1 } |
| 161 | } |
| 162 | }, |
| 163 | { { Twcscspn, TST_LOC_end }} |
| 164 | }; |