From cd5ab5da9b56bf560407554c0377cfa8567d4430 Mon Sep 17 00:00:00 2001 From: Sergey Kaplun Date: Thu, 19 Dec 2024 10:39:00 +0300 Subject: [PATCH] test: harden skipcond for libc in LuaJIT-tests The `strtod parsing` subtest in the checks the results yielded by the `strtod()` via FFI call. In glibc versions before 2.28 it returns an incorrect result (NaN instead of inf) for "0x3p1023" [1]. This patch hardens the skipcond for this test for a smaller version of the libc installed. [1]: https://sourceware.org/bugzilla/show_bug.cgi?id=23279 --- test/LuaJIT-tests/lib/base/tonumber_scan.lua | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test/LuaJIT-tests/lib/base/tonumber_scan.lua b/test/LuaJIT-tests/lib/base/tonumber_scan.lua index ac7d68a4d8..800c57b016 100644 --- a/test/LuaJIT-tests/lib/base/tonumber_scan.lua +++ b/test/LuaJIT-tests/lib/base/tonumber_scan.lua @@ -186,9 +186,11 @@ do --- tonumber parsing test_conv(tonumber) end --- Skip for the old libc version with the bug in the `strtod()`. --- See also https://sourceware.org/bugzilla/show_bug.cgi?id=16151. -do --- strtod parsing -libc<2.19 +-- Skip for the old libc version with the bugs in the `strtod()`. +-- Affected versions: +-- * <2.19: https://sourceware.org/bugzilla/show_bug.cgi?id=16151. +-- * <2.28: https://sourceware.org/bugzilla/show_bug.cgi?id=23279. +do --- strtod parsing -libc<2.28 test_conv(function(s) local d = ffi.C.strtod(s, e) return (e[0][0] == 0 and #s ~= 0) and d or nil