2 MBRLEN: size_t mbrlen (char *s, size_t n, mbstate_t *ps)
5 #define TST_FUNCTION mbrlen
7 #include "tsp_common.c"
8 #include "dat_mbrlen.c"
12 tst_mbrlen (FILE * fp
, int debug_flg
)
14 TST_DECL_VARS (size_t);
20 static mbstate_t s
= { 0 };
25 TST_HEAD_LOCALE (mbrlen
, S_MBRLEN
);
28 if (mbrlen (NULL
, 0, &s
) != 0)
31 Result (C_FAILURE
, S_MBRLEN
, CASE_3
,
32 "Initialization (external mbstate object) failed "
33 "- skipped this test case.");
37 TST_DO_SEQ (MBRLEN_SEQNUM
)
39 TST_GET_ERRET_SEQ (mbrlen
);
40 s_flg
= TST_INPUT_SEQ (mbrlen
).s_flg
;
41 s_in
= TST_INPUT_SEQ (mbrlen
).s
;
42 n
= TST_INPUT_SEQ (mbrlen
).n
;
43 t_flg
= TST_INPUT_SEQ (mbrlen
).t_flg
;
44 t_ini
= TST_INPUT_SEQ (mbrlen
).t_init
;
50 if (n
== USE_MBCURMAX
) /* rewrite tst_mblen() like this */
55 ps
= (t_flg
== 0) ? NULL
: &s
;
59 memset (&s
, 0, sizeof (s
));
60 mbrlen (NULL
, 0, NULL
);
64 ret
= mbrlen (s_in
, n
, ps
);
69 fprintf (stdout
, "mbrlen() [ %s : %d : %d ] ret = %zd\n",
70 locale
, rec
+ 1, seq_num
+ 1, ret
);
71 fprintf (stdout
, " errno = %d\n", errno_save
);
74 TST_IF_RETURN (S_MBRLEN
)