From patchwork Wed Oct 14 03:47:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kent Gibson X-Patchwork-Id: 269606 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 428D4C433E7 for ; Wed, 14 Oct 2020 09:09:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CB9C520BED for ; Wed, 14 Oct 2020 09:09:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="vc2LXEBr" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727993AbgJNJJh (ORCPT ); Wed, 14 Oct 2020 05:09:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38368 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728325AbgJNJJh (ORCPT ); Wed, 14 Oct 2020 05:09:37 -0400 Received: from mail-pg1-x542.google.com (mail-pg1-x542.google.com [IPv6:2607:f8b0:4864:20::542]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A8F1AC041E59 for ; Tue, 13 Oct 2020 20:48:20 -0700 (PDT) Received: by mail-pg1-x542.google.com with SMTP id f5so1142962pgb.1 for ; Tue, 13 Oct 2020 20:48:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=UiqZjFRSnrMFRi/m5ijtrvDGe3gJuzomeF0Arv3qS7Y=; b=vc2LXEBrc6fAPFsAEIlMopqd0S7MiuMN63xTH8/QI1lfCw3cIwFOTY/jLTzN05s2cz 708TpoQCfQR7qjrKbhFoVrYujxknvDCyqWW8VR4W+PLE+i6beiU+UHlWNQ5geeYOQxMj RBAu9v7aA3PNQBWQE8Wa1rG+1wK4KDBRduZ63avabMnk1pGOYCwmW8Cywn6vHKyNIP0c FpQsxJN4z6jT02o76dhkc9kVW70ABdqJqmU+wb28KnyDxDCtO6eqYwasa2nPfLGKcmla svtCy0cN8oPa0CuSGdM/NmdTss33CWQIQRaPiYlBv3XoUNLJwwXm2lOhiBB5WJ+V9eGC BuHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=UiqZjFRSnrMFRi/m5ijtrvDGe3gJuzomeF0Arv3qS7Y=; b=b7zIkdrpkkugD7HFuxjBqf5gDiwbL5VpLq2RJ6WG7jXWyz8IZySbHDxZh9Uj3DkBmO nWOrOaEhkJvgVuFLcC6cR3v3PCxIjy0b8yTW1DX+J5TKoPB7zCNTimYhrDeHFZwKEEOX Mp1wnc/25kfLIgmDVcy6SqhHNMkXdq8EKnRred6FFydN0kBx7N2uZ7+2zaWkKMlhR71K 4are2Est+ERd09Mx6zxBI+1faIK7p8YeNx06rL220i9Fx50QLwkjK/e+JmcJDUexIbOM PRkCkGNiYcxIm/xUVDvcN86L1aNop8vIDekKnbFgzxhbEvK/Lg4EIA3huftmNtFTDQt+ z7ww== X-Gm-Message-State: AOAM533WPw1UqaO/GNnjnAVgUWXXOfjiq3nFtx+bg/7U0HVE/qV+/MB0 5syjObyI41r5ov/pujYNIa80+ptgf04uYQ== X-Google-Smtp-Source: ABdhPJx+H59yuP4WJoQsJeUSnIDahcwfYOuhYdo8nIhZZ0PulNwTJLe+NLOGdiNr3vGP874Ue8dsaQ== X-Received: by 2002:a62:8497:0:b029:155:9366:381b with SMTP id k145-20020a6284970000b02901559366381bmr2416223pfd.15.1602647299888; Tue, 13 Oct 2020 20:48:19 -0700 (PDT) Received: from sol.lan (106-69-182-59.dyn.iinet.net.au. [106.69.182.59]) by smtp.gmail.com with ESMTPSA id z73sm1362940pfc.75.2020.10.13.20.48.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Oct 2020 20:48:19 -0700 (PDT) From: Kent Gibson To: linux-gpio@vger.kernel.org, bgolaszewski@baylibre.com Cc: Kent Gibson Subject: [libgpiod][PATCH 1/2] tests: create mismatch between chip and bulk offsets in wait_multiple Date: Wed, 14 Oct 2020 11:47:57 +0800 Message-Id: <20201014034758.19427-2-warthog618@gmail.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201014034758.19427-1-warthog618@gmail.com> References: <20201014034758.19427-1-warthog618@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org Create a mismatch between the chip offsets and the bulk offsets to ensure the implementation is not dependent on them matching. Signed-off-by: Kent Gibson --- tests/tests-event.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/tests-event.c b/tests/tests-event.c index 6066e45..a43f865 100644 --- a/tests/tests-event.c +++ b/tests/tests-event.c @@ -546,7 +546,7 @@ GPIOD_TEST_CASE(wait_multiple, 0, { 8 }) gpiod_test_return_if_failed(); gpiod_line_bulk_init(&bulk); - for (i = 0; i < 8; i++) { + for (i = 1; i < 8; i++) { line = gpiod_chip_get_line(chip, i); g_assert_nonnull(line); gpiod_test_return_if_failed(); From patchwork Wed Oct 14 03:47:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kent Gibson X-Patchwork-Id: 285607 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 83BA6C4363A for ; Wed, 14 Oct 2020 09:09:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 37F4420B1F for ; Wed, 14 Oct 2020 09:09:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="XR6KUMdz" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728922AbgJNJJs (ORCPT ); Wed, 14 Oct 2020 05:09:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38360 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728980AbgJNJJi (ORCPT ); Wed, 14 Oct 2020 05:09:38 -0400 Received: from mail-pf1-x444.google.com (mail-pf1-x444.google.com [IPv6:2607:f8b0:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E619C041E5A for ; Tue, 13 Oct 2020 20:48:24 -0700 (PDT) Received: by mail-pf1-x444.google.com with SMTP id f19so1156736pfj.11 for ; Tue, 13 Oct 2020 20:48:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ymXjerOG7F5lrdWGzRbH2dXBpMBc6Bk/cbcPiJCkZ8U=; b=XR6KUMdz/2GweOB4GCYUsPp8Jzd54farqylH4yep5nPRsR2dSbCvsiWOswLUlRVmdv 4u1QZH8qUGoH2EtW1MgYMgjAuaHMqf8Ro/mdU0vxqZq8/wAZ36t8uvIBu+5bLW/MfJqN 2+PTBBpUYQc9wFB/4tsOyY2uFhyeErlqs+5JIDdpvqSDBwPYRj+s5Y3RsevHu2S4KpPe ziq2/1/qOr0AmOjIQIlR9HrttfuNK60VY7PbcJa84R9R70usrK9Lvz85dDVun68wInhX fqiYpjTxTqmtLkjOnpdGIqZXNrPv6HjlrA+5Vqb3zreggqBaWxLeD2GphCqVqx9GDHuk 2PnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ymXjerOG7F5lrdWGzRbH2dXBpMBc6Bk/cbcPiJCkZ8U=; b=LIDuCNctoGnLVTWhXNMe81KcBISkNJFmmWpr8ltqyK7gw946vkzejGDqA36rfwmgBq q+wmOigoJ1KyEWvLzYqbz6k+XiqEylilgPrWc8pDl2QD9SIRXDgBZ6sKw49NCTNwsnvO J2aMtrDtUEHD3Hd61fBEJ5MtYhwN0nD01uqWcKWEDb5tfjvllRhDIs6k81fndkNamJ5X H0iyumaU9nLYXsm7P31HzgJbBlhJIpqlG1po7LdMMQ1BGjN8j/YsP+nUYNf38uERK1bZ 3MkXwRiEPpO+CiFCzahqjJz7Ho6IumqByMDhoN11dgAKeJ/jYZhkup5c9Q915hea6f8T Qh3w== X-Gm-Message-State: AOAM533JU6ve3aJSnihg6iHiVNhvTuLObnqBGshywsFsnAgLviX2SLw1 Gj+DkXym+i0kpSwavhlrDd1jjAkvJSVOpg== X-Google-Smtp-Source: ABdhPJwiIobw+yCej5NzCkkjsBZVTawUOCUc9ttE3dxynXfYeAW7WODhgOInYUleNJQmNWT6lrh7bw== X-Received: by 2002:a65:6086:: with SMTP id t6mr2251146pgu.146.1602647303629; Tue, 13 Oct 2020 20:48:23 -0700 (PDT) Received: from sol.lan (106-69-182-59.dyn.iinet.net.au. [106.69.182.59]) by smtp.gmail.com with ESMTPSA id z73sm1362940pfc.75.2020.10.13.20.48.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Oct 2020 20:48:23 -0700 (PDT) From: Kent Gibson To: linux-gpio@vger.kernel.org, bgolaszewski@baylibre.com Cc: Kent Gibson Subject: [libgpiod][PATCH 2/2] tests: add check of event offset to wait_multiple Date: Wed, 14 Oct 2020 11:47:58 +0800 Message-Id: <20201014034758.19427-3-warthog618@gmail.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201014034758.19427-1-warthog618@gmail.com> References: <20201014034758.19427-1-warthog618@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org The offset field is added for uAPI v2, so extend the test to check that the value returned is correct. Signed-off-by: Kent Gibson --- tests/tests-event.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/tests-event.c b/tests/tests-event.c index a43f865..0e5effe 100644 --- a/tests/tests-event.c +++ b/tests/tests-event.c @@ -570,6 +570,7 @@ GPIOD_TEST_CASE(wait_multiple, 0, { 8 }) ret = gpiod_line_event_read(line, &ev); g_assert_cmpint(ret, ==, 0); g_assert_cmpint(ev.event_type, ==, GPIOD_LINE_EVENT_RISING_EDGE); + g_assert_cmpint(ev.offset, ==, 4); } GPIOD_TEST_CASE(get_fd_when_values_requested, 0, { 8 })