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_wcsncpy.c |
| 5 | * |
| 6 | * WCSNCPY: wchar_t *wcsncpy (wchar_t *ws1, const wchar_t *ws2, |
| 7 | * size_t n); |
| 8 | */ |
| 9 | |
| 10 | |
| 11 | /* Note: |
| 12 | * |
| 13 | * An initial value of ws1 in the test program is defined as: |
| 14 | * |
| 15 | * #define WCSNUM_NCPY 7 |
| 16 | * wchar_t ws1 [WCSSIZE] = { 0x9999, 0x9999, 0x9999, 0x9999, |
| 17 | * 0x9999, 0x9999, 0x0000 }; |
| 18 | * */ |
| 19 | |
| 20 | |
| 21 | TST_WCSNCPY tst_wcsncpy_loc [] = { |
| 22 | { |
| 23 | {Twcsncpy, TST_LOC_de}, |
| 24 | { |
| 25 | /* 1 */ |
| 26 | {{ { 0x00D1,0x00D2,0x00D3,0x0000 }, 6 }, |
| 27 | { 0,0,0, { 0x00D1,0x00D2,0x00D3,0x0000,0x0000,0x0000,0x0000 } }, |
| 28 | }, |
| 29 | /* 2 */ |
| 30 | {{ { 0x00D1,0x00D2,0x00D3,0x0000 }, 5 }, |
| 31 | { 0,0,0, { 0x00D1,0x00D2,0x00D3,0x0000,0x0000,0x9999,0x0000 } }, |
| 32 | }, |
| 33 | /* 3 */ |
| 34 | {{ { 0x00D1,0x00D2,0x00D3,0x0000 }, 3 }, |
| 35 | { 0,0,0, { 0x00D1,0x00D2,0x00D3,0x9999,0x9999,0x9999,0x0000 } }, |
| 36 | }, |
| 37 | /* 4 */ |
| 38 | {{ { 0x00D1,0x00D2,0x00D3,0x0000 }, 2 }, |
| 39 | { 0,0,0, { 0x00D1,0x00D2,0x9999,0x9999,0x9999,0x9999,0x0000 } }, |
| 40 | }, |
| 41 | /* 5 */ |
| 42 | {{ { 0x00D1,0x00D2,0x00D3,0x0000 }, 0 }, |
| 43 | { 0,0,0, { 0x9999,0x9999,0x9999,0x9999,0x9999,0x9999,0x0000 } }, |
| 44 | }, |
| 45 | /* 6 */ |
| 46 | {{ { 0x0000,0x00D2,0x00D3,0x0000 }, 3 }, |
| 47 | { 0,0,0, { 0x0000,0x0000,0x0000,0x9999,0x9999,0x9999,0x0000 } }, |
| 48 | }, |
| 49 | {.is_last = 1} |
| 50 | } |
| 51 | }, |
| 52 | { |
| 53 | {Twcsncpy, TST_LOC_enUS}, |
| 54 | { |
| 55 | /* 1 */ |
| 56 | {{ { 0x0041,0x0042,0x0043,0x0000 }, 6 }, |
| 57 | { 0,0,0, { 0x0041,0x0042,0x0043,0x0000,0x0000,0x0000,0x0000 } }, |
| 58 | }, |
| 59 | /* 2 */ |
| 60 | {{ { 0x0041,0x0042,0x0043,0x0000 }, 5 }, |
| 61 | { 0,0,0, { 0x0041,0x0042,0x0043,0x0000,0x0000,0x9999,0x0000 } }, |
| 62 | }, |
| 63 | /* 3 */ |
| 64 | {{ { 0x0041,0x0042,0x0043,0x0000 }, 3 }, |
| 65 | { 0,0,0, { 0x0041,0x0042,0x0043,0x9999,0x9999,0x9999,0x0000 } }, |
| 66 | }, |
| 67 | /* 4 */ |
| 68 | {{ { 0x0041,0x0042,0x0043,0x0000 }, 2 }, |
| 69 | { 0,0,0, { 0x0041,0x0042,0x9999,0x9999,0x9999,0x9999,0x0000 } }, |
| 70 | }, |
| 71 | /* 5 */ |
| 72 | {{ { 0x0041,0x0042,0x0043,0x0000 }, 0 }, |
| 73 | { 0,0,0, { 0x9999,0x9999,0x9999,0x9999,0x9999,0x9999,0x0000 } }, |
| 74 | }, |
| 75 | /* 6 */ |
| 76 | {{ { 0x0000,0x0042,0x0043,0x0000 }, 3 }, |
| 77 | { 0,0,0, { 0x0000,0x0000,0x0000,0x9999,0x9999,0x9999,0x0000 } }, |
| 78 | }, |
| 79 | {.is_last = 1} |
| 80 | } |
| 81 | }, |
| 82 | { |
| 83 | #if 0 |
| 84 | {Twcsncpy, TST_LOC_eucJP}, |
| 85 | #else |
| 86 | {Twcsncpy, TST_LOC_ja_UTF8}, |
| 87 | #endif |
| 88 | { |
| 89 | /* 1 */ |
| 90 | {{ { 0x3041,0x3042,0x3043,0x0000 }, 6 }, |
| 91 | { 0,0,0, { 0x3041,0x3042,0x3043,0x0000,0x0000,0x0000,0x0000 } }, |
| 92 | }, |
| 93 | /* 2 */ |
| 94 | {{ { 0x3041,0x3042,0x3043,0x0000 }, 5 }, |
| 95 | { 0,0,0, { 0x3041,0x3042,0x3043,0x0000,0x0000,0x9999,0x0000 } }, |
| 96 | }, |
| 97 | /* 3 */ |
| 98 | {{ { 0x3041,0x3042,0x3043,0x0000 }, 3 }, |
| 99 | { 0,0,0, { 0x3041,0x3042,0x3043,0x9999,0x9999,0x9999,0x0000 } }, |
| 100 | }, |
| 101 | /* 4 */ |
| 102 | {{ { 0x3041,0x3042,0x3043,0x0000 }, 2 }, |
| 103 | { 0,0,0, { 0x3041,0x3042,0x9999,0x9999,0x9999,0x9999,0x0000 } }, |
| 104 | }, |
| 105 | /* 5 */ |
| 106 | {{ { 0x3041,0x3042,0x3043,0x0000 }, 0 }, |
| 107 | { 0,0,0, { 0x9999,0x9999,0x9999,0x9999,0x9999,0x9999,0x0000 } }, |
| 108 | }, |
| 109 | /* 6 */ |
| 110 | {{ { 0x0000,0x3042,0x3043,0x0000 }, 3 }, |
| 111 | { 0,0,0, { 0x0000,0x0000,0x0000,0x9999,0x9999,0x9999,0x0000 } }, |
| 112 | }, |
| 113 | {.is_last = 1} |
| 114 | } |
| 115 | }, |
| 116 | { |
| 117 | {Twcsncpy, TST_LOC_end} |
| 118 | } |
| 119 | }; |