From patchwork Thu Sep 12 07:38:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 827827 Delivered-To: patch@linaro.org Received: by 2002:adf:ab1c:0:b0:367:895a:4699 with SMTP id q28csp1144701wrc; Thu, 12 Sep 2024 00:51:45 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVPCqpON2xdbQsCpRdhG4Y/3//k4dhzIQjLAs5BnnR4bA8wqBJkGO/ItTUKpwcn2hQeVz7mQA==@linaro.org X-Google-Smtp-Source: AGHT+IEl3XwbJ1x1sHqdg514JygOAJRj6VKeqOsszPWQZByrwUUgNs65SenCQ/H7R/efvS63inzB X-Received: by 2002:a05:6214:398d:b0:6c5:52fa:29e5 with SMTP id 6a1803df08f44-6c57351dc2bmr31607046d6.22.1726127505263; Thu, 12 Sep 2024 00:51:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1726127505; cv=none; d=google.com; s=arc-20240605; b=YWk1G6hSUjlkercZ4Gh7cMs/2dL+H/Mof3ACh5mN0d72n7mF0F/dffLAwHol5uWhlB ck9h0T2vssMC7NlEvmQBT46UU3b1k10je+H1/w68+kQGu+vCKGtQie6STZHfFDjqAX3U 1Hbuz1fsMo8BrctAm7eOAlSr8TfN2RtInmYYlm0q4ae2XM1/w20QOAiuh64YZJteDE1t bKHzVc2yh1RgtU7nhFZXrGcbqJMeYYFWQLLByrrPG6U3QL1slv3bqvXmO7sFaQ04Umgx WVVv+acRjtl2xsDJ8st/VWhUAEgZXkxGUnaR0p/I9jZn8pYTiLv1T2I4F5zt4f/R3VjN eGIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=/E70KJJTPx2V75BYTTVlugDcxiGJ3PzFoLEiBX1aDhc=; fh=9lXHm2cv0EOsvaESlQxkp+iopfNbpS2ZXLeBYSea/ko=; b=ZFjssAA9vIhL4A5zpTMeWA+EFh0+TcJ9B9xH1uRAXbQKkWzWShi+BVry9oJOcxNBga Bq+N0/L9qWEbIU7yjkhTeqJ7hJefInnse6eBT0+zF9uBVGuWst79p+qaeZnl2uP/+yDG UMb4tDapE6PUZAqhv416oP/Gvcq5bT33mrS7hJLmfwnRYv+eYWA4yAnoiZN5R38SUZih EFKRXNnR6xvdORskEQCMR41sZtiVWXt+0MCNEnZcs4mLrQZkE5Tcc5QxTGeknc5j+s0O 4NH4BRbuzn9R7yW/DR9j4bDtjpYukMl0LsKq6wPjewU3bkQ5YVq8LAn0b0HP0SHqo+Q7 /8/g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NBt0kJq2; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6c5348c8d4fsi121665626d6.565.2024.09.12.00.51.45 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 12 Sep 2024 00:51:45 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NBt0kJq2; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1soeRf-0006D3-07; Thu, 12 Sep 2024 03:40:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1soeQr-0002f3-P1 for qemu-devel@nongnu.org; Thu, 12 Sep 2024 03:40:02 -0400 Received: from mail-ot1-x332.google.com ([2607:f8b0:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1soeQp-0000Iw-Jp for qemu-devel@nongnu.org; Thu, 12 Sep 2024 03:40:01 -0400 Received: by mail-ot1-x332.google.com with SMTP id 46e09a7af769-710da656c0bso235528a34.0 for ; Thu, 12 Sep 2024 00:39:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1726126798; x=1726731598; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=/E70KJJTPx2V75BYTTVlugDcxiGJ3PzFoLEiBX1aDhc=; b=NBt0kJq29ZrdVYnNEiFbNvx3zWegkEfso4uyW6P4UKfl9HP6JSpW0UP5HM1GNGeiyT FXKIdZN+K10sN60PbTcTtWtmYM2dJIxvyxAuNcez9+NeN3Ab57NjRYaUiwAOFDi6Yh98 EwyUuWCU5uaM+OX2P3Gz7pfQ1+adCADPfuJzfbwjHDTSgV2QbBkKYoa7HKP/iJu7w8fm H2bo/3rk11hQq9plVG00btD/97GM6MQsHtkklxkxZ39vMCz0cY1RoE93Y5W2BqblTNEP 6YnnFsiCsZjuzoHB8FJP8wsSHQARA5q60NJyvxnYuIPXHIE4Je1KM0DVhowegOX/Zhts DMdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726126798; x=1726731598; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/E70KJJTPx2V75BYTTVlugDcxiGJ3PzFoLEiBX1aDhc=; b=hec9Z85A3Jl/VAb3x//eo7Cr95QaDGgMnMYLPSCynHaTCBKCr6bdtDSrPLfrat8Mht HdfT3ZhEWg6Vtf6hOCO/c3JerxiCfdRbF2Kna5WyHaUOOw3PIOHP8byNXBkYSBf6kWWj EZ/2CGcwqNPzEeDlenhTs0MkVzsiJdF19IGc0y6RzOE/7d0FJjLHG+eJqxIM37d6ZM5a FucWL92Skzq3GRkZBR2UHeoV08c09ydbwnJwZnQoRVtqgdCazO+moSh0WQufVtaefF3b k+frVYjgHa1TDwUSQHvhD07gd08jRtmxdX2H+GopXI+JVpjogmWKQtnHIpFiAQB5LQnR UZYg== X-Gm-Message-State: AOJu0YzCcyBXOqCW2WhYLNS14whbAZT/7tStdUj/2pmihinDk6Rn8MpL RYcw7OxxKVwzQImSFGfcX4yEFsgjS0JDHH/QCkhBv6kZN5LY3vSLkINiq4tWP6S7F3fKXCDAmRX ipd/b5zUN X-Received: by 2002:a05:6830:d02:b0:710:bffc:a28e with SMTP id 46e09a7af769-7110949a084mr1707232a34.19.1726126797795; Thu, 12 Sep 2024 00:39:57 -0700 (PDT) Received: from linaro.vn.shawcable.net ([2604:3d08:9384:1d00::9633]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-7db1fb9ad87sm983458a12.6.2024.09.12.00.39.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Sep 2024 00:39:57 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Jason Wang , =?utf-8?q?Alex_Benn=C3=A9e?= , Laurent Vivier , Marcelo Tosatti , Nicholas Piggin , Klaus Jensen , WANG Xuerui , Halil Pasic , Rob Herring , Michael Rolnik , Zhao Liu , Peter Maydell , Richard Henderson , Fabiano Rosas , Corey Minyard , Keith Busch , Thomas Huth , "Maciej S. Szmigiero" , Harsh Prateek Bora , Kevin Wolf , Paolo Bonzini , Jesper Devantier , Hyman Huang , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Palmer Dabbelt , qemu-s390x@nongnu.org, Laurent Vivier , qemu-riscv@nongnu.org, "Richard W.M. Jones" , Liu Zhiwei , Aurelien Jarno , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Marcel Apfelbaum , kvm@vger.kernel.org, Christian Borntraeger , Akihiko Odaki , Daniel Henrique Barboza , Hanna Reitz , Ani Sinha , qemu-ppc@nongnu.org, =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Alistair Francis , Bin Meng , "Michael S. Tsirkin" , Helge Deller , Peter Xu , Daniel Henrique Barboza , Dmitry Fleytman , Nina Schoetterl-Glausch , Yanan Wang , qemu-arm@nongnu.org, Igor Mammedov , Jean-Christophe Dubois , Eric Farman , Sriram Yagnaraman , qemu-block@nongnu.org, Stefan Berger , Joel Stanley , Eduardo Habkost , David Gibson , Fam Zheng , Weiwei Li , Markus Armbruster , Pierrick Bouvier Subject: [PATCH v2 12/48] tests/qtest: replace assert(0) with g_assert_not_reached() Date: Thu, 12 Sep 2024 00:38:45 -0700 Message-Id: <20240912073921.453203-13-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240912073921.453203-1-pierrick.bouvier@linaro.org> References: <20240912073921.453203-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::332; envelope-from=pierrick.bouvier@linaro.org; helo=mail-ot1-x332.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org This patch is part of a series that moves towards a consistent use of g_assert_not_reached() rather than an ad hoc mix of different assertion mechanisms. Reviewed-by: Richard Henderson Reviewed-by: Thomas Huth Signed-off-by: Pierrick Bouvier --- tests/qtest/ipmi-bt-test.c | 2 +- tests/qtest/ipmi-kcs-test.c | 4 ++-- tests/qtest/rtl8139-test.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/qtest/ipmi-bt-test.c b/tests/qtest/ipmi-bt-test.c index 383239bcd48..13f7c841f59 100644 --- a/tests/qtest/ipmi-bt-test.c +++ b/tests/qtest/ipmi-bt-test.c @@ -251,7 +251,7 @@ static void emu_msg_handler(void) msg[msg_len++] = 0xa0; write_emu_msg(msg, msg_len); } else { - g_assert(0); + g_assert_not_reached(); } } diff --git a/tests/qtest/ipmi-kcs-test.c b/tests/qtest/ipmi-kcs-test.c index afc24dd3e46..3186c6ad64b 100644 --- a/tests/qtest/ipmi-kcs-test.c +++ b/tests/qtest/ipmi-kcs-test.c @@ -145,7 +145,7 @@ static void kcs_cmd(uint8_t *cmd, unsigned int cmd_len, break; default: - g_assert(0); + g_assert_not_reached(); } *rsp_len = j; } @@ -184,7 +184,7 @@ static void kcs_abort(uint8_t *cmd, unsigned int cmd_len, break; default: - g_assert(0); + g_assert_not_reached(); } /* Start the abort here */ diff --git a/tests/qtest/rtl8139-test.c b/tests/qtest/rtl8139-test.c index eedf90f65af..55f671f2f59 100644 --- a/tests/qtest/rtl8139-test.c +++ b/tests/qtest/rtl8139-test.c @@ -65,7 +65,7 @@ PORT(IntrMask, w, 0x3c) PORT(IntrStatus, w, 0x3E) PORT(TimerInt, l, 0x54) -#define fatal(...) do { g_test_message(__VA_ARGS__); g_assert(0); } while (0) +#define fatal(...) do { g_test_message(__VA_ARGS__); g_assert_not_reached(); } while (0) static void test_timer(void) {