diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/dm/phy.c | 2 | ||||
-rw-r--r-- | test/dm/test-fdt.c | 18 | ||||
-rw-r--r-- | test/py/tests/test_bind.py | 18 |
3 files changed, 28 insertions, 10 deletions
diff --git a/test/dm/phy.c b/test/dm/phy.c index 75d05a14c0..ecbd47bf12 100644 --- a/test/dm/phy.c +++ b/test/dm/phy.c @@ -47,7 +47,7 @@ static int dm_test_phy_base(struct unit_test_state *uts) ut_assert(phy2.dev != phy3.dev); /* Try to get a non-existing phy */ - ut_asserteq(-ENODEV, uclass_get_device(UCLASS_PHY, 3, &dev)); + ut_asserteq(-ENODEV, uclass_get_device(UCLASS_PHY, 4, &dev)); ut_asserteq(-ENODATA, generic_phy_get_by_name(parent, "phy_not_existing", &phy1_method1)); diff --git a/test/dm/test-fdt.c b/test/dm/test-fdt.c index ac8ce99f51..04802deb7f 100644 --- a/test/dm/test-fdt.c +++ b/test/dm/test-fdt.c @@ -619,6 +619,24 @@ static int dm_test_fdt_translation(struct unit_test_state *uts) } DM_TEST(dm_test_fdt_translation, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +static int dm_test_fdt_get_addr_ptr_flat(struct unit_test_state *uts) +{ + struct udevice *gpio, *dev; + void *ptr; + + /* Test for missing reg property */ + ut_assertok(uclass_first_device_err(UCLASS_GPIO, &gpio)); + ut_assertnull(devfdt_get_addr_ptr(gpio)); + + ut_assertok(uclass_find_device_by_seq(UCLASS_TEST_DUMMY, 0, true, &dev)); + ptr = devfdt_get_addr_ptr(dev); + ut_asserteq_ptr((void *)0x8000, ptr); + + return 0; +} +DM_TEST(dm_test_fdt_get_addr_ptr_flat, + UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT | UT_TESTF_FLAT_TREE); + static int dm_test_fdt_remap_addr_flat(struct unit_test_state *uts) { struct udevice *dev; diff --git a/test/py/tests/test_bind.py b/test/py/tests/test_bind.py index e9681c69c5..5e73d40361 100644 --- a/test/py/tests/test_bind.py +++ b/test/py/tests/test_bind.py @@ -7,13 +7,16 @@ import re def in_tree(response, name, uclass, drv, depth, last_child): lines = [x.strip() for x in response.splitlines()] - leaf = ' ' * 4 * depth; - if not last_child: - leaf = leaf + r'\|' - else: - leaf = leaf + '`' + leaf = '' + if depth != 0: + leaf = ' ' + ' ' * (depth - 1) ; + if not last_child: + leaf = leaf + r'\|' + else: + leaf = leaf + '`' + leaf = leaf + '-- ' + name - line = (r' *{:10.10} [0-9]* \[ [ +] \] {:20.20} {}$' + line = (r' *{:10.10} [0-9]* \[ [ +] \] {:20.20} [` |]{}$' .format(uclass, drv, leaf)) prog = re.compile(line) for l in lines: @@ -25,9 +28,6 @@ def in_tree(response, name, uclass, drv, depth, last_child): @pytest.mark.buildconfigspec('cmd_bind') def test_bind_unbind_with_node(u_boot_console): - #bind /bind-test. Device should come up as well as its children - response = u_boot_console.run_command('bind /bind-test simple_bus') - assert response == '' tree = u_boot_console.run_command('dm tree') assert in_tree(tree, 'bind-test', 'simple_bus', 'simple_bus', 0, True) assert in_tree(tree, 'bind-test-child1', 'phy', 'phy_sandbox', 1, False) |