Skip to content

Commit 31272e4

Browse files
authored
[libc++] Update locale grouping tests (#119463)
Fixes #119047
1 parent 1dac0cd commit 31272e4

File tree

2 files changed

+10
-28
lines changed

2 files changed

+10
-28
lines changed

libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/grouping.pass.cpp

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -89,27 +89,22 @@ int main(int, char**)
8989
}
9090
#endif
9191

92-
#if defined( _WIN32) || defined(_AIX)
93-
std::string us_grouping = "\3";
94-
#else
95-
std::string us_grouping = "\3\3";
96-
#endif
9792
{
9893
Fnf f(LOCALE_en_US_UTF_8, 1);
99-
assert(f.grouping() == us_grouping);
94+
assert(f.grouping() == "\3" || f.grouping() == "\3\3");
10095
}
10196
{
10297
Fnt f(LOCALE_en_US_UTF_8, 1);
103-
assert(f.grouping() == us_grouping);
98+
assert(f.grouping() == "\3" || f.grouping() == "\3\3");
10499
}
105100
#ifndef TEST_HAS_NO_WIDE_CHARACTERS
106101
{
107102
Fwf f(LOCALE_en_US_UTF_8, 1);
108-
assert(f.grouping() == us_grouping);
103+
assert(f.grouping() == "\3" || f.grouping() == "\3\3");
109104
}
110105
{
111106
Fwt f(LOCALE_en_US_UTF_8, 1);
112-
assert(f.grouping() == us_grouping);
107+
assert(f.grouping() == "\3" || f.grouping() == "\3\3");
113108
}
114109
#endif
115110

@@ -132,27 +127,22 @@ int main(int, char**)
132127
}
133128
#endif
134129

135-
#if defined( _WIN32) || defined(_AIX)
136-
std::string ru_grouping = "\3";
137-
#else
138-
std::string ru_grouping = "\3\3";
139-
#endif
140130
{
141131
Fnf f(LOCALE_ru_RU_UTF_8, 1);
142-
assert(f.grouping() == ru_grouping);
132+
assert(f.grouping() == "\3" || f.grouping() == "\3\3");
143133
}
144134
{
145135
Fnt f(LOCALE_ru_RU_UTF_8, 1);
146-
assert(f.grouping() == ru_grouping);
136+
assert(f.grouping() == "\3" || f.grouping() == "\3\3");
147137
}
148138
#ifndef TEST_HAS_NO_WIDE_CHARACTERS
149139
{
150140
Fwf f(LOCALE_ru_RU_UTF_8, 1);
151-
assert(f.grouping() == ru_grouping);
141+
assert(f.grouping() == "\3" || f.grouping() == "\3\3");
152142
}
153143
{
154144
Fwt f(LOCALE_ru_RU_UTF_8, 1);
155-
assert(f.grouping() == ru_grouping);
145+
assert(f.grouping() == "\3" || f.grouping() == "\3\3");
156146
}
157147
#endif
158148

libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct.byname/grouping.pass.cpp

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,21 +48,13 @@ int main(int, char**)
4848
{
4949
typedef char C;
5050
const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l);
51-
#if defined(_WIN32) || defined(_AIX)
52-
assert(np.grouping() == "\3");
53-
#else
54-
assert(np.grouping() == "\3\3");
55-
#endif
51+
assert(np.grouping() == "\3" || np.grouping() == "\3\3");
5652
}
5753
#ifndef TEST_HAS_NO_WIDE_CHARACTERS
5854
{
5955
typedef wchar_t C;
6056
const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l);
61-
# if defined(_WIN32) || defined(_AIX)
62-
assert(np.grouping() == "\3");
63-
# else
64-
assert(np.grouping() == "\3\3");
65-
# endif
57+
assert(np.grouping() == "\3" || np.grouping() == "\3\3");
6658
}
6759
#endif
6860
}

0 commit comments

Comments
 (0)