From patchwork Wed Apr 10 15:24:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 1922102 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=MrJrLr0R; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VF6Bz37Nsz1yYS for ; Thu, 11 Apr 2024 01:27:23 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9FD53384601F for ; Wed, 10 Apr 2024 15:27:21 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 424273845BC1 for ; Wed, 10 Apr 2024 15:24:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 424273845BC1 Authentication-Results: sourceware.org; dmarc=pass (p=none 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 424273845BC1 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712762695; cv=none; b=frZCywhJWF7HlvuHBH4p0+Sb8OhZTiUPDnY9KrYjnp7rZ0SdoabUmz0PycaFEmLmn8PaBAsz8RW5PXxkpfk2v/+zsRzTEzAzQ0RE0CaD5RIzcADWnvZj+C07HljcuxtT0ZC2lAvyVgVExTfJur6eaTI7OWq+/XD/1gMYNUQRkik= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712762695; c=relaxed/simple; bh=HD4hxZEUVJ/E/Z6Shor7J9tUnoMnhx7ATFzvD6PLCNc=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=lVXVnwbz0QO8Xp/RSXMUG9wZjSeNGAd3JYwa0N78cGFaR7dW/UOGtrtYABiw61rhDcjv/fIPY8AKdw2270BtgycsPdXpPuiiPb1ill3L0mXiCEFdsab/2iJS4DbTnx3K+JlbcxIILlyabJvtoeRtlpBqFXBAQnggeQVynyZnGFQ= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1712762694; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4mFs4Zjhwp8HFRaQANhxvlAlkTIICWfzs/a9SYE0i2M=; b=MrJrLr0RFbUVbFHJNJXAOIF8dVWKkxq5BlVMIj2sVsU5VHrwvqVAgQeijW9Ff1ikccOiBy BO/yvpKVxvvSxt20XZ/VD6Dyhec+mHQYLoJB1b8Grn4t6E4ioh9YrT+RbOfd4sSP0jiyI6 AavNcFUUZ+vwBBgxl6AWUBdA9bYA63Q= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-367-V7tnECnsNAiyz76n80sulQ-1; Wed, 10 Apr 2024 11:24:51 -0400 X-MC-Unique: V7tnECnsNAiyz76n80sulQ-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (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 mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4B1361C0C640; Wed, 10 Apr 2024 15:24:51 +0000 (UTC) Received: from localhost (unknown [10.42.28.163]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1B3A71121306; Wed, 10 Apr 2024 15:24:51 +0000 (UTC) From: Jonathan Wakely To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [committed] libstdc++: Adjust expected locale-dependent date formats in tests Date: Wed, 10 Apr 2024 16:24:40 +0100 Message-ID: <20240410152446.374524-1-jwakely@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-13.1 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Tested x86_64-linux and x86_64-freebsd14. Pushed to trunk. -- >8 -- The std/time/year_month_day/io.cc test assumes that %x in the fr_FR locale is %d/%m/%Y but on FreeBSD it is %d.%m.%Y instead. Make the test PASS for either format. Similarly, 27_io/manipulators/extended/get_time/char/2.cc expects that %a in the de_DE locale is "Di" but on FreeBSD it's "Di." with a trailing period. Adjust the input string to be "1971 Di." instead of "Di 1971" and that way if %a doesn't expect the trailing '.' it simply won't extract it from the stream. This fixes: FAIL: std/time/year_month_day/io.cc -std=gnu++20 execution test FAIL: 27_io/manipulators/extended/get_time/char/2.cc -std=gnu++17 execution test libstdc++-v3/ChangeLog: * testsuite/27_io/manipulators/extended/get_time/char/2.cc: Adjust input string so that it matches %a with or without a trailing period. * testsuite/std/time/year_month_day/io.cc: Adjust expected format for %x in the fr_FR locale. --- .../27_io/manipulators/extended/get_time/char/2.cc | 6 +++--- libstdc++-v3/testsuite/std/time/year_month_day/io.cc | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libstdc++-v3/testsuite/27_io/manipulators/extended/get_time/char/2.cc b/libstdc++-v3/testsuite/27_io/manipulators/extended/get_time/char/2.cc index 6104349d254..b582967fddc 100644 --- a/libstdc++-v3/testsuite/27_io/manipulators/extended/get_time/char/2.cc +++ b/libstdc++-v3/testsuite/27_io/manipulators/extended/get_time/char/2.cc @@ -35,9 +35,9 @@ void test01() VERIFY( loc_de != loc_c ); istringstream iss; iss.imbue(loc_de); - iss.str("Di 1971"); - tm time1; - iss >> get_time(&time1, "%a %Y"); + iss.str("1971 Di."); // %a is "Di" on some targets, "Di." on others. + tm time1{}; + iss >> get_time(&time1, "%Y %a"); VERIFY(time1.tm_wday == 2); VERIFY(time1.tm_year == 71); } diff --git a/libstdc++-v3/testsuite/std/time/year_month_day/io.cc b/libstdc++-v3/testsuite/std/time/year_month_day/io.cc index cb82ef3b612..632b7a0fc2d 100644 --- a/libstdc++-v3/testsuite/std/time/year_month_day/io.cc +++ b/libstdc++-v3/testsuite/std/time/year_month_day/io.cc @@ -84,7 +84,7 @@ test_format() s = std::format(loc_fr, "{:%x}", 2022y/December/19); VERIFY( s == "12/19/22" ); s = std::format(loc_fr, "{:L%x}", 2022y/December/19); - VERIFY( s == "19/12/2022" ); + VERIFY( s == "19/12/2022" || s == "19.12.2022" ); // depends on locale defs s = std::format(loc_fr, "{}", 2022y/December/19); VERIFY( s == "2022-12-19" ); s = std::format(loc_fr, "{:L%F}", 2022y/December/19);