Skip to content

Commit 6cf5a81

Browse files
committed
test: harden skipcond for libc in LuaJIT-tests
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
1 parent 3f4f46a commit 6cf5a81

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

test/LuaJIT-tests/lib/base/tonumber_scan.lua

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,9 +186,11 @@ do --- tonumber parsing
186186
test_conv(tonumber)
187187
end
188188

189-
-- Skip for the old libc version with the bug in the `strtod()`.
190-
-- See also https://sourceware.org/bugzilla/show_bug.cgi?id=16151.
191-
do --- strtod parsing -libc<2.19
189+
-- Skip for the old libc version with the bugs in the `strtod()`.
190+
-- Affected versions:
191+
-- * <2.19: https://sourceware.org/bugzilla/show_bug.cgi?id=16151.
192+
-- * <2.28: https://sourceware.org/bugzilla/show_bug.cgi?id=23279.
193+
do --- strtod parsing -libc<2.28
192194
test_conv(function(s)
193195
local d = ffi.C.strtod(s, e)
194196
return (e[0][0] == 0 and #s ~= 0) and d or nil

0 commit comments

Comments
 (0)