1 /*-------------------------------------------------------------------------------------*/
2 /* WCSNCMP: int wcsncmp( const wchar_t *ws1, const wchar_t *ws2, size_t n )	       */
3 /*-------------------------------------------------------------------------------------*/
4 
5 #define TST_FUNCTION wcsncmp
6 
7 #include "tsp_common.c"
8 #include "dat_wcsncmp.c"
9 
10 int
tst_wcsncmp(FILE * fp,int debug_flg)11 tst_wcsncmp (FILE * fp, int debug_flg)
12 {
13   TST_DECL_VARS (int);
14   wchar_t *ws1, *ws2;
15   size_t n;
16 
17   TST_DO_TEST (wcsncmp)
18   {
19     TST_HEAD_LOCALE (wcsncmp, S_WCSNCMP);
20     TST_DO_REC (wcsncmp)
21     {
22       TST_GET_ERRET (wcsncmp);
23       ws1 = TST_INPUT (wcsncmp).ws1;	/* external value: size WCSSIZE */
24       ws2 = TST_INPUT (wcsncmp).ws2;
25       n = TST_INPUT (wcsncmp).n;
26       ret = wcsncmp (ws1, ws2, n);
27       ret = (ret > 0 ? 1 : ret < 0 ? -1 : 0);
28 
29       if (debug_flg)
30 	{
31 	  fprintf (stderr, "tst_wcsncmp: ret = %d, 0x%x\n", ret, ret);
32 	}
33 
34       TST_IF_RETURN (S_WCSNCMP)
35       {
36       };
37     }
38   }
39 
40   return err_count;
41 }
42