Back to index

glibc  2.9
dat_wcsncmp.c
Go to the documentation of this file.
00001 /*
00002  *  TEST SUITE FOR MB/WC FUNCTIONS IN C LIBRARY
00003  *
00004  *      FILE: dat_wcsncmp.c
00005  *
00006  *      WCSNCMP:  int wcsncmp (const wchar_t *ws1, const wchar_t *ws2,
00007  *                          size_t n);
00008  */
00009 
00010 TST_WCSNCMP tst_wcsncmp_loc [] = {
00011   {
00012     { Twcsncmp, TST_LOC_de },
00013     {
00014       { /*input.*/ { { 0x00D1,0x00D2,0x00D3,0x0000 },
00015                    { 0x00D1,0x00D2,0x00D3,0x0000 }, 4 },  /* #01 */
00016        /*expect*/ { 0,1,0,                       },
00017       },
00018       { /*input.*/ { { 0x00D1,0x00D2,0x00D3,0x0000 },
00019                    { 0x00D1,0x00D2,0x00D3,0x0000 }, 3 },  /* #02 */
00020        /*expect*/ { 0,1,0,                       },
00021       },
00022       { /*input.*/ { { 0x00D1,0x00D2,0x00D1,0x0000 },
00023                    { 0x00D1,0x00D2,0x00D3,0x0000 }, 2 },  /* #03 */
00024        /*expect*/ { 0,1,0,                       },
00025       },
00026       { /*input.*/ { { 0x00D1,0x00D2,0x00D3,0x0000 },
00027                    { 0x00D0,0x00D2,0x00D3,0x0000 }, 0 },  /* #04 */
00028        /*expect*/ { 0,1,0,                       },
00029       },
00030       { /*input.*/ { { 0x0000,0x00D2,0x00D3,0x0000 },
00031                    { 0x0000,0x00D2,0x00D1,0x0000 }, 3 },  /* #05 */
00032        /*expect*/ { 0,1,0,                       },
00033       },
00034       { /*input.*/ { { 0x00D1,0x00D2,0x00D3,0x0000 },
00035                    { 0x0000,0x00D2,0x00D3,0x0000 }, 3 },  /* #06 */
00036        /*expect*/ { 0,1,0x00D1,                  },
00037       },
00038       { /*input.*/ { { 0x00D1,0x00D2,0x00D3,0x0000 },
00039                    { 0x00D1,0x00D2,0x00D9,0x0000 }, 2 },  /* #07 */
00040        /*expect*/ { 0,1,0,                       },
00041       },
00042       { /*input.*/ { { 0x00D1,0x00D2,0x00D3,0x0000 },
00043                    { 0x00D1,0x00D2,0x00D9,0x0000 }, 3 },  /* #08 */
00044        /*expect*/ { 0,1,-0x0006,                 },
00045       },
00046       { /*input.*/ { { 0x00D1,0x00D2,0x00D3,0x0000 },
00047                    { 0x00D1,0x00D2,0x0000    }, 4 },  /* #09 */
00048        /*expect*/ { 0,1,0x00D3,                  },
00049       },
00050       { .is_last = 1 }
00051     }
00052   },
00053   {
00054     { Twcsncmp, TST_LOC_enUS },
00055     {
00056       { /*input.*/ { { 0x0041,0x0042,0x0043,0x0000 },
00057                    { 0x0041,0x0042,0x0043,0x0000 }, 4 },  /* #01 */
00058        /*expect*/ { 0,1,0,                       },
00059       },
00060       { /*input.*/ { { 0x0041,0x0042,0x0043,0x0000 },
00061                    { 0x0041,0x0042,0x0043,0x0000 }, 3 },  /* #02 */
00062        /*expect*/ { 0,1,0,                       },
00063       },
00064       { /*input.*/ { { 0x0041,0x0042,0x0041,0x0000 },
00065                    { 0x0041,0x0042,0x0043,0x0000 }, 2 },  /* #03 */
00066        /*expect*/ { 0,1,0,                       },
00067       },
00068       { /*input.*/ { { 0x0041,0x0042,0x0043,0x0000 },
00069                    { 0x0040,0x0042,0x0043,0x0000 }, 0 },  /* #04 */
00070        /*expect*/ { 0,1,0,                       },
00071       },
00072       { /*input.*/ { { 0x0000,0x0042,0x0043,0x0000 },
00073                    { 0x0000,0x0042,0x0041,0x0000 }, 3 },  /* #05 */
00074        /*expect*/ { 0,1,0,                       },
00075       },
00076       { /*input.*/ { { 0x0041,0x0042,0x0043,0x0000 },
00077                    { 0x0000,0x0042,0x0043,0x0000 }, 3 },  /* #06 */
00078        /*expect*/ { 0,1,0x0041,                  },
00079       },
00080       { /*input.*/ { { 0x0041,0x0042,0x0043,0x0000 },
00081                    { 0x0041,0x0042,0x0049,0x0000 }, 2 },  /* #07 */
00082        /*expect*/ { 0,1,0,                       },
00083       },
00084       { /*input.*/ { { 0x0041,0x0042,0x0043,0x0000 },
00085                    { 0x0041,0x0042,0x0049,0x0000 }, 3 },  /* #08 */
00086        /*expect*/ { 0,1,-0x0006,                 },
00087       },
00088       { /*input.*/ { { 0x0041,0x0042,0x0043,0x0000 },
00089                    { 0x0041,0x0042,0x0000    }, 4 },  /* #09 */
00090        /*expect*/ { 0,1,0x0043,                  },
00091       },
00092       { .is_last = 1 }
00093     }
00094   },
00095   {
00096     { Twcsncmp, TST_LOC_eucJP },
00097     {
00098       { /*input.*/ { { 0x3041,0x3042,0x3043,0x0000 },
00099                    { 0x3041,0x3042,0x3043,0x0000 }, 4 },  /* #01 */
00100        /*expect*/ { 0,1,0,                       },
00101       },
00102       { /*input.*/ { { 0x3041,0x3042,0x3043,0x0000 },
00103                    { 0x3041,0x3042,0x3043,0x0000 }, 3 },  /* #02 */
00104        /*expect*/ { 0,1,0,                       },
00105       },
00106       { /*input.*/ { { 0x3041,0x3042,0x3041,0x0000 },
00107                    { 0x3041,0x3042,0x3043,0x0000 }, 2 },  /* #03 */
00108        /*expect*/ { 0,1,0,                       },
00109       },
00110       { /*input.*/ { { 0x3041,0x3042,0x3043,0x0000 },
00111                    { 0x3040,0x3042,0x3043,0x0000 }, 0 },  /* #04 */
00112        /*expect*/ { 0,1,0,                       },
00113       },
00114       { /*input.*/ { { 0x0000,0x3042,0x3043,0x0000 },
00115                    { 0x0000,0x3042,0x3041,0x0000 }, 3 },  /* #05 */
00116        /*expect*/ { 0,1,0,                       },
00117       },
00118       { /*input.*/ { { 0x3041,0x3042,0x3043,0x0000 },
00119                    { 0x0000,0x3042,0x3043,0x0000 }, 3 },  /* #06 */
00120        /*expect*/ { 0,1,0x3041,                  },
00121       },
00122       { /*input.*/ { { 0x3041,0x3042,0x3043,0x0000 },
00123                    { 0x3041,0x3042,0x3049,0x0000 }, 2 },  /* #07 */
00124        /*expect*/ { 0,1,0,                       },
00125       },
00126       { /*input.*/ { { 0x3041,0x3042,0x3043,0x0000 },
00127                    { 0x3041,0x3042,0x3049,0x0000 }, 3 },  /* #08 */
00128        /*expect*/ { 0,1,-0x0006,                 },
00129       },
00130       { /*input.*/ { { 0x3041,0x3042,0x3043,0x0000 },
00131                    { 0x3041,0x3042,0x0000    }, 4 },  /* #09 */
00132        /*expect*/ { 0,1,0x3043,                  },
00133       },
00134       { .is_last = 1 }
00135     }
00136   },
00137   {
00138     { Twcsncmp, TST_LOC_end }
00139   }
00140 };