Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp1612416rdb; Thu, 7 Dec 2023 04:23:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IE0neZpgS3TlU3KD9Va0IXfp/goRyvbAs0Uw1zE1clWOKwyRQGrQJtQpmuhkr6JgHu4EAAp X-Received: by 2002:a17:902:eed5:b0:1d0:8f10:930e with SMTP id h21-20020a170902eed500b001d08f10930emr5419512plb.64.1701951794025; Thu, 07 Dec 2023 04:23:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701951794; cv=none; d=google.com; s=arc-20160816; b=BODa33woKogEn+RDJzVyB/hPiCizXUdQmVD+6ygytv9EazpA0RYw11ZGwQ3GPseTGR TlQoX7oNwa9twNswK8kZzExJffnFnBtJdKLJEOPhpDVVredSYL+g81GxH4I08YNLrUS8 Kd6sqZPKvIs3R9kE/iORkAg1GleQXLPrgiHn1Tw6V4Encdei1bKUDkefAmJCbsLM1IEd d43eEOjQRtnCqliUiDZDWAOIk1+++EsN7s4NjHBhNG5VByi+U9fjdaaO0LPL2HHtpHkx HMv3Dd37H1p0aan2dz84iKwz+DDdbwlEt7ZiLcCjID/Qd5g+ZjGlvEfa2vYs+9deXGzV Td0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:message-id:content-transfer-encoding :mime-version:subject:date:from:dkim-signature; bh=0R141pjf5RAJhw88CEp3ADG9Jk6iWPvBvCQ+arAZNsg=; fh=9F5iwaP/n8Y7TRNJqUE8MsmsCLPLdm4oaS0R2TQKbek=; b=XSbKpFWKNJd/UOgOFzOE7sknY00bBSj0EY7f/B3DanrViFSoX6MbTylsbknceDmqm5 r2bGoUygitjBwABOeSVlC+FCpP9dCz/eo33kB+tUPIwLE3pE4NsLT4NTJqKCv7DuyZTF /bCIhSn/lpAPlXUTKbNWzqa6JNhbxALGyc2b52Ab6zEQFLvXN713mMD4+QQk7hgABiOi w4i06d9kNrmRBn+d2uAUsyEeLo6r4NjP84uQ/8aGi30k2HGCJ1FHqMEezjDOGcH4v/is 1G3Bn9UyBYldXbrdWdOdYujKDNxZLF8fTt/MxpmPzHmG2ju/+fybuboBwmjHzna9jN94 fb7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ZRuAepFh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id j9-20020a17090276c900b001cf8d044c2asi1034152plt.544.2023.12.07.04.23.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Dec 2023 04:23:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ZRuAepFh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 580728083A83; Thu, 7 Dec 2023 04:23:10 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1379234AbjLGMWn (ORCPT + 99 others); Thu, 7 Dec 2023 07:22:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35866 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232482AbjLGMWj (ORCPT ); Thu, 7 Dec 2023 07:22:39 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1B06810CA for ; Thu, 7 Dec 2023 04:22:45 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EB499C433C8; Thu, 7 Dec 2023 12:22:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701951764; bh=epH6N4HOQY9d/F5eZFuiUiKcD6erclTqiNFuoeHNibM=; h=From:Date:Subject:To:Cc:From; b=ZRuAepFhfUG/d4JUckztQmMS323WJgPb0oGVjoiVT16Sw9k3gd2mcP1s2X+UCQhvm TTX8vLZ/lNjgv68XatsoQiJNDp2Kmmq9H854ivI9VPmVLP9p70meAooJGYxI1LJTgL QT/RAmD1b14G3rSJqRc4372ZDLz6i5nKmz2lsxe4xSDv12Y2ByD3xiexVsFxncGrDS TOt/qKsUYnZ/laPTjMCTRn0sqo0B84C9zuiZ566wL1mJ04fGJnN8aY5gdcLCG56hkV 9aevdE7LoYOLkHTHMomf0iLxG91JcLifQyl1l9vrt/8PZHvaTouWNw3vypYTYqvEE0 ss+Dg2q8YUkIQ== From: Benjamin Tissoires Date: Thu, 07 Dec 2023 13:22:39 +0100 Subject: [PATCH] selftests/hid: fix failing tablet button tests MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20231207-b4-wip-selftests-v1-1-c4e13fe04a70@kernel.org> X-B4-Tracking: v=1; b=H4sIAA65cWUC/x3MQQ5AMBBA0avIrE2i1SKuIha0g0kE6QiSxt01l m/xfwShwCTQZhECXSy8bwkqz8AtwzYTsk8GXehS6aLG0eDNBwqt00lyCjplK+uNN7ZuIGVHoIm ff9n17/sBuP0ArGIAAAA= To: Jiri Kosina , Benjamin Tissoires , Shuah Khan , Peter Hutterer Cc: Jiri Kosina , Benjamin Tissoires , linux-input@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=ed25519-sha256; t=1701951762; l=1894; i=bentiss@kernel.org; s=20230215; h=from:subject:message-id; bh=epH6N4HOQY9d/F5eZFuiUiKcD6erclTqiNFuoeHNibM=; b=n/90PDIVzBVYmex40erDeyr8UfBLYJJvGN2LIAvfkl2wkUtPc4ZONsXa4LXWuHGuUhRNjEr3t S29RzIxWhgoCbx0SJBI78CjhJjrx8MqBr1/El5ybpfDF2e1WRSpLa54 X-Developer-Key: i=bentiss@kernel.org; a=ed25519; pk=7D1DyAVh6ajCkuUTudt/chMuXWIJHlv2qCsRkIizvFw= X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Thu, 07 Dec 2023 04:23:10 -0800 (PST) An overlook from commit 74452d6329be ("selftests/hid: tablets: add variants of states with buttons"), where I don't use the Enum... Fixes: 74452d6329be ("selftests/hid: tablets: add variants of states with buttons") Signed-off-by: Benjamin Tissoires --- Not sure what happened, but I mustn't have run the tests before sending the series, and they fail blatently. I'm deeply sorry for that, I thought these failures were fixed. Cheers, Benjamin --- tools/testing/selftests/hid/tests/test_tablet.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/hid/tests/test_tablet.py b/tools/testing/selftests/hid/tests/test_tablet.py index dc8b0fe9e7f3..903f19f7cbe9 100644 --- a/tools/testing/selftests/hid/tests/test_tablet.py +++ b/tools/testing/selftests/hid/tests/test_tablet.py @@ -115,7 +115,7 @@ class PenState(Enum): # we take only the highest button in account for b in [libevdev.EV_KEY.BTN_STYLUS, libevdev.EV_KEY.BTN_STYLUS2]: if bool(evdev.value[b]): - button = b + button = BtnPressed(b) # the kernel tends to insert an EV_SYN once removing the tool, so # the button will be released after @@ -155,7 +155,7 @@ class PenState(Enum): if button_found: raise ValueError(f"duplicated BTN_STYLUS* in {events}") button_found = True - button = ev.code if ev.value else None + button = BtnPressed(ev.code) if ev.value else None # the kernel tends to insert an EV_SYN once removing the tool, so # the button will be released after --- base-commit: f556aa957df8cb3e98af0f54bf1fa65f59ae47a3 change-id: 20231207-b4-wip-selftests-c1565d4d4578 Best regards, -- Benjamin Tissoires