From patchwork Mon Mar 9 18:03:45 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leif Lindholm X-Patchwork-Id: 5970491 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 8D6209F2A9 for ; Mon, 9 Mar 2015 18:05:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C91CD20266 for ; Mon, 9 Mar 2015 18:05:47 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EE443202B8 for ; Mon, 9 Mar 2015 18:05:46 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YV21h-0002aJ-E9; Mon, 09 Mar 2015 18:03:37 +0000 Received: from mail-wi0-f172.google.com ([209.85.212.172]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YV20x-00022D-8Q for linux-arm-kernel@lists.infradead.org; Mon, 09 Mar 2015 18:02:52 +0000 Received: by wivr20 with SMTP id r20so23500517wiv.5 for ; Mon, 09 Mar 2015 11:02:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=la0fcfD232NRd04+asxJg5RxGlIcqCewk6kO7+46BTY=; b=DnfmDKTxHPw6YeW2nDhRSKTWHzZyebZnzXR19qzBhAM2t/MCv1WbBDEEXqP3C+tCTK 3cRR7ksu38ieHdLgWyWcNbbrfS+4AmfaELthU29+6l5JA83O3Nf1SxMFZzTBCnJWvzjf /OZOBJqvXpsbGVxdgGdRED6Pghy6lpJVh7OPqRjHXxshIfCgXtTW9000cpNqJqKZnobT u8thMOhOC0GNx5NhKp0G+etD6bgs91G7jv4Si9IexGfCWqGkHAloTNeUAOpkQT5AVG+o EbCcBvSTbzoVVTSnQGHqrI62TAZCOv4U8HiwiT83ujQRH5L5IxZx+1XZAnYWzP0i8nkK fPNg== X-Gm-Message-State: ALoCoQklir56ckI6iAXgeO8qaA+BNs1rlhMnFjZII2/IsT1zl1JPv8rTLSB+QMMEbGVpvY9wHXPf X-Received: by 10.194.23.39 with SMTP id j7mr61627678wjf.9.1425924146240; Mon, 09 Mar 2015 11:02:26 -0700 (PDT) Received: from mohikan.mushroom.smurfnet.nu (cpc4-cmbg17-2-0-cust71.5-4.cable.virginm.net. [86.14.224.72]) by mx.google.com with ESMTPSA id cj9sm13768530wjc.42.2015.03.09.11.02.24 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 09 Mar 2015 11:02:25 -0700 (PDT) From: Leif Lindholm To: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] of: unittest: Add options string testcase variants Date: Mon, 9 Mar 2015 18:03:45 +0000 Message-Id: <1425924225-22748-3-git-send-email-leif.lindholm@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1425924225-22748-1-git-send-email-leif.lindholm@linaro.org> References: <1425924225-22748-1-git-send-email-leif.lindholm@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150309_110251_488924_15245F6C X-CRM114-Status: UNSURE ( 9.38 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.7 (/) Cc: grant.likely@linaro.org, robh+dt@kernel.org, peter@hurleysoftware.com X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Peter Hurley Add testcase variants with '/' in the options string to test for scan beyond end path name terminated by ':'. Signed-off-by: Peter Hurley --- 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);