bsp: k230: use utest asset api
Some checks failed
pkgs_test / change (push) Has been skipped
ToolsCI / Tools (push) Has been cancelled
AutoTestCI / components/cpp11 (push) Has been cancelled
AutoTestCI / kernel/atomic (push) Has been cancelled
AutoTestCI / kernel/atomic/riscv64 (push) Has been cancelled
AutoTestCI / kernel/atomic_c11 (push) Has been cancelled
AutoTestCI / kernel/atomic_c11/riscv64 (push) Has been cancelled
AutoTestCI / kernel/device (push) Has been cancelled
AutoTestCI / kernel/ipc (push) Has been cancelled
AutoTestCI / kernel/irq (push) Has been cancelled
AutoTestCI / kernel/mem (push) Has been cancelled
AutoTestCI / kernel/mem/riscv64 (push) Has been cancelled
AutoTestCI / kernel/thread (push) Has been cancelled
AutoTestCI / kernel/timer (push) Has been cancelled
AutoTestCI / rtsmart/aarch64 (push) Has been cancelled
AutoTestCI / rtsmart/arm (push) Has been cancelled
AutoTestCI / rtsmart/riscv64 (push) Has been cancelled
AutoTestCI / components/utest (push) Has been cancelled
RT-Thread BSP Static Build Check / 🔍 Summary of Git Diff Changes (push) Has been cancelled
RT-Thread BSP Static Build Check / ${{ matrix.legs.RTT_BSP }} (push) Has been cancelled
RT-Thread BSP Static Build Check / collect-artifacts (push) Has been cancelled
utest_auto_run / AARCH64-rtsmart :default.cfg (push) Has been cancelled
utest_auto_run / A9-rtsmart :default.cfg (push) Has been cancelled
utest_auto_run / RISCV-rtsmart :default.cfg (push) Has been cancelled
utest_auto_run / AARCH64 :default.cfg (push) Has been cancelled
utest_auto_run / A9 :default.cfg (push) Has been cancelled
utest_auto_run / A9-smp :default.cfg (push) Has been cancelled
utest_auto_run / RISCV :default.cfg (push) Has been cancelled

Use utest assert API for utest cases.

Signed-off-by: Chen Wang <unicorn_wang@outlook.com>
This commit is contained in:
Chen Wang
2025-05-30 08:17:06 +08:00
committed by Rbb666
parent f4e619a17c
commit 890a4bad72

View File

@@ -71,27 +71,15 @@ static void test_wdt_feed(void)
/* Find the watchdog device according to the name and obtain the handle */
wdg_dev = rt_device_find(IWDG_DEVICE_NAME);
if (!wdg_dev)
{
LOG_E("find %s failed!\n", IWDG_DEVICE_NAME);
return;
}
uassert_not_null(wdg_dev);
/* Initialize the device */
ret = rt_device_init(wdg_dev);
if (ret != RT_EOK)
{
LOG_E("initialize %s failed!\n", IWDG_DEVICE_NAME);
return;
}
uassert_int_equal(ret, RT_EOK);
/* Set the watchdog timeout time */
ret = rt_device_control(wdg_dev, KD_DEVICE_CTRL_WDT_SET_TIMEOUT, &timeout);
if (ret != RT_EOK)
{
LOG_E("set %s timeout failed!\n", IWDG_DEVICE_NAME);
return;
}
uassert_int_equal(ret, RT_EOK);
flag_feed = 1; /* Set feed the dog sign */
@@ -118,27 +106,15 @@ static void test_wdt_nofeed(void)
/* Find the watchdog device according to the name and obtain the handle */
wdg_dev = rt_device_find(IWDG_DEVICE_NAME);
if (!wdg_dev)
{
LOG_E("find %s failed!\n", IWDG_DEVICE_NAME);
return;
}
uassert_not_null(wdg_dev);
/* Initialize the device */
ret = rt_device_init(wdg_dev);
if (ret != RT_EOK)
{
LOG_E("initialize %s failed!\n", IWDG_DEVICE_NAME);
return;
}
uassert_int_equal(ret, RT_EOK);
/* Set the watchdog timeout time */
ret = rt_device_control(wdg_dev, KD_DEVICE_CTRL_WDT_SET_TIMEOUT, &timeout);
if (ret != RT_EOK)
{
LOG_E("set %s timeout failed!\n", IWDG_DEVICE_NAME);
return;
}
uassert_int_equal(ret, RT_EOK);
flag_feed = 0; /* Do not feed the dog */