From patchwork Thu Apr 10 05:06:13 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 110157 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9FBEF383CA8F for ; Thu, 10 Apr 2025 05:06:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9FBEF383CA8F Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=WtVLtL04 X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id D286B384A47B for ; Thu, 10 Apr 2025 05:06:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D286B384A47B Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org D286B384A47B Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1744261581; cv=none; b=Ocz1rj/1ERgfjHdnA7VnYPUFwsWWsthS86TqWvhQlB7pSIjy96zx5OCu28tAwu/PZ0JhDOlcaA2vtFgJCu4oZkDS3yp3lhfH2cNBIkD8jkGHxQ5FuoXAK/TpzKXUuLoPyte+0lLWwwM+Nuh2rATpLg7sJKet+nUZL/84bgY54Hw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1744261581; c=relaxed/simple; bh=SkSlrfneui0WtBX9vK1ShJcICk/4YFBZSp4dqLuwf5k=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=pCt6vpibZHQyaS74TzkqGv+yaribbwWQohxQj+NRfhqHx439sDA3ifJrgn/0owVygC0vM0bS4uKVPGoxsdzpWgHIP36gnPWLZBQCBjvZynsDBxC68h9Ofk7p3RnHmVGUrW8eaeJJ5WsKGtX5t5S0ye/OkIqqXv6VAw0q0dAoVMs= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D286B384A47B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1744261581; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=YpWvc6o5p4fuBgjN7jJBAglOXdg7ePusmIKlfq+FoEo=; b=WtVLtL04qHe+rFAaERiqY1Q/zGCT8VGGksOH6puPjPBptLfu/fs/4lGikQR4/6a+TJGSGB w2IDygY0d7BSpf7pcfYIeA6RezDx2m+19G5H5eIqA30S4fBsgDvFE1lKOOqiVetuc1XNvR QqTP7CKeAg9TGV2WWeQoh+HsDPioUiE= Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-138-MQV1FRmmPWmQ5e9KqEa40g-1; Thu, 10 Apr 2025 01:06:18 -0400 X-MC-Unique: MQV1FRmmPWmQ5e9KqEa40g-1 X-Mimecast-MFC-AGG-ID: MQV1FRmmPWmQ5e9KqEa40g_1744261578 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 2A74F195609E for ; Thu, 10 Apr 2025 05:06:18 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.44.32.39]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 350E5180175D for ; Thu, 10 Apr 2025 05:06:16 +0000 (UTC) From: Florian Weimer To: libc-alpha@sourceware.org Subject: [PATCH v3] timezone: Enhance tst-bz28707 diagnostics Date: Thu, 10 Apr 2025 07:06:13 +0200 Message-ID: <878qo8k3lm.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: YbVnf3snqdHoEW2oJ5yKzmOpd65r1HyQGAbkUoV90gM_1744261578 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-11.1 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~patchwork=sourceware.org@sourceware.org This hopefully provides additional information about why the test failed, in case the fix in commit 62db87ab24f9ca483f97f ("timezone: Fix tst-bz28707 Makefile rule") turns out to be insufficient. Reviewed-by: Paul Eggert --- v3: Add comment about the errno diagnostic after tzset. timezone/tst-bz28707.c | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) base-commit: 77e8b40a6ef4dc70c373523f7ac46e726089906f diff --git a/timezone/tst-bz28707.c b/timezone/tst-bz28707.c index a5723f4b8a..a03cd1f7ca 100644 --- a/timezone/tst-bz28707.c +++ b/timezone/tst-bz28707.c @@ -15,10 +15,11 @@ License along with the GNU C Library; if not, see . */ -#include +#include #include #include -#include +#include +#include /* Test that we can use a truncated timezone-file, where the time-type at index 0 is not indexed by the transition-types array (and the @@ -28,19 +29,24 @@ static int do_test (void) { - if (setenv ("TZ", "XT5", 1)) - { - puts ("setenv failed."); - return 1; - } + if (setenv ("TZ", "XT5", 1) != 0) + FAIL_EXIT1 ("setenv: %m"); + errno = 0; tzset (); + if (errno != 0) + /* This is not a test failure because checking errno this way is + not a documented way for determining tzset success. We do this + only to gather additional diagnostics. */ + printf ("warning: tzset set errno to %d (%m)", errno); - return - /* Sanity-check that we got the right abbreviation for DST. For - normal time, we're likely to get "-00" (the "unspecified" marker), - even though the POSIX timezone string says "-04". Let's not test - that. */ - !(strcmp (tzname[1], "-03") == 0); + /* Sanity-check that we got the right abbreviation for DST. For + normal time, we're likely to get "-00" (the "unspecified" marker), + even though the POSIX timezone string says "-04". Let's not test + that. */ + TEST_COMPARE_STRING (tzname[1], "-03"); + + return 0; } + #include