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 C135570310; Mon, 8 Feb 2021 18:40:27 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org C135570310 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1612798827; bh=Cry+rSWR4tuy9X8ByUiZlJdiyA1fFUYlb6cOciaeb4s=; h=To:References:Date:In-Reply-To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=V1efQeptVG9LNADhNpD2AwbBqDBcipRCK+2pZM/Or820xcso6q3q1jKQgPF4e09Cu /R9cykblG+yVJmG/jJ1Fql0/jrfOfcK7YVfgPeS/UxUD77jNV9GV2ZzMlWSHDbGHfb ByPzRJtvDR0tXA2adTFdVQYzKNgibAmcdr+HLGjk= Received: from smtpng2.m.smailru.net (smtpng2.m.smailru.net [94.100.179.3]) (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 B39C870310 for ; Mon, 8 Feb 2021 18:40:26 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org B39C870310 Received: by smtpng2.m.smailru.net with esmtpa (envelope-from ) id 1l98eC-00015J-OT; Mon, 08 Feb 2021 18:40:21 +0300 To: 'Igor Munkin' , Timur Safin , 'Sergey Kaplun' , tarantool-patches@dev.tarantool.org References: <2db1d3a53682de0bb4231ec494fc44e95acd9a8f.1612291495.git.imun@tarantool.org> <012f01d6fe1a$a2aa6890$e7ff39b0$@tarantool.org> <2c495492-50f4-acfd-ad66-2cb44abb5fa1@tarantool.org> Message-ID: Date: Mon, 8 Feb 2021 18:40:20 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <2c495492-50f4-acfd-ad66-2cb44abb5fa1@tarantool.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-7564579A: 78E4E2B564C1792B X-77F55803: 4F1203BC0FB41BD953AC099BC0052A9C55152E5B36F70094641E3870F0CF5304182A05F53808504038AA7B855B8B5C4F7878B422F2EA03B85ACC8B7BFCF22298431EAF89AE117162 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7FEAC828D2BF6EC3CEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006371DF52D98DC3592C48638F802B75D45FF5571747095F342E8C7A0BC55FA0FE5FC92A7252287DEBD85F6B710A0C93AE3EB9815DFEB5E079C34389733CBF5DBD5E913377AFFFEAFD269176DF2183F8FC7C0ECC8AC47CD0EDEFF8941B15DA834481FCF19DD082D7633A0EF3E4896CB9E6436389733CBF5DBD5E9D5E8D9A59859A8B6AEEA5BB16A939343CC7F00164DA146DA6F5DAA56C3B73B23C77107234E2CFBA567F23339F89546C55F5C1EE8F4F765FC8F8100A08BBC9ED475ECD9A6C639B01BBD4B6F7A4D31EC0BC0CAF46E325F83A522CA9DD8327EE4930A3850AC1BE2E7351337B709B3801B10C4224003CC836476C0CAF46E325F83A50BF2EBBBDD9D6B0F05F538519369F3743B503F486389A921A5CC5B56E945C8DA X-C1DE0DAB: 0D63561A33F958A50140957088D23EC3B1743E5B850856EF1E652F0F901FFF8AD59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA75448CF9D3A7B2C848410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34C6EC1BD9807109D26C02041318BB14C474F0446B4D69CE6540CB218FE5190BEE6B7650BF68A224FB1D7E09C32AA3244C3ECCC1670FA5931EA09C17689CCFC4CEF165894D92D62706927AC6DF5659F194 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojMxr0zTsJFiR/SYskcFNb4A== X-Mailru-Sender: 689FA8AB762F73936BC43F508A0638229BEB9D5449B97FAEC40A6F9E176C3E1DDD788429FD8613638ED9BB8B05EE7B3AFB559BB5D741EB96D19CD4E7312BAA970A04DAD6CC59E33667EA787935ED9F1B 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 Bronnikov via Tarantool-patches Reply-To: Sergey Bronnikov Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" + tarantool-patches On 08.02.2021 18:19, Sergey Bronnikov wrote: > Thanks for the patch! > > LGTM > >> : -----Original Message----- >> : From: Tarantool-patches >> On >> : Behalf Of Igor Munkin via Tarantool-patches >> : Subject: [Tarantool-patches] [PATCH luajit 4/5] test: fix warnings >> found >> : with luacheck in misclib* >> : >> : 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 >> : 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 >> :          -- 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 >> : >> : -    placeholder = nil >> : +    placeholder = nil -- luacheck: no unused >> :      -- Restore default jit settings. >> :      jit.opt.start(unpack(jit_opt_default)) >> :  end)) >> : @@ -69,15 +69,11 @@ end)) >> :  test:ok(testgetmetrics.snap_restores(function() >> :      jit.opt.start(0, "hotloop=1") >> : >> : -    local old_metrics = misc.getmetrics() >> : - >> :      local sum = 0 >> :      for i = 1, 20 do >> :          sum = sum + i >> :      end >> : >> : -    local new_metrics = misc.getmetrics() >> : - >> :      -- Restore default jit settings. >> :      jit.opt.start(unpack(jit_opt_default)) >> : >> : 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() >> : >> :      -- Remember allocated size for getmetrics table. >> : -    old_metrics = misc.getmetrics() >> : +    local old_metrics = misc.getmetrics() >> : >> :      collectgarbage("collect") >> : >> : @@ -77,7 +77,7 @@ test:test("gc-allocated-freed", function(subtest) >> :      -- (such as concatenation, string.format, table.concat) >> :      -- while creating the string. Otherwise gc_freed/gc_allocated >> :      -- relations will not be so straightforward. >> : -    local str = string.sub("Hello, world", 1, 5) >> : +    local str = string.sub("Hello, world", 1, 5) -- luacheck: no >> unused >> :      collectgarbage("collect") >> : >> :      new_metrics = misc.getmetrics() >> : @@ -196,29 +196,29 @@ test:test("objcount", function(subtest) >> :      } >> : >> :      -- Separate objects creations to separate jit traces. >> : -    for i = 1, 1000 do >> : -        table.insert(placeholder.str, tostring(i)) >> : +    for _ = 1, 1000 do >> : +        table.insert(placeholder.str, tostring(_)) >> :      end >> : >> : -    for i = 1, 1000 do >> : -        table.insert(placeholder.tab, {i}) >> : +    for _ = 1, 1000 do >> : +        table.insert(placeholder.tab, {_}) >> :      end >> : >> : -    for i = 1, 1000 do >> : +    for _ = 1, 1000 do >> :          table.insert(placeholder.udata, newproxy()) >> :      end >> : >> : -    for i = 1, 1000 do >> : +    for _ = 1, 1000 do >> :          -- Check counting of VLA/VLS/aligned cdata. >> :          table.insert(placeholder.cdata, ffi.new("char[?]", 4)) >> :      end >> : >> : -    for i = 1, 1000 do >> : +    for _ = 1, 1000 do >> :          -- 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 >> : >> : -    placeholder = nil >> : +    placeholder = nil -- luacheck: no unused >> :      collectgarbage("collect") >> :      local new_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" >> : >> :      new_metrics = misc.getmetrics() >> :      assert(new_metrics.strhash_hit - old_metrics.strhash_hit == 19) >> : -- >> : 2.25.0 >> >>