mirror of
https://git.savannah.gnu.org/git/coreutils.git
synced 2026-11-17 18:02:09 +03:00
tests: sort-NaN-infloop: augment testing for recent fix
* tests/misc/sort-NaN-infloop.sh: Add test case from https://unix.stackexchange.com/a/700967/37127 * src/sort.c: Avoid syntax-check failure.
This commit is contained in:
1 parent
cfeb6b15a5
commit
ddafdae21c
2 files changed
+4
-1
No files matched your search
+1
-1
@@ -2006,7 +2006,7 @@ numcompare (char const *a, char const *b)
|
||||
static int
|
||||
nan_compare (long double a, long double b)
|
||||
{
|
||||
char buf[2][sizeof "-nan()" + CHAR_BIT * sizeof a];
|
||||
char buf[2][sizeof "-nan""()" + CHAR_BIT * sizeof a];
|
||||
snprintf (buf[0], sizeof buf[0], "%Lf", a);
|
||||
snprintf (buf[1], sizeof buf[1], "%Lf", b);
|
||||
return strcmp (buf[0], buf[1]);
|
||||
|
||||
@@ -23,6 +23,9 @@ echo nan > F || framework_failure_
|
||||
printf 'nan\nnan\n' > exp || framework_failure_
|
||||
timeout 10 sort -g -m F F > out || fail=1
|
||||
|
||||
# This was seen to infloop on some systems until coreutils v9.2 (bug 55212)
|
||||
yes nan | head -n128095 | timeout 60 sort -g > /dev/null || fail=1
|
||||
|
||||
compare exp out || fail=1
|
||||
|
||||
Exit $fail
|
||||
Reference in new issue
Block a user