summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2019-02-11 11:15:34 -0500
committerTom Rini <trini@konsulko.com>2019-02-11 11:15:34 -0500
commitf94fa0e94f36c740d3c7aa314c89a750c742185b (patch)
tree42077386d60386628bed02011566ddf990913eb8 /test
parentf49929772c5ea22e4af987bfb1e5ae13e9895093 (diff)
parentc4bd12a7dad43ed9de3070c7c5e8b690d8c03a79 (diff)
downloadu-boot-f94fa0e94f36c740d3c7aa314c89a750c742185b.tar.gz
u-boot-f94fa0e94f36c740d3c7aa314c89a750c742185b.tar.bz2
u-boot-f94fa0e94f36c740d3c7aa314c89a750c742185b.zip
Merge branch 'master' of git://git.denx.de/u-boot-i2c
- DM I2C improvements
Diffstat (limited to 'test')
-rw-r--r--test/dm/test-fdt.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/dm/test-fdt.c b/test/dm/test-fdt.c
index 984b80c02c..be16c99e17 100644
--- a/test/dm/test-fdt.c
+++ b/test/dm/test-fdt.c
@@ -219,6 +219,29 @@ static int dm_test_fdt(struct unit_test_state *uts)
}
DM_TEST(dm_test_fdt, 0);
+static int dm_test_alias_highest_id(struct unit_test_state *uts)
+{
+ int ret;
+
+ ret = dev_read_alias_highest_id("eth");
+ ut_asserteq(5, ret);
+
+ ret = dev_read_alias_highest_id("gpio");
+ ut_asserteq(2, ret);
+
+ ret = dev_read_alias_highest_id("pci");
+ ut_asserteq(2, ret);
+
+ ret = dev_read_alias_highest_id("i2c");
+ ut_asserteq(0, ret);
+
+ ret = dev_read_alias_highest_id("deadbeef");
+ ut_asserteq(-1, ret);
+
+ return 0;
+}
+DM_TEST(dm_test_alias_highest_id, 0);
+
static int dm_test_fdt_pre_reloc(struct unit_test_state *uts)
{
struct uclass *uc;