unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: liqingqing <liqingqing3@huawei.com>
To: <libc-alpha@sourceware.org>, Florian Weimer <fweimer@redhat.com>,
	"Carlos O'Donell" <carlos@redhat.com>
Cc: Hushiyuan <hushiyuan@huawei.com>, Liusirui <liusirui@huawei.com>
Subject: [discuss] iconv: what's the purpose of the mtrace in the tst-iconv2.c
Date: Sat, 14 Dec 2019 16:44:50 +0800	[thread overview]
Message-ID: <fe3eef9c-740e-9b83-c472-59f8e2353b86@huawei.com> (raw)

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;


             reply	other threads:[~2019-12-14  8:45 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-14  8:44 liqingqing [this message]
2020-01-02 10:54 ` question about regex liqingqing
2020-01-02 16:16   ` Tim Rühsen
2020-01-02 22:14     ` Paul Eggert
2020-01-03  8:09       ` liqingqing
2020-01-20 10:41         ` liqingqing
2020-01-20 19:25           ` Paul Eggert
2020-01-21  1:15             ` liqingqing
2020-01-21  8:57               ` Paul Eggert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/libc/involved.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fe3eef9c-740e-9b83-c472-59f8e2353b86@huawei.com \
    --to=liqingqing3@huawei.com \
    --cc=carlos@redhat.com \
    --cc=fweimer@redhat.com \
    --cc=hushiyuan@huawei.com \
    --cc=libc-alpha@sourceware.org \
    --cc=liusirui@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).