Back to index

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