[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:12:45 MSK 2024


Hi, Sergey!
Thanks for the review!
Fixed your comment below.

On 05.02.24, Sergey Bronnikov wrote:
> 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.

Renamed as the following:

===================================================================
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)
===================================================================

> 

<snipped>

> >   jit_complex.lua

-- 
Best regards,
Sergey Kaplun


More information about the Tarantool-patches mailing list