Commit 5ca1b0dd authored by Brian Norris's avatar Brian Norris Committed by Rob Herring

of: unittest: Add option string test case with longer path

There were regressions seen with commit 106937e8 ("of: fix handling
of '/' in options for of_find_node_by_path()"), where we couldn't handle
extra '/' before the ':'. Let's test for this now.

Confirmed that this test fails without the previous patch and passes
when patched. All other tests pass.
Signed-off-by: default avatarBrian Norris <computersforpeace@gmail.com>
Acked-by: default avatarLeif Lindholm <leif.lindholm@linaro.org>
Signed-off-by: default avatarRob Herring <robh@kernel.org>
parent d7c14605
...@@ -97,6 +97,11 @@ static void __init of_selftest_find_node_by_name(void) ...@@ -97,6 +97,11 @@ static void __init of_selftest_find_node_by_name(void)
"option path test, subcase #1 failed\n"); "option path test, subcase #1 failed\n");
of_node_put(np); of_node_put(np);
np = of_find_node_opts_by_path("/testcase-data/testcase-device1:test/option", &options);
selftest(np && !strcmp("test/option", options),
"option path test, subcase #2 failed\n");
of_node_put(np);
np = of_find_node_opts_by_path("/testcase-data:testoption", NULL); np = of_find_node_opts_by_path("/testcase-data:testoption", NULL);
selftest(np, "NULL option path test failed\n"); selftest(np, "NULL option path test failed\n");
of_node_put(np); of_node_put(np);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment