aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorPeter Hurley <peter@hurleysoftware.com>2015-03-06 13:59:59 -0500
committerAlex Shi <alex.shi@linaro.org>2015-12-16 15:29:29 +0800
commit479c55cc1950b1dca1cf67a736d33e7355029d21 (patch)
treef20e9b97cbdbff479916c1ef2fb08a69c4a63844 /drivers
parente67407af4ef469bf14e0560a7455fe94600b0e2e (diff)
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> (cherry picked from commit 8cbba1ab1ae15b3a5d96caa526eac607f80bda23) Signed-off-by: Alex Shi <alex.shi@linaro.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/of/unittest.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/of/unittest.c b/drivers/of/unittest.c
index 764a0e967266..4c2ee3f86e42 100644
--- a/drivers/of/unittest.c
+++ b/drivers/of/unittest.c
@@ -89,6 +89,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);
@@ -99,6 +104,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);