]> xenbits.xensource.com Git - people/aperard/qemu-dm.git/commitdiff
tests/qtest: replace assert(0) with g_assert_not_reached()
authorPierrick Bouvier <pierrick.bouvier@linaro.org>
Thu, 12 Sep 2024 07:38:45 +0000 (00:38 -0700)
committerThomas Huth <thuth@redhat.com>
Tue, 17 Sep 2024 08:50:39 +0000 (10:50 +0200)
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
tests/qtest/ipmi-kcs-test.c
tests/qtest/rtl8139-test.c

index 383239bcd48e9b98a569c5aa10b9846cfb339040..13f7c841f59a7167e37299b586fa052357e96722 100644 (file)
@@ -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();
     }
 }
 
index afc24dd3e460821d291b16802c52766af9730ee0..3186c6ad64bd50c6c7a4d7de26b4a6736de046d4 100644 (file)
@@ -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 */
index eedf90f65af88bfae73183425029c2c586f5df78..55f671f2f592634a909f4b0d0e143823c410bd45 100644 (file)
@@ -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)
 {