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 DCE8A9DC60E; Mon, 29 Jan 2024 13:54:24 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org DCE8A9DC60E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1706525664; bh=zVJGNu402hU9jtwGuT6Md1sMezZ3vIh4/5G0GfKm9NY=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=GIMQsQaN+Zi0VO0UH22SbuuM/uiD12ktxOfEUI6D7epn3A9/bIYQQCw2+MwUTwZvX j1MibXjCQ59CKexdEWi9wf+7vweZOrTrVBcOEAssWYke8ZwkbU6rNq2x5bKv9rQ/9y gRwFmMJlqQRVmxEFMDpNtYuyeIW82T6AK/dFgyYI= Received: from smtp32.i.mail.ru (smtp32.i.mail.ru [95.163.41.73]) (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 97E139C2036 for ; Mon, 29 Jan 2024 13:49:33 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 97E139C2036 Received: by smtp32.i.mail.ru with esmtpa (envelope-from ) id 1rUPCn-0000000BQ6r-00kp; Mon, 29 Jan 2024 13:49:33 +0300 To: Maxim Kokryashkin , Sergey Bronnikov Date: Mon, 29 Jan 2024 13:45:10 +0300 Message-ID: <5f4bb19f9ab035c79089802fcc99ec7c5550b455.1706520765.git.skaplun@tarantool.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: EEAE043A70213CC8 X-77F55803: 4F1203BC0FB41BD9A2BFDE4DD2630CDA5F99C8985E3DD4BF24CBCDD037658F52182A05F5380850404C228DA9ACA6FE27F4693A1D8E16FEE733594132A326AF8BB52B066D3A23BD7ADCA4176470581478718F752AB0E2B2A6 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7CE015DA2C687B387EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637225475490A77DC518638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D8FBCF9D5DBF06C640BE1BF1E404F07B8EE7B9C3EC35B5BC97CC7F00164DA146DAFE8445B8C89999728AA50765F7900637BA939FD1B3BAB99B389733CBF5DBD5E9C8A9BA7A39EFB766F5D81C698A659EA7CC7F00164DA146DA9985D098DBDEAEC8B861051D4BA689FCF6B57BC7E6449061A352F6E88A58FB86F5D81C698A659EA73AA81AA40904B5D9A18204E546F3947CDA7BFA4571439BB2BA3038C0950A5D36C8A9BA7A39EFB766D91E3A1F190DE8FDBA3038C0950A5D36D5E8D9A59859A8B6D827CA74CCEABFF33AA81AA40904B5D99C9F4D5AE37F343AD1F44FA8B9022EA23BBE47FD9DD3FB595F5C1EE8F4F765FC8C7ADC89C2F0B2A5E2021AF6380DFAD18AA50765F790063735872C767BF85DA227C277FBC8AE2E8BF62623862A568E3375ECD9A6C639B01B4E70A05D1297E1BBCB5012B2E24CD356 X-C1DE0DAB: 0D63561A33F958A59CD0C94FFB203DA45002B1117B3ED696813423DDB8272A4E8D59E407A97E9958823CB91A9FED034534781492E4B8EEAD3B72D73EA5828B68C79554A2A72441328621D336A7BC284946AD531847A6065A535571D14F44ED41 X-C8649E89: 1C3962B70DF3F0ADE00A9FD3E00BEEDF3FED46C3ACD6F73ED3581295AF09D3DF87807E0823442EA2ED31085941D9CD0AF7F820E7B07EA4CFA8727C10D15920F386C52F999FC133DFAB9366ADB0DBE7509739E76DF5263E4EF2F1C324C53BDAF28FB01E7B8BF01A69703997DD6F518C65B718120DE96C5CC5FD3457722508E235C226CC413062362A913E6812662D5F2A5EAB5682573093F7837F15F2B5E4A70B33F2C28C22F508233FCF178C6DD14203 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojmd9AG1X07oRuMW8SxS9XYw== X-Mailru-Sender: 11C2EC085EDE56FAC07928AF2646A76930D7C137249C58B233594132A326AF8BB52B066D3A23BD7AB7CBEF92542CD7C88B0A2698F12F5C9EC77752E0C033A69E86920BD37369036789A8C6A0E60D2BB63A5DB60FBEB33A8A0DA7A0AF5A3A8387 X-Mras: Ok Subject: [Tarantool-patches] [PATCH v2 luajit 10/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" 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()` call and renames the C library in the `require()` call. Also, it names all subtests and includes the test in . Part of tarantool/tarantool#9398 --- test/LuaJIT-tests/lib/ffi/ffi_enum.lua | 11 +++++------ test/LuaJIT-tests/lib/ffi/index | 1 + 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/test/LuaJIT-tests/lib/ffi/ffi_enum.lua b/test/LuaJIT-tests/lib/ffi/ffi_enum.lua index e8e40ad0..49c874c7 100644 --- a/test/LuaJIT-tests/lib/ffi/ffi_enum.lua +++ b/test/LuaJIT-tests/lib/ffi/ffi_enum.lua @@ -1,7 +1,7 @@ local ffi = require("ffi") -dofile("../common/ffi_util.inc") +local fails = require("common.fails") ffi.cdef[[ typedef enum enum_i { FOO_I = -1, II = 10 } enum_i; @@ -13,10 +13,9 @@ int call_i_ei(enum_i a) asm("call_i"); int call_i_eu(enum_u a) asm("call_i"); ]] -local C = ffi.load("../clib/ctest") - -do +local C = ffi.load("ctest") +do --- base local t = ffi.new("enum_i[100]") for i=0,99 do t[i] = "II" end for i=0,99 do assert(t[i] == "II") end @@ -42,14 +41,14 @@ do for i=0,99 do assert(t[i] ~= u[i]) end end -do +do --- calls for i=0,99 do assert(C.call_ei_i(9) == "II") end for i=0,99 do assert(C.call_eu_i(9) == "UU") end for i=0,99 do assert(C.call_i_ei("II") == 11) end for i=0,99 do assert(C.call_i_eu("UU") == 11) end end -do +do --- cast to bool local f = ffi.cast("bool (*)(enum_i)", function(e) return e == "II" end) assert(f("II")) assert(not f(0)) diff --git a/test/LuaJIT-tests/lib/ffi/index b/test/LuaJIT-tests/lib/ffi/index index 5c2be87f..b11e5aa4 100644 --- a/test/LuaJIT-tests/lib/ffi/index +++ b/test/LuaJIT-tests/lib/ffi/index @@ -8,6 +8,7 @@ ffi_call.lua ffi_callback.lua ffi_const.lua ffi_convert.lua +ffi_enum.lua istype.lua jit_array.lua jit_complex.lua -- 2.43.0