diff options
author | Peter Hurley <peter@hurleysoftware.com> | 2015-03-06 13:59:59 -0500 |
---|---|---|
committer | Rob Herring <robh@kernel.org> | 2015-03-10 11:44:21 -0400 |
commit | 8cbba1ab1ae15b3a5d96caa526eac607f80bda23 (patch) | |
tree | f2f58907cd2e0efe8cffc8254f411ca44703a924 | |
parent | 106937e8ccdcf0f4b95fbf0fe9abd42766cade33 (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>
-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) | |||
92 | "option path test failed\n"); | 92 | "option path test failed\n"); |
93 | of_node_put(np); | 93 | of_node_put(np); |
94 | 94 | ||
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 | |||
95 | np = of_find_node_opts_by_path("/testcase-data:testoption", NULL); | 100 | np = of_find_node_opts_by_path("/testcase-data:testoption", NULL); |
96 | selftest(np, "NULL option path test failed\n"); | 101 | selftest(np, "NULL option path test failed\n"); |
97 | of_node_put(np); | 102 | of_node_put(np); |
@@ -102,6 +107,12 @@ static void __init of_selftest_find_node_by_name(void) | |||
102 | "option alias path test failed\n"); | 107 | "option alias path test failed\n"); |
103 | of_node_put(np); | 108 | of_node_put(np); |
104 | 109 | ||
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 | |||
105 | np = of_find_node_opts_by_path("testcase-alias:testaliasoption", NULL); | 116 | np = of_find_node_opts_by_path("testcase-alias:testaliasoption", NULL); |
106 | selftest(np, "NULL option alias path test failed\n"); | 117 | selftest(np, "NULL option alias path test failed\n"); |
107 | of_node_put(np); | 118 | of_node_put(np); |