LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Leif Lindholm <leif.lindholm@linaro.org>
To: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Cc: grant.likely@linaro.org, robh+dt@kernel.org, peter@hurleysoftware.com
Subject: [PATCH 2/2] of: unittest: Add options string testcase variants
Date: Mon,  9 Mar 2015 18:03:45 +0000	[thread overview]
Message-ID: <1425924225-22748-3-git-send-email-leif.lindholm@linaro.org> (raw)
In-Reply-To: <1425924225-22748-1-git-send-email-leif.lindholm@linaro.org>

From: Peter Hurley <peter@hurleysoftware.com>

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>
---
 drivers/of/unittest.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/of/unittest.c b/drivers/of/unittest.c
index 0cf9a23..b2d7547 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);
-- 
2.1.4


  parent reply	other threads:[~2015-03-09 18:02 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-09 18:03 [PATCH 0/2] of: fix handling of '/' in path options Leif Lindholm
2015-03-09 18:03 ` [PATCH 1/2] of: fix handling of '/' in options for of_find_node_by_path() Leif Lindholm
2015-03-17 19:30   ` [PATCH 1/2] of: handle both '/' and ':' in path strings Brian Norris
2015-03-17 19:30     ` [PATCH 2/2] of: unittest: Add option string test case with longer path Brian Norris
2015-03-17 21:12       ` Leif Lindholm
2015-03-17 21:11     ` [PATCH 1/2] of: handle both '/' and ':' in path strings Leif Lindholm
2015-03-22 20:04     ` Rob Herring
2015-03-09 18:03 ` Leif Lindholm [this message]
2015-03-11 12:49 ` [PATCH 0/2] of: fix handling of '/' in path options Rob Herring
2015-03-11 13:00   ` Leif Lindholm

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1425924225-22748-3-git-send-email-leif.lindholm@linaro.org \
    --to=leif.lindholm@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=grant.likely@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peter@hurleysoftware.com \
    --cc=robh+dt@kernel.org \
    --subject='Re: [PATCH 2/2] of: unittest: Add options string testcase variants' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).