[Tarantool-patches] [PATCH v2 luajit 18/26] test: enable <ffi_parse_array.lua> in LuaJIT-tests
Sergey Bronnikov
sergeyb at tarantool.org
Mon Feb 5 16:08:35 MSK 2024
Hi, Sergey
thanks for the patch! LGTM wit a minor comment
On 1/29/24 13:45, Sergey Kaplun wrote:
> This patch changes `dofile()` (which uses an unreliable relative file
> path and mutates `_G` with global functions to be defined) to the
> corresponding `require()` of the helper functions. It adds groups with
> the names of subtests and enables the test in <index>.
>
> Part of tarantool/tarantool#9398
> ---
> test/LuaJIT-tests/lib/ffi/ffi_parse_array.lua | 106 ++++++++++--------
> test/LuaJIT-tests/lib/ffi/index | 1 +
> 2 files changed, 58 insertions(+), 49 deletions(-)
>
> diff --git a/test/LuaJIT-tests/lib/ffi/ffi_parse_array.lua b/test/LuaJIT-tests/lib/ffi/ffi_parse_array.lua
> index 3a9616d7..d3b02759 100644
> --- a/test/LuaJIT-tests/lib/ffi/ffi_parse_array.lua
> +++ b/test/LuaJIT-tests/lib/ffi/ffi_parse_array.lua
> @@ -1,58 +1,66 @@
> local ffi = require("ffi")
<snipped>
>
> -do
> +do --- sizeof VLA
it is inconsistent with test name at least in a previous patch.
Here: "sizeof VLA", in a previous patch "VLA".
Feel free to ignore.
> assert(ffi.sizeof("int [?]", 10) == 4*10)
> local id = ffi.typeof("const short [?]")
> assert(ffi.sizeof(id, 10) == 2*10)
> @@ -64,7 +72,7 @@ do
> assert(ffi.sizeof(id, 0x3fffffff) == 2*0x3fffffff)
> end
>
> -do
> +do --- sizeof VLS
> assert(ffi.sizeof("struct { double x; int a[?]; }", 10) == 8+4*10)
> local id = ffi.typeof("struct { int x; short a[?]; }")
> assert(ffi.sizeof(id, 10) == 4+2*10)
> diff --git a/test/LuaJIT-tests/lib/ffi/index b/test/LuaJIT-tests/lib/ffi/index
> index e6c1fd0f..89773c0c 100644
> --- a/test/LuaJIT-tests/lib/ffi/index
> +++ b/test/LuaJIT-tests/lib/ffi/index
> @@ -16,6 +16,7 @@ ffi_jit_conv.lua
> ffi_lex_number.lua
> ffi_metatype.lua
> ffi_new.lua
> +ffi_parse_array.lua
> istype.lua
> jit_array.lua
> jit_complex.lua
More information about the Tarantool-patches
mailing list