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 AC8629A88D9; Mon, 5 Feb 2024 15:58:42 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org AC8629A88D9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1707137922; bh=AQJnPTT8+H4WrS6Ttl4SloUfk0UAdr8q+Qy96A1B9LA=; h=Date:To:Cc:References:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=JAKj0sb4tCqoHlqp6aaDnfF1a3e7pZarAinE3fyhyeIyvdFWZ6zPvHV8DzxbnJ7AP hREqO/FRS/czlht1W+lA2vxFhAl5Ducnhqsy50+66mWVoR79ITdz2HdqIdv7sdKkad p5vTLbbHHcE42iLdHR+DdrJrB0grNRDtqh/eMJqk= Received: from smtp52.i.mail.ru (smtp52.i.mail.ru [95.163.41.88]) (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 EC2459A88D3 for ; Mon, 5 Feb 2024 15:58:41 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org EC2459A88D3 Received: by smtp52.i.mail.ru with esmtpa (envelope-from ) id 1rWyYa-0000000Bzmt-2tYN; Mon, 05 Feb 2024 15:58:41 +0300 Message-ID: Date: Mon, 5 Feb 2024 15:58:40 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: Sergey Kaplun , Maxim Kokryashkin Cc: tarantool-patches@dev.tarantool.org References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD94C460F083DF69F511846634448A0B09D48B4D6D920496B8E182A05F538085040311EA770CA1165A933594132A326AF8B78FECF7AD1F6702F4328C2A7945C3420E1BDF786614B4017 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE77B6C7FE2D09642C2EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637F4A5B18E3CA6E045EA1F7E6F0F101C6723150C8DA25C47586E58E00D9D99D84E1BDDB23E98D2D38B73AB1701401CD871AB4D32B22533F9CAC6810048CF9B7F2291F0C832030CD39FA471835C12D1D9774AD6D5ED66289B5278DA827A17800CE7328B01A8D746D8839FA2833FD35BB23D2EF20D2F80756B5F868A13BD56FB6657A471835C12D1D977725E5C173C3A84C317B107DEF921CE79117882F4460429728AD0CFFFB425014E868A13BD56FB6657D81D268191BDAD3DC09775C1D3CA48CFF820309483B11D81BA3038C0950A5D36C8A9BA7A39EFB766D91E3A1F190DE8FDBA3038C0950A5D36D5E8D9A59859A8B662EF7529D2A07B7B76E601842F6C81A1F004C906525384303E02D724532EE2C3F43C7A68FF6260569E8FC8737B5C22494854413538E1713FE827F84554CEF50127C277FBC8AE2E8BA83251EDC214901ED5E8D9A59859A8B699FC562817B5DAD0089D37D7C0E48F6C5571747095F342E88FB05168BE4CE3AF X-C1DE0DAB: 0D63561A33F958A51C6772BE9C1BD7485002B1117B3ED6966AAFF2495EB62B8569995D676B7B4CBE823CB91A9FED034534781492E4B8EEAD3B72D73EA5828B68BDAD6C7F3747799A X-C8649E89: 1C3962B70DF3F0ADE00A9FD3E00BEEDF3FED46C3ACD6F73ED3581295AF09D3DF87807E0823442EA2ED31085941D9CD0AF7F820E7B07EA4CFC53637CC00A877EB0D6BBBCF6DB04FE1F35FB092CA3A35A02E9ECAEF672FA3F4CCDF2CE9FE05F2E714BC176DD269F15EDEC816CA01FB045770CD00ED94A389A08EA05EA3464DA2695F4332CA8FE04980913E6812662D5F2AB9AF64DB4688768036DF5FE9C0001AF333F2C28C22F508233FCF178C6DD14203 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2bioj0TrRSEWQ3VlyNcBdt8Bd4Q== X-Mailru-Sender: 11C2EC085EDE56FAC07928AF2646A769F0FECBAE31D5C5F833594132A326AF8B78FECF7AD1F6702FB7CBEF92542CD7C8795FA72BAB74744FC77752E0C033A69EA16A481184E8BB1C9B38E6EA4F046BE03A5DB60FBEB33A8A0DA7A0AF5A3A8387 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH v2 luajit 16/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: Sergey Bronnikov via Tarantool-patches Reply-To: Sergey Bronnikov Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Hi, Sergey thanks for the patch! LGTM with 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 function. It adds test names and > includes the test in . > > Part of tarantool/tarantool#9398 > --- > test/LuaJIT-tests/lib/ffi/ffi_metatype.lua | 16 ++++++++-------- > test/LuaJIT-tests/lib/ffi/index | 1 + > 2 files changed, 9 insertions(+), 8 deletions(-) > > diff --git a/test/LuaJIT-tests/lib/ffi/ffi_metatype.lua b/test/LuaJIT-tests/lib/ffi/ffi_metatype.lua > index 2db717f4..b0054b1a 100644 > --- a/test/LuaJIT-tests/lib/ffi/ffi_metatype.lua > +++ b/test/LuaJIT-tests/lib/ffi/ffi_metatype.lua > @@ -1,6 +1,6 @@ > local ffi = require("ffi") > > -dofile("../common/ffi_util.inc") > +local fails = require("common.fails") > > ffi.cdef[[ > typedef struct { int x; } idx1_t; > @@ -14,7 +14,7 @@ local function ptreq(a, b) > return ffi.cast("void *", a) == ffi.cast("void *", b) > end > > -do > +do --- metatype index newindex isn't better: "metatype with index and newindex metamethods" or smthing like this? This descriptions are for humans mostly and would be better to convert these keywords to readable sentence. same for test names below > local nidx = {} > local tp = ffi.metatype("idx1_t", { > __index = { foo = 99, method = function(c, v) return v end }, > @@ -45,7 +45,7 @@ do > fails(function(cp) cp.bar = 42 end, cp) > end > > -do > +do --- metatype index newindex with upvalues > local uc, uk, uv > local tp = ffi.metatype("idx2_t", { > __index = function(c, k, x, y) > @@ -78,7 +78,7 @@ do > fails(function(p) p[0] = 11 end, p) > end > > -do > +do --- metatype index newindex with upvalues via setmetatable > local uc, uk, uv > local ti, tn = {}, {} > local tp = ffi.metatype("idx3_t", { > @@ -103,7 +103,7 @@ do > uc, uk, uv = nil, nil, nil > end > > -do > +do --- metatype arith > local tp > tp = ffi.metatype("arith_t", { > __add = function(a, b) return tp(a.x+b.x, a.y+b.y) end, > @@ -174,7 +174,7 @@ do > assert(x == 3000) > end > > -do > +do --- metatype GC > local count = 0 > local tp = ffi.metatype("gc_t", { > __gc = function(x) count = count + 1 end, > @@ -206,7 +206,7 @@ do > assert(count == 103) > end > > -do > +do --- metatype new, type change > local tp = ffi.metatype([[ > struct { > static const int Z42 = 42; > @@ -236,7 +236,7 @@ struct { > assert(o.x == 5) > end > > -do > +do --- metatype is other cdata > local fb = ffi.new("struct { int x; }", 99) > local xt = ffi.metatype("struct { }", { __index = fb }) > local o = xt() > diff --git a/test/LuaJIT-tests/lib/ffi/index b/test/LuaJIT-tests/lib/ffi/index > index 833c31e3..338a6930 100644 > --- a/test/LuaJIT-tests/lib/ffi/index > +++ b/test/LuaJIT-tests/lib/ffi/index > @@ -14,6 +14,7 @@ ffi_jit_arith.lua > ffi_jit_call.lua > ffi_jit_conv.lua > ffi_lex_number.lua > +ffi_metatype.lua > istype.lua > jit_array.lua > jit_complex.lua