diff mbox series

[v3,02/20] dm: test: Add test case to check node name ignoring unit address

Message ID 20210504104155.19222-3-kishon@ti.com
State Changes Requested
Delegated to: Lokesh Vutla
Headers show
Series TI/Cadence: Add Sierra/Torrent SERDES driver | expand

Commit Message

Kishon Vijay Abraham I May 4, 2021, 10:41 a.m. UTC
Add test to check node name ignoring unit address.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
---
 test/dm/core.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
diff mbox series

Patch

diff --git a/test/dm/core.c b/test/dm/core.c
index 2210345dd1..e83f71f767 100644
--- a/test/dm/core.c
+++ b/test/dm/core.c
@@ -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)
 {