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 DF6E33858425 for ; Mon, 4 Sep 2023 13:33:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DF6E33858425 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-433-DGynikBIPQ-7d2tpM5651Q-1; Mon, 04 Sep 2023 09:33:20 -0400 X-MC-Unique: DGynikBIPQ-7d2tpM5651Q-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E4B7F38041D1 for ; Mon, 4 Sep 2023 13:33:19 +0000 (UTC) Received: from oldenburg3.str.redhat.com (unknown [10.39.194.68]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8E386140E963 for ; Mon, 4 Sep 2023 13:33:19 +0000 (UTC) From: Florian Weimer To: libc-alpha@sourceware.org Subject: [PATCH] intl: Add test case for bug 16621 Date: Mon, 04 Sep 2023 15:33:18 +0200 Message-ID: <87o7iiukpt.fsf@oldenburg3.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-34.5 required=5.0 tests=BAYES_00,GIT_PATCH_0,KAM_DMARC_NONE,KAM_DMARC_STATUS,KAM_LAZY_DOMAIN_SECURITY,KAM_NUMSUBJECT,KAM_SHORT,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: --- intl/Makefile | 6 +++++- intl/tst-gettext-c-utf8.c | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 1 deletion(-) diff --git a/intl/Makefile b/intl/Makefile index d7223256eb..a6dd138dad 100644 --- a/intl/Makefile +++ b/intl/Makefile @@ -32,7 +32,10 @@ test-srcs := tst-gettext tst-translit tst-gettext2 tst-codeset tst-gettext3 ifeq ($(have-thread-library),yes) test-srcs += $(multithread-test-srcs) endif -tests = tst-ngettext +tests = \ + tst-gettext-c-utf8 \ + tst-ngettext \ + # tests before-compile += $(objpfx)msgs.h @@ -117,6 +120,7 @@ $(objpfx)tst-gettext3.out: $(gen-locales) $(objpfx)tst-gettext4.out: $(gen-locales) $(objpfx)tst-gettext5.out: $(gen-locales) $(objpfx)tst-gettext6.out: $(gen-locales) +$(objpfx)tst-gettext-c-utf8.out: $(gen-locales) $(objpfx)tst-translit.out: $(gen-locales) endif diff --git a/intl/tst-gettext-c-utf8.c b/intl/tst-gettext-c-utf8.c new file mode 100644 index 0000000000..bdb9b5396c --- /dev/null +++ b/intl/tst-gettext-c-utf8.c @@ -0,0 +1,37 @@ +/* Check that C.UTF-8 uses C translations (bug 16621). + Copyright (C) 2021-2023 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include +#include +#include +#include +#include + +static int +do_test (void) +{ + if (setenv ("LANGUAGE", "de_DE.UTF-8", 1) != 0) + FAIL_EXIT1 ("setenv"); + if (setenv ("LC_ALL", "C.UTF-8", 1) != 0) + FAIL_EXIT1 ("setenv"); + xsetlocale (LC_ALL, ""); + TEST_COMPARE_STRING (strerror (ENOENT), "No such file or directory"); + return 0; +} + +#include base-commit: 2897b231a6b71ee17d47d3d63f1112b2641a476c