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 2C5456DDCD5; Fri, 10 Nov 2023 14:41:53 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 2C5456DDCD5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1699616513; bh=MyLfALyjuDnqCmd/BX5wfIQMhS2qX4LudD9kAkbjyQo=; h=Date:To:Cc:References:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=fX7jIAxsRquubWi4o0bIHHS//UuVeeUX/rt91vEbSMdF9tX8Tp8eDvt/iMv37oKqV T0nXiaIzI0uwOhZQCiSBm7QSMD5pNeJztCHN5cp3cOciRpr5X8hGmnP76fMKTAdNYB QtuwAHyhKcnOTHeDHWg1f1fx15BhaKHOlbrizzi8= Received: from smtp33.i.mail.ru (smtp33.i.mail.ru [95.163.41.74]) (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 87B886DDCD5 for ; Fri, 10 Nov 2023 14:41:51 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 87B886DDCD5 Received: by smtp33.i.mail.ru with esmtpa (envelope-from ) id 1r1PtW-00FQnX-2L; Fri, 10 Nov 2023 14:41:51 +0300 Message-ID: <639a0c42-13a6-4a2e-ac4f-6077b89ff6fe@tarantool.org> Date: Fri, 10 Nov 2023 14:41:50 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: Igor Munkin , Sergey Kaplun Cc: Sergey Bronnikov , max.kokryashkin@gmail.com, tarantool-patches@dev.tarantool.org References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD9C2A6B03AB739174C6C1832769EA9286E0D6FE4A60DB83BBE00894C459B0CD1B9FC04397851B124760098B508123FEB83D6BA8C4D3EAF433A495FBEDC84B91D45 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE78E8764B5BC580342EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006370EBB47D88F71BB738638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D88058DA85EB372150BD7CC484E2D8B0F1117882F4460429724CE54428C33FAD305F5C1EE8F4F765FC1BE95B8C87527B4BA471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F44604297287769387670735201E561CDFBCA1751FC26CFBAC0749D213D2E47CDBA5A96583BA9C0B312567BB2376E601842F6C81A19E625A9149C048EE9647ADFADE5905B17F16001415B11694D8FC6C240DEA76429C9F4D5AE37F343AA9539A8B242431040A6AB1C7CE11FEE34E7D9683544204AF040F9FF01DFDA4A8C4224003CC836476E2F48590F00D11D6E2021AF6380DFAD1A18204E546F3947CB861051D4BA689FC2E808ACE2090B5E1725E5C173C3A84C3C5EA940A35A165FF2DBA43225CD8A89F0A35B161A8BF67C157739F23D657EF2BB5C8C57E37DE458BEDA766A37F9254B7 X-C1DE0DAB: 0D63561A33F958A5794DAFB30D2DF38D9CAE827606ED8659BA6F1F98AB9CFFB8F87CCE6106E1FC07E67D4AC08A07B9B0B4B51A2BAB7FBE05BDAD6C7F3747799A X-C8649E89: 1C3962B70DF3F0ADBF74143AD284FC7177DD89D51EBB7742424CF958EAFF5D571004E42C50DC4CA955A7F0CF078B5EC49A30900B95165D3490011A262ADAEDFE8911DAC2D205BB4F356A3CD716B44B78C1897E93872EFE71E1F8C5B3B65BD6731D7E09C32AA3244C8F8EA4E524001C47A5C0F4CC8A73D77F24AF4FAF06DA24FDED9A463B7D0AAFF65DA084F8E80FEBD3FFA33E6B6B2F82C47A83BD0C44CE203720ABEDE4BBDD9CDD X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2bioj1d5ULkquG7zgg582hpdMVQ== X-Mailru-Sender: 11C2EC085EDE56FAC07928AF2646A7697BA514D710BBBD1E77A2E18B5DB66053825871508D9F3970EBA65886582A37BD66FEC6BF5C9C28D98A98C1125256619760D574B6FC815AB872D6B4FCE48DF648AE208404248635DF X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit 1/2] test: introduce asserts assert_str{_not}_equal 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" Hi, Igor On 11/1/23 11:28, Igor Munkin via Tarantool-patches wrote: > Sergey, > > On 01.11.23, Sergey Kaplun via Tarantool-patches wrote: >> Hi, Sergey! > > >> If some test fails we got the following output: >> >> | TAP version 13 >> | 1..1 >> | not ok 1 - lua_concat_testcase >> | --- >> | location: /home/burii/reviews/luajit/lj-881-lua-concat/test/tarantool-c-tests/lj-881-fix-lua-concat.test.c:81 >> | failed_assertion: assert_str_equal >> | got: 1652880104 >> | expected: -1138225337 >> | ... >> | # Failed 1 tests out of 1 >> >> Failed assertion field is incorrect (see the comment above). >> But the most important is "got" and "expected" fields, that returns the >> addresses of strings, which isn't very meaningful. >> >> I suggest dumping the strings instead if they are not long enough (less >> than 128 symbols, I suppose). The maxdump string length should be >> a customizeable parameter. I suggest defining a macro `MAX_DUMP_STRLEN` >> inside the header. So the user can redefine it before the >> `assert_str_{not_}equal()` and use a custom value. >> >> If the string is too long, we should dump the offset of the mismatched >> symbol. Or maybe it's better to always dump it. >> >> Thoughts? > What if the different part starts after 128 symbols? I believe the most > valuable part is the one where the difference starts, so you have to > dump the beginning (for convenience), the difference and some numeric > parameters (length, offset where strings differ, etc). > > Furthermore, I suggest implementing <*_str_*> helpers for nul-terminated > strings and <*_mem_*> helpers for length limited memory blobs. I would postpone implementation of  <*_mem_*> helpers until we will need them in tests. > >> Side note: >> >> Also, this comparing "by eye" isn't very convenient if values aren't >> aligned, so maybe it is better to use spaces instead of tabs to align >> values? This may be added within the separate patch series later. > I believe, this is quite minor thing (at least for now). > > > >> -- >> Best regards, >> Sergey Kaplun