From 734baae5a20c510a0f3dc22b569c6a94b5de88ea Mon Sep 17 00:00:00 2001 From: dulibo1 Date: Fri, 13 Oct 2023 16:54:42 +0800 Subject: [PATCH] test case update follow the regualtor framework Signed-off-by: dulibo1 --- testing/drivertest/drivertest_regulator.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/testing/drivertest/drivertest_regulator.c b/testing/drivertest/drivertest_regulator.c index 4310fdf48..212c6805a 100644 --- a/testing/drivertest/drivertest_regulator.c +++ b/testing/drivertest/drivertest_regulator.c @@ -446,10 +446,8 @@ static void test_regulator_supply_4(FAR void **state) &g_fake_regulator); assert_false(NULL == g_fake_regulator.rdev); test = regulator_get(REGULATOR_ID); - assert_false(NULL == test); + assert_true(NULL == test); g_fake_regulator_supply.state = 0; - ret = regulator_enable(test); - assert_true(ret < 0); g_fake_regulator_supply.rdev = regulator_register( &g_fake_regulator_supply_desc, &g_fake_regulator_ops, @@ -457,7 +455,8 @@ static void test_regulator_supply_4(FAR void **state) assert_false(NULL == g_fake_regulator_supply.rdev); assert_int_equal(g_fake_regulator_supply.state, 0); assert_int_equal(g_fake_regulator.state, 0); - + test = regulator_get(REGULATOR_ID); + assert_false(NULL == test); while (cnt--) { ret = regulator_enable(test); @@ -499,6 +498,7 @@ static void test_regulator_mode(FAR void **state) int ret = 0; g_fake_regulator.lpmode = 0; + g_fake_regulator_desc.supply_name = NULL; g_fake_regulator.rdev = regulator_register(&g_fake_regulator_desc, &g_fake_regulator_ops, &g_fake_regulator);