-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[libc++][locale] Update grouping tests #119463
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[libc++][locale] Update grouping tests #119463
Conversation
Created using spr 1.3.4
@llvm/pr-subscribers-libcxx Author: Vitaly Buka (vitalybuka) ChangesFull diff: https://github.com/llvm/llvm-project/pull/119463.diff 2 Files Affected:
diff --git a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/grouping.pass.cpp b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/grouping.pass.cpp
index ca5b6736f32726..6f23d444f2fe9d 100644
--- a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/grouping.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/grouping.pass.cpp
@@ -24,6 +24,7 @@
// string grouping() const;
+#include <iostream>
#include <locale>
#include <limits>
#include <cassert>
@@ -89,27 +90,22 @@ int main(int, char**)
}
#endif
-#if defined( _WIN32) || defined(_AIX)
- std::string us_grouping = "\3";
-#else
- std::string us_grouping = "\3\3";
-#endif
{
Fnf f(LOCALE_en_US_UTF_8, 1);
- assert(f.grouping() == us_grouping);
+ assert(f.grouping() == "\3" || f.grouping() == "\3\3");
}
{
Fnt f(LOCALE_en_US_UTF_8, 1);
- assert(f.grouping() == us_grouping);
+ assert(f.grouping() == "\3" || f.grouping() == "\3\3");
}
#ifndef TEST_HAS_NO_WIDE_CHARACTERS
{
Fwf f(LOCALE_en_US_UTF_8, 1);
- assert(f.grouping() == us_grouping);
+ assert(f.grouping() == "\3" || f.grouping() == "\3\3");
}
{
Fwt f(LOCALE_en_US_UTF_8, 1);
- assert(f.grouping() == us_grouping);
+ assert(f.grouping() == "\3" || f.grouping() == "\3\3");
}
#endif
@@ -132,27 +128,22 @@ int main(int, char**)
}
#endif
-#if defined( _WIN32) || defined(_AIX)
- std::string ru_grouping = "\3";
-#else
- std::string ru_grouping = "\3\3";
-#endif
{
Fnf f(LOCALE_ru_RU_UTF_8, 1);
- assert(f.grouping() == ru_grouping);
+ assert(f.grouping() == "\3" || f.grouping() == "\3\3");
}
{
Fnt f(LOCALE_ru_RU_UTF_8, 1);
- assert(f.grouping() == ru_grouping);
+ assert(f.grouping() == "\3" || f.grouping() == "\3\3");
}
#ifndef TEST_HAS_NO_WIDE_CHARACTERS
{
Fwf f(LOCALE_ru_RU_UTF_8, 1);
- assert(f.grouping() == ru_grouping);
+ assert(f.grouping() == "\3" || f.grouping() == "\3\3");
}
{
Fwt f(LOCALE_ru_RU_UTF_8, 1);
- assert(f.grouping() == ru_grouping);
+ assert(f.grouping() == "\3" || f.grouping() == "\3\3");
}
#endif
diff --git a/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct.byname/grouping.pass.cpp b/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct.byname/grouping.pass.cpp
index 86c447d400aaae..1e68bb3967f0f3 100644
--- a/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct.byname/grouping.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct.byname/grouping.pass.cpp
@@ -48,21 +48,13 @@ int main(int, char**)
{
typedef char C;
const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l);
-#if defined(_WIN32) || defined(_AIX)
- assert(np.grouping() == "\3");
-#else
- assert(np.grouping() == "\3\3");
-#endif
+ assert(np.grouping() == "\3" || np.grouping() == "\3\3");
}
#ifndef TEST_HAS_NO_WIDE_CHARACTERS
{
typedef wchar_t C;
const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l);
-# if defined(_WIN32) || defined(_AIX)
- assert(np.grouping() == "\3");
-# else
- assert(np.grouping() == "\3\3");
-# endif
+ assert(np.grouping() == "\3" || np.grouping() == "\3\3");
}
#endif
}
|
#119047 is probably the issue. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, but I believe someone in reviewers-libcxx needs to approve it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM but someone in reviewers-libcxx needs to approve
I am not sure when it happen, but these tests started to fail.
Checkout to 6 month back does not help, but I am sure it worked then.
I believe it can be related to some update, e.g. gcc:
Fixes #119047.