Files
gentoo/dev-lua/lgi/files/lgi-0.9.2-skip_tests_5-1.patch
Nicolas PARLANT 9d56ca0fba dev-lua/lgi: skip more tests for lua-5.1
FP conversion in Lua 5.1/32bit cannot represent exactly large unsigned
integers

Bug: https://bugs.gentoo.org/836839
Signed-off-by: Nicolas PARLANT <nicolas.parlant@parhuet.fr>
Part-of: https://codeberg.org/gentoo/gentoo/pulls/1189
Merges: https://codeberg.org/gentoo/gentoo/pulls/1189
Signed-off-by: Sam James <sam@gentoo.org>
2026-06-19 11:38:40 +01:00

33 lines
1.2 KiB
Diff

See https://bugs.gentoo.org/836839 and https://github.com/lgi-devs/lgi/issues/353
FP conversion in Lua 5.1/32bit cannot represent exactly large unsigned integers
Skip tests w/ large unsigned if lua-5.1
--- a/tests/gireg.lua
+++ b/tests/gireg.lua
@@ -143,7 +150,10 @@ function gireg.type_uint32()
if not nativeIntegers then
checkv(R.test_uint32(1.1), 1, 'number')
end
- checkv(R.test_uint32(0xffffffff), 0xffffffff, 'number')
+ -- skip large unsigned on Lua 5.1
+ if not (_VERSION == "Lua 5.1" and not jit) then
+ checkv(R.test_uint32(0xffffffff), 0xffffffff, 'number')
+ end
check(not pcall(R.test_uint32, 0x100000000))
check(not pcall(R.test_uint32, -1))
check(not pcall(R.test_uint32))
@@ -815,9 +823,12 @@ function gireg.enum()
check(R.test_enum_param(-1) == 'value3')
check(R.TestEnumUnsigned.VALUE1 == 1)
- check(R.TestEnumUnsigned.VALUE2 == 0x80000000)
check(R.TestEnumUnsigned[1] == 'VALUE1')
- check(R.TestEnumUnsigned[0x80000000] == 'VALUE2')
+ -- skip large unsigned enum on Lua 5.1
+ if not (_VERSION == "Lua 5.1" and not jit) then
+ check(R.TestEnumUnsigned.VALUE2 == 0x80000000)
+ check(R.TestEnumUnsigned[0x80000000] == 'VALUE2')
+ end
check(R.TestEnumUnsigned[-1] == -1)
end