Skip to content

Commit

Permalink
of: unittest: Add option string test case with longer path
Browse files Browse the repository at this point in the history
There were regressions seen with commit 106937e ("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: Brian Norris <[email protected]>
Acked-by: Leif Lindholm <[email protected]>
Signed-off-by: Rob Herring <[email protected]>
  • Loading branch information
computersforpeace authored and robherring committed Mar 19, 2015
1 parent d7c1460 commit 5ca1b0d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/of/unittest.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@ static void __init of_selftest_find_node_by_name(void)
"option path test, subcase #1 failed\n");
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);
selftest(np, "NULL option path test failed\n");
of_node_put(np);
Expand Down

0 comments on commit 5ca1b0d

Please sign in to comment.