Back to index

glibc  2.9
dat_wcsncpy.c
Go to the documentation of this file.
00001 /*
00002  *  TEST SUITE FOR MB/WC FUNCTIONS IN C LIBRARY
00003  *
00004  *       FILE:  dat_wcsncpy.c
00005  *
00006  *       WCSNCPY:  wchar_t *wcsncpy (wchar_t *ws1, const wchar_t *ws2,
00007  *                                   size_t n);
00008  */
00009 
00010 
00011 /* Note:
00012  *
00013  *       An initial value of ws1 in the test program is defined as:
00014  *
00015  *       #define WCSNUM_NCPY 7
00016  *       wchar_t ws1 [WCSSIZE] = { 0x9999, 0x9999, 0x9999, 0x9999,
00017  *                                 0x9999, 0x9999, 0x0000 };
00018  * */
00019 
00020 
00021 TST_WCSNCPY tst_wcsncpy_loc [] = {
00022   {
00023     {Twcsncpy, TST_LOC_de},
00024     {
00025       /* 1 */
00026       {{           { 0x00D1,0x00D2,0x00D3,0x0000                      }, 6 },
00027        {    0,0,0, { 0x00D1,0x00D2,0x00D3,0x0000,0x0000,0x0000,0x0000 }    },
00028       },
00029       /* 2 */
00030       {{           { 0x00D1,0x00D2,0x00D3,0x0000                      }, 5 },
00031        {    0,0,0, { 0x00D1,0x00D2,0x00D3,0x0000,0x0000,0x9999,0x0000 }    },
00032       },
00033       /* 3 */
00034       {{           { 0x00D1,0x00D2,0x00D3,0x0000                      }, 3 },
00035        {    0,0,0, { 0x00D1,0x00D2,0x00D3,0x9999,0x9999,0x9999,0x0000 }    },
00036       },
00037       /* 4 */
00038       {{           { 0x00D1,0x00D2,0x00D3,0x0000                      }, 2 },
00039        {    0,0,0, { 0x00D1,0x00D2,0x9999,0x9999,0x9999,0x9999,0x0000 }    },
00040       },
00041       /* 5 */
00042       {{           { 0x00D1,0x00D2,0x00D3,0x0000                      }, 0 },
00043        {    0,0,0, { 0x9999,0x9999,0x9999,0x9999,0x9999,0x9999,0x0000 }    },
00044       },
00045       /* 6 */
00046       {{           { 0x0000,0x00D2,0x00D3,0x0000                      }, 3 },
00047        {    0,0,0, { 0x0000,0x0000,0x0000,0x9999,0x9999,0x9999,0x0000 }    },
00048       },
00049       {.is_last = 1}
00050     }
00051   },
00052   {
00053     {Twcsncpy, TST_LOC_enUS},
00054     {
00055       /* 1 */
00056       {{           { 0x0041,0x0042,0x0043,0x0000                      }, 6 },
00057        {    0,0,0, { 0x0041,0x0042,0x0043,0x0000,0x0000,0x0000,0x0000 }    },
00058       },
00059       /* 2 */
00060       {{           { 0x0041,0x0042,0x0043,0x0000                      }, 5 },
00061        {    0,0,0, { 0x0041,0x0042,0x0043,0x0000,0x0000,0x9999,0x0000 }    },
00062       },
00063       /* 3 */
00064       {{           { 0x0041,0x0042,0x0043,0x0000                      }, 3 },
00065        {    0,0,0, { 0x0041,0x0042,0x0043,0x9999,0x9999,0x9999,0x0000 }    },
00066       },
00067       /* 4 */
00068       {{           { 0x0041,0x0042,0x0043,0x0000                      }, 2 },
00069        {    0,0,0, { 0x0041,0x0042,0x9999,0x9999,0x9999,0x9999,0x0000 }    },
00070       },
00071       /* 5 */
00072       {{           { 0x0041,0x0042,0x0043,0x0000                      }, 0 },
00073        {    0,0,0, { 0x9999,0x9999,0x9999,0x9999,0x9999,0x9999,0x0000 }    },
00074       },
00075       /* 6 */
00076       {{           { 0x0000,0x0042,0x0043,0x0000                      }, 3 },
00077        {    0,0,0, { 0x0000,0x0000,0x0000,0x9999,0x9999,0x9999,0x0000 }    },
00078       },
00079       {.is_last = 1}
00080     }
00081   },
00082   {
00083     {Twcsncpy, TST_LOC_eucJP},
00084     {
00085       /* 1 */
00086       {{           { 0x3041,0x3042,0x3043,0x0000                      }, 6 },
00087        {    0,0,0, { 0x3041,0x3042,0x3043,0x0000,0x0000,0x0000,0x0000 }    },
00088       },
00089       /* 2 */
00090       {{           { 0x3041,0x3042,0x3043,0x0000                      }, 5 },
00091        {    0,0,0, { 0x3041,0x3042,0x3043,0x0000,0x0000,0x9999,0x0000 }    },
00092       },
00093       /* 3 */
00094       {{           { 0x3041,0x3042,0x3043,0x0000                      }, 3 },
00095        {    0,0,0, { 0x3041,0x3042,0x3043,0x9999,0x9999,0x9999,0x0000 }    },
00096       },
00097       /* 4 */
00098       {{           { 0x3041,0x3042,0x3043,0x0000                      }, 2 },
00099        {    0,0,0, { 0x3041,0x3042,0x9999,0x9999,0x9999,0x9999,0x0000 }    },
00100       },
00101       /* 5 */
00102       {{           { 0x3041,0x3042,0x3043,0x0000                      }, 0 },
00103        {    0,0,0, { 0x9999,0x9999,0x9999,0x9999,0x9999,0x9999,0x0000 }    },
00104       },
00105       /* 6 */
00106       {{           { 0x0000,0x3042,0x3043,0x0000                      }, 3 },
00107        {    0,0,0, { 0x0000,0x0000,0x0000,0x9999,0x9999,0x9999,0x0000 }    },
00108       },
00109       {.is_last = 1}
00110     }
00111   },
00112   {
00113     {Twcsncpy, TST_LOC_end}
00114   }
00115 };