Skip to content

Commit

Permalink
test: harden skipcond for libc in LuaJIT-tests
Browse files Browse the repository at this point in the history
The `strtod parsing` subtest in the <lib/base/tonumber_scan.lua> 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
  • Loading branch information
Buristan committed Dec 19, 2024
1 parent 3f4f46a commit cd5ab5d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions test/LuaJIT-tests/lib/base/tonumber_scan.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit cd5ab5d

Please sign in to comment.