Commit Graph

3 Commits

Author SHA1 Message Date
Joseph Myers 04277e02d7 Update copyright dates with scripts/update-copyrights.
* All files with FSF copyright notices: Update copyright dates
	using scripts/update-copyrights.
	* locale/programs/charmap-kw.h: Regenerated.
	* locale/programs/locfile-kw.h: Likewise.
2019-01-01 00:11:28 +00:00
Gabriel F. T. Gomes 43257c335a Use TEST_COMPARE_STRING in recently added test
The commit

commit 1df872fd74
Author: Florian Weimer <fweimer@redhat.com>
Date:   Wed Nov 7 12:42:44 2018 +0100

    support: Implement TEST_COMPARE_STRING

added the new macro TEST_COMPARE_STRING, which compares the output of
functions under test against expected strings, and, when there's a
mismatch, automatically reports an error and prints the differences.
This patch adapts recently added test cases to use this new macro.

Tested for powerpc64le (as is, and locally patched to intentionally fail
and produce error output).

	* argp/tst-ldbl-argp.c (do_one_test): Use TEST_COMPARE_STRING,
	instead of manually comparing and reporting mismatching strings.
	* misc/tst-ldbl-error.c (do_one_test): Likewise.
	* misc/tst-ldbl-warn.c (do_one_test): Likewise.
2018-11-08 22:42:01 -02:00
Gabriel F. T. Gomes 2c03961fce Add tests for argp_error and argp_failure with floating-point parameters
The functions argp_error and argp_failure, from argp.h, have a format
string as parameter, which can possibly request the printing of
floating-point values.  These values could be of long double type, which
can have different formats, depending on the architecture and on
compilation parameters (for instance, on powerpc, long double values can
have double format (-mlong-double-64) or IBM Extended Precision format
(-mlong-double-128)).

This patch adds tests for argp_error and argp_failure that contain a
format string with double and long double conversion specifiers ('%f'
and '%Lf').  These tests automatically check that the default format of
the long double type works.  A future patch will extend the test for
platforms that can have an optional format for long double.

Tested for powerpc64le.

	* argp/Makefile (tests): Add tst-ldbl-argp.
	* argp/tst-ldbl-argp.c: New file.
2018-11-06 11:19:54 -02:00