Blame localedata/tests-mbwc/tst_towctrans.c
|
Packit |
6c4009 |
/*
|
|
Packit |
6c4009 |
TOWCTRANS: wint_t towctrans (wint_t wc, wctrans_t desc);
|
|
Packit |
6c4009 |
*/
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
#define TST_FUNCTION towctrans
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
#include "tsp_common.c"
|
|
Packit |
6c4009 |
#include "dat_towctrans.c"
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
int
|
|
Packit |
6c4009 |
tst_towctrans (FILE *fp, int debug_flg)
|
|
Packit |
6c4009 |
{
|
|
Packit |
6c4009 |
TST_DECL_VARS (wint_t);
|
|
Packit |
6c4009 |
wint_t wc;
|
|
Packit |
6c4009 |
const char *ts;
|
|
Packit |
6c4009 |
wctrans_t wto;
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
TST_DO_TEST (towctrans)
|
|
Packit |
6c4009 |
{
|
|
Packit |
6c4009 |
TST_HEAD_LOCALE (towctrans, S_TOWCTRANS);
|
|
Packit |
6c4009 |
TST_DO_REC (towctrans)
|
|
Packit |
6c4009 |
{
|
|
Packit |
6c4009 |
TST_GET_ERRET (towctrans);
|
|
Packit |
6c4009 |
wc = TST_INPUT (towctrans).wc;
|
|
Packit |
6c4009 |
ts = TST_INPUT (towctrans).ts;
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
wto = wctrans (ts);
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
TST_CLEAR_ERRNO;
|
|
Packit |
6c4009 |
ret = towctrans (wc, wto);
|
|
Packit |
6c4009 |
TST_SAVE_ERRNO;
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
if (debug_flg)
|
|
Packit |
6c4009 |
{
|
|
Packit |
6c4009 |
fprintf (stdout, "towctrans() [ %s : %d ] ret = 0x%x\n",
|
|
Packit |
6c4009 |
locale, rec+1, ret);
|
|
Packit |
6c4009 |
fprintf (stdout, " errno = %d\n",
|
|
Packit |
6c4009 |
errno_save);
|
|
Packit |
6c4009 |
}
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
TST_IF_RETURN (S_TOWCTRANS)
|
|
Packit |
6c4009 |
{
|
|
Packit |
6c4009 |
if (ret != 0)
|
|
Packit |
6c4009 |
{
|
|
Packit |
6c4009 |
result (fp, C_SUCCESS, S_TOWCTRANS, locale, rec+1,
|
|
Packit |
6c4009 |
seq_num+1, 3, MS_PASSED);
|
|
Packit |
6c4009 |
}
|
|
Packit |
6c4009 |
else
|
|
Packit |
6c4009 |
{
|
|
Packit |
6c4009 |
err_count++;
|
|
Packit |
6c4009 |
result (fp, C_FAILURE, S_TOWCTRANS, locale, rec+1,
|
|
Packit |
6c4009 |
seq_num+1, 3,
|
|
Packit |
6c4009 |
"the function returned 0, but should be non-zero");
|
|
Packit |
6c4009 |
}
|
|
Packit |
6c4009 |
}
|
|
Packit |
6c4009 |
}
|
|
Packit |
6c4009 |
}
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
return err_count;
|
|
Packit |
6c4009 |
}
|