Back to index

glibc  2.9
dat_wcspbrk.c
Go to the documentation of this file.
00001 /*
00002  *  TEST SUITE FOR MB/WC FUNCTIONS IN C LIBRARY
00003  *
00004  *      FILE: dat_wcspbrk.c
00005  *
00006  *      WCSSTR:  wchar_t *wcspbrk (const wchar_t *ws1, const wchar_t *ws2);
00007  */
00008 
00009 
00010 /*
00011  * NOTE:
00012  *      This is not a locale sensitive function.
00013  *      So those data in each locale doesn't make sense
00014  *      ... (redundant test cases)
00015  */
00016 
00017 
00018 TST_WCSPBRK tst_wcspbrk_loc [] = {
00019   {
00020     { Twcspbrk, TST_LOC_de },
00021     {
00022       { /*input.*/ { { 0x00D1,0x00D2,0x00D3,0x0000 },
00023                    { 0x00D1,0x0000           }, },  /* #01 */
00024        /*expect*/ { 0,0,0,             0x00D1    },
00025       },
00026       { /*input.*/ { { 0x00D1,0x00D2,0x00D3,0x0000 },
00027                    {       0x00D2,0x0000     }, },  /* #02 */
00028        /*expect*/ { 0,0,0,             0x00D2    },
00029       },
00030       { /*input.*/ { { 0x00D1,0x00D2,0x00D3,0x0000 },
00031                    {             0x00D3,0x0000 }, },  /* #03 */
00032        /*expect*/ { 0,0,0,             0x00D3    },
00033       },
00034       { /*input.*/ { { 0x00D1,0x00D2,0x00D3,0x0000 },
00035                    { 0x00D1,0x00D2,0x0000    }, },  /* #04 */
00036        /*expect*/ { 0,0,0,             0x00D1    },
00037       },
00038       { /*input.*/ { { 0x00D1,0x00D2,0x00D3,0x0000 },
00039                    {       0x00D2,0x00D3,0x0000 }, },  /* #05 */
00040        /*expect*/ { 0,0,0,             0x00D2    },
00041       },
00042       { /*input.*/ { { 0x00D1,0x00D2,0x00D3,0x0000 },
00043                    { 0x00D1,0x00D2,0x00D3,0x0000 }, },  /* #06 */
00044        /*expect*/ { 0,0,0,             0x00D1    },
00045       },
00046       { /*input.*/ { { 0x00D1,0x00D2,0x00D3,0x0000 },
00047                    { 0x00D0,0x00D4,0x00D5,0x0000 }, },  /* #07 */
00048        /*expect*/ { 0,1,(wchar_t *)NULL, 0x0000    },
00049       },
00050       { /*input.*/ { { 0x00D1,0x00D2,0x00D3,0x0000 },
00051                    { 0x00D5,0x00D0,0x00D4,0x0000 }, },  /* #08 */
00052        /*expect*/ { 0,1,(wchar_t *)NULL, 0x0000    },
00053       },
00054       { /*input.*/ { { 0x00D1,0x00D2,0x00D3,0x0000 },
00055                    { 0x0000                  }, },  /* #09 */
00056        /*expect*/ { 0,1,(wchar_t *)NULL, 0x0000    },
00057       },
00058       { /*input.*/ { { 0x0000,0x00D2,0x00D3,0x0000 },
00059                    { 0x00D1,0x0000           }, },  /* #10 */
00060        /*expect*/ { 0,1,(wchar_t *)NULL, 0x0000    },
00061       },
00062       { /*input.*/ { { 0x0000,0x00D2,0x00D3,0x0000 },
00063                    { 0x0000                  }, },  /* #11 */
00064        /*expect*/ { 0,1,(wchar_t *)NULL, 0x0000    },
00065       },
00066       { .is_last = 1 }
00067     }
00068   },
00069   {
00070     { Twcspbrk, TST_LOC_enUS },
00071     {
00072       { /*input.*/ { { 0x0041,0x0042,0x0043,0x0000 },
00073                    { 0x0041,0x0000           }, },  /* #01 */
00074        /*expect*/ { 0,0,0,             0x0041    },
00075       },
00076       { /*input.*/ { { 0x0041,0x0042,0x0043,0x0000 },
00077                    {       0x0042,0x0000     }, },  /* #02 */
00078        /*expect*/ { 0,0,0,             0x0042    },
00079       },
00080       { /*input.*/ { { 0x0041,0x0042,0x0043,0x0000 },
00081                    {             0x0043,0x0000 }, },  /* #03 */
00082        /*expect*/ { 0,0,0,             0x0043    },
00083       },
00084       { /*input.*/ { { 0x0041,0x0042,0x0043,0x0000 },
00085                    { 0x0041,0x0042,0x0000    }, },  /* #04 */
00086        /*expect*/ { 0,0,0,             0x0041    },
00087       },
00088       { /*input.*/ { { 0x0041,0x0042,0x0043,0x0000 },
00089                    {       0x0042,0x0043,0x0000 }, },  /* #05 */
00090        /*expect*/ { 0,0,0,             0x0042    },
00091       },
00092       { /*input.*/ { { 0x0041,0x0042,0x0043,0x0000 },
00093                    { 0x0041,0x0042,0x0043,0x0000 }, },  /* #06 */
00094        /*expect*/ { 0,0,0,             0x0041    },
00095       },
00096       { /*input.*/ { { 0x0041,0x0042,0x0043,0x0000 },
00097                    { 0x0040,0x0044,0x0045,0x0000 }, },  /* #07 */
00098        /*expect*/ { 0,1,(wchar_t *)NULL, 0x0000    },
00099       },
00100       { /*input.*/ { { 0x0041,0x0042,0x0043,0x0000 },
00101                    { 0x0045,0x0040,0x0044,0x0000 }, },  /* #08 */
00102        /*expect*/ { 0,1,(wchar_t *)NULL, 0x0000    },
00103       },
00104       { /*input.*/ { { 0x0041,0x0042,0x0043,0x0000 },
00105                    { 0x0000                  }, },  /* #09 */
00106        /*expect*/ { 0,1,(wchar_t *)NULL, 0x0000    },
00107       },
00108       { /*input.*/ { { 0x0000,0x0042,0x0043,0x0000 },
00109                    { 0x0041,0x0000           }, },  /* #10 */
00110        /*expect*/ { 0,1,(wchar_t *)NULL, 0x0000    },
00111       },
00112       { /*input.*/ { { 0x0000,0x0042,0x0043,0x0000 },
00113                    { 0x0000                  }, },  /* #11 */
00114        /*expect*/ { 0,1,(wchar_t *)NULL, 0x0000    },
00115       },
00116       { .is_last = 1 }
00117     }
00118   },
00119   {
00120     { Twcspbrk, TST_LOC_eucJP },
00121     {
00122       { /*input.*/ { { 0x3041,0x3042,0x3043,0x0000 },
00123                    { 0x3041,0x0000           }, },  /* #01 */
00124        /*expect*/ { 0,0,0,             0x3041    },
00125       },
00126       { /*input.*/ { { 0x3041,0x3042,0x3043,0x0000 },
00127                    {       0x3042,0x0000     }, },  /* #02 */
00128        /*expect*/ { 0,0,0,             0x3042    },
00129       },
00130       { /*input.*/ { { 0x3041,0x3042,0x3043,0x0000 },
00131                    {             0x3043,0x0000 }, },  /* #03 */
00132        /*expect*/ { 0,0,0,             0x3043    },
00133       },
00134       { /*input.*/ { { 0x3041,0x3042,0x3043,0x0000 },
00135                    { 0x3041,0x3042,0x0000    }, },  /* #04 */
00136        /*expect*/ { 0,0,0,             0x3041    },
00137       },
00138       { /*input.*/ { { 0x3041,0x3042,0x3043,0x0000 },
00139                    {       0x3042,0x3043,0x0000 }, },  /* #05 */
00140        /*expect*/ { 0,0,0,             0x3042    },
00141       },
00142       { /*input.*/ { { 0x3041,0x3042,0x3043,0x0000 },
00143                    { 0x3041,0x3042,0x3043,0x0000 }, },  /* #06 */
00144        /*expect*/ { 0,0,0,             0x3041    },
00145       },
00146       { /*input.*/ { { 0x3041,0x3042,0x3043,0x0000 },
00147                    { 0x3042,0x3043,0x3044,0x0000 }, },  /* #07 */
00148        /*expect*/ { 0,0,0, 0x3042               },
00149       },
00150       { /*input.*/ { { 0x3041,0x3042,0x3043,0x0000 },
00151                    { 0x3040,0x3041,0x3042,0x0000 }, },  /* #08 */
00152        /*expect*/ { 0,0,0, 0x3041               },
00153       },
00154       { /*input.*/ { { 0x3041,0x3042,0x3043,0x0000 },
00155                    { 0x0000                  }, },  /* #09 */
00156        /*expect*/ { 0,1,(wchar_t *)NULL, 0x0000    },
00157       },
00158       { /*input.*/ { { 0x0000,0x3042,0x3043,0x0000 },
00159                    { 0x3041,0x0000           }, },  /* #10 */
00160        /*expect*/ { 0,1,(wchar_t *)NULL, 0x0000    },
00161       },
00162       { /*input.*/ { { 0x0000,0x3042,0x3043,0x0000 },
00163                    { 0x0000                  }, },  /* #11 */
00164        /*expect*/ { 0,1,(wchar_t *)NULL, 0x0000    },
00165       },
00166       { .is_last = 1 }
00167     }
00168   },
00169   {
00170     { Twcspbrk, TST_LOC_end }
00171   }
00172 };