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 6346BB5FCE3; Fri, 12 Apr 2024 13:51:18 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 6346BB5FCE3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1712919078; bh=qnrYX4wTS6uguxc3+IoEE/96MZgAicJ/thWZlaw/s7A=; 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=DtJD/w0L152IRCyXhx6+jKTK2+vAEtYBdDKJCcviEVGQVRi8j7RrWV/u61E/vph/M odGLNCUPQIIy9vWLxbK92r59u8XOjDtAPK9DtDoUESYLCESqsmaeypjkJXKSVg+/Ch vMOz/z/Q4Mw9NtZzxY18/wnuSOKIH4u4hVaan3Nw= Received: from smtp41.i.mail.ru (smtp41.i.mail.ru [95.163.41.64]) (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 8DDA3B5FCE2 for ; Fri, 12 Apr 2024 13:51:16 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 8DDA3B5FCE2 Received: by smtp41.i.mail.ru with esmtpa (envelope-from ) id 1rvEV1-00000007vFh-2r7Q; Fri, 12 Apr 2024 13:51:16 +0300 Date: Fri, 12 Apr 2024 13:47:14 +0300 To: Sergey Bronnikov Message-ID: References: <9234535074cc11e0682353c0e5e865bb22cd88f0.1712841312.git.sergeyb@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9234535074cc11e0682353c0e5e865bb22cd88f0.1712841312.git.sergeyb@tarantool.org> X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD9D327C87852EB66D3B5F9CEDACDA8A376D5C6B368178EF610182A05F538085040BAB40626FF71FCE691417EB218679B82064BB602B7746F5C09244C526417AF45810A56970F496ED6 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7F65C230EDDCD559EEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006374F638C8F0F4AA0FB8638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D85425BBCDC5080150227999A0AC794B2B1D507A7CE0BC7714CC7F00164DA146DAFE8445B8C89999728AA50765F79006370277CA7F994D7EF5389733CBF5DBD5E9C8A9BA7A39EFB766F5D81C698A659EA7CC7F00164DA146DA9985D098DBDEAEC8ED96AA85C75E140D117882F4460429728AD0CFFFB425014E868A13BD56FB6657E2021AF6380DFAD1A18204E546F3947C2FFDA4F57982C5F42E808ACE2090B5E1725E5C173C3A84C3C5EA940A35A165FF2DBA43225CD8A89FB26E97DCB74E62526D8C47C27EEC5E9FB5C8C57E37DE458BEDA766A37F9254B7 X-C1DE0DAB: 0D63561A33F958A588F5F8B93F1E81D55002B1117B3ED6963FF5A104719A56D7B74D9144D44E4FCF823CB91A9FED034534781492E4B8EEADDFC043C56F70D752BDAD6C7F3747799A X-C8649E89: 1C3962B70DF3F0ADE00A9FD3E00BEEDF3FED46C3ACD6F73ED3581295AF09D3DF87807E0823442EA2ED31085941D9CD0AF7F820E7B07EA4CF9C0BF516D42F593FD946F1FD76DBAAFB9E84ABC852B6F3E23E70CCC80A4F4115136DDA45E01CE4BE1E5F415AA55898CCE3959E889118C33309388B88262882831D1BFDD0BC12250BC226CC413062362A913E6812662D5F2A5EAB5682573093F7837F15F2B5E4A70B33F2C28C22F508233FCF178C6DD14203 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojj8Sl06kWf01QysyTLWs2ng== X-DA7885C5: F0F2832F5D8A844FF255D290C0D534F94AE1488B3A3860FAFABEC64A6CD721F904BBB90C1FFD849B5B1A4C17EAA7BC4BEF2421ABFA55128DAF83EF9164C44C7E X-Mailru-Sender: 689FA8AB762F7393590D8C940224AE3374E040686AEEF0C5B59A0E9A7CC41941B795451563FC2757E49D44BB4BD9522A059A1ED8796F048DB274557F927329BE89D5A3BC2B10C37545BD1C3CC395C826B4A721A3011E896F X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit 2/4][v2] test: introduce a helper read_file 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, Sergey! Thanks for the fixes! LGTM, after fixing two nits below. On 11.04.24, Sergey Bronnikov wrote: > From: Sergey Bronnikov > > diff --git a/test/tarantool-tests/lj-366-strtab-correct-size.test.lua b/test/tarantool-tests/lj-366-strtab-correct-size.test.lua > index 8a97a441..580fce09 100644 > --- a/test/tarantool-tests/lj-366-strtab-correct-size.test.lua > +++ b/test/tarantool-tests/lj-366-strtab-correct-size.test.lua > @@ -9,6 +9,7 @@ local test = tap.test('lj-366-strtab-correct-size'):skipcond({ > }) > > local ffi = require 'ffi' > +local utils = require('utils') > -- Parses a buffer in an ELF format and returns an offset and a size of strtab > -- and symtab sections. > local function read_elf(elf_content) > @@ -172,7 +165,7 @@ end > test:plan(3) > > local elf_filename = create_obj_file(MODULE_NAME) > -local elf_content = read_file(elf_filename) > +local elf_content = require('utils').tools.read_file(elf_filename) Nit: s/require('utils')/utils/ Rationale: `utils` are already required above. > assert(#elf_content ~= 0, 'cannot read an object file') > > local strtab, symtab = read_elf(elf_content) > diff --git a/test/tarantool-tests/utils/tools.lua b/test/tarantool-tests/utils/tools.lua > index f35c6922..a2556e32 100644 > --- a/test/tarantool-tests/utils/tools.lua > +++ b/test/tarantool-tests/utils/tools.lua > @@ -12,4 +12,12 @@ function M.profilename(name) > return (arg[0]:gsub('^(.+)/([^/]+)%.test%.lua$', replacepattern)) > end > > +-- Reads a file located at a specified path and returns its content. Nit: Comment line width is more than 66 symbols. > +function M.read_file(path) > + local file = assert(io.open(path), 'cannot open an object file') > + local content = file:read('*a') > + file:close() > + return content > +end > + > return M > -- > 2.34.1 > -- Best regards, Sergey Kaplun