[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 08/17] tests/qtest: replace assert(0) with g_assert_not_reached()
From: |
Thomas Huth |
Subject: |
[PULL 08/17] tests/qtest: replace assert(0) with g_assert_not_reached() |
Date: |
Tue, 17 Sep 2024 12:35:31 +0200 |
From: Pierrick Bouvier <pierrick.bouvier@linaro.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 <richard.henderson@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Message-ID: <20240912073921.453203-13-pierrick.bouvier@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
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 383239bcd4..13f7c841f5 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 afc24dd3e4..3186c6ad64 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 eedf90f65a..55f671f2f5 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)
{
--
2.46.0
- [PULL 00/17] s390x and test patches, Thomas Huth, 2024/09/17
- [PULL 01/17] tests/qtest/cdrom-test: Improve the machine detection in the cdrom test, Thomas Huth, 2024/09/17
- [PULL 03/17] tests/qtest/hd-geo-test: Check for availability of "pc" machine before using it, Thomas Huth, 2024/09/17
- [PULL 02/17] tests/qtest/boot-order-test: Make the machine name mandatory in this test, Thomas Huth, 2024/09/17
- [PULL 05/17] tests/qtest: Disable numa-test if the default machine is not available, Thomas Huth, 2024/09/17
- [PULL 04/17] tests/qtest/meson.build: Add more CONFIG switches checks for the x86 tests, Thomas Huth, 2024/09/17
- [PULL 06/17] .gitlab-ci.d/buildtest: Build most targets in the build-without-defaults job, Thomas Huth, 2024/09/17
- [PULL 07/17] gitlab: fix logic for changing docker tag on stable branches, Thomas Huth, 2024/09/17
- [PULL 08/17] tests/qtest: replace assert(0) with g_assert_not_reached(),
Thomas Huth <=
- [PULL 09/17] tests/unit: replace assert(0) with g_assert_not_reached(), Thomas Huth, 2024/09/17
- [PULL 10/17] include/hw/s390x: replace assert(false) with g_assert_not_reached(), Thomas Huth, 2024/09/17
- [PULL 14/17] system: Enable the device aliases for or1k, too, Thomas Huth, 2024/09/17
- [PULL 16/17] tests/functional: Move the mips64el fuloong2e test into the thorough category, Thomas Huth, 2024/09/17
- [PULL 13/17] system: Sort QEMU_ARCH_VIRTIO_PCI definition, Thomas Huth, 2024/09/17
- [PULL 11/17] tests/qtest: replace assert(false) with g_assert_not_reached(), Thomas Huth, 2024/09/17
- [PULL 15/17] docs/fuzz: fix outdated mention to enable-sanitizers, Thomas Huth, 2024/09/17
- [PULL 12/17] tests/qtest: remove break after g_assert_not_reached(), Thomas Huth, 2024/09/17
- [PULL 17/17] .gitlab-ci.d/crossbuilds.yml: Force 'make check' to -j2 for cross-i686-tci, Thomas Huth, 2024/09/17
- Re: [PULL 00/17] s390x and test patches, Peter Maydell, 2024/09/17