1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-02-13 02:42:18 +02:00

tests: parameterize IO_BUFSIZE

* src/getlimits.c (main): Output IO_BUFSIZE, useful for
sizing data for tests.
* tests/fold/fold-characters.sh: Use it rather than hardcoding.
This commit is contained in:
Pádraig Brady
2025-08-26 18:04:56 +01:00
parent aec4f85476
commit cbf6a27810
2 changed files with 8 additions and 1 deletions

View File

@@ -23,6 +23,7 @@
#include "ftoastr.h"
#include "system.h"
#include "ioblksize.h"
#include "long-options.h"
#define PROGRAM_NAME "getlimits"
@@ -168,5 +169,8 @@ main (int argc, char **argv)
print_float (DBL);
print_float (LDBL);
/* Other useful constants */
printf ("IO_BUFSIZE=%ju\n", (uintmax_t) IO_BUFSIZE);
return EXIT_SUCCESS;
}

View File

@@ -18,6 +18,7 @@
. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
print_ver_ fold printf
getlimits_
test "$LOCALE_FR_UTF8" != none || skip_ "French UTF-8 locale not available"
@@ -60,7 +61,9 @@ compare character-exp2 character-out2 || fail=1
# Test a Unicode character on the edge of the input buffer.
# Keep in sync with IO_BUFSIZE - 1.
yes a | head -n 262143 | tr -d '\n' > input3 || framework_failure_
IO_BUFSIZE_MINUS_1=$(($IO_BUFSIZE - 1))
test $IO_BUFSIZE_MINUS_1 -gt 0 || framework_failure_
yes a | head -n $IO_BUFSIZE_MINUS_1 | tr -d '\n' > input3 || framework_failure_
env printf '\uB250' >> input3 || framework_failure_
yes a | head -n 100 | tr -d '\n' >> input3 || framework_failure_
env printf '\n' >> input3 || framework_failure_