Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1001425rwd; Thu, 18 May 2023 06:49:11 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5B7DoCzMbkp4AZNAFgcIWDB83pSZVWsGR1BCcq3F0judYy5ow+ELigqnRRwHt9UrL38TwC X-Received: by 2002:a05:6a20:7f8c:b0:fa:1f3a:8f56 with SMTP id d12-20020a056a207f8c00b000fa1f3a8f56mr2455937pzj.12.1684417750586; Thu, 18 May 2023 06:49:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684417750; cv=none; d=google.com; s=arc-20160816; b=vCYvca/ydfSRM6w2w5rAkNbQ72enhwPmi+iYXLdhbI5Dfitn1PdW9c4XtgN2vGyRI/ SRkcfAA+6lvBh0jWuDGvZhm+DsJiwOIReYND7UHcE9PqopOVqMfHCaD6gpMP7DyxnivI I7OjQxgWo5oH0bMR5rxeG+w2wg/OFC5QBFRYPlFh5d/WlCZQZvLI4yKEzVgDuf5cKiNt Z4zbsn2kKTO4w5G5adURGwthma+Ao26HnByPMv0NDD+OEcdbW5dN6Em8ulEu+Qs5SZWa rPX/v9CQ9VUFZZm2rxZmXQ/g55dww5vkmSh8xVfFBJdC90skfOerPJijO5XBMcDnkZng 8rqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:dkim-signature; bh=w/spM/Tt+6jY+bXguF/tdV1zzuEZPNfnHi37xmhV69Q=; b=Qb0c8WMsBIyuDS+YTXO4WSK4tgGTwuZe1JjDVFPGMoTGGalGPpcl+rxKLU9eaWq7ni fOVNWjsXmc2OvEDnInD2muq+dVmdFRpNModd2sqcLzT3/OtcXFNXjh0XkBjW5JEgfM/q zYyRQqcYqzlujcNc0mZWt12GDngv/nRg0eYBacP+ozh6euJ8z68BGkquHbh8RdOoFbcQ Ol8jiwLDDeqH0ogFElhMnMb+XEubrVJuv3kmf69JPkr2LzLHSuZ/amofbLUWeYMmrB8S rUcbrjOdrKroLD6inW+yM8yD1gonkwQ8K5nTaroS6bQTomTxFOFVRxK8bXZWhCj6pS+Q Saxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=FLz4Y+Q0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k8-20020a17090a3cc800b0024d7fdc4778si1810608pjd.32.2023.05.18.06.48.54; Thu, 18 May 2023 06:49:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=FLz4Y+Q0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230341AbjERNjj (ORCPT + 99 others); Thu, 18 May 2023 09:39:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59160 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230175AbjERNjh (ORCPT ); Thu, 18 May 2023 09:39:37 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8181719B for ; Thu, 18 May 2023 06:38:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1684417131; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=w/spM/Tt+6jY+bXguF/tdV1zzuEZPNfnHi37xmhV69Q=; b=FLz4Y+Q0YGMdcH2n2uQrETqLG6d+cDr5UVXDe7jf5e4xj5106kKNvovG/5WVMCwC9P92dJ VirEwGhSP69UIfF1RrbwnVg9TF8VwlGLF0MjNvodJvVvyFzWyoNv0B24T9QyopEv2EVmfh vRJ+Mxlklz6pybdiR5YVECIYWYjjjYA= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-434-SVtK4aBLP9OGTLBCJgYSSA-1; Thu, 18 May 2023 09:38:50 -0400 X-MC-Unique: SVtK4aBLP9OGTLBCJgYSSA-1 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-3f4dd7f13d0so8608225e9.3 for ; Thu, 18 May 2023 06:38:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684417129; x=1687009129; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=w/spM/Tt+6jY+bXguF/tdV1zzuEZPNfnHi37xmhV69Q=; b=HaJpTUL8WmoXaMbDDTgJ68G6ZrDtmWObOVTQ8P2Mlzok5KvtYE9w4bLNroBboQqDU1 yiZ6s13Nrejwr5Gv4QXysQtnIpp/pVeNq2M2IvZJafhaDQ5HE/K+50rc+pPUYh94k/xb lJoni2MR8CIWtpocSKP77oZNIkLfgzMJa08/a1p3RFmu5Uai7xZiJ4XA8vKKh3GlHTGt 7Vi2Eg8Up5ro3Nb6TLySYXuzl5em/+xwyEuabxEwWJB/mHql9mP0a5W059niUiv6VYc6 smfaWgUPesEJT6Fi2RaGg2M/SCxldytjIFRt6Lu4WlCG9fY+zdbvI5OtF60RL1IiCPB2 63VA== X-Gm-Message-State: AC+VfDw4e+lEKihchdMXl1VZMmXurElrCVSrFmVRRBClSiimXiw+0A/S 6ZLcRrp7WUaPq1spr1wjcHZP1Tcuass/omFG/ridj1ZY+H7EOie1EMnjujQA80J76+lmgYJjXys nblCOr+C7Pvm42KwOcESYBl48 X-Received: by 2002:a1c:7712:0:b0:3f4:ec32:6a00 with SMTP id t18-20020a1c7712000000b003f4ec326a00mr1688261wmi.6.1684417128967; Thu, 18 May 2023 06:38:48 -0700 (PDT) X-Received: by 2002:a1c:7712:0:b0:3f4:ec32:6a00 with SMTP id t18-20020a1c7712000000b003f4ec326a00mr1688247wmi.6.1684417128711; Thu, 18 May 2023 06:38:48 -0700 (PDT) Received: from localhost (205.pool92-176-231.dynamic.orange.es. [92.176.231.205]) by smtp.gmail.com with ESMTPSA id p4-20020a05600c204400b003f0aefcc457sm5509645wmg.45.2023.05.18.06.38.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 May 2023 06:38:48 -0700 (PDT) From: Javier Martinez Canillas To: Dana Elfassy , eballetb@redhat.com, dmitry.torokhov@gmail.com, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Dana Elfassy Subject: Re: [PATCH v2] Input: tests: add test to cover all input_grab_device() function In-Reply-To: <20230517153145.513095-1-dangel101@gmail.com> References: <20230517153145.513095-1-dangel101@gmail.com> Date: Thu, 18 May 2023 15:38:47 +0200 Message-ID: <87v8gp92u0.fsf@minerva.mail-host-address-is-not-set> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,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 lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Dana Elfassy writes: Hello Dana, > Currently input_grab_device() isn't covered by any tests > Thus, adding a test to cover the cases: > 1. The device is grabbed successfully > 2. Trying to grab a device that is already grabbed by another input > handle > > Signed-off-by: Dana Elfassy > Tested-by: Javier Martinez Canillas > Reviewed-by: Javier Martinez Canillas > --- [...] > + > + handle.dev = input_get_device(input_dev); > + handle.name = dev_name(&input_dev->dev); > + handle.handler = &handler; > + res = input_grab_device(&handle); Another thing I noticed is that your test will try to grab the same input_handle twice. So you need to remove the line above I believe. > + KUNIT_ASSERT_TRUE(test, input_grab_device(&handle)); > + -- Best regards, Javier Martinez Canillas Core Platforms Red Hat