From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id 110949E43CE; Thu, 1 Feb 2024 12:01:17 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 110949E43CE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1706778077; bh=ruYQIS0Cihr/KemwIxp9VL5Dy1T6eOIfGo9q/JqOtt0=; h=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=xy3HGdVXU2XSJsuSTr3EngPh+RlarbhA906DurAEdyx0HMSxbwv41TfEx8bHJrSGa xITdvoWsF/wC5w2yEXe+OQplxXvkhoJNtSefH7JO4zirU66Fx3JMx3KkVcV1FlwpTv 6cxR4i0me+PCirhJ84p1jFZGPRbXTylj95hHN/uA= Received: from smtp3.i.mail.ru (smtp3.i.mail.ru [95.163.41.67]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 45DD39E43CD for ; Thu, 1 Feb 2024 12:01:16 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 45DD39E43CD Received: by smtp3.i.mail.ru with esmtpa (envelope-from ) id 1rVSwd-0000000ETGq-1puz; Thu, 01 Feb 2024 12:01:15 +0300 Date: Thu, 1 Feb 2024 12:01:15 +0300 To: Sergey Kaplun Message-ID: References: <2d1cb0d61396fbc7d6efd352ed540079df684477.1706520765.git.skaplun@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2d1cb0d61396fbc7d6efd352ed540079df684477.1706520765.git.skaplun@tarantool.org> X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD9A3FCF9DB4FFE09550EB071B8444FE4D3AAC905CB603E818C182A05F538085040935F713E4711C90A03ED270C30F246C582C7AB3803A1593142E0A2E5ABDEE8B2B0371ADBF8103445 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7353CFE866E745C13EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006372E000E903B06FBD58638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D88B4B827E326C37DB12EAE9B1EBFD8C2E78D836500C582ED9CC7F00164DA146DAFE8445B8C89999728AA50765F7900637F924B32C592EA89F389733CBF5DBD5E9C8A9BA7A39EFB766F5D81C698A659EA7CC7F00164DA146DA9985D098DBDEAEC8EDCF5861DED71B2F389733CBF5DBD5E9B5C8C57E37DE458BD9DD9810294C998ED8FC6C240DEA76428AA50765F7900637131B56B3E08984A1D81D268191BDAD3DBD4B6F7A4D31EC0BE2F48590F00D11D6D81D268191BDAD3D78DA827A17800CE7E2C08009A4E2C92DEC76A7562686271ED91E3A1F190DE8FD2E808ACE2090B5E14AD6D5ED66289B5278DA827A17800CE7A03E8F3C2D3812562EB15956EA79C166A417C69337E82CC275ECD9A6C639B01B78DA827A17800CE7E1BCFB2C0BE3F189731C566533BA786AA5CC5B56E945C8DA X-C1DE0DAB: 0D63561A33F958A5173B76E3150247805002B1117B3ED6962ACDB92472494096F5FEB6EB1EB183FD823CB91A9FED034534781492E4B8EEAD2609375A3A81E2DDBDAD6C7F3747799A X-C8649E89: 1C3962B70DF3F0ADE00A9FD3E00BEEDF3FED46C3ACD6F73ED3581295AF09D3DF87807E0823442EA2ED31085941D9CD0AF7F820E7B07EA4CF3F8CDBBFD759C98559EB107F4B31E939F5B3A8B553985C080A552BD917B6684E6141934554CE5B5FBAF4CF3B87E910B15DFB4FD49B4138B18DB2BEBDEC82EC4D3AECE9EF70E7D6B05F4332CA8FE04980913E6812662D5F2A54F6898A6FDCBDC72A617DFBE5FEC2C6383653B6C8D9AE0FD16FCAA6493B703A X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojqJaWtPsRtym24CmaMWqueQ== X-Mailru-Sender: 7940E2A4EB16C9970E7603824FE97C20212B75C28D25B6DA912804B892A32FBE1725ADA6904762C4B6F7D78CE1F58EAD61AD1BC23DFB21333DDE9B364B0DF289BB83A8C3DAEBA78A61AAEF30F77CACB9EAB4BC95F72C04283CDA0F3B3F5B9367 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH v2 luajit 18/26] test: enable in LuaJIT-tests X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Maxim Kokryashkin via Tarantool-patches Reply-To: Maxim Kokryashkin Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Hi, Sergey! Thanks for the patch! Please consider my comments below. On Mon, Jan 29, 2024 at 01:45:18PM +0300, 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 . > > 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") > > -dofile("../common/ffi_util.inc") > +local checkfail = require("common.ffi.checkfail") > +local checktypes = require("common.ffi.checktypes") > +local fails = require("common.fails") > > -checkfail{ > - "int [", > - "int [-1]", > - "int [[1]]", > - "int [10][]", > - "int [10][?]", > - "int [][]", > - "int [][?]", > - "int [?][]", > - "int [?][?]", > - "int [0x10000][0x2000]", > - "int [256][256][256][256]", > - "int [10](void)", > - "int (void)[10]", > - "int &[10]", > - "union { double x; int a[?]; }", > -} I would prefer a more elaborate name here. > +do --- checkfail > + checkfail{ > + "int [", > + "int [-1]", > + "int [[1]]", > + "int [10][]", > + "int [10][?]", > + "int [][]", > + "int [][?]", > + "int [?][]", > + "int [?][?]", > + "int [0x10000][0x2000]", > + "int [256][256][256][256]", > + "int [10](void)", > + "int (void)[10]", > + "int &[10]", > + "union { double x; int a[?]; }", > + } > +end > > -ffi.cdef([[ > - typedef int foo1_t[10]; > - typedef foo1_t foo2_t[5]; > -]]) > -assert(ffi.sizeof("foo1_t") == 40) > -assert(ffi.sizeof("foo2_t") == 200) > +do --- sizeof of arrays > + ffi.cdef([[ > + typedef int foo1_array_t[10]; > + typedef foo1_array_t foo2_array_t[5]; > + ]]) > + assert(ffi.sizeof("foo1_array_t") == 40) > + assert(ffi.sizeof("foo2_array_t") == 200) > +end > > -local P = ffi.sizeof("void *") > > -checktypes{ > - 10, 1, "char [10]", > - 4*10, 4, "int [10]", > - 4*10, 4, "int [10]", > - 4*10*5, 4, "int [10][5]", > - 4*10*5*3*2*7, 4, "int [10][5][3][2][7]", > - 4*10*5, 4, "int ([10])[5]", > - P*10, P, "int *[10]", > - P, P, "int (*)[10]", > - P*5, P, "int (*[5])[10]", > - 8*10, 4, "struct { int x; char y; } [10]", > - P*5*10, P, "volatile int *(* const *[5][10])(void)", > - nil, 4, "int []", > - 4*10, 8, "int __attribute__((aligned(8))) [10]", > - 4*10, 8, "__attribute__((aligned(8))) int [10]", > - 4*10, 8, "int [10] __attribute__((aligned(8)))", > - 97, 1, "char ['a']", > - 83, 1, "char ['\\123']", > - 79, 1, "char ['\x4F']", > - 5, 1, "char [sizeof(\"aa\" \"bb\")]", > - 80, 8, "double [10]", > -} Same here. > +do --- checktypes > + local P = ffi.sizeof("void *") > + checktypes{ > + 10, 1, "char [10]", > + 4*10, 4, "int [10]", > + 4*10, 4, "int [10]", > + 4*10*5, 4, "int [10][5]", > + 4*10*5*3*2*7, 4, "int [10][5][3][2][7]", > + 4*10*5, 4, "int ([10])[5]", > + P*10, P, "int *[10]", > + P, P, "int (*)[10]", > + P*5, P, "int (*[5])[10]", > + 8*10, 4, "struct { int x; char y; } [10]", > + P*5*10, P, "volatile int *(* const *[5][10])(void)", > + nil, 4, "int []", > + 4*10, 8, "int __attribute__((aligned(8))) [10]", > + 4*10, 8, "__attribute__((aligned(8))) int [10]", > + 4*10, 8, "int [10] __attribute__((aligned(8)))", > + 97, 1, "char ['a']", > + 83, 1, "char ['\\123']", > + 79, 1, "char ['\x4F']", > + 5, 1, "char [sizeof(\"aa\" \"bb\")]", > + 80, 8, "double [10]", > + } > +end > > -do > +do --- sizeof VLA > 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 > -- > 2.43.0 >