|
Packit |
6c4009 |
/*
|
|
Packit |
6c4009 |
* TEST SUITE FOR MB/WC FUNCTIONS IN CLIBRARY
|
|
Packit |
6c4009 |
*
|
|
Packit |
6c4009 |
* FILE: dat_strxfrm.c
|
|
Packit |
6c4009 |
*
|
|
Packit |
6c4009 |
* STRXFRM: size_t strxfrm (char *s1, const char s2, size_t n);
|
|
Packit |
6c4009 |
*/
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
/*
|
|
Packit |
6c4009 |
* NOTE:
|
|
Packit |
6c4009 |
*
|
|
Packit |
6c4009 |
* Return value and errno value are checked only for 2nd string:
|
|
Packit |
6c4009 |
* org2[]; n1 and n2 don't mean bytes to be translated.
|
|
Packit |
6c4009 |
* It means a buffer size including a null character.
|
|
Packit |
6c4009 |
* Results of this test depens on results of strcoll().
|
|
Packit |
6c4009 |
* If you got errors, check both test results.
|
|
Packit |
6c4009 |
*
|
|
Packit |
6c4009 |
* The buffer size should be enough to contain a string including a
|
|
Packit |
6c4009 |
* null char. Returns the number of bytes of the string (NOT
|
|
Packit |
6c4009 |
* including a null char).
|
|
Packit |
6c4009 |
*/
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
TST_STRXFRM tst_strxfrm_loc [] = {
|
|
Packit |
6c4009 |
{
|
|
Packit |
6c4009 |
{ Tstrxfrm, TST_LOC_de },
|
|
Packit |
6c4009 |
{
|
|
Packit |
6c4009 |
{ /*inp*/ { "\xf6\xc4\xe4\xfc", "\xf6\xc4\xe4\xfc", 17, 17 }, /* #01 */
|
|
Packit |
6c4009 |
/*exp*/ { 0,0,0, },
|
|
Packit |
6c4009 |
},
|
|
Packit |
6c4009 |
{ /*inp*/ { "aA", "Aa", 10, 10 }, /* #02 */
|
|
Packit |
6c4009 |
/*exp*/ { 0,0,0 , },
|
|
Packit |
6c4009 |
},
|
|
Packit |
6c4009 |
{ /*inp*/ { "Aa", "aA", 10, 10 }, /* #03 */
|
|
Packit |
6c4009 |
/*exp*/ { 0,0,0, },
|
|
Packit |
6c4009 |
},
|
|
Packit |
6c4009 |
{ /*inp*/ { "abc", "", 13, 13 }, /* #04 */
|
|
Packit |
6c4009 |
/*exp*/ { 0,0,0, },
|
|
Packit |
6c4009 |
},
|
|
Packit |
6c4009 |
{ /*inp*/ { "a", "B", 7, 7 }, /* #05 */
|
|
Packit |
6c4009 |
/*exp*/ { 0,0,0, },
|
|
Packit |
6c4009 |
},
|
|
Packit |
6c4009 |
{ /*inp*/ { "B", "a", 7, 7 }, /* #06 */
|
|
Packit |
6c4009 |
/*exp*/ { 0,0,0, },
|
|
Packit |
6c4009 |
},
|
|
Packit |
6c4009 |
{
|
|
Packit |
6c4009 |
/* hiragana == latin1 */
|
|
Packit |
6c4009 |
/*inp*/ { "abc", "\244\241\244\242", 13, 9 }, /* #07 */
|
|
Packit |
6c4009 |
/*exp*/ { 0,0,0, },
|
|
Packit |
6c4009 |
},
|
|
Packit |
6c4009 |
{ .is_last = 1 }
|
|
Packit |
6c4009 |
}
|
|
Packit |
6c4009 |
},
|
|
Packit |
6c4009 |
{
|
|
Packit |
6c4009 |
{ Tstrxfrm, TST_LOC_enUS },
|
|
Packit |
6c4009 |
{
|
|
Packit |
6c4009 |
{ /*inp*/ { "abcd", "abcd", 17, 17 }, /* #01 */
|
|
Packit |
6c4009 |
/*exp*/ { 0,0,0, },
|
|
Packit |
6c4009 |
},
|
|
Packit |
6c4009 |
{ /*inp*/ { "aA", "Aa", 10, 10 }, /* #02 */
|
|
Packit |
6c4009 |
/*exp*/ { 0,0,0 , },
|
|
Packit |
6c4009 |
},
|
|
Packit |
6c4009 |
{ /*inp*/ { "Aa", "aA", 10, 10 }, /* #03 */
|
|
Packit |
6c4009 |
/*exp*/ { 0,0,0, },
|
|
Packit |
6c4009 |
},
|
|
Packit |
6c4009 |
{ /*inp*/ { "abc", "", 13, 13 }, /* #04 */
|
|
Packit |
6c4009 |
/*exp*/ { 0,0,0, },
|
|
Packit |
6c4009 |
},
|
|
Packit |
6c4009 |
{ /*inp*/ { "a", "B", 7, 7 }, /* #05 */
|
|
Packit |
6c4009 |
/*exp*/ { 0,0,0, },
|
|
Packit |
6c4009 |
},
|
|
Packit |
6c4009 |
{ /*inp*/ { "B", "a", 7, 7 }, /* #06 */
|
|
Packit |
6c4009 |
/*exp*/ { 0,0,0, },
|
|
Packit |
6c4009 |
},
|
|
Packit |
6c4009 |
#ifdef NO_WAIVER
|
|
Packit |
6c4009 |
{
|
|
Packit |
6c4009 |
/* <WAIVER> */
|
|
Packit |
6c4009 |
/*inp*/ { "abc", "\244\241\244\242", 13, 9 }, /* #07 */
|
|
Packit |
6c4009 |
/*exp*/ { EINVAL,0,0, },
|
|
Packit |
6c4009 |
},
|
|
Packit |
6c4009 |
#endif
|
|
Packit |
6c4009 |
{ .is_last = 1 }
|
|
Packit |
6c4009 |
}
|
|
Packit |
6c4009 |
},
|
|
Packit |
6c4009 |
{
|
|
Packit |
6c4009 |
{ Tstrxfrm, TST_LOC_eucJP }, /* ??? */
|
|
Packit |
6c4009 |
{
|
|
Packit |
6c4009 |
{
|
|
Packit |
6c4009 |
/* #01 */
|
|
Packit |
6c4009 |
/*inp*/ { "\244\242\244\241", "\244\241\244\242", 5, 5 },
|
|
Packit |
6c4009 |
/*exp*/ { 0,0,0, },
|
|
Packit |
6c4009 |
},
|
|
Packit |
6c4009 |
{
|
|
Packit |
6c4009 |
/* #02 */
|
|
Packit |
6c4009 |
/*inp*/ { "\244\241\244\242", "\244\242\244\241", 5, 5 },
|
|
Packit |
6c4009 |
/*exp*/ { 0,0,0, },
|
|
Packit |
6c4009 |
},
|
|
Packit |
6c4009 |
{
|
|
Packit |
6c4009 |
/* #03 */
|
|
Packit |
6c4009 |
/*inp*/ { "\244\242\216\261", "\216\261\244\242", 5, 5 },
|
|
Packit |
6c4009 |
/*exp*/ { 0,0,0, },
|
|
Packit |
6c4009 |
},
|
|
Packit |
6c4009 |
#ifdef NO_WAIVER
|
|
Packit |
6c4009 |
{
|
|
Packit |
6c4009 |
/*inp*/ { "AAA", "\216\217", 5, 5 }, /* #04 */ /* <WAIVER> */
|
|
Packit |
6c4009 |
/*exp*/ { EINVAL,0,0, },
|
|
Packit |
6c4009 |
},
|
|
Packit |
6c4009 |
#endif
|
|
Packit |
6c4009 |
{ .is_last = 1 }
|
|
Packit |
6c4009 |
}
|
|
Packit |
6c4009 |
},
|
|
Packit |
6c4009 |
{
|
|
Packit |
6c4009 |
{ Tstrxfrm, TST_LOC_end }
|
|
Packit |
6c4009 |
}
|
|
Packit |
6c4009 |
};
|