summary refs log tree commit diff stats
path: root/tests/qtest/stm32l4x5_gpio-test.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2024-11-15 16:50:40 +0000
committerFabiano Rosas <farosas@suse.de>2024-12-12 10:25:38 -0300
commit9881d3d1687d1f18dc605a589d13ae5b8a9db456 (patch)
treeb1d780b5bd81eec80e9f63a61cb87d4665aebb5a /tests/qtest/stm32l4x5_gpio-test.c
parent6b76264ed0fed402df09aab8edacf1ee03d87c7f (diff)
downloadfocaccia-qemu-9881d3d1687d1f18dc605a589d13ae5b8a9db456.tar.gz
focaccia-qemu-9881d3d1687d1f18dc605a589d13ae5b8a9db456.zip
tests/qtest: Use qtest_system_reset() instead of open-coded versions
Use the qtest_system_reset() function in various tests that were
previously open-coding the system-reset. Note that in several
cases this fixes a bug where the test did not wait for the RESET
QMP event before continuing.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Fabiano Rosas <farosas@suse.de>
Diffstat (limited to 'tests/qtest/stm32l4x5_gpio-test.c')
-rw-r--r--tests/qtest/stm32l4x5_gpio-test.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/tests/qtest/stm32l4x5_gpio-test.c b/tests/qtest/stm32l4x5_gpio-test.c
index c0686c7b30..3c6ea71feb 100644
--- a/tests/qtest/stm32l4x5_gpio-test.c
+++ b/tests/qtest/stm32l4x5_gpio-test.c
@@ -169,14 +169,6 @@ static uint32_t reset(uint32_t gpio, unsigned int offset)
     return 0x0;
 }
 
-static void system_reset(void)
-{
-    QDict *r;
-    r = qtest_qmp(global_qtest, "{'execute': 'system_reset'}");
-    g_assert_false(qdict_haskey(r, "error"));
-    qobject_unref(r);
-}
-
 static void test_idr_reset_value(void)
 {
     /*
@@ -214,7 +206,7 @@ static void test_idr_reset_value(void)
     gpio_writel(GPIO_H, OTYPER, 0xDEADBEEF);
     gpio_writel(GPIO_H, PUPDR, 0xDEADBEEF);
 
-    system_reset();
+    qtest_system_reset(global_qtest);
 
     uint32_t moder = gpio_readl(GPIO_A, MODER);
     uint32_t odr = gpio_readl(GPIO_A, ODR);