[libcxx-commits] [libcxx] 3d118f2 - [libc++] Remove unique usage of the en_US locale in a test
Louis Dionne via libcxx-commits
libcxx-commits at lists.llvm.org
Fri Sep 30 12:00:05 PDT 2022
Author: Louis Dionne
Date: 2022-09-30T14:59:55-04:00
New Revision: 3d118f29014973fdb403237ca7ba3d944fb4c487
URL: https://github.com/llvm/llvm-project/commit/3d118f29014973fdb403237ca7ba3d944fb4c487
DIFF: https://github.com/llvm/llvm-project/commit/3d118f29014973fdb403237ca7ba3d944fb4c487.diff
LOG: [libc++] Remove unique usage of the en_US locale in a test
Differential Revision: https://reviews.llvm.org/D134914
Added:
Modified:
libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt.byname/ctor_char.pass.cpp
libcxx/test/support/platform_support.h
Removed:
################################################################################
diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt.byname/ctor_char.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt.byname/ctor_char.pass.cpp
index 33de9013378c4..ed4212cc82f14 100644
--- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt.byname/ctor_char.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt.byname/ctor_char.pass.cpp
@@ -13,6 +13,8 @@
// explicit codecvt_byname(const char* nm, size_t refs = 0);
// explicit codecvt_byname(const string& nm, size_t refs = 0);
+// REQUIRES: locale.en_US.UTF-8
+
#include <locale>
#include <cassert>
@@ -40,12 +42,12 @@ int my_facet::count = 0;
int main(int, char**)
{
{
- std::locale l(std::locale::classic(), new my_facet(LOCALE_en_US));
+ std::locale l(std::locale::classic(), new my_facet(LOCALE_en_US_UTF_8));
assert(my_facet::count == 1);
}
assert(my_facet::count == 0);
{
- my_facet f(LOCALE_en_US, 1);
+ my_facet f(LOCALE_en_US_UTF_8, 1);
assert(my_facet::count == 1);
{
std::locale l(std::locale::classic(), &f);
@@ -55,12 +57,12 @@ int main(int, char**)
}
assert(my_facet::count == 0);
{
- std::locale l(std::locale::classic(), new my_facet(std::string(LOCALE_en_US)));
+ std::locale l(std::locale::classic(), new my_facet(std::string(LOCALE_en_US_UTF_8)));
assert(my_facet::count == 1);
}
assert(my_facet::count == 0);
{
- my_facet f(std::string(LOCALE_en_US), 1);
+ my_facet f(std::string(LOCALE_en_US_UTF_8), 1);
assert(my_facet::count == 1);
{
std::locale l(std::locale::classic(), &f);
diff --git a/libcxx/test/support/platform_support.h b/libcxx/test/support/platform_support.h
index a6fa5661dfbfc..0ea9bf0ea8ce4 100644
--- a/libcxx/test/support/platform_support.h
+++ b/libcxx/test/support/platform_support.h
@@ -17,7 +17,6 @@
#include "test_macros.h"
// locale names
-#define LOCALE_en_US "en_US"
#define LOCALE_en_US_UTF_8 "en_US.UTF-8"
#define LOCALE_fr_FR_UTF_8 "fr_FR.UTF-8"
#ifdef __linux__
More information about the libcxx-commits
mailing list