Back to index

glibc  2.9
dat_wcsxfrm.c
Go to the documentation of this file.
00001 /*
00002  *  TEST SUITE FOR MB/WC FUNCTIONS IN CLIBRARY
00003  *
00004  *      FILE: dat_wcsxfrm.c
00005  *
00006  *      WCSXFRM:  size_t  wcsxfrm (char *s1, const char s2, size_t n);
00007  */
00008 
00009 /*
00010  *  NOTE:
00011  *
00012  *  Return value and errno value are checked only for 2nd string:
00013  *  org2[]; n1 and n2 don't mean bytes to be translated.
00014  *  It means a buffer size including a null character.
00015  *  Results of this test depens on results of wcscoll().
00016  *  If you got errors, check both test results.
00017  */
00018 
00019 
00020 TST_WCSXFRM tst_wcsxfrm_loc [] = {
00021 
00022   {
00023     { Twcsxfrm, TST_LOC_de },
00024     {
00025       { /*inp*/ { { 0x00C1,0x0000 }, { 0x00C1,0x0000 }, 7, 7 },        /* #01 */
00026        /*exp*/ {   0,              0,0,               },
00027       },
00028       { /*inp*/ { { 0x0042,0x0000 }, { 0x0061,0x0000 }, 7, 7 },        /* #02 */
00029        /*exp*/ {   0,              0,0,               },
00030       },
00031       { /*inp*/ { { 0x0061,0x0000 }, { 0x0042,0x0000 }, 7, 7 },        /* #03 */
00032        /*exp*/ {   0,              0,0,               },
00033       },
00034       { /*inp*/ { { 0x00E4,0x0000 }, { 0x00DC,0x0000 }, 7, 7 },        /* #04 */
00035        /*exp*/ {   0,              0,0,               },
00036       },
00037       { /*inp*/ { { 0x00DC,0x0000 }, { 0x00E4,0x0000 }, 7, 7 },        /* #05 */
00038        /*exp*/ {   0,              0,0,               },
00039       },
00040       { .is_last = 1 }
00041     }
00042   },
00043   {
00044     { Twcsxfrm, TST_LOC_enUS },
00045     {
00046       { /*inp*/ { { 0x0041,0x0000 }, { 0x0041,0x0000 }, 7, 7 },        /* #01 */
00047        /*exp*/ {   0,              0,0,               },
00048       },
00049       { /*inp*/ { { 0x0042,0x0000 }, { 0x0061,0x0000 }, 7, 7 },        /* #02 */
00050        /*exp*/ {   0,              0,0,               },
00051       },
00052       { /*inp*/ { { 0x0061,0x0000 }, { 0x0042,0x0000 }, 7, 7 },        /* #03 */
00053        /*exp*/ {   0,              0,0,               },
00054       },
00055       { /*inp*/ { { 0x0000,0x0000 }, { 0x0000,0x0000 }, 7, 7 },        /* #04 */
00056        /*exp*/ {   0,              0,0,               },
00057       },
00058 #ifdef NO_WAIVER
00059       { /* <WAIVER> x 2 */
00060        /*inp*/ { { 0x3061,0x0000 }, { 0xFF42,0x0000 }, 7, 7 },  /* #05 */
00061        /* <WAIVER>   */
00062        /*exp*/ {   EINVAL,         1,(size_t)-1,      },
00063       },
00064 #endif
00065       { .is_last = 1 }
00066     }
00067   },
00068   {
00069     { Twcsxfrm, TST_LOC_eucJP },        /* need more test data ! */
00070     {
00071       { /*inp*/ { { 0x3041,0x0000 }, { 0x3041,0x0000 }, 7, 7 },        /* #01 */
00072        /*exp*/ {   0,              0,0,               },
00073       },
00074       { /*inp*/ { { 0x0042,0x0000 }, { 0x0061,0x0000 }, 7, 7 },        /* #02 */
00075        /*exp*/ {   0,              0,0,               },
00076       },
00077       { /*inp*/ { { 0x0061,0x0000 }, { 0x0042,0x0000 }, 7, 7 },        /* #03 */
00078        /*exp*/ {   0,              0,0,               },
00079       },
00080       { /*inp*/ { { 0x30A2,0x0000 }, { 0xFF71,0x0000 }, 7, 7 },        /* #04 */
00081        /*exp*/ {   0,              0,0,               },
00082       },
00083       { /*inp*/ { { 0xFF71,0x0000 }, { 0x30A2,0x0000 }, 7, 7 },        /* #05 */
00084        /*exp*/ {   0,              0,0,               },
00085       },
00086 #ifdef NO_WAIVER
00087       /* <WAIVER> x 2 */
00088       { /*inp*/ { { 0x008E,0x0000 }, { 0x008F,0x0000 }, 7, 7 },        /* #06 */
00089        /*exp*/ {   EINVAL,         1,(size_t)-1,      },
00090       },
00091 #endif
00092       { .is_last = 1 }
00093     }
00094   },
00095   {
00096     { Twcsxfrm, TST_LOC_end }
00097   }
00098 };