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 8E8359E037A; Wed, 31 Jan 2024 14:58:06 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 8E8359E037A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1706702286; bh=QSl2EvPlMcCUNSxthY1BJpN3z2k766HpuhGkakePzPM=; 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=Algu0uUtSAGSTv+0WWdvmlOZxXbZbhe9px2NiCFkLv3Mxy23MPGnm6h20HNf7zl5t teSoadTxirFyjr+8tds/AsQCm27/L0L5+8o/C5WFuWQNUerj7Sk/fYz990Nj7y01EG 3MGabbMm9uGzytLSC3/4x5zaPf0oo6yrtCbodtJg= Received: from smtp34.i.mail.ru (smtp34.i.mail.ru [95.163.41.75]) (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 E6F199E037A for ; Wed, 31 Jan 2024 14:58:04 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org E6F199E037A Received: by smtp34.i.mail.ru with esmtpa (envelope-from ) id 1rV9EC-00000008Doo-1Gtz; Wed, 31 Jan 2024 14:58:04 +0300 Date: Wed, 31 Jan 2024 14:58:04 +0300 To: Sergey Kaplun Message-ID: References: <98fb92f07dcd2879a423006642f2bdcd4acfd9f2.1706520765.git.skaplun@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <98fb92f07dcd2879a423006642f2bdcd4acfd9f2.1706520765.git.skaplun@tarantool.org> X-Mailru-Src: smtp X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD9DF1FFD52FB7F4A9544A615B89DCAEEF65FD94589276DE8CF00894C459B0CD1B9BC63C08786C288E66546F32817DD6D02CD1B303DC983106CA5FF73F9B7EDAB3DB57612C3CDEB6A40 X-C1DE0DAB: 0D63561A33F958A5EA7A803E808E75575002B1117B3ED696F6D51CC2934928E1F5FEB6EB1EB183FD823CB91A9FED034534781492E4B8EEAD1247ADC107F68C7B X-C8649E89: 1C3962B70DF3F0ADE00A9FD3E00BEEDF77DD89D51EBB7742D3581295AF09D3DF87807E0823442EA2ED31085941D9CD0AF7F820E7B07EA4CF58D366C4DB7529E3E0AE27A8499E7AC76A83E4C4399411B1810D778DD3E60248A30287D0F4871F18BAF4CF3B87E910B17F48AA7814FC6EAAF6DB56C390EB3D3EE9590875DC3ABC405F4332CA8FE04980913E6812662D5F2A54F6898A6FDCBDC72A617DFBE5FEC2C6383653B6C8D9AE0FD16FCAA6493B703A X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojqJaWtPsRtym7QX8y4IYr4A== X-Mailru-Sender: 11C2EC085EDE56FA38FD4C59F7EFE4077975177FC2CAC2E6B951B70A5BD4BD8EA6727A5C3A7E116A1442BDFAA493918404C9FB44FCBCE9EE92D99EB8CC7091A7ECEABDC5717908DEF544888E8238EB4872D6B4FCE48DF648AE208404248635DF X-Mras: OK Subject: Re: [Tarantool-patches] [PATCH v2 luajit 03/26] test: separate LuaJIT helpers from ffi_util.inc 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! LGTM, except for a few nits below. On Mon, Jan 29, 2024 at 01:45:03PM +0300, Sergey Kaplun wrote: > This patch moves common helpers from > into separate files by analogy with . The > `include()` helper isn't touched since it is used in system dependend > tests, which won't be modified for now. > > Part of tarantool/tarantool#9398 > --- > test/LuaJIT-tests/common/fails.lua | 3 +++ > test/LuaJIT-tests/common/ffi/checkfail.lua | 14 +++++++++++++ > test/LuaJIT-tests/common/ffi/checktypes.lua | 15 ++++++++++++++ > test/LuaJIT-tests/common/ffi_util.inc | 23 --------------------- > 4 files changed, 32 insertions(+), 23 deletions(-) > create mode 100644 test/LuaJIT-tests/common/fails.lua > create mode 100644 test/LuaJIT-tests/common/ffi/checkfail.lua > create mode 100644 test/LuaJIT-tests/common/ffi/checktypes.lua > > diff --git a/test/LuaJIT-tests/common/fails.lua b/test/LuaJIT-tests/common/fails.lua > new file mode 100644 > index 00000000..d555a2b5 > --- /dev/null > +++ b/test/LuaJIT-tests/common/fails.lua > @@ -0,0 +1,3 @@ > diff --git a/test/LuaJIT-tests/common/ffi/checkfail.lua b/test/LuaJIT-tests/common/ffi/checkfail.lua > new file mode 100644 > index 00000000..d3ca74e8 > --- /dev/null > +++ b/test/LuaJIT-tests/common/ffi/checkfail.lua > @@ -0,0 +1,14 @@ > diff --git a/test/LuaJIT-tests/common/ffi/checktypes.lua b/test/LuaJIT-tests/common/ffi/checktypes.lua > new file mode 100644 > index 00000000..c995d667 > --- /dev/null > +++ b/test/LuaJIT-tests/common/ffi/checktypes.lua > @@ -0,0 +1,15 @@ > +local ffi = require("ffi") > + > +-- Checker that takes an array with the following each 3 elements: Typo: s/each 3 elements/triplets/ > +-- 1) Sizeof for the given C type to be checked. > +-- 2) Alignof for the given C type to be checked. Nit: `sizeof()` and `alignof()` or something like that? Feel free to ignore. > +-- 3) String representing the C type. > +return function(t) > + for i=1,1e9,3 do > + local tp = t[i+2] > + if not tp then break end > + local id = ffi.typeof(tp) > + assert(ffi.sizeof(id) == t[i], tp) > + assert(ffi.alignof(id) == t[i+1], tp) > + end > +end > diff --git a/test/LuaJIT-tests/common/ffi_util.inc b/test/LuaJIT-tests/common/ffi_util.inc > index 1eee8dd9..9604d7b0 100644 > --- a/test/LuaJIT-tests/common/ffi_util.inc > +++ b/test/LuaJIT-tests/common/ffi_util.inc > @@ -4,29 +4,6 @@ > -- > 2.43.0 >