I did: > * tests/test-vasnprintf-big.c (main): Move INT_MAX test case to here.
This has the unfortunate consequence that, in a Solaris 11.4 or Solaris OpenIndiana VM with 32 GB RAM this test is now "SKIPPED". Why? The physmem_claimable (1.0) call returns 27 GB when at the beginning of the file, but only 23 GB (4 GB less) when after the INT_MAX test. 23 GB is not enough for this test. The fix is to separate the test cases into different programs. 2026-07-14 Bruno Haible <[email protected]> vasnwprintf-extra-tests: Refactor. * tests/test-vasnwprintf-big2.c: Renamed from tests/test-vasnwprintf-big.c. * modules/vasnwprintf-extra-tests: Update. vaszprintf-extra-tests: Refactor. * tests/test-vaszprintf-big1.c: Renamed from tests/test-vaszprintf-big.c. * modules/vaszprintf-extra-tests: Update. vasprintf-extra-tests: Refactor. * tests/test-vasprintf-big1.c: Renamed from tests/test-vasprintf-big.c. * modules/vasprintf-extra-tests: Update. vasnprintf-extra-tests: Refactor. * tests/test-vasnprintf-big1.c: New file, based on tests/test-vasnprintf-big.c. * tests/test-vasnprintf-big2.c: New file, based on tests/test-vasnprintf-big.c. * tests/test-vasnprintf-big.c: Remove file. * modules/vasnprintf-extra-tests: Update to build two separate programs. obstack-zprintf-extra-tests: Refactor. * tests/test-obstack-zprintf-big2.c: Renamed from tests/test-obstack-zprintf-big.c. * modules/obstack-zprintf-extra-tests: Update.
>From a37b0b513b63ea1d4faab936dd409dc9e6eb2ab0 Mon Sep 17 00:00:00 2001 From: Bruno Haible <[email protected]> Date: Tue, 14 Jul 2026 19:21:23 +0200 Subject: [PATCH 1/5] obstack-zprintf-extra-tests: Refactor. * tests/test-obstack-zprintf-big2.c: Renamed from tests/test-obstack-zprintf-big.c. * modules/obstack-zprintf-extra-tests: Update. --- ChangeLog | 7 +++++++ modules/obstack-zprintf-extra-tests | 8 ++++---- ...-obstack-zprintf-big.c => test-obstack-zprintf-big2.c} | 0 3 files changed, 11 insertions(+), 4 deletions(-) rename tests/{test-obstack-zprintf-big.c => test-obstack-zprintf-big2.c} (100%) diff --git a/ChangeLog b/ChangeLog index 0ddd38c4ef..eb6e2cd7a8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2026-07-14 Bruno Haible <[email protected]> + + obstack-zprintf-extra-tests: Refactor. + * tests/test-obstack-zprintf-big2.c: Renamed from + tests/test-obstack-zprintf-big.c. + * modules/obstack-zprintf-extra-tests: Update. + 2026-07-14 Bruno Haible <[email protected]> vasnprintf-extra-tests: Fix test bug. diff --git a/modules/obstack-zprintf-extra-tests b/modules/obstack-zprintf-extra-tests index 65f7b7096e..7201159512 100644 --- a/modules/obstack-zprintf-extra-tests +++ b/modules/obstack-zprintf-extra-tests @@ -2,7 +2,7 @@ Status: longrunning-test Files: -tests/test-obstack-zprintf-big.c +tests/test-obstack-zprintf-big2.c tests/macros.h Depends-on: @@ -12,6 +12,6 @@ configure.ac: AC_CHECK_FUNCS_ONCE([setrlimit]) Makefile.am: -TESTS += test-obstack-zprintf-big -check_PROGRAMS += test-obstack-zprintf-big -test_obstack_zprintf_big_LDADD = $(LDADD) @LIBINTL@ +TESTS += test-obstack-zprintf-big2 +check_PROGRAMS += test-obstack-zprintf-big2 +test_obstack_zprintf_big2_LDADD = $(LDADD) @LIBINTL@ diff --git a/tests/test-obstack-zprintf-big.c b/tests/test-obstack-zprintf-big2.c similarity index 100% rename from tests/test-obstack-zprintf-big.c rename to tests/test-obstack-zprintf-big2.c -- 2.53.0
>From 73c289e5599904131afb2543884c8016ecf49cf8 Mon Sep 17 00:00:00 2001 From: Bruno Haible <[email protected]> Date: Tue, 14 Jul 2026 19:28:10 +0200 Subject: [PATCH 2/5] vasnprintf-extra-tests: Refactor. * tests/test-vasnprintf-big1.c: New file, based on tests/test-vasnprintf-big.c. * tests/test-vasnprintf-big2.c: New file, based on tests/test-vasnprintf-big.c. * tests/test-vasnprintf-big.c: Remove file. * modules/vasnprintf-extra-tests: Update to build two separate programs. --- ChangeLog | 8 +++ modules/vasnprintf-extra-tests | 7 +-- tests/test-vasnprintf-big1.c | 50 +++++++++++++++++++ ...asnprintf-big.c => test-vasnprintf-big2.c} | 19 ------- 4 files changed, 62 insertions(+), 22 deletions(-) create mode 100644 tests/test-vasnprintf-big1.c rename tests/{test-vasnprintf-big.c => test-vasnprintf-big2.c} (94%) diff --git a/ChangeLog b/ChangeLog index eb6e2cd7a8..75b1e870c1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,13 @@ 2026-07-14 Bruno Haible <[email protected]> + vasnprintf-extra-tests: Refactor. + * tests/test-vasnprintf-big1.c: New file, based on + tests/test-vasnprintf-big.c. + * tests/test-vasnprintf-big2.c: New file, based on + tests/test-vasnprintf-big.c. + * tests/test-vasnprintf-big.c: Remove file. + * modules/vasnprintf-extra-tests: Update to build two separate programs. + obstack-zprintf-extra-tests: Refactor. * tests/test-obstack-zprintf-big2.c: Renamed from tests/test-obstack-zprintf-big.c. diff --git a/modules/vasnprintf-extra-tests b/modules/vasnprintf-extra-tests index 55e372e7c9..c450bfcfcc 100644 --- a/modules/vasnprintf-extra-tests +++ b/modules/vasnprintf-extra-tests @@ -2,7 +2,8 @@ Status: longrunning-test Files: -tests/test-vasnprintf-big.c +tests/test-vasnprintf-big1.c +tests/test-vasnprintf-big2.c tests/macros.h Depends-on: @@ -14,5 +15,5 @@ configure.ac: AC_CHECK_FUNCS_ONCE([setrlimit]) Makefile.am: -TESTS += test-vasnprintf-big -check_PROGRAMS += test-vasnprintf-big +TESTS += test-vasnprintf-big1 test-vasnprintf-big2 +check_PROGRAMS += test-vasnprintf-big1 test-vasnprintf-big2 diff --git a/tests/test-vasnprintf-big1.c b/tests/test-vasnprintf-big1.c new file mode 100644 index 0000000000..80580f31aa --- /dev/null +++ b/tests/test-vasnprintf-big1.c @@ -0,0 +1,50 @@ +/* Test of [v]asnprintf() with big results. + Copyright (C) 2024-2026 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <https://www.gnu.org/licenses/>. */ + +#include <config.h> + +#include "vasnprintf.h" + +/* Get INT_MAX. */ +#include <limits.h> + +#include <errno.h> +#include <stdlib.h> +#include <string.h> + +#include "macros.h" + +int +main () +{ + /* Large width given as argument. */ + { + size_t length; + char *result = + asnprintf (NULL, &length, "%*d", INT_MAX, INT_MIN); + if (!result) + ASSERT (errno == ENOMEM); + else + { + ASSERT (atoi (result) == INT_MIN); + ASSERT (length == INT_MAX); + ASSERT (length == strlen (result)); + free (result); + } + } + + return test_exit_status; +} diff --git a/tests/test-vasnprintf-big.c b/tests/test-vasnprintf-big2.c similarity index 94% rename from tests/test-vasnprintf-big.c rename to tests/test-vasnprintf-big2.c index 1ff043a105..ba44fc0c5e 100644 --- a/tests/test-vasnprintf-big.c +++ b/tests/test-vasnprintf-big2.c @@ -44,25 +44,6 @@ int main () { - /* Large width given as argument. */ - { - size_t length; - char *result = - asnprintf (NULL, &length, "%*d", INT_MAX, INT_MIN); - if (!result) - ASSERT (errno == ENOMEM); - else - { - ASSERT (atoi (result) == INT_MIN); - ASSERT (length == INT_MAX); - ASSERT (length == strlen (result)); - free (result); - } - } - - if (test_exit_status != EXIT_SUCCESS) - return test_exit_status; - #if PTRDIFF_MAX == INT_MAX fputs ("Skipping test: ptrdiff_t is not 64-bits wide\n", stderr); return 77; -- 2.53.0
>From 427753b97b1c526e36df0592bf3e135dce0dbf21 Mon Sep 17 00:00:00 2001 From: Bruno Haible <[email protected]> Date: Tue, 14 Jul 2026 19:30:55 +0200 Subject: [PATCH 3/5] vasprintf-extra-tests: Refactor. * tests/test-vasprintf-big1.c: Renamed from tests/test-vasprintf-big.c. * modules/vasprintf-extra-tests: Update. --- ChangeLog | 4 ++++ modules/vasprintf-extra-tests | 6 +++--- tests/{test-vasprintf-big.c => test-vasprintf-big1.c} | 0 3 files changed, 7 insertions(+), 3 deletions(-) rename tests/{test-vasprintf-big.c => test-vasprintf-big1.c} (100%) diff --git a/ChangeLog b/ChangeLog index 75b1e870c1..1f20a6936e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2026-07-14 Bruno Haible <[email protected]> + vasprintf-extra-tests: Refactor. + * tests/test-vasprintf-big1.c: Renamed from tests/test-vasprintf-big.c. + * modules/vasprintf-extra-tests: Update. + vasnprintf-extra-tests: Refactor. * tests/test-vasnprintf-big1.c: New file, based on tests/test-vasnprintf-big.c. diff --git a/modules/vasprintf-extra-tests b/modules/vasprintf-extra-tests index 5a99516681..21d9de8f02 100644 --- a/modules/vasprintf-extra-tests +++ b/modules/vasprintf-extra-tests @@ -2,7 +2,7 @@ Status: longrunning-test Files: -tests/test-vasprintf-big.c +tests/test-vasprintf-big1.c tests/macros.h Depends-on: @@ -10,5 +10,5 @@ Depends-on: configure.ac: Makefile.am: -TESTS += test-vasprintf-big -check_PROGRAMS += test-vasprintf-big +TESTS += test-vasprintf-big1 +check_PROGRAMS += test-vasprintf-big1 diff --git a/tests/test-vasprintf-big.c b/tests/test-vasprintf-big1.c similarity index 100% rename from tests/test-vasprintf-big.c rename to tests/test-vasprintf-big1.c -- 2.53.0
>From 1074fe8f3beb467c906a2755002aedaec1a208ba Mon Sep 17 00:00:00 2001 From: Bruno Haible <[email protected]> Date: Tue, 14 Jul 2026 19:34:35 +0200 Subject: [PATCH 5/5] vasnwprintf-extra-tests: Refactor. * tests/test-vasnwprintf-big2.c: Renamed from tests/test-vasnwprintf-big.c. * modules/vasnwprintf-extra-tests: Update. --- ChangeLog | 5 +++++ modules/vasnwprintf-extra-tests | 6 +++--- tests/{test-vasnwprintf-big.c => test-vasnwprintf-big2.c} | 0 3 files changed, 8 insertions(+), 3 deletions(-) rename tests/{test-vasnwprintf-big.c => test-vasnwprintf-big2.c} (100%) diff --git a/ChangeLog b/ChangeLog index 9099c7ac86..81ba3ad21c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2026-07-14 Bruno Haible <[email protected]> + vasnwprintf-extra-tests: Refactor. + * tests/test-vasnwprintf-big2.c: Renamed from + tests/test-vasnwprintf-big.c. + * modules/vasnwprintf-extra-tests: Update. + vaszprintf-extra-tests: Refactor. * tests/test-vaszprintf-big1.c: Renamed from tests/test-vaszprintf-big.c. diff --git a/modules/vasnwprintf-extra-tests b/modules/vasnwprintf-extra-tests index 10b838643b..bbb02c1925 100644 --- a/modules/vasnwprintf-extra-tests +++ b/modules/vasnwprintf-extra-tests @@ -2,7 +2,7 @@ Status: longrunning-test Files: -tests/test-vasnwprintf-big.c +tests/test-vasnwprintf-big2.c tests/macros.h Depends-on: @@ -14,5 +14,5 @@ configure.ac: AC_CHECK_FUNCS_ONCE([setrlimit]) Makefile.am: -TESTS += test-vasnwprintf-big -check_PROGRAMS += test-vasnwprintf-big +TESTS += test-vasnwprintf-big2 +check_PROGRAMS += test-vasnwprintf-big2 diff --git a/tests/test-vasnwprintf-big.c b/tests/test-vasnwprintf-big2.c similarity index 100% rename from tests/test-vasnwprintf-big.c rename to tests/test-vasnwprintf-big2.c -- 2.53.0
>From 8021551f1e72e6b23f5bb08777a723aaaa014c2b Mon Sep 17 00:00:00 2001 From: Bruno Haible <[email protected]> Date: Tue, 14 Jul 2026 19:32:31 +0200 Subject: [PATCH 4/5] vaszprintf-extra-tests: Refactor. * tests/test-vaszprintf-big1.c: Renamed from tests/test-vaszprintf-big.c. * modules/vaszprintf-extra-tests: Update. --- ChangeLog | 5 +++++ modules/vaszprintf-extra-tests | 6 +++--- tests/{test-vaszprintf-big.c => test-vaszprintf-big1.c} | 0 3 files changed, 8 insertions(+), 3 deletions(-) rename tests/{test-vaszprintf-big.c => test-vaszprintf-big1.c} (100%) diff --git a/ChangeLog b/ChangeLog index 1f20a6936e..9099c7ac86 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2026-07-14 Bruno Haible <[email protected]> + vaszprintf-extra-tests: Refactor. + * tests/test-vaszprintf-big1.c: Renamed from + tests/test-vaszprintf-big.c. + * modules/vaszprintf-extra-tests: Update. + vasprintf-extra-tests: Refactor. * tests/test-vasprintf-big1.c: Renamed from tests/test-vasprintf-big.c. * modules/vasprintf-extra-tests: Update. diff --git a/modules/vaszprintf-extra-tests b/modules/vaszprintf-extra-tests index b0d0faa542..3d88ebe080 100644 --- a/modules/vaszprintf-extra-tests +++ b/modules/vaszprintf-extra-tests @@ -2,7 +2,7 @@ Status: longrunning-test Files: -tests/test-vaszprintf-big.c +tests/test-vaszprintf-big1.c tests/macros.h Depends-on: @@ -10,5 +10,5 @@ Depends-on: configure.ac: Makefile.am: -TESTS += test-vaszprintf-big -check_PROGRAMS += test-vaszprintf-big +TESTS += test-vaszprintf-big1 +check_PROGRAMS += test-vaszprintf-big1 diff --git a/tests/test-vaszprintf-big.c b/tests/test-vaszprintf-big1.c similarity index 100% rename from tests/test-vaszprintf-big.c rename to tests/test-vaszprintf-big1.c -- 2.53.0
