diff options
author | Peter Hurley <peter@hurleysoftware.com> | 2015-03-06 13:59:59 -0500 |
---|---|---|
committer | Rob Herring <robh@kernel.org> | 2015-03-10 10:44:21 -0500 |
commit | 8cbba1ab1ae15b3a5d96caa526eac607f80bda23 (patch) | |
tree | f2f58907cd2e0efe8cffc8254f411ca44703a924 /drivers/of/unittest.c | |
parent | 106937e8ccdcf0f4b95fbf0fe9abd42766cade33 (diff) | |
download | blackbird-op-linux-8cbba1ab1ae15b3a5d96caa526eac607f80bda23.tar.gz blackbird-op-linux-8cbba1ab1ae15b3a5d96caa526eac607f80bda23.zip |
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>
Diffstat (limited to 'drivers/of/unittest.c')
-rw-r--r-- | drivers/of/unittest.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/of/unittest.c b/drivers/of/unittest.c index ac1a834f828f..aba8946cac46 100644 --- a/drivers/of/unittest.c +++ b/drivers/of/unittest.c @@ -92,6 +92,11 @@ static void __init of_selftest_find_node_by_name(void) "option path test failed\n"); of_node_put(np); + np = of_find_node_opts_by_path("/testcase-data:test/option", &options); + selftest(np && !strcmp("test/option", options), + "option path test, subcase #1 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); @@ -102,6 +107,12 @@ static void __init of_selftest_find_node_by_name(void) "option alias path test failed\n"); of_node_put(np); + np = of_find_node_opts_by_path("testcase-alias:test/alias/option", + &options); + selftest(np && !strcmp("test/alias/option", options), + "option alias path test, subcase #1 failed\n"); + of_node_put(np); + np = of_find_node_opts_by_path("testcase-alias:testaliasoption", NULL); selftest(np, "NULL option alias path test failed\n"); of_node_put(np); |