From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kishon Vijay Abraham I Date: Mon, 5 Apr 2021 15:58:21 +0530 Subject: [PATCH v2 02/17] dm: test: Add test case to check node name ignoring unit address In-Reply-To: <20210405102836.24515-1-kishon@ti.com> References: <20210405102836.24515-1-kishon@ti.com> Message-ID: <20210405102836.24515-3-kishon@ti.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Add test to check node name ignoring unit address. Signed-off-by: Kishon Vijay Abraham I --- test/dm/core.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/dm/core.c b/test/dm/core.c index 35ca689d64..b88b1966fd 100644 --- a/test/dm/core.c +++ b/test/dm/core.c @@ -178,6 +178,20 @@ static int dm_test_autobind_uclass_pdata_alloc(struct unit_test_state *uts) } DM_TEST(dm_test_autobind_uclass_pdata_alloc, UT_TESTF_SCAN_PDATA); +/* compare node names ignoring the unit address */ +static int dm_test_compare_node_name(struct unit_test_state *uts) +{ + ofnode node; + + node = ofnode_path("/mmio-bus at 0"); + ut_assert(ofnode_valid(node)); + ut_assert(ofnode_name_eq(node, "mmio-bus")); + + return 0; +} + +DM_TEST(dm_test_compare_node_name, UT_TESTF_SCAN_PDATA); + /* Test that binding with uclass plat setting occurs correctly */ static int dm_test_autobind_uclass_pdata_valid(struct unit_test_state *uts) { -- 2.17.1