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 11BB57185A; Sun, 14 Feb 2021 22:17:15 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 11BB57185A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1613330235; bh=fLQGzFEyB8/VYv8aAdGmDoYcLyfy7T67NY33BndJ/RU=; 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=XUwS5pLgVJKbXDZM7ZwSJNGcpdmi6Cm3RlNjhEQ/L61YSzUfQsDRlDzmAgxJUUSXu EdW4QRo/4yuDQAl3GKhuTcoKHmRQz6kOlbruKxuyNWieg5foXZ6rGdZeV9Xe6pCjt/ XbA+HVTaDVnlQJKeQvXpUugWX0fYFjlflJ2U7Y2E= Received: from smtp16.mail.ru (smtp16.mail.ru [94.100.176.153]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 5F9397185A for ; Sun, 14 Feb 2021 22:17:13 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 5F9397185A Received: by smtp16.mail.ru with esmtpa (envelope-from ) id 1lBMtJ-0000L8-6h; Sun, 14 Feb 2021 22:17:09 +0300 Date: Sun, 14 Feb 2021 22:16:26 +0300 To: Igor Munkin Message-ID: <20210214191626.GF9361@root> References: <2db1d3a53682de0bb4231ec494fc44e95acd9a8f.1612291495.git.imun@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <2db1d3a53682de0bb4231ec494fc44e95acd9a8f.1612291495.git.imun@tarantool.org> X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD981647AC6901E234B939F02D0E92C1ADFFCD11FC915E146DC182A05F538085040C3AA1F85F441FBEDA7D86FB9BA243427CA5183189F45614380ECDF200EA88421 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7FCFCB92DA8654BB0EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637652CD06254D2F21C8638F802B75D45FF5571747095F342E8C7A0BC55FA0FE5FCD44DEFF938657E1C70B425856E7CEF98FA7359EDE6C9D6DD389733CBF5DBD5E913377AFFFEAFD269176DF2183F8FC7C091DAD9F922AA71188941B15DA834481FCF19DD082D7633A0EF3E4896CB9E6436389733CBF5DBD5E9D5E8D9A59859A8B6E954A0C70C50C109CC7F00164DA146DA6F5DAA56C3B73B23C77107234E2CFBA567F23339F89546C55F5C1EE8F4F765FCAEB924C2B054B06E75ECD9A6C639B01BBD4B6F7A4D31EC0BC0CAF46E325F83A522CA9DD8327EE4930A3850AC1BE2E7352686C055BC15B7FBC4224003CC836476C0CAF46E325F83A50BF2EBBBDD9D6B0F5D41B9178041F3E72623479134186CDE6BA297DBC24807EABDAD6C7F3747799A X-C1DE0DAB: 0D63561A33F958A529BCDA491A02EBA2AD259893753F0E9B572381C05C6E11B3D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA75F04B387B5D7535DE410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D340297C696F996E384A5DB1DBFB0DB89807BA585C4B78C627481CF19F015BA905AF3D8BF7E5B78376B1D7E09C32AA3244C6627792DFFD52AEB2BDD8DC87FC81917C86C126E7119A0FEFACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojcZK6cmu79qQX8lXC/69XUQ== X-Mailru-Sender: 3B9A0136629DC91206CBC582EFEF4CB4697FD065E53F76D9928251E81A0AAEBA9BB23FB40F0A9B33F2400F607609286E924004A7DEC283833C7120B22964430C52B393F8C72A41A89437F6177E88F7363CDA0F3B3F5B9367 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit 4/5] test: fix warnings found with luacheck in misclib* 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, Igor! Thanks for the patch! Looks like I was late for the ball and you got two LGTMs, but here’s my two cents on the matter, because I've been mentioned. Feel free to ignore my nitpicks. LGTM, except two nitpicks below. On 02.02.21, Igor Munkin wrote: > Since the regular static analysis has not been enabled for the test > chunks in LuaJIT repository yet, the tests for recently implemented > features still produce luacheck warnings. > > The most of the issues are fixed in scope of the commit > 8fc103fb1a21c28185a1942e75d8d9485e3aade7 ('test: fix warnings spotted by > luacheck') and this patch fixes the remaining ones. > > Fixes tarantool/tarantool#5631 Nit: Looks like 'Closes' or even 'Part of' (considering the next patch), not 'Fixes'. Also, After this patch there are tons of misc-related warnings by the luacheсk without config. So, I think that this patch should be squashed with the next one. Feel free to ignore. > Part of tarantool/tarantool#4862 > Part of tarantool/tarantool#5470 > Follows up tarantool/tarantool#5187 > > Reported-by: Sergey Bronnikov > Signed-off-by: Igor Munkin > --- > .../misclib-getmetrics-capi.test.lua | 22 ++++++--------- > .../misclib-getmetrics-lapi.test.lua | 28 +++++++++---------- > 2 files changed, 23 insertions(+), 27 deletions(-) > > diff --git a/test/tarantool-tests/misclib-getmetrics-capi.test.lua b/test/tarantool-tests/misclib-getmetrics-capi.test.lua > index c418e9f..d409ea9 100755 > --- a/test/tarantool-tests/misclib-getmetrics-capi.test.lua > +++ b/test/tarantool-tests/misclib-getmetrics-capi.test.lua > @@ -38,29 +38,29 @@ test:ok(testgetmetrics.objcount(function(iterations) > } > > -- Separate objects creations to separate jit traces. > - for i = 1, iterations do > - table.insert(placeholder.str, tostring(i)) > + for _ = 1, iterations do > + table.insert(placeholder.str, tostring(_)) > end > > - for i = 1, iterations do > - table.insert(placeholder.tab, {i}) > + for _ = 1, iterations do > + table.insert(placeholder.tab, {_}) > end > > - for i = 1, iterations do > + for _ = 1, iterations do > table.insert(placeholder.udata, newproxy()) > end > > - for i = 1, iterations do > + for _ = 1, iterations do > -- Check counting of VLA/VLS/aligned cdata. > table.insert(placeholder.cdata, ffi.new("char[?]", 4)) > end > > - for i = 1, iterations do > + for _ = 1, iterations do Side note: this change is not necessary for the patch, but the code looks more consistent. So, it is good, thanks! > -- Check counting of non-VLA/VLS/aligned cdata. > - table.insert(placeholder.cdata, ffi.new("uint64_t", i)) > + table.insert(placeholder.cdata, ffi.new("uint64_t", _)) > end > > diff --git a/test/tarantool-tests/misclib-getmetrics-lapi.test.lua b/test/tarantool-tests/misclib-getmetrics-lapi.test.lua > index 959293d..d54caac 100755 > --- a/test/tarantool-tests/misclib-getmetrics-lapi.test.lua > +++ b/test/tarantool-tests/misclib-getmetrics-lapi.test.lua > @@ -58,10 +58,10 @@ test:test("gc-allocated-freed", function(subtest) > until collectgarbage("count") == count > > -- Bump getmetrics table and string keys allocation. > - local old_metrics = misc.getmetrics() > + misc.getmetrics() Side note: This is a very elegant solution! Cool! > > -- Remember allocated size for getmetrics table. > - old_metrics = misc.getmetrics() > + local old_metrics = misc.getmetrics() > @@ -372,7 +372,7 @@ test:test("strhash", function(subtest) > assert(new_metrics.strhash_miss - old_metrics.strhash_miss == 0) > old_metrics = new_metrics > > - local str1 = "strhash".."_hit" > + local _ = "strhash".."_hit" > > new_metrics = misc.getmetrics() > assert(new_metrics.strhash_hit - old_metrics.strhash_hit == 20) > @@ -384,7 +384,7 @@ test:test("strhash", function(subtest) > assert(new_metrics.strhash_miss - old_metrics.strhash_miss == 0) > old_metrics = new_metrics > > - local str2 = "new".."string" > + local _ = "new".."string" Nit: this `local` is redundant. Feel free to ignore. > > new_metrics = misc.getmetrics() > assert(new_metrics.strhash_hit - old_metrics.strhash_hit == 19) > -- > 2.25.0 > -- Best regards, Sergey Kaplun