qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2] tests/qtest : Use `g_assert_cmphex` instead of `g_assert_


From: Ninad Palsule
Subject: Re: [PATCH v2] tests/qtest : Use `g_assert_cmphex` instead of `g_assert_cmpuint`
Date: Tue, 16 Apr 2024 06:54:47 -0500
User-agent: Mozilla Thunderbird


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>





reply via email to

[Prev in Thread] Current Thread [Next in Thread]