[discuss] iconv: what's the purpose of the mtrace in the tst-iconv2.c
liqingqing
liqingqing3@huawei.com
Sat Dec 14 08:45:00 GMT 2019
I am working on the test of iconv feel confused with this test case tst-iconv2.c,
because this function use mtrace, but i don't know what is the exactly purpose.
what i want to do is removing the mtrace function but i'm not sure.
static int
do_test (void)
{
char buf[3];
const wchar_t wc[1] = L"a";
iconv_t cd;
char *inptr;
size_t inlen;
char *outptr;
size_t outlen;
size_t n;
int e;
int result = 0;
mtrace ();//does test case want test memory leak?
cd = iconv_open ("UCS4", "WCHAR_T");
if (cd == (iconv_t) -1)
{
printf ("cannot convert from wchar_t to UCS4: %m\n");
exit (1);
}
inptr = (char *) wc;
inlen = sizeof (wchar_t);
outptr = buf;
outlen = 3;
n = iconv (cd, &inptr, &inlen, &outptr, &outlen);
e = errno;
More information about the Libc-alpha
mailing list