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 D745A9E5CDA; Tue, 6 Feb 2024 15:13:14 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org D745A9E5CDA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1707221594; bh=kc4I7CILOdCF19U8S+dJLAZN1dToXSI+30OP+1WCHz8=; 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=zoU0E3hBFJOJvbJjWt2jfd6jg9iA/TI/H2ds3hey7Ek5pxr0YK4ZCe/eLCosugWnw PPji+vCZdcE9GBM+1T6Hv/+Ee1zlfmNzla33BwnIzH87nGlK9ZnYM4gH548AxBacoc AAPbbYPKrsdeQE0PsebrLCc2E/9sdxgnqRBxrLqw= Received: from smtp54.i.mail.ru (smtp54.i.mail.ru [95.163.41.89]) (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 0616F9E5CD8 for ; Tue, 6 Feb 2024 15:13:13 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 0616F9E5CD8 Received: by smtp54.i.mail.ru with esmtpa (envelope-from ) id 1rXKK7-00000007751-1au3; Tue, 06 Feb 2024 15:13:11 +0300 Date: Tue, 6 Feb 2024 15:09:14 +0300 To: Maxim Kokryashkin Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD94C460F083DF69F519C7FE39648913355F55DE976E2925CCD182A05F538085040A75EAA6674AD98E491417EB218679B82EE47E73B8EA01253CA1D9A8F3B14CC98A316B52795F7D3CA X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE757AEC41D7AA04458EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006370E0E628E5A2670BA8638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D8E4C58EE6B079FA8C29BF529B3DAFE229C238FF8BD8DE4833CC7F00164DA146DAFE8445B8C89999728AA50765F7900637D0FEED2715E18529389733CBF5DBD5E9C8A9BA7A39EFB766F5D81C698A659EA7CC7F00164DA146DA9985D098DBDEAEC82FFDA4F57982C5F4F6B57BC7E6449061A352F6E88A58FB86F5D81C698A659EA7E827F84554CEF5019E625A9149C048EE33AC447995A7AD182BEBFE083D3B9BA73A03B725D353964B0B7D0EA88DDEDAC722CA9DD8327EE4930A3850AC1BE2E7352629B07FD02F83A6C4224003CC83647689D4C264860C145E X-C1DE0DAB: 0D63561A33F958A5362477EF765785035002B1117B3ED696F159535D034269B803803A57F48E4E5A823CB91A9FED034534781492E4B8EEAD32941D3B652364A4BDAD6C7F3747799A X-C8649E89: 1C3962B70DF3F0ADE00A9FD3E00BEEDF3FED46C3ACD6F73ED3581295AF09D3DF87807E0823442EA2ED31085941D9CD0AF7F820E7B07EA4CFB0AA7F3AB33EF269B3B4B987E9494080AE3B161D3B8C6F517CFE6496FFC3983C75F3776783CA996B807D692F32DC7032DB933F319FAB8F2D736BF0BBAE9891703308C7AE793D5DC15F4332CA8FE04980913E6812662D5F2A5EAB5682573093F7837F15F2B5E4A70B33F2C28C22F508233FCF178C6DD14203 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojh/iSjD2txnOIt6ZqgCkh2g== X-DA7885C5: 19E23E38D551D70CF255D290C0D534F916520FF526C63E0A2D3CE79B0FA7A403B92F9FAD564397FE5B1A4C17EAA7BC4BEF2421ABFA55128DAF83EF9164C44C7E X-Mailru-Sender: 689FA8AB762F7393590D8C940224AE336602F52670564DA2146F669E93BBCBC8937AEB5FFDC4752BE49D44BB4BD9522A059A1ED8796F048DB274557F927329BE89D5A3BC2B10C37545BD1C3CC395C826B4A721A3011E896F X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH v2 luajit 08/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 Kaplun via Tarantool-patches Reply-To: Sergey Kaplun Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Hi, Maxim! Thanks for the review! Fixed your comment and force-pushed the branch. On 31.01.24, Maxim Kokryashkin wrote: > Hi, Sergey! > Thanks for the patch! > LGTM, except for the question below. > On Mon, Jan 29, 2024 at 01:45:08PM +0300, Sergey Kaplun wrote: > > This patch changes the `dofile()` (which uses an unreliable relative > > file path and mutates `_G` with global functions to be defined) to the > > corresponding `require()`. Also, it names the only one test as "misc" > > and includes the test in . > > > > Part of tarantool/tarantool#9398 The new commit message is the following: | test: enable in LuaJIT-tests | | This patch changes the `dofile()` (which uses an unreliable relative | file path and mutates `_G` with global functions to be defined) to the | corresponding `require()`. Also, it splits the test case into several | and includes the test in . | | Part of tarantool/tarantool#9398 > > --- > > test/LuaJIT-tests/lib/ffi/ffi_const.lua | 4 ++-- > > test/LuaJIT-tests/lib/ffi/index | 1 + > > 2 files changed, 3 insertions(+), 2 deletions(-) > > > > diff --git a/test/LuaJIT-tests/lib/ffi/ffi_const.lua b/test/LuaJIT-tests/lib/ffi/ffi_const.lua > > index d42133ad..3213156d 100644 > > --- a/test/LuaJIT-tests/lib/ffi/ffi_const.lua > > +++ b/test/LuaJIT-tests/lib/ffi/ffi_const.lua > > @@ -1,6 +1,6 @@ > > local ffi = require("ffi") > > > > -dofile("../common/ffi_util.inc") > > +local fails = require("common.fails") > > > > ffi.cdef[[ > > typedef struct s_t { > > @@ -41,7 +41,7 @@ typedef struct foo_t { > > } foo_t; > > ]] > > > > -do > > +do --- misc > Again, maybe it is worth splitting into the subcategories that are > mentioned below. Fixed within the following patch: =================================================================== diff --git a/test/LuaJIT-tests/lib/ffi/ffi_const.lua b/test/LuaJIT-tests/lib/ffi/ffi_const.lua index 3213156d..01db9881 100644 --- a/test/LuaJIT-tests/lib/ffi/ffi_const.lua +++ b/test/LuaJIT-tests/lib/ffi/ffi_const.lua @@ -41,27 +41,29 @@ typedef struct foo_t { } foo_t; ]] -do --- misc - local foo_t = ffi.typeof("foo_t") - local x = foo_t() +local foo_t = ffi.typeof("foo_t") +local x = foo_t() - -- constval +do --- constval assert(x.cc == 17) fails(function(x) x.cc = 1 end, x) assert(x.CC == -37) fails(function(x) x.CC = 1 end, x) +end - -- fields +do --- fields x.i = 1 fails(function(x) x.ci = 1 end, x) x.e = 1 fails(function(x) x.ce = 1 end, x) +end - -- bitfields +do --- bitfields x.bi = 1 fails(function(x) x.cbi = 1 end, x) +end - -- arrays +do --- arrays do local a = ffi.new("int[10]") a[0] = 1 @@ -74,8 +76,9 @@ do --- misc fails(function(x) x.ca = x.a end, x) fails(function(x) x.ca = {} end, x) fails(function(x) x.cac = "abc" end, x) +end - -- structs +do --- structs do local s = ffi.new("s_t") s.v = 1 @@ -87,18 +90,21 @@ do --- misc x.s = x.cs fails(function(x) x.cs = x.s end, x) fails(function(x) x.cs = {} end, x) +end - -- pseudo-const structs +do --- pseudo-const structs x.pcs1.v = 1 fails(function(x) x.pcs1.w = 1 end, x) fails(function(x) x.pcs1 = x.pcs2 end, x) fails(function(x) x.pcs1 = {} end, x) +end - -- transparent structs +do --- transparent structs local y = x.ni fails(function(x) x.ni = 1 end, x) +end - -- complex subtype is implicitly const and doesn't inherit const attribute +do --- complex subtype is implicitly const and doesn't inherit const attribute x.cx = 1 fails(function(x) x.ccx = 1 end, x) do @@ -110,4 +116,3 @@ do --- misc x.ccp = ccxa end end - =================================================================== > > local foo_t = ffi.typeof("foo_t") > > local x = foo_t() > > > > diff --git a/test/LuaJIT-tests/lib/ffi/index b/test/LuaJIT-tests/lib/ffi/index > > index 9a22104a..0a72daed 100644 > > --- a/test/LuaJIT-tests/lib/ffi/index > > +++ b/test/LuaJIT-tests/lib/ffi/index > > @@ -6,6 +6,7 @@ ffi_arith_ptr.lua > > ffi_bitfield.lua > > ffi_call.lua > > ffi_callback.lua > > +ffi_const.lua > > istype.lua > > jit_array.lua > > jit_complex.lua > > -- > > 2.43.0 > > -- Best regards, Sergey Kaplun