Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 479c55cc authored by Peter Hurley's avatar Peter Hurley Committed by Alex Shi
Browse files

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: default avatarPeter Hurley <peter@hurleysoftware.com>
Signed-off-by: default avatarRob Herring <robh@kernel.org>
(cherry picked from commit 8cbba1ab1ae15b3a5d96caa526eac607f80bda23)
Signed-off-by: default avatarAlex Shi <alex.shi@linaro.org>
parent e67407af
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -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);