This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[discuss] iconv: what's the purpose of the mtrace in the tst-iconv2.c
- From: liqingqing <liqingqing3 at huawei dot com>
- To: <libc-alpha at sourceware dot org>, Florian Weimer <fweimer at redhat dot com>, "Carlos O'Donell" <carlos at redhat dot com>
- Cc: Hushiyuan <hushiyuan at huawei dot com>, Liusirui <liusirui at huawei dot com>
- Date: Sat, 14 Dec 2019 16:44:50 +0800
- Subject: [discuss] iconv: what's the purpose of the mtrace in the tst-iconv2.c
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;