Back to index

glibc  2.9
dat_wcsncat.c
Go to the documentation of this file.
00001 /*
00002  *  TEST SUITE FOR MB/WC FUNCTIONS IN C LIBRARY
00003  *
00004  *      FILE: dat_wcsncat.c
00005  *
00006  *      WCSNCAT:  wchar_t *wcsncat (wchar_t *ws1, wchar_t *ws2, size_t n);
00007  */
00008 
00009 
00010 /*
00011  *  Note:
00012  *       A terminating null wide chararacter is always appended to
00013  *       the result: ws1.
00014  *
00015  */
00016 
00017 
00018 TST_WCSNCAT tst_wcsncat_loc [] = {
00019   {
00020     {Twcsncat, TST_LOC_de},
00021     {
00022       /* 1 */
00023       {
00024        /* Input: */
00025        {{ 0x00D1,0x00D2,0x0000      },
00026         {                0x00D3,0x00D4,0x0000 }, 3 },
00027        /* Expect: */
00028        {   0, 0,    0,
00029            { 0x00D1,0x00D2,0x00D3,0x00D4,0x0000 }    },
00030       },
00031       /* 2 */
00032       {{{ 0x00D1,0x00D2,0x0000     },
00033        {                0x00D3,0x00D4,0x0000 }, 2 },
00034        {   0,    0,    0,
00035           { 0x00D1,0x00D2,0x00D3,0x00D4,0x0000 }    },
00036       },
00037       /* 3 */
00038       {{{ 0x00E1,0x00E2,0x0000     },
00039        {                0x00E3,0x00E4,0x0000 }, 1 },
00040        {   0,    0,    0,
00041           { 0x00E1,0x00E2,0x00E3,0x0000   }    },
00042       },
00043       /* 4 */
00044       {{{ 0x00E1,0x00E2,0x0000     },
00045        {                0x00E3,0x00E4,0x0000 }, 0 },
00046        {   0,    0,    0,
00047           { 0x00E1,0x00E2,0x0000          }    },
00048       },
00049       /* 5 */
00050       {{{ 0x0000            },
00051        {                0x00D3,0x00D4,0x0000 }, 3 },
00052        {   0,    0,    0,
00053           {             0x00D3,0x00D4,0x0000 }    },
00054       },
00055       /* 6 */
00056       {{{ 0x00E1,0x00E2,0x0000     },
00057        {                0x0000            }, 3 },
00058        {   0,    0,    0,
00059           { 0x00E1,0x00E2,0x0000          }    },
00060       },
00061       {.is_last = 1}
00062     }
00063   },
00064   {
00065     {Twcsncat, TST_LOC_enUS},
00066     {
00067       /* 1 */
00068       {
00069        /* Input:  */
00070        {{ 0x0041,0x0042,0x0000      },
00071         {                0x0043,0x0044,0x0000 }, 3 },
00072        /* Expect:  */
00073        {   0, 0,    0,
00074            { 0x0041,0x0042,0x0043,0x0044,0x0000 }    },
00075       },
00076       /* 2 */
00077       {{{ 0x0041,0x0042,0x0000     },
00078        {                0x0043,0x0044,0x0000 }, 2 },
00079        {   0,    0,    0,
00080           { 0x0041,0x0042,0x0043,0x0044,0x0000 }    },
00081       },
00082       /* 3 */
00083       {{{ 0x0051,0x0052,0x0000     },
00084        {                0x0053,0x0054,0x0000 }, 1 },
00085        {   0,    0,    0,
00086           { 0x0051,0x0052,0x0053,0x0000   }    },
00087       },
00088       /* 4 */
00089       {{{ 0x0051,0x0052,0x0000     },
00090        {                0x0053,0x0054,0x0000 }, 0 },
00091        {   0,    0,    0,
00092           { 0x0051,0x0052,0x0000          }    },
00093       },
00094       /* 5 */
00095       {{{ 0x0000            },
00096        {                0x0043,0x0044,0x0000 }, 3 },
00097        {   0,    0,    0,
00098           {             0x0043,0x0044,0x0000 }    },
00099       },
00100       /* 6 */
00101       {{{ 0x0051,0x0052,0x0000     },
00102        {                0x0000            }, 3 },
00103        {   0,    0,    0,
00104           { 0x0051,0x0052,0x0000          }    },
00105       },
00106       {.is_last = 1}
00107     }
00108   },
00109   {
00110     {Twcsncat, TST_LOC_eucJP},
00111     {
00112       /* 1 */
00113       {{{ 0x3041,0x3042,0x0000     },
00114        {                0x3043,0x3044,0x0000 }, 3 },
00115        {   0,    0,    0,
00116           { 0x3041,0x3042,0x3043,0x3044,0x0000 }    },
00117       },
00118       /* 2 */
00119       {{{ 0x30A2,0x30A3,0x0000     },
00120        {                0xFF71,0xFF72,0x0000 }, 2 },
00121        {   0,    0,    0,
00122           { 0x30A2,0x30A3,0xFF71,0xFF72,0x0000 }    },
00123       },
00124       /* 3 */
00125       {{{ 0x3051,0x3052,0x0000     },
00126        {                0x3053,0x3054,0x0000 }, 1 },
00127        {   0,    0,    0,
00128           { 0x3051,0x3052,0x3053,0x0000   }    },
00129       },
00130       /* 4 */
00131       {{{ 0x3051,0x3052,0x0000     },
00132        {                0x3053,0x3054,0x0000 }, 0 },
00133        {   0,    0,    0,
00134           { 0x3051,0x3052,0x0000          }    },
00135       },
00136       /* 5 */
00137       {{{ 0x0000            },
00138        {                0x3043,0x3044,0x0000 }, 3 },
00139        {   0,    0,    0,
00140           {             0x3043,0x3044,0x0000 }    },
00141       },
00142       /* 6 */
00143       {{{ 0x3051,0x3052,0x0000     },
00144        {                0x0000            }, 3 },
00145        {   0,    0,    0,
00146           { 0x3051,0x3052,0x0000          }    },
00147       },
00148       {.is_last = 1}
00149     }
00150   },
00151   {
00152     {Twcsncat, TST_LOC_end}
00153   }
00154 };