From nobody Wed Nov 5 13:14:13 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1536606590552544.3617903532588; Mon, 10 Sep 2018 12:09:50 -0700 (PDT) Received: from localhost ([::1]:53578 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fzRZF-0000U0-HO for importer@patchew.org; Mon, 10 Sep 2018 15:09:49 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49208) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fzRPS-0001JP-Ic for qemu-devel@nongnu.org; Mon, 10 Sep 2018 14:59:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fzRPQ-0001Ej-7S for qemu-devel@nongnu.org; Mon, 10 Sep 2018 14:59:42 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:36299) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fzRPP-00013L-KI for qemu-devel@nongnu.org; Mon, 10 Sep 2018 14:59:39 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 8F4F221C5F; Mon, 10 Sep 2018 14:59:07 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Mon, 10 Sep 2018 14:59:07 -0400 Received: from localhost (flamenco.cs.columbia.edu [128.59.20.216]) by mail.messagingengine.com (Postfix) with ESMTPA id 31F3B102A9; Mon, 10 Sep 2018 14:59:07 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=braap.org; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=mesmtp; bh=mDW1bpU8LZHVmYbAuYwFaDzRgC kzPTfrTIP6+P4z2yY=; b=GQWri1QSnEufh5xLYqnHiItFdyfALkJRnmYsE4lFlx E0yiM0kbTx8ywIZwoyqQ5+KA/JCBl4KTvK1r2nmm/Xu/m7w9W0pxmm0FaspCPai8 FynhGMT7RePFcP3o/p4bE1edZRV3Ot0oFIk/T39UivyZJx+smTMP8RlZTXMBhBOm c= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=mDW1bp U8LZHVmYbAuYwFaDzRgCkzPTfrTIP6+P4z2yY=; b=D0LFp46cExt4EG2DmH+tf0 AaruVGeNC6Nl1Bf6CI9Cc+GhTgBo+vam9BwW6O5Ufvg0oos1iUeHnK9RFWak5HLD 0KPC0IPe+YkuquZCsySMZYZSK5xLA1GHs0Lz/fe1e3p9AlvzXZIpjptcdMQ3OdXh FinCKISLXnPz762GRoqAiksb1jEKzJ3z27nutu0evmphcu40A20o54Py4MD1nXL9 yQRRRndVhd9unmftf/6FDKjlmp8xIB6Bjm+24gbVWjVqgKaanxBVBKBpasiCltoB pgNuNjhkEWrrZBfV/dAR0gx2eLe7BzQ4eEQCy9psLRRLTYnuGDTlV8SY7VGa2X3g == X-ME-Proxy: X-ME-Sender: From: "Emilio G. Cota" To: qemu-devel@nongnu.org Date: Mon, 10 Sep 2018 14:58:52 -0400 Message-Id: <20180910185859.27917-6-cota@braap.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180910185859.27917-1-cota@braap.org> References: <20180910185859.27917-1-cota@braap.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 66.111.4.25 Subject: [Qemu-devel] [PATCH v2 05/12] test-qht: test deletion of the last entry in a bucket X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 This improves coverage by one (!) LoC in qht.c, bringing the coverage rate up from 90.00% to 90.28%. Reviewed-by: Alex Benn=C3=A9e Signed-off-by: Emilio G. Cota --- tests/test-qht.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/tests/test-qht.c b/tests/test-qht.c index 05b1d6807a..77666e8c5f 100644 --- a/tests/test-qht.c +++ b/tests/test-qht.c @@ -172,9 +172,20 @@ static void qht_do_test(unsigned int mode, size_t init= _entries) =20 qht_init(&ht, is_equal, 0, mode); rm_nonexist(0, 4); + /* + * Test that we successfully delete the last element in a bucket. + * This is a hard-to-reach code path when resizing is on, but without + * resizing we can easily hit it if init_entries <=3D 1. + * Given that the number of elements per bucket can be 4 or 6 dependin= g on + * the host's pointer size, test the removal of the 4th and 6th elemen= ts. + */ insert(0, 4); rm_nonexist(5, 6); - insert(4, 6); + rm(3, 4); + check_n(3); + insert(3, 6); + rm(5, 6); + check_n(5); rm_nonexist(7, 8); iter_rm_mod(1); =20 --=20 2.17.1