From patchwork Mon May 3 10:03:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Archie Pusaka X-Patchwork-Id: 430929 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=-26.2 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT,USER_IN_DEF_DKIM_WL 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 E5624C433B4 for ; Mon, 3 May 2021 10:04:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B55A5611AB for ; Mon, 3 May 2021 10:04:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233215AbhECKFA (ORCPT ); Mon, 3 May 2021 06:05:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47058 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233147AbhECKE7 (ORCPT ); Mon, 3 May 2021 06:04:59 -0400 Received: from mail-pl1-x64a.google.com (mail-pl1-x64a.google.com [IPv6:2607:f8b0:4864:20::64a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8BDF3C06174A for ; Mon, 3 May 2021 03:04:05 -0700 (PDT) Received: by mail-pl1-x64a.google.com with SMTP id m12-20020a170902db0cb02900eede9a042cso518195plx.20 for ; Mon, 03 May 2021 03:04:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:message-id:mime-version:subject:from:to:cc; bh=zJfC0G3Lz/5UGJXANbR7NBMfeIBJYHLXlTbAaZMoNWc=; b=FBGQONzGO0WU8n4RfBUK2B7fGCLXbOLdn4ZMSWOBtXjcvDqXZsg5m0wYxsaZoeDx++ +ns17QGkkqMPfJdoM5a5K1HqlTSRhhdUAjdvufkCNtDo9aUr0qkEO8kMbHgp1gCLZ9jg 5tE3VF479d18i2Jij30obd4u/wcGydjKif5SwBaaMC8u7nrGSexhqJCH5zDSp6PQlqB2 fLTyPooYwAVQColRO0djo/q85AZC28H7LodJ7182IYo8aluxjs22EaLu7N1wVvUtfvBo oef6IduBxcFEa44dzFi5be+7BKl+y5wLaERsscbf+IzzYcpwehUpNRBT13x0an0Qcn9M yWDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=zJfC0G3Lz/5UGJXANbR7NBMfeIBJYHLXlTbAaZMoNWc=; b=aICXKjIjYqWynm0+FICvQ2t5thyRBPuLNpygzVQB7ZIEdqfrntmHysMEiVTk/DK+ZA 82t3OsSGzgQDwp2T/Iwa786Lu6sL3jAKE7JOghOZzjVyaCNQVTUL2WjXWaPDvwXQ7KOy oKK7wqxJu1ctf3Hm6mJZ7XElpBNH7NzzBY5pNzziIFK9iZZCKS4R2qSEQCyVU0TY++BJ VYqjb5o8MQk2dtBERM2kywHrWxex3cdl5qC8Fp8EkAFP1GgNbDDQ9RoTbSTIMn/YhuGd qjJEB7SdPxMH6L7dLPxNyUx3Z0avGHwlXwoNmQpCzGt/WEXGernkCaWo7GzzfJmSAbFE w6Rg== X-Gm-Message-State: AOAM533QJR4SKWAVMiz7d3OAJakYeUUTJYUeq0a8GjTbyDowM5K8vi7d yDdrnvlPC3n9MMuJ/5YDPPl9KQCLPUg51AI+BoEnfQxPcjRg5sqkYclqjwaMmiH7q9rxEEBfhn1 /8UlJFlm5phpiu8ts9I48bt3SXvnrb84iTYt+O0ZNSCpZg4YbrtZooJskNuoNCC/BFJYakv192d in X-Google-Smtp-Source: ABdhPJwSh9L4kFMCDZK++2k1ZoET63Agbz4M5ZaCkfa9m1M6teIC0RnSLmnzzoPfuf6F/OsLoML8rNTEShHf X-Received: from apusaka-p920.tpe.corp.google.com ([2401:fa00:1:b:5010:35e5:ebd5:76d7]) (user=apusaka job=sendgmr) by 2002:a17:90a:4593:: with SMTP id v19mr29906418pjg.207.1620036244950; Mon, 03 May 2021 03:04:04 -0700 (PDT) Date: Mon, 3 May 2021 18:03:44 +0800 Message-Id: <20210503180321.Bluez.1.I462ae10efbf980757258cabcce883b212259a793@changeid> Mime-Version: 1.0 X-Mailer: git-send-email 2.31.1.527.g47e6f16901-goog Subject: [Bluez PATCH 1/2] unit/gobex: remove timer only when it's not removed yet From: Archie Pusaka To: linux-bluetooth , Luiz Augusto von Dentz Cc: CrosBT Upstreaming , Archie Pusaka , Sonny Sasaka , Yun-Hao Chung Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org From: Archie Pusaka There are instances where timer is removed because timeout has occurred, yet we still remove it again by the end of the test. This causes double removal and prints ugly messages which obscures the real culprit. Reviewed-by: Sonny Sasaka Reviewed-by: Yun-Hao Chung --- unit/test-gobex.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/unit/test-gobex.c b/unit/test-gobex.c index 6fbfa183ec..25a3646630 100644 --- a/unit/test-gobex.c +++ b/unit/test-gobex.c @@ -266,7 +266,8 @@ static void send_req(GObexPacket *req, GObexResponseFunc rsp_func, g_main_loop_unref(mainloop); mainloop = NULL; - g_source_remove(timer_id); + if (!g_error_matches(gerr, TEST_ERROR, TEST_ERROR_TIMEOUT)) + g_source_remove(timer_id); g_io_channel_unref(io); g_obex_unref(obex); @@ -450,7 +451,8 @@ static void test_cancel_req_delay(int transport_type) g_assert_no_error(r.err); - g_source_remove(timer_id); + if (!g_error_matches(r.err, TEST_ERROR, TEST_ERROR_TIMEOUT)) + g_source_remove(timer_id); g_io_channel_unref(io); g_source_remove(io_id); g_obex_unref(r.obex); @@ -551,7 +553,8 @@ static void test_send_connect(int transport_type) g_main_loop_unref(mainloop); mainloop = NULL; - g_source_remove(timer_id); + if (!g_error_matches(r.err, TEST_ERROR, TEST_ERROR_TIMEOUT)) + g_source_remove(timer_id); g_io_channel_unref(io); if (!r.completed) g_source_remove(io_id); @@ -612,7 +615,8 @@ static void test_recv_unexpected(void) g_main_loop_unref(mainloop); mainloop = NULL; - g_source_remove(timer_id); + if (!g_error_matches(err, TEST_ERROR, TEST_ERROR_TIMEOUT)) + g_source_remove(timer_id); g_io_channel_unref(io); g_obex_unref(obex); @@ -667,7 +671,8 @@ static void test_send_on_demand(int transport_type, GObexDataProducer func) g_main_loop_unref(mainloop); mainloop = NULL; - g_source_remove(timer_id); + if (!g_error_matches(r.err, TEST_ERROR, TEST_ERROR_TIMEOUT)) + g_source_remove(timer_id); g_io_channel_unref(io); if (!r.completed) g_source_remove(io_id); @@ -748,7 +753,8 @@ static void recv_connect(int transport_type) g_main_loop_run(mainloop); - g_source_remove(timer_id); + if (!g_error_matches(gerr, TEST_ERROR, TEST_ERROR_TIMEOUT)) + g_source_remove(timer_id); g_obex_unref(obex); g_io_channel_unref(io); @@ -800,7 +806,8 @@ static void test_disconnect(void) g_assert_no_error(gerr); - g_source_remove(timer_id); + if (!g_error_matches(gerr, TEST_ERROR, TEST_ERROR_TIMEOUT)) + g_source_remove(timer_id); g_io_channel_unref(io); g_obex_unref(obex); From patchwork Mon May 3 10:03:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Archie Pusaka X-Patchwork-Id: 430657 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=-26.2 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT,USER_IN_DEF_DKIM_WL 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 EDDB7C433B4 for ; Mon, 3 May 2021 10:04:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C79F8610C8 for ; Mon, 3 May 2021 10:04:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233216AbhECKFR (ORCPT ); Mon, 3 May 2021 06:05:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47088 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233218AbhECKFG (ORCPT ); Mon, 3 May 2021 06:05:06 -0400 Received: from mail-yb1-xb4a.google.com (mail-yb1-xb4a.google.com [IPv6:2607:f8b0:4864:20::b4a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 59ECDC06174A for ; Mon, 3 May 2021 03:04:12 -0700 (PDT) Received: by mail-yb1-xb4a.google.com with SMTP id g29-20020a25b11d0000b02904f44adeb480so7044189ybj.13 for ; Mon, 03 May 2021 03:04:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=LnUjlGz38MHKl4kK47ZhHWnpX3jjIoovM9n6tgvDXXM=; b=u09yMpWAPasl2MgwPxQ50J+YyrC+dasqn3OF7CheHr76D6OO8dCVVBQzklTa5ZCeJE R8dZr0WIw7R+aM6BxNgWgNUkXc9rae75XkFqT34/nRhDXk+GnX86tCTTVtmKOJ9xXnJA pnwZsvT3ZKGsRiTIu7rVRNG0hbec3U8h9qhsI0ekjHDrHpq1KCdnrLEpMvNSdBcYWhUc hFiXFGsFuuFR1jA+IgG4guj8/FeeyT+qatNBEEEKn+yMv4yLGOmatINfe+dEAK0KXBQF KKAfBsZe3wfPt/dfh2NmfrpdgipGQp6KXiIVZddNuulqn2CmPz/gImBsueDU+ywo5KrO /dMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=LnUjlGz38MHKl4kK47ZhHWnpX3jjIoovM9n6tgvDXXM=; b=mGbP8Msrx5NrNnDA76USzils6PmafGP/lKSVWbAmnHfbSnr6QfPraf8mJAKI+ibECZ LaeqVAJvyuXScPF7pS6M2ocDqLs9g5yp0v/HtzN+crGkr3zZrx6moVWteTAlrC0yopRX gYH14SttHgvKlLRLYKcgxYq5+d1f4LV8xW9CrT2WI9yo2Bh7wp0z6PckofeWVpJuAVo6 SiTam+BmT6SjSu668CfclxAZMA7p/J8DheQ4FBRca34NB6775b3wMDvU8r5JISPLiFvD Ex6U04RV71gJ95pKWvrEH4DNq/FLkQxeBLL6FzY2cEK6cFsmIuWi1tTrSRB18nVKSlXj +v8A== X-Gm-Message-State: AOAM532S1v78eOZRPQghFy+UfeXjdaiD+QcSiw4An64Y6n6Bh/TLeV2m 5gla6T/mmbwHWwpxA8L+KNcq1boiQmrYfid0FkRUmOrLirTrlFu7SChJphjR1SMFfD7naoRaVT6 12m2AT6mWx6QcMo/gFxgCkBOxaVU+1VoDBXxtWOm6SNDVCcp6FztvxlDCLQjiT8t+KA1a2uDzNC /R X-Google-Smtp-Source: ABdhPJwAcrnIn8uGPWUlYen5r4p8PyJHXs902p/nySerwaen496U5SemdT5BL78F+Uqe/JGQ2CX4DdqbN6Kh X-Received: from apusaka-p920.tpe.corp.google.com ([2401:fa00:1:b:5010:35e5:ebd5:76d7]) (user=apusaka job=sendgmr) by 2002:a25:2bc1:: with SMTP id r184mr26498538ybr.51.1620036251434; Mon, 03 May 2021 03:04:11 -0700 (PDT) Date: Mon, 3 May 2021 18:03:45 +0800 In-Reply-To: <20210503180321.Bluez.1.I462ae10efbf980757258cabcce883b212259a793@changeid> Message-Id: <20210503180321.Bluez.2.Ifd899edb45d3800750c6d04d6bde30a0115c007f@changeid> Mime-Version: 1.0 References: <20210503180321.Bluez.1.I462ae10efbf980757258cabcce883b212259a793@changeid> X-Mailer: git-send-email 2.31.1.527.g47e6f16901-goog Subject: [Bluez PATCH 2/2] Makefile.am: Hide test-gobex* behind OBEX flag From: Archie Pusaka To: linux-bluetooth , Luiz Augusto von Dentz Cc: CrosBT Upstreaming , Archie Pusaka , Sonny Sasaka , Yun-Hao Chung Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org From: Archie Pusaka If obex is disabled in the config, running gobex test is unnecessary. This patch skips gobex tests if obex is disabled. Reviewed-by: Sonny Sasaka Reviewed-by: Yun-Hao Chung --- Makefile.am | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Makefile.am b/Makefile.am index 2a222167f7..add80dde9e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -492,6 +492,7 @@ unit_test_gdbus_client_SOURCES = unit/test-gdbus-client.c unit_test_gdbus_client_LDADD = gdbus/libgdbus-internal.la \ src/libshared-glib.la $(GLIB_LIBS) $(DBUS_LIBS) +if OBEX unit_tests += unit/test-gobex-header unit/test-gobex-packet unit/test-gobex \ unit/test-gobex-transfer unit/test-gobex-apparam @@ -514,6 +515,7 @@ unit_test_gobex_transfer_LDADD = $(GLIB_LIBS) unit_test_gobex_apparam_SOURCES = $(gobex_sources) unit/util.c unit/util.h \ unit/test-gobex-apparam.c unit_test_gobex_apparam_LDADD = $(GLIB_LIBS) +endif unit_tests += unit/test-lib