diff options
Diffstat (limited to 'test/dm/phy.c')
-rw-r--r-- | test/dm/phy.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/dm/phy.c b/test/dm/phy.c index 4d4a083dd0..09329b9f71 100644 --- a/test/dm/phy.c +++ b/test/dm/phy.c @@ -29,7 +29,9 @@ static int dm_test_phy_base(struct unit_test_state *uts) * Get the same phy port in 2 different ways and compare. */ ut_assertok(generic_phy_get_by_name(parent, "phy1", &phy1_method1)); + ut_assert(generic_phy_valid(&phy1_method1)); ut_assertok(generic_phy_get_by_index(parent, 0, &phy1_method2)); + ut_assert(generic_phy_valid(&phy1_method2)); ut_asserteq(phy1_method1.id, phy1_method2.id); /* @@ -50,6 +52,10 @@ static int dm_test_phy_base(struct unit_test_state *uts) ut_asserteq(-ENODEV, uclass_get_device(UCLASS_PHY, 4, &dev)); ut_asserteq(-ENODATA, generic_phy_get_by_name(parent, "phy_not_existing", &phy1_method1)); + ut_assert(!generic_phy_valid(&phy1_method1)); + ut_asserteq(-ENOENT, generic_phy_get_by_index(parent, 3, + &phy1_method2)); + ut_assert(!generic_phy_valid(&phy1_method2)); return 0; } |