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 20644A04CC0; Wed, 31 Jan 2024 17:55:41 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 20644A04CC0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1706712941; bh=rgPlNrrcsLOaUoBtwAXoDl36YhuxRYIAOYAo6Jd0yoQ=; 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=GQmeHgryqPeA8i9sMqpjo0sokxFdW3ARC2n/8IJwA13LLVQDIo/hEr6JR0xFNqUjK UygJKPIfWkDSCvq22KMbFI/kozRs71F2rLhiMGBi6x4nayxdFzZfEQIzZAMkB6/41P RCj+yTWmG2JuPWKneGGaYHXpmlM2jOa2fyoNTMMk= Received: from smtp57.i.mail.ru (smtp57.i.mail.ru [95.163.41.95]) (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 E5F45A04CC0 for ; Wed, 31 Jan 2024 17:55:39 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org E5F45A04CC0 Received: by smtp57.i.mail.ru with esmtpa (envelope-from ) id 1rVC02-0000000Dax6-1Veo; Wed, 31 Jan 2024 17:55:38 +0300 Date: Wed, 31 Jan 2024 17:55:38 +0300 To: Sergey Kaplun Message-ID: References: <4d80dfc5a12d8e7d0ca668432543a9241dd58017.1706520765.git.skaplun@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4d80dfc5a12d8e7d0ca668432543a9241dd58017.1706520765.git.skaplun@tarantool.org> X-Mailru-Src: smtp X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD9A3FCF9DB4FFE0955989D0D03A8568AF7C06CDD26FFB83D83182A05F538085040C1C6DA37EB9C5B92AC8EDD30083ED68EAB950A6454EE1C758834D3388A37B585ACA8F312C2F0F594 X-C1DE0DAB: 0D63561A33F958A5936146B0F15D99695002B1117B3ED696746AF74AE543E5019E040399BDE4761E823CB91A9FED034534781492E4B8EEAD1247ADC107F68C7B X-C8649E89: 1C3962B70DF3F0ADE00A9FD3E00BEEDF77DD89D51EBB7742D3581295AF09D3DF87807E0823442EA2ED31085941D9CD0AF7F820E7B07EA4CF627B279835B41D48135198CACB21F3B4817B1B24F85C7B19FEFE7715C6FF4E96FDDCA1AF55FC97B2BAF4CF3B87E910B1582488F67F9B43B62F4F258B0F04936137ABAC29229005E25F4332CA8FE04980913E6812662D5F2A54F6898A6FDCBDC72A617DFBE5FEC2C6383653B6C8D9AE0FD16FCAA6493B703A X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojqJaWtPsRtylfYK7GUHkXtQ== X-Mailru-Sender: 11C2EC085EDE56FA38FD4C59F7EFE40799FBFE670BAA7F65B951B70A5BD4BD8EA8016D9ACDC8939238066306E4938E9F04C9FB44FCBCE9EE92D99EB8CC7091A7ECEABDC5717908DEF544888E8238EB4872D6B4FCE48DF648AE208404248635DF X-Mras: OK Subject: Re: [Tarantool-patches] [PATCH v2 luajit 09/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:09PM +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 and renames the C library in the `require()` call. > It adds groups with the names of subtests and enables the test in > . It renames structure and enum typedefs to avoid conflicts with > cdef in other tests. The GC threshold is increased since all tests run > in a single process, so the number of GC objects is greater. > > Part of tarantool/tarantool#9398 > --- > test/LuaJIT-tests/lib/ffi/ffi_convert.lua | 35 +++++++++++------------ > test/LuaJIT-tests/lib/ffi/index | 1 + > 2 files changed, 18 insertions(+), 18 deletions(-) > > diff --git a/test/LuaJIT-tests/lib/ffi/ffi_convert.lua b/test/LuaJIT-tests/lib/ffi/ffi_convert.lua > index bd3fb1f9..284f2b53 100644 > --- a/test/LuaJIT-tests/lib/ffi/ffi_convert.lua > +++ b/test/LuaJIT-tests/lib/ffi/ffi_convert.lua > @@ -1,8 +1,7 @@ > local ffi = require("ffi") > > -local ctest = require("ctest") > - > -dofile("../common/ffi_util.inc") > +local ctest = require("libctest") > +local fails = require("common.fails") > > local tonumber = tonumber > > @@ -32,15 +31,15 @@ typedef struct arrinc_t { > int a[]; > } arrinc_t; > > -typedef enum uenum_t { > +typedef enum uenum_convert_t { > UE0, UE71 = 71, UE72 > -} uenum_t; > +} uenum_convert_t; `convert` acts as a namespace here, and those are usually used as a prefix. Here and below. > > -typedef enum ienum_t { > +typedef enum ienum_convert_t { > IE0, IEM12 = -12, IEM11 > -} ienum_t; > +} ienum_convert_t; > > -typedef struct foo_t { > +typedef struct foo_convert_t { > bool b; > int8_t i8; > uint8_t u8; > @@ -79,9 +78,9 @@ typedef struct foo_t { > int si_guard; > nest_t sn; > uni_t ui; > - uenum_t ue; > - ienum_t ie; > -} foo_t; > + uenum_convert_t ue; > + ienum_convert_t ie; > +} foo_convert_t; > > char *strcpy(char *dest, const char *src); > typedef struct FILE FILE; > @@ -89,11 +88,11 @@ int fileno(FILE *stream); > int _fileno(FILE *stream); > ]] > > -do > - local foo_t = ffi.typeof("foo_t") > - local sz = ffi.sizeof(foo_t) > - local x = foo_t() > - local y = foo_t() > +do --- misc Is there any chance to split it up? > + local foo_convert_t = ffi.typeof("foo_convert_t") > + local sz = ffi.sizeof(foo_convert_t) > + local x = foo_convert_t() > + local y = foo_convert_t() > ffi.fill(x, sz, 0xff) > ffi.fill(y, sz, 0xee) > > @@ -769,7 +768,7 @@ do > x.ppf = ffi.C.strcpy > end > > -do > +do --- GC cdata __index > collectgarbage() > local oc = collectgarbage("count") > local cd = ffi.new"struct { struct { int a; } x;}" > @@ -780,7 +779,7 @@ do > for i=1,2 do > f(cd) > local nc = collectgarbage("count") > - assert(nc < oc + 200, "GC step missing for cdata __index") Are you sure it is the lower bound threshold? > + assert(nc < oc * 3, "GC step missing for cdata __index") > jit.off(f) > end > end > diff --git a/test/LuaJIT-tests/lib/ffi/index b/test/LuaJIT-tests/lib/ffi/index > index 0a72daed..5c2be87f 100644 > --- a/test/LuaJIT-tests/lib/ffi/index > +++ b/test/LuaJIT-tests/lib/ffi/index > @@ -7,6 +7,7 @@ ffi_bitfield.lua > ffi_call.lua > ffi_callback.lua > ffi_const.lua > +ffi_convert.lua > istype.lua > jit_array.lua > jit_complex.lua > -- > 2.43.0 >