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);