tests/qtest: replace assert(0) with g_assert_not_reached()

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>
This commit is contained in:
Pierrick Bouvier 2024-09-12 00:38:45 -07:00 committed by Thomas Huth
parent 8d5ab746b1
commit 74dcb2535d
3 changed files with 4 additions and 4 deletions

View file

@ -251,7 +251,7 @@ static void emu_msg_handler(void)
msg[msg_len++] = 0xa0; msg[msg_len++] = 0xa0;
write_emu_msg(msg, msg_len); write_emu_msg(msg, msg_len);
} else { } else {
g_assert(0); g_assert_not_reached();
} }
} }

View file

@ -145,7 +145,7 @@ static void kcs_cmd(uint8_t *cmd, unsigned int cmd_len,
break; break;
default: default:
g_assert(0); g_assert_not_reached();
} }
*rsp_len = j; *rsp_len = j;
} }
@ -184,7 +184,7 @@ static void kcs_abort(uint8_t *cmd, unsigned int cmd_len,
break; break;
default: default:
g_assert(0); g_assert_not_reached();
} }
/* Start the abort here */ /* Start the abort here */

View file

@ -65,7 +65,7 @@ PORT(IntrMask, w, 0x3c)
PORT(IntrStatus, w, 0x3E) PORT(IntrStatus, w, 0x3E)
PORT(TimerInt, l, 0x54) 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) static void test_timer(void)
{ {