]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
dm: test: Add test case to check node name ignoring unit address
authorKishon Vijay Abraham I <kishon@ti.com>
Wed, 21 Jul 2021 15:58:31 +0000 (21:28 +0530)
committerLokesh Vutla <lokeshvutla@ti.com>
Tue, 27 Jul 2021 05:26:53 +0000 (10:56 +0530)
Add test to check node name ignoring unit address.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Link: https://lore.kernel.org/r/20210721155849.20994-3-kishon@ti.com
test/dm/core.c

index 0492698997c19721a92e1c236db86e2dfe9ce751..48e66b7333567d54f4b8191bae56ce4d5d771842 100644 (file)
@@ -177,6 +177,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@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)
 {