Blame localedata/tests-mbwc/tst_wcsncmp.c
|
Packit Service |
82fcde |
/*-------------------------------------------------------------------------------------*/
|
|
Packit Service |
82fcde |
/* WCSNCMP: int wcsncmp( const wchar_t *ws1, const wchar_t *ws2, size_t n ) */
|
|
Packit Service |
82fcde |
/*-------------------------------------------------------------------------------------*/
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
#define TST_FUNCTION wcsncmp
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
#include "tsp_common.c"
|
|
Packit Service |
82fcde |
#include "dat_wcsncmp.c"
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
int
|
|
Packit Service |
82fcde |
tst_wcsncmp (FILE * fp, int debug_flg)
|
|
Packit Service |
82fcde |
{
|
|
Packit Service |
82fcde |
TST_DECL_VARS (int);
|
|
Packit Service |
82fcde |
wchar_t *ws1, *ws2;
|
|
Packit Service |
82fcde |
size_t n;
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
TST_DO_TEST (wcsncmp)
|
|
Packit Service |
82fcde |
{
|
|
Packit Service |
82fcde |
TST_HEAD_LOCALE (wcsncmp, S_WCSNCMP);
|
|
Packit Service |
82fcde |
TST_DO_REC (wcsncmp)
|
|
Packit Service |
82fcde |
{
|
|
Packit Service |
82fcde |
TST_GET_ERRET (wcsncmp);
|
|
Packit Service |
82fcde |
ws1 = TST_INPUT (wcsncmp).ws1; /* external value: size WCSSIZE */
|
|
Packit Service |
82fcde |
ws2 = TST_INPUT (wcsncmp).ws2;
|
|
Packit Service |
82fcde |
n = TST_INPUT (wcsncmp).n;
|
|
Packit Service |
82fcde |
ret = wcsncmp (ws1, ws2, n);
|
|
Packit Service |
82fcde |
ret = (ret > 0 ? 1 : ret < 0 ? -1 : 0);
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
if (debug_flg)
|
|
Packit Service |
82fcde |
{
|
|
Packit Service |
82fcde |
fprintf (stderr, "tst_wcsncmp: ret = %d, 0x%x\n", ret, ret);
|
|
Packit Service |
82fcde |
}
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
TST_IF_RETURN (S_WCSNCMP)
|
|
Packit Service |
82fcde |
{
|
|
Packit Service |
82fcde |
};
|
|
Packit Service |
82fcde |
}
|
|
Packit Service |
82fcde |
}
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
return err_count;
|
|
Packit Service |
82fcde |
}
|