This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH v3 2/3] Add test for warn, warnx, vwarn, and vwarnx with floating-point parameters
- From: Florian Weimer <fweimer at redhat dot com>
- To: "Gabriel F. T. Gomes" <gabriel at inconstante dot eti dot br>
- Cc: <libc-alpha at sourceware dot org>
- Date: Mon, 05 Nov 2018 12:40:14 +0100
- Subject: Re: [PATCH v3 2/3] Add test for warn, warnx, vwarn, and vwarnx with floating-point parameters
- References: <20180828215427.18653-1-gabriel@inconstante.eti.br> <20180828215427.18653-3-gabriel@inconstante.eti.br>
* Gabriel F. T. Gomes:
> + FILE *fp = open_memstream (&buffer, &length);
I think I mentioned xopen_memstream before.
> + /* Write to the buffer using one of the *warn* functions. */
> + switch (select)
> + {
You need to initialize errno to zero before the switch, I think. The
test is currently rather brittle.
> + /* Check that the rest of the output is as expected. */
> + if (strcmp (buffer, expected) != 0)
> + FAIL_EXIT1 ("unexpected output: %s", buffer);
It would also help to include expected output here, so that the context
of the failure is clearer.
Okay with these changes.
Thanks,
Florian