[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v6 3/3] tests/qtest: Add STM32L4x5 EXTI QTest testcase
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [PATCH v6 3/3] tests/qtest: Add STM32L4x5 EXTI QTest testcase |
Date: |
Mon, 8 Jan 2024 22:31:50 +0100 |
User-agent: |
Mozilla Thunderbird |
Hi Inès,
On 8/1/24 19:03, Inès Varhol wrote:
Acked-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Arnaud Minier <arnaud.minier@telecom-paris.fr>
Signed-off-by: Inès Varhol <ines.varhol@telecom-paris.fr>
---
tests/qtest/meson.build | 5 +
tests/qtest/stm32l4x5_exti-test.c | 590 ++++++++++++++++++++++++++++++
2 files changed, 595 insertions(+)
create mode 100644 tests/qtest/stm32l4x5_exti-test.c
+static void test_reg_write_read(void)
+{
+ /* Test that non-reserved bits in xMR and xTSR can be set and cleared */
+
+ exti_writel(EXTI_IMR1, 0xFFFFFFFF);
+ uint32_t imr1 = exti_readl(EXTI_IMR1);
+ g_assert_cmpuint(imr1, ==, 0xFFFFFFFF);
+ exti_writel(EXTI_IMR1, 0x00000000);
+ imr1 = exti_readl(EXTI_IMR1);
+ g_assert_cmpuint(imr1, ==, 0x00000000);
+
+ exti_writel(EXTI_EMR1, 0xFFFFFFFF);
+ uint32_t emr1 = exti_readl(EXTI_EMR1);
Per QEMU Coding Style [*]:
Mixed declarations (interleaving statements and declarations within
blocks) are generally not allowed; declarations should be at the
beginning of blocks.
Up to the maintainers to accept as is or request a change. Personally
this looks good enough, so:
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
[*] https://qemu-project.gitlab.io/qemu/devel/style.html#declarations
+ g_assert_cmpuint(emr1, ==, 0xFFFFFFFF);
+ exti_writel(EXTI_EMR1, 0x00000000);
+ emr1 = exti_readl(EXTI_EMR1);
+ g_assert_cmpuint(emr1, ==, 0x00000000);
[...]