[Tarantool-patches] [PATCH v2 luajit 18/26] test: enable <ffi_parse_array.lua> in LuaJIT-tests
Sergey Kaplun
skaplun at tarantool.org
Tue Feb 6 17:11:37 MSK 2024
Hi, Maxim!
Thanks for the review!
Renamed test cases as you suggested:
===================================================================
diff --git a/test/LuaJIT-tests/lib/ffi/ffi_parse_array.lua b/test/LuaJIT-tests/lib/ffi/ffi_parse_array.lua
index d3b02759..ce82f5da 100644
--- a/test/LuaJIT-tests/lib/ffi/ffi_parse_array.lua
+++ b/test/LuaJIT-tests/lib/ffi/ffi_parse_array.lua
@@ -4,7 +4,7 @@ local checkfail = require("common.ffi.checkfail")
local checktypes = require("common.ffi.checktypes")
local fails = require("common.fails")
-do --- checkfail
+do --- incorrect declarations
checkfail{
"int [",
"int [-1]",
@@ -33,8 +33,7 @@ do --- sizeof of arrays
assert(ffi.sizeof("foo2_array_t") == 200)
end
-
-do --- checktypes
+do --- array declarations, sizeof() and alignof()
local P = ffi.sizeof("void *")
checktypes{
10, 1, "char [10]",
@@ -60,7 +59,7 @@ do --- checktypes
}
end
-do --- sizeof VLA
+do --- VLA sizeof
assert(ffi.sizeof("int [?]", 10) == 4*10)
local id = ffi.typeof("const short [?]")
assert(ffi.sizeof(id, 10) == 2*10)
@@ -72,7 +71,7 @@ do --- sizeof VLA
assert(ffi.sizeof(id, 0x3fffffff) == 2*0x3fffffff)
end
-do --- sizeof VLS
+do --- VLS sizeof
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)
===================================================================
On 01.02.24, Maxim Kokryashkin wrote:
> Hi, Sergey!
> Thanks for the patch!
> Please consider my comments below.
> On Mon, Jan 29, 2024 at 01:45:18PM +0300, Sergey Kaplun wrote:
<snipped>
> >
--
Best regards,
Sergey Kaplun
More information about the Tarantool-patches
mailing list