0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-12-22 17:51:53 +00:00

Printf test suite fails on systems with musl libc because tests for "%m"

and "%M" formats expect "Input/output error" message but musl returns
"I/O error". Proposed change compares the printf output with string
returned from strerror function for EIO constant.

See-also: https://bugs.gentoo.org/836713

Minor change from committer.
This commit is contained in:
Petr Vaněk 2023-03-06 11:19:30 +01:00 committed by Ondrej Zajicek
parent 2f080b5432
commit 0f679438f3

View File

@ -32,11 +32,14 @@ t_simple(void)
BSPRINTF(1, "@", buf, "@", 64); BSPRINTF(1, "@", buf, "@", 64);
BSPRINTF(1, "\xff", buf, "%c", 0xff); BSPRINTF(1, "\xff", buf, "%c", 0xff);
errno = 5; const char *io_error_str = lp_strdup(tmp_linpool, strerror(EIO));
BSPRINTF(18, "Input/output error", buf, "%m"); const int io_error_len = strlen(io_error_str);
errno = EIO;
BSPRINTF(io_error_len, io_error_str, buf, "%m");
errno = 0; errno = 0;
BSPRINTF(18, "Input/output error", buf, "%M", 5); BSPRINTF(io_error_len, io_error_str, buf, "%M", EIO);
BSPRINTF(11, "TeSt%StRiNg", buf, "%s", "TeSt%StRiNg"); BSPRINTF(11, "TeSt%StRiNg", buf, "%s", "TeSt%StRiNg");