This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]