From patchwork Mon Sep 14 10:50:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heinrich Schuchardt X-Patchwork-Id: 1363512 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=gmx.de Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=gmx.net header.i=@gmx.net header.a=rsa-sha256 header.s=badeba3b8450 header.b=aAcSvAp2; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Bqjq75JJ3z9sTm for ; Mon, 14 Sep 2020 20:52:03 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E85BD822D2; Mon, 14 Sep 2020 12:51:42 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=gmx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; secure) header.d=gmx.net header.i=@gmx.net header.b="aAcSvAp2"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2A98E81C31; Mon, 14 Sep 2020 12:51:41 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FREEMAIL_FROM,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mout.gmx.net (mout.gmx.net [212.227.15.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id C6FB181BD2 for ; Mon, 14 Sep 2020 12:51:38 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=gmx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=xypron.glpk@gmx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1600080695; bh=u2S3rj4slA47vsYNAyL9l/xngXSd7fFxbpc+gpoTrcQ=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=aAcSvAp2kGUJ+5VL99Yg43Thu7nW8mnYSNcYBfpOCeoVTiqv28CG1iSBsuPUYR2/1 l1VOq5rpfO1dOhRvkmDsoVvBJxBeinxo67XGHF0+123nRopBGWdTQySq8rPZyjr/7Z FXSkHlmLYKecJLw5mrGVMtR5XItQRnJOWbHMgdWA= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from LT02.fritz.box ([178.202.41.107]) by mail.gmx.com (mrgmx005 [212.227.17.184]) with ESMTPSA (Nemesis) id 1M9FjR-1kBT5E0nkl-006S6R; Mon, 14 Sep 2020 12:51:35 +0200 From: Heinrich Schuchardt To: Tom Rini Cc: Philippe Reynes , Simon Glass , Patrick Delaunay , Walter Lozano , Wolfgang Wallner , u-boot@lists.denx.de, Heinrich Schuchardt Subject: [PATCH v2 1/3] test: sharpen button label unit test Date: Mon, 14 Sep 2020 12:50:54 +0200 Message-Id: <20200914105056.174287-2-xypron.glpk@gmx.de> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200914105056.174287-1-xypron.glpk@gmx.de> References: <20200914105056.174287-1-xypron.glpk@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:tDbl6OJM1eDbJhFRX5QxHYvv/aF3vlfzEV/0GtDXZdP4Ad6KcuX HfwwV/OxZw2KbxOlB6gSnIXMA0rUzYZEY02ma74dK3IFsn8EabT0EE6go13tdx8WCXTfNv1 JZpICEmD1KE6P7AW5wWrzhuTk4Xlmh8hSgs13GbgFdQnGix8RELY+xtoTtsCiQ5N8Jcd0AU EvOaI/yYY+B+TBDnYEQIg== X-UI-Out-Filterresults: notjunk:1;V03:K0:hJFgiFNmIec=:+z4kbtdHgP6c+LRGddRwlT Ww50rbchqDeOqR3p/nCgOIgxoySbwbfESTjh678KErghS4qS3gsbuu9w9BPkxJ3cQQ9m6lh+/ 8GkbShuGagsv6KXFP+CyBEI71VB93g0NU63s05+3Zf3tlLb6gYJmVTALVOt1jAUlzUGXPai24 MrCuyLD2jRQvEnIyTe4Ylb7hCL2rvkP2o77JR1f0dLmAXY5Qe57iohDVXNcRzmbEvRkE22dXg sA6NPwL1OYYi7CC2eow/KZeNOgzQafcD30SmxFee6ePPQPnM2EftxYewnCMmSO3gX92Z7E43K D2/um2jyy440/1ty4+547tMGidR+C0pngimHSqCLbI+RyklcvlZF03TFFPSEcI5qTdkfuvGAV KsFL0OjdgJKBJ5g12CFIy3Hv7Spu3S6Wh34nhnvqtxaghSfP2N4i3FGrimy9t6uttouEqYfzB s/IiBe42uQsDKTx6tG6MlyPpyFJYI+EgVN73wPbJ8HWF1D2Yr89RvvGlSRf7ssQ7fHNRc6Pif 3vdYvXxAU9K4t6QMAYdG6KpjMv+Ql8aloZJCsspTm7FSCH4TTGBOHtYOZZ8LBB0fadhACm6aH hpOmMfhhwzRilnmSWPKyvuhhHphUbPqgyKek3P/lM9m0sf0En1pJvk0k4Vq7yVboUDn5QXrBI bSJj/g7rAhJ3+ODy5h8od/ocydf5XabYFeobB1LIXXEk57KDN4znSEEJ0478UCMCkjDzsM6xR PDSRYSlh2d6fhEvnTJhaqPe4ri94rfixD2EExHdwF6FX3QipPa+9s1zXmV92yYIkNYb0r7PBW XLgOVqwMwVFesc94sZP0vfpw/MCL/8TxJ5W1juYa/F4TMESP+iw9bc3H8IT4tF7es6qP8+sQ9 eVq9XwlaI+qUWvLLltAj2IPsq/ycg7yLk4DN5s9zQaSSWU/DWyVfN0fJwIFcgLbbpNYIYxdn6 BGttDaV5m9kvQ7iqZLkU2UPFayiiheEb2MiEObQyXgjRG4NavWUp0LOKbsAT+z7qHgrzOaB6x vzDlcLdKbRvAm9PwqsRstAoNao9xIf73vq1iSV8fPOOYgwLlOrLvlSpnBP2dLaofk+G04iFoJ N/+Bpgv2oeVhjNdLzeyDZusswzGycRxzSRrhbIafX6iiZ+Pb1l63h/1ADA1ht/iEyYFfOijxe sLxlR+GIAXTfUsoeWZJjwWc4a7lBsVaRcotAzGK+2p55RyPg8Yj4N2NaDSOUOMErdnW8PIqHN GyKFPTi6EUr6YzmRTVINZCZRP61Jb5gaoHv+APg== X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean Using different strings for the device tree node labels and the label property of buttons sharpens the button label unit test. Signed-off-by: Heinrich Schuchardt Reviewed-by: Philippe Reynes --- v2: new patch --- arch/sandbox/dts/sandbox.dtsi | 8 ++++---- arch/sandbox/dts/test.dts | 8 ++++---- test/dm/button.c | 6 +++--- test/py/tests/test_button.py | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) -- 2.28.0 diff --git a/arch/sandbox/dts/sandbox.dtsi b/arch/sandbox/dts/sandbox.dtsi index c76ecc013c..0faad3f319 100644 --- a/arch/sandbox/dts/sandbox.dtsi +++ b/arch/sandbox/dts/sandbox.dtsi @@ -18,14 +18,14 @@ buttons { compatible = "gpio-keys"; - summer { + btn1 { gpios = <&gpio_a 3 0>; - label = "summer"; + label = "button1"; }; - christmas { + btn2 { gpios = <&gpio_a 4 0>; - label = "christmas"; + label = "button2"; }; }; diff --git a/arch/sandbox/dts/test.dts b/arch/sandbox/dts/test.dts index 9f45c48e4e..395d5f5e56 100644 --- a/arch/sandbox/dts/test.dts +++ b/arch/sandbox/dts/test.dts @@ -54,14 +54,14 @@ buttons { compatible = "gpio-keys"; - summer { + btn1 { gpios = <&gpio_a 3 0>; - label = "summer"; + label = "button1"; }; - christmas { + btn2 { gpios = <&gpio_a 4 0>; - label = "christmas"; + label = "button2"; }; }; diff --git a/test/dm/button.c b/test/dm/button.c index 9117801736..ecaa47cf5f 100644 --- a/test/dm/button.c +++ b/test/dm/button.c @@ -57,17 +57,17 @@ static int dm_test_button_label(struct unit_test_state *uts) { struct udevice *dev, *cmp; - ut_assertok(button_get_by_label("summer", &dev)); + ut_assertok(button_get_by_label("button1", &dev)); ut_asserteq(1, device_active(dev)); ut_assertok(uclass_get_device(UCLASS_BUTTON, 1, &cmp)); ut_asserteq_ptr(dev, cmp); - ut_assertok(button_get_by_label("christmas", &dev)); + ut_assertok(button_get_by_label("button2", &dev)); ut_asserteq(1, device_active(dev)); ut_assertok(uclass_get_device(UCLASS_BUTTON, 2, &cmp)); ut_asserteq_ptr(dev, cmp); - ut_asserteq(-ENODEV, button_get_by_label("spring", &dev)); + ut_asserteq(-ENODEV, button_get_by_label("nobutton", &dev)); return 0; } diff --git a/test/py/tests/test_button.py b/test/py/tests/test_button.py index 98067a98f2..eadd9dd613 100644 --- a/test/py/tests/test_button.py +++ b/test/py/tests/test_button.py @@ -11,7 +11,7 @@ def test_button_exit_statuses(u_boot_console): expected_response = 'rc:0' response = u_boot_console.run_command('button list; echo rc:$?') assert(expected_response in response) - response = u_boot_console.run_command('button summer; echo rc:$?') + response = u_boot_console.run_command('button button1; echo rc:$?') assert(expected_response in response) expected_response = 'rc:1'