From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 8B36838449C0 for ; Wed, 10 Apr 2024 15:24:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8B36838449C0 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 8B36838449C0 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=VNyinPI2EWQgSUd5uYatmR1qUFoU3izZsB5kxzpIs530nhbc9g9CYFF73S2T6mTsSfHt+MCsMCjSmND7hWLdx5lBUQ9ElbXd8PvCEw/jSJmoRx3QyAIgaMZPfmv8VG2mw7luaA7/UzC9EA8pvbSYiKuuJlMqTkLUedIMMvPDjWE= 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=RlZPvNUGwhRo41sONzyhAAZuCsLczp+nJX0q6u8WeJkPDL+w7v/igI7viSb2pTfXIDxxXadKcNQz1DaTYOXAcH4Fp+YuE8zTezuN55y/7PtAL2ZktNTjGrzhjnMumYssefcI6VvMTn4APPaRzlYfWSFnoGK8wrER+I8VwewBOWo= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1712762693; 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=UxJ7yTX9ZxQdLGVMHn+YdvI/LJYH8aVKHepk24EqE3NROi4rQsEFYhV9fI03yimlNPS4Ra y4KfgrzHPFLG79JH6K4MunuRE/2oL3q/GTvowxiUeb3uFknZ6GBo8yyG+sY4GyCSB8lfRO iIVnsbhKvDRKoYI7MmG14hwVfTO+qHc= 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 Content-Type: text/plain Content-Transfer-Encoding: 8bit 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=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: 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); -- 2.44.0