From: Ninad Palsule <ninad@linux.ibm.com>
To: "Inès Varhol" <ines.varhol@telecom-paris.fr>, qemu-devel@nongnu.org
Cc: "Thomas Huth" <thuth@redhat.com>,
"Andrew Jeffery" <andrew@codeconstruct.com.au>,
"Joel Stanley" <joel@jms.id.au>,
"Cédric Le Goater" <clg@kaod.org>,
qemu-block@nongnu.org,
"Arnaud Minier" <arnaud.minier@telecom-paris.fr>,
"Samuel Tardieu" <samuel.tardieu@telecom-paris.fr>,
qemu-arm@nongnu.org, "Peter Maydell" <peter.maydell@linaro.org>,
"John Snow" <jsnow@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Laurent Vivier" <lvivier@redhat.com>
Subject: Re: [PATCH v2] tests/qtest : Use `g_assert_cmphex` instead of `g_assert_cmpuint`
Date: Tue, 16 Apr 2024 06:54:47 -0500 [thread overview]
Message-ID: <a860264b-e1e4-4d10-87f7-a95f0eee4e01@linux.ibm.com> (raw)
In-Reply-To: <20240414173349.31194-1-ines.varhol@telecom-paris.fr>
On 4/14/24 12:28, Inès Varhol wrote:
> The messages for assertions using hexadecimal numbers will be
> easier to understand with `g_assert_cmphex`.
>
> Cases changed : "cmpuint.*0x", "cmpuint.*<<"
>
> Signed-off-by: Inès Varhol <ines.varhol@telecom-paris.fr>
> ---
> tests/qtest/aspeed_fsi-test.c | 20 ++--
> tests/qtest/cmsdk-apb-dualtimer-test.c | 2 +-
> tests/qtest/cmsdk-apb-watchdog-test.c | 2 +-
> tests/qtest/erst-test.c | 2 +-
> tests/qtest/ivshmem-test.c | 10 +-
> tests/qtest/libqos/ahci.c | 4 +-
> tests/qtest/microbit-test.c | 46 ++++-----
> tests/qtest/sse-timer-test.c | 4 +-
> tests/qtest/stm32l4x5_exti-test.c | 138 ++++++++++++-------------
> tests/qtest/stm32l4x5_syscfg-test.c | 74 ++++++-------
> 10 files changed, 151 insertions(+), 151 deletions(-)
>
> diff --git a/tests/qtest/aspeed_fsi-test.c b/tests/qtest/aspeed_fsi-test.c
> index b3020dd821..f5ab269972 100644
> --- a/tests/qtest/aspeed_fsi-test.c
> +++ b/tests/qtest/aspeed_fsi-test.c
> @@ -63,22 +63,22 @@ static void test_fsi_setup(QTestState *s, uint32_t base_addr)
> /* Unselect FSI1 */
> aspeed_fsi_writel(s, ASPEED_FSI_OPB1_BUS_SELECT, 0x0);
> curval = aspeed_fsi_readl(s, ASPEED_FSI_OPB1_BUS_SELECT);
> - g_assert_cmpuint(curval, ==, 0x0);
> + g_assert_cmphex(curval, ==, 0x0);
>
> /* Select FSI0 */
> aspeed_fsi_writel(s, ASPEED_FSI_OPB0_BUS_SELECT, 0x1);
> curval = aspeed_fsi_readl(s, ASPEED_FSI_OPB0_BUS_SELECT);
> - g_assert_cmpuint(curval, ==, 0x1);
> + g_assert_cmphex(curval, ==, 0x1);
> } else if (base_addr == AST2600_OPB_FSI1_BASE_ADDR) {
> /* Unselect FSI0 */
> aspeed_fsi_writel(s, ASPEED_FSI_OPB0_BUS_SELECT, 0x0);
> curval = aspeed_fsi_readl(s, ASPEED_FSI_OPB0_BUS_SELECT);
> - g_assert_cmpuint(curval, ==, 0x0);
> + g_assert_cmphex(curval, ==, 0x0);
>
> /* Select FSI1 */
> aspeed_fsi_writel(s, ASPEED_FSI_OPB1_BUS_SELECT, 0x1);
> curval = aspeed_fsi_readl(s, ASPEED_FSI_OPB1_BUS_SELECT);
> - g_assert_cmpuint(curval, ==, 0x1);
> + g_assert_cmphex(curval, ==, 0x1);
> } else {
> g_assert_not_reached();
> }
> @@ -145,11 +145,11 @@ static void test_fsi0_getcfam_addr0(const void *data)
> aspeed_fsi_writel(s, ASPEED_FSI_ENGINER_TRIGGER, 0x1);
>
> curval = aspeed_fsi_readl(s, ASPEED_FSI_INTRRUPT_STATUS);
> - g_assert_cmpuint(curval, ==, 0x10000);
> + g_assert_cmphex(curval, ==, 0x10000);
> curval = aspeed_fsi_readl(s, ASPEED_FSI_OPB0_BUS_STATUS);
> - g_assert_cmpuint(curval, ==, 0x0);
> + g_assert_cmphex(curval, ==, 0x0);
> curval = aspeed_fsi_readl(s, ASPEED_FSI_OPB0_READ_DATA);
> - g_assert_cmpuint(curval, ==, 0x152d02c0);
> + g_assert_cmphex(curval, ==, 0x152d02c0);
> }
>
> static void test_fsi1_getcfam_addr0(const void *data)
> @@ -168,11 +168,11 @@ static void test_fsi1_getcfam_addr0(const void *data)
> aspeed_fsi_writel(s, ASPEED_FSI_ENGINER_TRIGGER, 0x1);
>
> curval = aspeed_fsi_readl(s, ASPEED_FSI_INTRRUPT_STATUS);
> - g_assert_cmpuint(curval, ==, 0x20000);
> + g_assert_cmphex(curval, ==, 0x20000);
> curval = aspeed_fsi_readl(s, ASPEED_FSI_OPB1_BUS_STATUS);
> - g_assert_cmpuint(curval, ==, 0x0);
> + g_assert_cmphex(curval, ==, 0x0);
> curval = aspeed_fsi_readl(s, ASPEED_FSI_OPB1_READ_DATA);
> - g_assert_cmpuint(curval, ==, 0x152d02c0);
> + g_assert_cmphex(curval, ==, 0x152d02c0);
> }
>
aspeed-fsi-test changes looks good. Thanks
Reviewed-by: Ninad Palsule <ninad@linux.ibm.com>
prev parent reply other threads:[~2024-04-16 11:55 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-14 17:28 [PATCH v2] tests/qtest : Use `g_assert_cmphex` instead of `g_assert_cmpuint` Inès Varhol
2024-04-15 7:35 ` Philippe Mathieu-Daudé
2024-04-16 11:54 ` Ninad Palsule [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a860264b-e1e4-4d10-87f7-a95f0eee4e01@linux.ibm.com \
--to=ninad@linux.ibm.com \
--cc=andrew@codeconstruct.com.au \
--cc=arnaud.minier@telecom-paris.fr \
--cc=clg@kaod.org \
--cc=ines.varhol@telecom-paris.fr \
--cc=joel@jms.id.au \
--cc=jsnow@redhat.com \
--cc=lvivier@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=philmd@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=samuel.tardieu@telecom-paris.fr \
--cc=thuth@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.