Skip to content

Commit 8cbba1a

Browse files
peterhurleyrobherring
authored andcommitted
of: unittest: Add options string testcase variants
Add testcase variants with '/' in the options string to test for scan beyond end path name terminated by ':'. Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Rob Herring <robh@kernel.org>
1 parent 106937e commit 8cbba1a

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

drivers/of/unittest.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,11 @@ static void __init of_selftest_find_node_by_name(void)
9292
"option path test failed\n");
9393
of_node_put(np);
9494

95+
np = of_find_node_opts_by_path("/testcase-data:test/option", &options);
96+
selftest(np && !strcmp("test/option", options),
97+
"option path test, subcase #1 failed\n");
98+
of_node_put(np);
99+
95100
np = of_find_node_opts_by_path("/testcase-data:testoption", NULL);
96101
selftest(np, "NULL option path test failed\n");
97102
of_node_put(np);
@@ -102,6 +107,12 @@ static void __init of_selftest_find_node_by_name(void)
102107
"option alias path test failed\n");
103108
of_node_put(np);
104109

110+
np = of_find_node_opts_by_path("testcase-alias:test/alias/option",
111+
&options);
112+
selftest(np && !strcmp("test/alias/option", options),
113+
"option alias path test, subcase #1 failed\n");
114+
of_node_put(np);
115+
105116
np = of_find_node_opts_by_path("testcase-alias:testaliasoption", NULL);
106117
selftest(np, "NULL option alias path test failed\n");
107118
of_node_put(np);

0 commit comments

Comments
 (0)