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_wcscmp.c |
| 5 | * |
| 6 | * WCSCMP: int wcscmp (const wchar_t *ws1, const wchar_t *ws2); |
| 7 | */ |
| 8 | |
| 9 | /* NOTE: |
| 10 | This is not a locale sensitive function and |
| 11 | it may not make sence testing it for each locale ... |
| 12 | */ |
| 13 | |
| 14 | |
| 15 | TST_WCSCMP tst_wcscmp_loc [] = { |
| 16 | { |
| 17 | { Twcscmp, TST_LOC_de }, |
| 18 | { |
| 19 | { /*input.*/ { { 0x00D1,0x00D2,0x00D3,0x0000 }, |
| 20 | { 0x00D1,0x00D2,0x00D3,0x0000 }, }, /* #1 */ |
| 21 | /*expect*/ { 0,1,0, }, |
| 22 | }, |
| 23 | { /*input.*/ { { 0x0000,0x00D1,0x00D3,0x0000 }, |
| 24 | { 0x0000,0x00D2,0x00D3,0x0000 }, }, /* #2 */ |
| 25 | /*expect*/ { 0,1,0, }, |
| 26 | }, |
| 27 | { /*input.*/ { { 0x00D1,0x00D1,0x00D3,0x0000 }, |
| 28 | { 0x0000,0x00D2,0x00D3,0x0000 }, }, /* #3 */ |
| 29 | /*expect*/ { 0,1,1, }, |
| 30 | }, |
| 31 | { /*input.*/ { { 0x0000,0x00D2,0x00D3,0x0000 }, |
| 32 | { 0x00D1,0x00D1,0x00D3,0x0000 }, }, /* #4 */ |
| 33 | /*expect*/ { 0,1,-1, }, |
| 34 | }, |
| 35 | { /*input.*/ { { 0x00D1,0x00D5,0x00D3,0x0000 }, |
| 36 | { 0x00D1,0x00D2,0x00D3,0x0000 }, }, /* #5 */ |
| 37 | /*expect*/ { 0,1,1, }, |
| 38 | }, |
| 39 | { /*input.*/ { { 0x00D1,0x00D2,0x00D3,0x0000 }, |
| 40 | { 0x00D1,0x00D2,0x00D9,0x0000 }, }, /* #6 */ |
| 41 | /*expect*/ { 0,1,-1, }, |
| 42 | }, |
| 43 | { /*input.*/ { { 0x00D1,0x00D2,0x0000 }, |
| 44 | { 0x00D1,0x00D2,0x00D9,0x0000 }, }, /* #7 */ |
| 45 | /*expect*/ { 0,1,-1, }, |
| 46 | }, |
| 47 | { /*input.*/ { { 0x00D1,0x00D2,0x00D9,0x0000 }, |
| 48 | { 0x00D1,0x00D2,0x0000 }, }, /* #8 */ |
| 49 | /*expect*/ { 0,1,1, }, |
| 50 | }, |
| 51 | { .is_last = 1 } |
| 52 | } |
| 53 | }, |
| 54 | { |
| 55 | { Twcscmp, TST_LOC_enUS }, |
| 56 | { |
| 57 | { /*input.*/ { { 0x0041,0x0042,0x0043,0x0000 }, |
| 58 | { 0x0041,0x0042,0x0043,0x0000 }, }, /* #1 */ |
| 59 | /*expect*/ { 0,1,0, }, |
| 60 | }, |
| 61 | { /*input.*/ { { 0x0000,0x0041,0x0043,0x0000 }, |
| 62 | { 0x0000,0x0042,0x0043,0x0000 }, }, /* #2 */ |
| 63 | /*expect*/ { 0,1,0, }, |
| 64 | }, |
| 65 | { /*input.*/ { { 0x0041,0x0041,0x0043,0x0000 }, |
| 66 | { 0x0000,0x0042,0x0043,0x0000 }, }, /* #3 */ |
| 67 | /*expect*/ { 0,1,1, }, |
| 68 | }, |
| 69 | { /*input.*/ { { 0x0000,0x0042,0x0043,0x0000 }, |
| 70 | { 0x0041,0x0041,0x0043,0x0000 }, }, /* #4 */ |
| 71 | /*expect*/ { 0,1,-1, }, |
| 72 | }, |
| 73 | { /*input.*/ { { 0x0041,0x0045,0x0043,0x0000 }, |
| 74 | { 0x0041,0x0042,0x0043,0x0000 }, }, /* #5 */ |
| 75 | /*expect*/ { 0,1,1, }, |
| 76 | }, |
| 77 | { /*input.*/ { { 0x0041,0x0042,0x0043,0x0000 }, |
| 78 | { 0x0041,0x0042,0x0049,0x0000 }, }, /* #6 */ |
| 79 | /*expect*/ { 0,1,-1, }, |
| 80 | }, |
| 81 | { /*input.*/ { { 0x0041,0x0042,0x0000 }, |
| 82 | { 0x0041,0x0042,0x0049,0x0000 }, }, /* #7 */ |
| 83 | /*expect*/ { 0,1,-1, }, |
| 84 | }, |
| 85 | { /*input.*/ { { 0x0041,0x0042,0x0049,0x0000 }, |
| 86 | { 0x0041,0x0042,0x0000 }, }, /* #8 */ |
| 87 | /*expect*/ { 0,1,1, }, |
| 88 | }, |
| 89 | { .is_last = 1 } |
| 90 | } |
| 91 | }, |
| 92 | { |
| 93 | #if 0 |
| 94 | { Twcscmp, TST_LOC_eucJP}, |
| 95 | #else |
| 96 | { Twcscmp, TST_LOC_ja_UTF8}, |
| 97 | #endif |
| 98 | { |
| 99 | { /*input.*/ { { 0x3041,0x3042,0x3043,0x0000 }, |
| 100 | { 0x3041,0x3042,0x3043,0x0000 }, }, /* #1 */ |
| 101 | /*expect*/ { 0,1,0, }, |
| 102 | }, |
| 103 | { /*input.*/ { { 0x0000,0x3041,0x3043,0x0000 }, |
| 104 | { 0x0000,0x3042,0x3043,0x0000 }, }, /* #2 */ |
| 105 | /*expect*/ { 0,1,0, }, |
| 106 | }, |
| 107 | { /*input.*/ { { 0x3041,0x3041,0x3043,0x0000 }, |
| 108 | { 0x0000,0x3042,0x3043,0x0000 }, }, /* #3 */ |
| 109 | /*expect*/ { 0,1,1, }, |
| 110 | }, |
| 111 | { /*input.*/ { { 0x0000,0x3042,0x3043,0x0000 }, |
| 112 | { 0x3041,0x3041,0x3043,0x0000 }, }, /* #4 */ |
| 113 | /*expect*/ { 0,1,-1, }, |
| 114 | }, |
| 115 | { /*input.*/ { { 0x3041,0x3045,0x3043,0x0000 }, |
| 116 | { 0x3041,0x3042,0x3043,0x0000 }, }, /* #5 */ |
| 117 | /*expect*/ { 0,1,1, }, |
| 118 | }, |
| 119 | { /*input.*/ { { 0x3041,0x3042,0x3043,0x0000 }, |
| 120 | { 0x3041,0x3042,0x3049,0x0000 }, }, /* #6 */ |
| 121 | /*expect*/ { 0,1,-1, }, |
| 122 | }, |
| 123 | { /*input.*/ { { 0x3041,0x3042,0x0000 }, |
| 124 | { 0x3041,0x3042,0x3049,0x0000 }, }, /* #7 */ |
| 125 | /*expect*/ { 0,1,-1, }, |
| 126 | }, |
| 127 | { /*input.*/ { { 0x3041,0x3042,0x3049,0x0000 }, |
| 128 | { 0x3041,0x3042,0x0000 }, }, /* #8 */ |
| 129 | /*expect*/ { 0,1,1, }, |
| 130 | }, |
| 131 | { .is_last = 1 } |
| 132 | } |
| 133 | }, |
| 134 | { |
| 135 | { Twcschr, TST_LOC_end} |
| 136 | } |
| 137 | }; |