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 an
older version of the libc installed.

[1]: https://sourceware.org/bugzilla/show_bug.cgi?id=23279

Reviewed-by: Maxim Kokryashkin <[email protected]>
Reviewed-by: Sergey Bronnikov <[email protected]>
Signed-off-by: Sergey Kaplun <[email protected]>
(cherry picked from commit f6abc63)
  • Loading branch information
Buristan committed Dec 23, 2024
1 parent a42ffb5 commit fed82d8
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 fed82d8

Please sign in to comment.