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: 13801590 Received: from mail-ot1-f51.google.com (mail-ot1-f51.google.com [209.85.210.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D9D9C18FDDE for ; Thu, 12 Sep 2024 07:39:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726126801; cv=none; b=TNX5i4rusQzmgRggPAJJWgMwI/RfdP3nU4sgcbrclKTsPS7wuYkngdbVZ4CAMJdhNW+tiKZk56Nkqu+4u2NgiabvokjOcLUm/u9w4YQRzm5AhKkuwrGsemWLutiOXPf1OMLOHFwq/2TMFOayNANBS9nGPpl2e2jupCqeIvz7zMY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726126801; c=relaxed/simple; bh=PhZK5jB8AGwL3Dlv0BhUdpfkS+HADWChfqJRb4K3skE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=tVm24yXcL5WwCmAfEAPQdFgpp4RwfNpP+jTh8VXm032feB8o9lsxikTfPYLkKetswadA4p201cpP09V9AzAFIO9zm6yujhb8YlUkNw0Nktr+I+x8QCgZE4BsJHR3K1lwJnTHLAG/ke+jzHK8EiCaGJZFE1zXOuTLuQopetM7D6E= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=j7sV1Fqh; arc=none smtp.client-ip=209.85.210.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="j7sV1Fqh" Received: by mail-ot1-f51.google.com with SMTP id 46e09a7af769-710da656c0bso235536a34.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=vger.kernel.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=j7sV1FqhTE4Nqy8h0xrxGU9XgX36n42LWilGltEUisefnL/LzDL7uCpr/imzv4O2fU fG4bgwND/HV/yYW0GpmkCGMB2vGxURVVrlik53cgatEPqOq6Ho5+SSUTLHb8jng7M3uw DClzoevD6eyhk4ybCd1mHPGQHmkV1te3MKVdDKx5AvP9MeH/sMazGCnCvehQVec4curt r+BYKcC0/CIYETm/mpmd8+bcUODDSSemrIz/TTnv3utHkeq+ZT0I0pIU6s0OBcbIUgW5 Ko+7vAd+0hAvqKSupb6RNq6nPVhmmKGfHGhDsOARxvSv8r+9kRqQ7wRs0ZywpxyQhJn9 4WLw== 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=V7fGEsZRiKIs8PSaReMrw6ln8Hv93MnMs8jVyeEseFgPah8OwsqcX+qPVqMM7J/Z9R ghc7eu/B/ecr5hrlO1RIeMLxDjTIoZVw3JVs2eTW3nyv1H8rvnXE71OyDZMwkgAj38IZ mtb9xW6JEwN4un0Y8EHrazLxpptUqbt9LeYOwA13qYCIeVfxhq8hmLaaOe393ux1QWjr HA41CBTWQBCteSFUCLaA/VM8MnFKGjb1tEp6xJANxq5xG4OOIUZ9VMexdxENjyr7uwBB Jv4DdQR1/dC7AY9X6kZCCg1RixV/TbXnhYAcZuc/zs3OZtqGqU+uZoRlnk5eIVPufALU 9akw== X-Forwarded-Encrypted: i=1; AJvYcCXc0MswY6LoMP5phdFV6gGkouAks1GiEPi2EupTxUt5ij3/JIQ8f9bI6+Sye5ssYR/35Z8=@vger.kernel.org X-Gm-Message-State: AOJu0YwH0SminX3quqDyljvdZostGRAwFGjhWQlJbWDbLG9EVTF/YvM/ ptu9f0lJI/tvMJTKewuutsTXnbzNPG9u5xGj4MmQK3GWLJ3Q0HVL6P97xtiA1hA= X-Google-Smtp-Source: AGHT+IG5ne8GTfzcAIBppwGJ8l4Yooy0KY6YC3wG/455mCNEr6eNEp84R9bb0cy5D5sMvEwevLyaeg== 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> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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) {