[libcxx-commits] [libcxx] [libcxx][test][AIX] address more platform differences in locale tests (PR #94826)

via libcxx-commits libcxx-commits at lists.llvm.org
Fri Jun 7 18:38:35 PDT 2024


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff c348e265bd1284f770e66639633199fefd8015ec 04fcf9ea4d9a5273de962cb48c236bd8c165a963 -- libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_fr_FR.pass.cpp libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_zh_CN.pass.cpp libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_fr_FR.pass.cpp libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_zh_CN.pass.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_fr_FR.pass.cpp b/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_fr_FR.pass.cpp
index 1ce64ee218..bbb67d6949 100644
--- a/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_fr_FR.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_fr_FR.pass.cpp
@@ -32,9 +32,9 @@
 
 #ifdef _AIX
 // the AIX libc expects U202F as LC_MONETARY thousands_sep
-#define THOUSANDS_SEP L"\u202F"
+#  define THOUSANDS_SEP L"\u202F"
 #else
-#define THOUSANDS_SEP L" "
+#  define THOUSANDS_SEP L" "
 #endif
 
 typedef std::money_get<char, cpp17_input_iterator<const char*> > Fn;
@@ -437,26 +437,24 @@ int main(int, char**)
             assert(ex == -1);
         }
         {   // positive
-            std::wstring v = convert_thousands_sep(L"1" THOUSANDS_SEP "234" THOUSANDS_SEP "567,89 ");
-            typedef cpp17_input_iterator<const wchar_t*> I;
-            long double ex;
-            std::ios_base::iostate err = std::ios_base::goodbit;
-            I iter = f.get(I(v.data()), I(v.data() + v.size()),
-                                                false, ios, err, ex);
-            assert(base(iter) == v.data() + v.size());
-            assert(err == std::ios_base::eofbit);
-            assert(ex == 123456789);
+          std::wstring v = convert_thousands_sep(L"1" THOUSANDS_SEP "234" THOUSANDS_SEP "567,89 ");
+          typedef cpp17_input_iterator<const wchar_t*> I;
+          long double ex;
+          std::ios_base::iostate err = std::ios_base::goodbit;
+          I iter                     = f.get(I(v.data()), I(v.data() + v.size()), false, ios, err, ex);
+          assert(base(iter) == v.data() + v.size());
+          assert(err == std::ios_base::eofbit);
+          assert(ex == 123456789);
         }
         {   // negative
-            std::wstring v = convert_thousands_sep(L"-1" THOUSANDS_SEP "234" THOUSANDS_SEP "567,89");
-            typedef cpp17_input_iterator<const wchar_t*> I;
-            long double ex;
-            std::ios_base::iostate err = std::ios_base::goodbit;
-            I iter = f.get(I(v.data()), I(v.data() + v.size()),
-                                                false, ios, err, ex);
-            assert(base(iter) == v.data() + v.size());
-            assert(err == std::ios_base::eofbit);
-            assert(ex == -123456789);
+          std::wstring v = convert_thousands_sep(L"-1" THOUSANDS_SEP "234" THOUSANDS_SEP "567,89");
+          typedef cpp17_input_iterator<const wchar_t*> I;
+          long double ex;
+          std::ios_base::iostate err = std::ios_base::goodbit;
+          I iter                     = f.get(I(v.data()), I(v.data() + v.size()), false, ios, err, ex);
+          assert(base(iter) == v.data() + v.size());
+          assert(err == std::ios_base::eofbit);
+          assert(ex == -123456789);
         }
         {   // negative
             std::wstring v = L"-1234567,89";
@@ -517,64 +515,59 @@ int main(int, char**)
             assert(ex == -1);
         }
         {   // positive, showbase
-            std::wstring v = convert_thousands_sep(L"1" THOUSANDS_SEP "234" THOUSANDS_SEP "567,89 \u20ac");  // EURO SIGN
-            typedef cpp17_input_iterator<const wchar_t*> I;
-            long double ex;
-            std::ios_base::iostate err = std::ios_base::goodbit;
-            I iter = f.get(I(v.data()), I(v.data() + v.size()),
-                                                false, ios, err, ex);
-            assert(base(iter) == v.data() + v.size());
-            assert(err == std::ios_base::eofbit);
-            assert(ex == 123456789);
+          std::wstring v = convert_thousands_sep(L"1" THOUSANDS_SEP "234" THOUSANDS_SEP "567,89 \u20ac"); // EURO SIGN
+          typedef cpp17_input_iterator<const wchar_t*> I;
+          long double ex;
+          std::ios_base::iostate err = std::ios_base::goodbit;
+          I iter                     = f.get(I(v.data()), I(v.data() + v.size()), false, ios, err, ex);
+          assert(base(iter) == v.data() + v.size());
+          assert(err == std::ios_base::eofbit);
+          assert(ex == 123456789);
         }
         {   // positive, showbase
-            std::wstring v = convert_thousands_sep(L"1" THOUSANDS_SEP "234" THOUSANDS_SEP "567,89 \u20ac");  // EURO SIGN
-            std::showbase(ios);
-            typedef cpp17_input_iterator<const wchar_t*> I;
-            long double ex;
-            std::ios_base::iostate err = std::ios_base::goodbit;
-            I iter = f.get(I(v.data()), I(v.data() + v.size()),
-                                                false, ios, err, ex);
-            assert(base(iter) == v.data() + v.size());
-            assert(err == std::ios_base::eofbit);
-            assert(ex == 123456789);
-            std::noshowbase(ios);
+          std::wstring v = convert_thousands_sep(L"1" THOUSANDS_SEP "234" THOUSANDS_SEP "567,89 \u20ac"); // EURO SIGN
+          std::showbase(ios);
+          typedef cpp17_input_iterator<const wchar_t*> I;
+          long double ex;
+          std::ios_base::iostate err = std::ios_base::goodbit;
+          I iter                     = f.get(I(v.data()), I(v.data() + v.size()), false, ios, err, ex);
+          assert(base(iter) == v.data() + v.size());
+          assert(err == std::ios_base::eofbit);
+          assert(ex == 123456789);
+          std::noshowbase(ios);
         }
         {   // negative, showbase
-            std::wstring v = convert_thousands_sep(L"-1" THOUSANDS_SEP "234" THOUSANDS_SEP "567,89 \u20ac");  // EURO SIGN
-            std::showbase(ios);
-            typedef cpp17_input_iterator<const wchar_t*> I;
-            long double ex;
-            std::ios_base::iostate err = std::ios_base::goodbit;
-            I iter = f.get(I(v.data()), I(v.data() + v.size()),
-                                                false, ios, err, ex);
-            assert(base(iter) == v.data() + v.size());
-            assert(err == std::ios_base::eofbit);
-            assert(ex == -123456789);
-            std::noshowbase(ios);
+          std::wstring v = convert_thousands_sep(L"-1" THOUSANDS_SEP "234" THOUSANDS_SEP "567,89 \u20ac"); // EURO SIGN
+          std::showbase(ios);
+          typedef cpp17_input_iterator<const wchar_t*> I;
+          long double ex;
+          std::ios_base::iostate err = std::ios_base::goodbit;
+          I iter                     = f.get(I(v.data()), I(v.data() + v.size()), false, ios, err, ex);
+          assert(base(iter) == v.data() + v.size());
+          assert(err == std::ios_base::eofbit);
+          assert(ex == -123456789);
+          std::noshowbase(ios);
         }
         {   // negative, showbase
-            std::wstring v = convert_thousands_sep(L"1" THOUSANDS_SEP "234" THOUSANDS_SEP "567,89 EUR -");
-            std::showbase(ios);
-            typedef cpp17_input_iterator<const wchar_t*> I;
-            long double ex;
-            std::ios_base::iostate err = std::ios_base::goodbit;
-            I iter = f.get(I(v.data()), I(v.data() + v.size()),
-                                                false, ios, err, ex);
-            assert(base(iter) == v.data() + 13);
-            assert(err == std::ios_base::failbit);
-            std::noshowbase(ios);
+          std::wstring v = convert_thousands_sep(L"1" THOUSANDS_SEP "234" THOUSANDS_SEP "567,89 EUR -");
+          std::showbase(ios);
+          typedef cpp17_input_iterator<const wchar_t*> I;
+          long double ex;
+          std::ios_base::iostate err = std::ios_base::goodbit;
+          I iter                     = f.get(I(v.data()), I(v.data() + v.size()), false, ios, err, ex);
+          assert(base(iter) == v.data() + 13);
+          assert(err == std::ios_base::failbit);
+          std::noshowbase(ios);
         }
         {   // negative, showbase
-            std::wstring v = convert_thousands_sep(L"1" THOUSANDS_SEP "234" THOUSANDS_SEP "567,89 EUR -");
-            typedef cpp17_input_iterator<const wchar_t*> I;
-            long double ex;
-            std::ios_base::iostate err = std::ios_base::goodbit;
-            I iter = f.get(I(v.data()), I(v.data() + v.size()),
-                                                false, ios, err, ex);
-            assert(base(iter) == v.data() + 13);
-            assert(err == std::ios_base::goodbit);
-            assert(ex == 123456789);
+          std::wstring v = convert_thousands_sep(L"1" THOUSANDS_SEP "234" THOUSANDS_SEP "567,89 EUR -");
+          typedef cpp17_input_iterator<const wchar_t*> I;
+          long double ex;
+          std::ios_base::iostate err = std::ios_base::goodbit;
+          I iter                     = f.get(I(v.data()), I(v.data() + v.size()), false, ios, err, ex);
+          assert(base(iter) == v.data() + 13);
+          assert(err == std::ios_base::goodbit);
+          assert(ex == 123456789);
         }
     }
     {
@@ -603,26 +596,24 @@ int main(int, char**)
             assert(ex == -1);
         }
         {   // positive
-            std::wstring v = convert_thousands_sep(L"1" THOUSANDS_SEP "234" THOUSANDS_SEP "567,89 ");
-            typedef cpp17_input_iterator<const wchar_t*> I;
-            long double ex;
-            std::ios_base::iostate err = std::ios_base::goodbit;
-            I iter = f.get(I(v.data()), I(v.data() + v.size()),
-                                                true, ios, err, ex);
-            assert(base(iter) == v.data() + v.size());
-            assert(err == std::ios_base::eofbit);
-            assert(ex == 123456789);
+          std::wstring v = convert_thousands_sep(L"1" THOUSANDS_SEP "234" THOUSANDS_SEP "567,89 ");
+          typedef cpp17_input_iterator<const wchar_t*> I;
+          long double ex;
+          std::ios_base::iostate err = std::ios_base::goodbit;
+          I iter                     = f.get(I(v.data()), I(v.data() + v.size()), true, ios, err, ex);
+          assert(base(iter) == v.data() + v.size());
+          assert(err == std::ios_base::eofbit);
+          assert(ex == 123456789);
         }
         {   // negative
-            std::wstring v = convert_thousands_sep(L"-1" THOUSANDS_SEP "234" THOUSANDS_SEP "567,89");
-            typedef cpp17_input_iterator<const wchar_t*> I;
-            long double ex;
-            std::ios_base::iostate err = std::ios_base::goodbit;
-            I iter = f.get(I(v.data()), I(v.data() + v.size()),
-                                                true, ios, err, ex);
-            assert(base(iter) == v.data() + v.size());
-            assert(err == std::ios_base::eofbit);
-            assert(ex == -123456789);
+          std::wstring v = convert_thousands_sep(L"-1" THOUSANDS_SEP "234" THOUSANDS_SEP "567,89");
+          typedef cpp17_input_iterator<const wchar_t*> I;
+          long double ex;
+          std::ios_base::iostate err = std::ios_base::goodbit;
+          I iter                     = f.get(I(v.data()), I(v.data() + v.size()), true, ios, err, ex);
+          assert(base(iter) == v.data() + v.size());
+          assert(err == std::ios_base::eofbit);
+          assert(ex == -123456789);
         }
         {   // negative
             std::wstring v = L"-1234567,89";
@@ -683,64 +674,59 @@ int main(int, char**)
             assert(ex == -1);
         }
         {   // positive, showbase
-            std::wstring v = convert_thousands_sep(L"1" THOUSANDS_SEP "234" THOUSANDS_SEP "567,89 EUR");
-            typedef cpp17_input_iterator<const wchar_t*> I;
-            long double ex;
-            std::ios_base::iostate err = std::ios_base::goodbit;
-            I iter = f.get(I(v.data()), I(v.data() + v.size()),
-                                                true, ios, err, ex);
-            assert(base(iter) == v.data() + v.size());
-            assert(err == std::ios_base::eofbit);
-            assert(ex == 123456789);
+          std::wstring v = convert_thousands_sep(L"1" THOUSANDS_SEP "234" THOUSANDS_SEP "567,89 EUR");
+          typedef cpp17_input_iterator<const wchar_t*> I;
+          long double ex;
+          std::ios_base::iostate err = std::ios_base::goodbit;
+          I iter                     = f.get(I(v.data()), I(v.data() + v.size()), true, ios, err, ex);
+          assert(base(iter) == v.data() + v.size());
+          assert(err == std::ios_base::eofbit);
+          assert(ex == 123456789);
         }
         {   // positive, showbase
-            std::wstring v = convert_thousands_sep(L"1" THOUSANDS_SEP "234" THOUSANDS_SEP "567,89 EUR");
-            std::showbase(ios);
-            typedef cpp17_input_iterator<const wchar_t*> I;
-            long double ex;
-            std::ios_base::iostate err = std::ios_base::goodbit;
-            I iter = f.get(I(v.data()), I(v.data() + v.size()),
-                                                true, ios, err, ex);
-            assert(base(iter) == v.data() + v.size());
-            assert(err == std::ios_base::eofbit);
-            assert(ex == 123456789);
-            std::noshowbase(ios);
+          std::wstring v = convert_thousands_sep(L"1" THOUSANDS_SEP "234" THOUSANDS_SEP "567,89 EUR");
+          std::showbase(ios);
+          typedef cpp17_input_iterator<const wchar_t*> I;
+          long double ex;
+          std::ios_base::iostate err = std::ios_base::goodbit;
+          I iter                     = f.get(I(v.data()), I(v.data() + v.size()), true, ios, err, ex);
+          assert(base(iter) == v.data() + v.size());
+          assert(err == std::ios_base::eofbit);
+          assert(ex == 123456789);
+          std::noshowbase(ios);
         }
         {   // negative, showbase
-            std::wstring v = convert_thousands_sep(L"-1" THOUSANDS_SEP "234" THOUSANDS_SEP "567,89 EUR");
-            std::showbase(ios);
-            typedef cpp17_input_iterator<const wchar_t*> I;
-            long double ex;
-            std::ios_base::iostate err = std::ios_base::goodbit;
-            I iter = f.get(I(v.data()), I(v.data() + v.size()),
-                                                true, ios, err, ex);
-            assert(base(iter) == v.data() + v.size());
-            assert(err == std::ios_base::eofbit);
-            assert(ex == -123456789);
-            std::noshowbase(ios);
+          std::wstring v = convert_thousands_sep(L"-1" THOUSANDS_SEP "234" THOUSANDS_SEP "567,89 EUR");
+          std::showbase(ios);
+          typedef cpp17_input_iterator<const wchar_t*> I;
+          long double ex;
+          std::ios_base::iostate err = std::ios_base::goodbit;
+          I iter                     = f.get(I(v.data()), I(v.data() + v.size()), true, ios, err, ex);
+          assert(base(iter) == v.data() + v.size());
+          assert(err == std::ios_base::eofbit);
+          assert(ex == -123456789);
+          std::noshowbase(ios);
         }
         {   // negative, showbase
-            std::wstring v = convert_thousands_sep(L"1" THOUSANDS_SEP "234" THOUSANDS_SEP "567,89 Eu-");
-            std::showbase(ios);
-            typedef cpp17_input_iterator<const wchar_t*> I;
-            long double ex;
-            std::ios_base::iostate err = std::ios_base::goodbit;
-            I iter = f.get(I(v.data()), I(v.data() + v.size()),
-                                                true, ios, err, ex);
-            assert(base(iter) == v.data() + 14);
-            assert(err == std::ios_base::failbit);
-            std::noshowbase(ios);
+          std::wstring v = convert_thousands_sep(L"1" THOUSANDS_SEP "234" THOUSANDS_SEP "567,89 Eu-");
+          std::showbase(ios);
+          typedef cpp17_input_iterator<const wchar_t*> I;
+          long double ex;
+          std::ios_base::iostate err = std::ios_base::goodbit;
+          I iter                     = f.get(I(v.data()), I(v.data() + v.size()), true, ios, err, ex);
+          assert(base(iter) == v.data() + 14);
+          assert(err == std::ios_base::failbit);
+          std::noshowbase(ios);
         }
         {   // negative, showbase
-            std::wstring v = convert_thousands_sep(L"1" THOUSANDS_SEP "234" THOUSANDS_SEP "567,89 Eu-");
-            typedef cpp17_input_iterator<const wchar_t*> I;
-            long double ex;
-            std::ios_base::iostate err = std::ios_base::goodbit;
-            I iter = f.get(I(v.data()), I(v.data() + v.size()),
-                                                true, ios, err, ex);
-            assert(base(iter) == v.data() + 13);
-            assert(err == std::ios_base::goodbit);
-            assert(ex == 123456789);
+          std::wstring v = convert_thousands_sep(L"1" THOUSANDS_SEP "234" THOUSANDS_SEP "567,89 Eu-");
+          typedef cpp17_input_iterator<const wchar_t*> I;
+          long double ex;
+          std::ios_base::iostate err = std::ios_base::goodbit;
+          I iter                     = f.get(I(v.data()), I(v.data() + v.size()), true, ios, err, ex);
+          assert(base(iter) == v.data() + 13);
+          assert(err == std::ios_base::goodbit);
+          assert(ex == 123456789);
         }
     }
 #endif // TEST_HAS_NO_WIDE_CHARACTERS
diff --git a/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_zh_CN.pass.cpp b/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_zh_CN.pass.cpp
index 3db6370b91..05c09b2696 100644
--- a/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_zh_CN.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_zh_CN.pass.cpp
@@ -156,35 +156,33 @@ int main(int, char**)
         }
         {   // negative one, showbase
 #ifdef _AIX
-            std::string v = "-" + currency_symbol + "0.01";
+          std::string v = "-" + currency_symbol + "0.01";
 #else
-            std::string v = currency_symbol + "-0.01";
+          std::string v = currency_symbol + "-0.01";
 #endif
-            typedef cpp17_input_iterator<const char*> I;
-            long double ex;
-            std::ios_base::iostate err = std::ios_base::goodbit;
-            I iter = f.get(I(v.data()), I(v.data() + v.size()),
-                                                false, ios, err, ex);
-            assert(base(iter) == v.data() + v.size());
-            assert(err == std::ios_base::eofbit);
-            assert(ex == -1);
+          typedef cpp17_input_iterator<const char*> I;
+          long double ex;
+          std::ios_base::iostate err = std::ios_base::goodbit;
+          I iter                     = f.get(I(v.data()), I(v.data() + v.size()), false, ios, err, ex);
+          assert(base(iter) == v.data() + v.size());
+          assert(err == std::ios_base::eofbit);
+          assert(ex == -1);
         }
         {   // negative one, showbase
 #ifdef _AIX
-            std::string v = "-" + currency_symbol + "0.01";
+          std::string v = "-" + currency_symbol + "0.01";
 #else
-            std::string v = currency_symbol + "-0.01";
+          std::string v = currency_symbol + "-0.01";
 #endif
-            std::showbase(ios);
-            typedef cpp17_input_iterator<const char*> I;
-            long double ex;
-            std::ios_base::iostate err = std::ios_base::goodbit;
-            I iter = f.get(I(v.data()), I(v.data() + v.size()),
-                                                false, ios, err, ex);
-            assert(base(iter) == v.data() + v.size());
-            assert(err == std::ios_base::eofbit);
-            assert(ex == -1);
-            std::noshowbase(ios);
+          std::showbase(ios);
+          typedef cpp17_input_iterator<const char*> I;
+          long double ex;
+          std::ios_base::iostate err = std::ios_base::goodbit;
+          I iter                     = f.get(I(v.data()), I(v.data() + v.size()), false, ios, err, ex);
+          assert(base(iter) == v.data() + v.size());
+          assert(err == std::ios_base::eofbit);
+          assert(ex == -1);
+          std::noshowbase(ios);
         }
         {   // positive, showbase
             std::string v = currency_symbol + "1,234,567.89";
@@ -212,20 +210,19 @@ int main(int, char**)
         }
         {   // negative, showbase
 #ifdef _AIX
-            std::string v = "-" + currency_symbol + "1,234,567.89";
+          std::string v = "-" + currency_symbol + "1,234,567.89";
 #else
-            std::string v = currency_symbol + "-1,234,567.89";
+          std::string v = currency_symbol + "-1,234,567.89";
 #endif
-            std::showbase(ios);
-            typedef cpp17_input_iterator<const char*> I;
-            long double ex;
-            std::ios_base::iostate err = std::ios_base::goodbit;
-            I iter = f.get(I(v.data()), I(v.data() + v.size()),
-                                                false, ios, err, ex);
-            assert(base(iter) == v.data() + v.size());
-            assert(err == std::ios_base::eofbit);
-            assert(ex == -123456789);
-            std::noshowbase(ios);
+          std::showbase(ios);
+          typedef cpp17_input_iterator<const char*> I;
+          long double ex;
+          std::ios_base::iostate err = std::ios_base::goodbit;
+          I iter                     = f.get(I(v.data()), I(v.data() + v.size()), false, ios, err, ex);
+          assert(base(iter) == v.data() + v.size());
+          assert(err == std::ios_base::eofbit);
+          assert(ex == -123456789);
+          std::noshowbase(ios);
         }
         {   // negative, showbase
             std::string v = "CNY -1,234,567.89";
@@ -334,7 +331,7 @@ int main(int, char**)
         }
         {   // negative one, showbase
 #if defined(TEST_HAS_GLIBC) || defined(_AIX)
-            std::string v = "-" + currency_name + "0.01";
+          std::string v = "-" + currency_name + "0.01";
 #else
             std::string v = currency_name + "-0.01";
 #endif
@@ -349,7 +346,7 @@ int main(int, char**)
         }
         {   // negative one, showbase
 #if defined(TEST_HAS_GLIBC) || defined(_AIX)
-            std::string v = "-" + currency_name + "0.01";
+          std::string v = "-" + currency_name + "0.01";
 #else
             std::string v = currency_name + "-0.01";
 #endif
@@ -390,7 +387,7 @@ int main(int, char**)
         }
         {   // negative, showbase
 #if defined(TEST_HAS_GLIBC) || defined(_AIX)
-            std::string v = "-" + currency_name + "1,234,567.89";
+          std::string v = "-" + currency_name + "1,234,567.89";
 #else
             std::string v = currency_name + "-1,234,567.89";
 #endif
@@ -519,35 +516,33 @@ int main(int, char**)
         }
         {   // negative one, showbase
 #  ifdef _AIX
-            std::wstring v = L"-" + w_currency_symbol + L"0.01";
+          std::wstring v = L"-" + w_currency_symbol + L"0.01";
 #  else
-            std::wstring v = w_currency_symbol + L"-0.01";
+          std::wstring v = w_currency_symbol + L"-0.01";
 #  endif
-            typedef cpp17_input_iterator<const wchar_t*> I;
-            long double ex;
-            std::ios_base::iostate err = std::ios_base::goodbit;
-            I iter = f.get(I(v.data()), I(v.data() + v.size()),
-                                                false, ios, err, ex);
-            assert(base(iter) == v.data() + v.size());
-            assert(err == std::ios_base::eofbit);
-            assert(ex == -1);
+          typedef cpp17_input_iterator<const wchar_t*> I;
+          long double ex;
+          std::ios_base::iostate err = std::ios_base::goodbit;
+          I iter                     = f.get(I(v.data()), I(v.data() + v.size()), false, ios, err, ex);
+          assert(base(iter) == v.data() + v.size());
+          assert(err == std::ios_base::eofbit);
+          assert(ex == -1);
         }
         {   // negative one, showbase
 #  ifdef _AIX
-            std::wstring v = L"-" + w_currency_symbol + L"0.01";
+          std::wstring v = L"-" + w_currency_symbol + L"0.01";
 #  else
-            std::wstring v = w_currency_symbol + L"-0.01";
+          std::wstring v = w_currency_symbol + L"-0.01";
 #  endif
-            std::showbase(ios);
-            typedef cpp17_input_iterator<const wchar_t*> I;
-            long double ex;
-            std::ios_base::iostate err = std::ios_base::goodbit;
-            I iter = f.get(I(v.data()), I(v.data() + v.size()),
-                                                false, ios, err, ex);
-            assert(base(iter) == v.data() + v.size());
-            assert(err == std::ios_base::eofbit);
-            assert(ex == -1);
-            std::noshowbase(ios);
+          std::showbase(ios);
+          typedef cpp17_input_iterator<const wchar_t*> I;
+          long double ex;
+          std::ios_base::iostate err = std::ios_base::goodbit;
+          I iter                     = f.get(I(v.data()), I(v.data() + v.size()), false, ios, err, ex);
+          assert(base(iter) == v.data() + v.size());
+          assert(err == std::ios_base::eofbit);
+          assert(ex == -1);
+          std::noshowbase(ios);
         }
         {   // positive, showbase
             std::wstring v = w_currency_symbol + L"1,234,567.89";
@@ -575,20 +570,19 @@ int main(int, char**)
         }
         {   // negative, showbase
 #  ifdef _AIX
-            std::wstring v = L"-" + w_currency_symbol + L"1,234,567.89";
+          std::wstring v = L"-" + w_currency_symbol + L"1,234,567.89";
 #  else
-            std::wstring v = w_currency_symbol + L"-1,234,567.89";
+          std::wstring v = w_currency_symbol + L"-1,234,567.89";
 #  endif
-            std::showbase(ios);
-            typedef cpp17_input_iterator<const wchar_t*> I;
-            long double ex;
-            std::ios_base::iostate err = std::ios_base::goodbit;
-            I iter = f.get(I(v.data()), I(v.data() + v.size()),
-                                                false, ios, err, ex);
-            assert(base(iter) == v.data() + v.size());
-            assert(err == std::ios_base::eofbit);
-            assert(ex == -123456789);
-            std::noshowbase(ios);
+          std::showbase(ios);
+          typedef cpp17_input_iterator<const wchar_t*> I;
+          long double ex;
+          std::ios_base::iostate err = std::ios_base::goodbit;
+          I iter                     = f.get(I(v.data()), I(v.data() + v.size()), false, ios, err, ex);
+          assert(base(iter) == v.data() + v.size());
+          assert(err == std::ios_base::eofbit);
+          assert(ex == -123456789);
+          std::noshowbase(ios);
         }
         {   // negative, showbase
             std::wstring v = L"CNY -1,234,567.89";
@@ -696,36 +690,34 @@ int main(int, char**)
             std::noshowbase(ios);
         }
         {   // negative one, showbase
-#if defined(TEST_HAS_GLIBC) || defined(_AIX)
-            std::wstring v = L"-" + w_currency_name + L"0.01";
-#else
-            std::wstring v = w_currency_name + L"-0.01";
-#endif
-            typedef cpp17_input_iterator<const wchar_t*> I;
-            long double ex;
-            std::ios_base::iostate err = std::ios_base::goodbit;
-            I iter = f.get(I(v.data()), I(v.data() + v.size()),
-                                                true, ios, err, ex);
-            assert(base(iter) == v.data() + v.size());
-            assert(err == std::ios_base::eofbit);
-            assert(ex == -1);
+#  if defined(TEST_HAS_GLIBC) || defined(_AIX)
+          std::wstring v = L"-" + w_currency_name + L"0.01";
+#  else
+          std::wstring v = w_currency_name + L"-0.01";
+#  endif
+          typedef cpp17_input_iterator<const wchar_t*> I;
+          long double ex;
+          std::ios_base::iostate err = std::ios_base::goodbit;
+          I iter                     = f.get(I(v.data()), I(v.data() + v.size()), true, ios, err, ex);
+          assert(base(iter) == v.data() + v.size());
+          assert(err == std::ios_base::eofbit);
+          assert(ex == -1);
         }
         {   // negative one, showbase
-#if defined(TEST_HAS_GLIBC) || defined(_AIX)
-            std::wstring v = L"-" + w_currency_name + L"0.01";
-#else
-            std::wstring v = w_currency_name + L"-0.01";
-#endif
-            std::showbase(ios);
-            typedef cpp17_input_iterator<const wchar_t*> I;
-            long double ex;
-            std::ios_base::iostate err = std::ios_base::goodbit;
-            I iter = f.get(I(v.data()), I(v.data() + v.size()),
-                                                true, ios, err, ex);
-            assert(base(iter) == v.data() + v.size());
-            assert(err == std::ios_base::eofbit);
-            assert(ex == -1);
-            std::noshowbase(ios);
+#  if defined(TEST_HAS_GLIBC) || defined(_AIX)
+          std::wstring v = L"-" + w_currency_name + L"0.01";
+#  else
+          std::wstring v = w_currency_name + L"-0.01";
+#  endif
+          std::showbase(ios);
+          typedef cpp17_input_iterator<const wchar_t*> I;
+          long double ex;
+          std::ios_base::iostate err = std::ios_base::goodbit;
+          I iter                     = f.get(I(v.data()), I(v.data() + v.size()), true, ios, err, ex);
+          assert(base(iter) == v.data() + v.size());
+          assert(err == std::ios_base::eofbit);
+          assert(ex == -1);
+          std::noshowbase(ios);
         }
         {   // positive, showbase
             std::wstring v = w_currency_name + L"1,234,567.89";
@@ -752,21 +744,20 @@ int main(int, char**)
             std::noshowbase(ios);
         }
         {   // negative, showbase
-#if defined(TEST_HAS_GLIBC) || defined(_AIX)
-            std::wstring v = L"-" + w_currency_name + L"1,234,567.89";
-#else
-            std::wstring v = w_currency_name + L"-1,234,567.89";
-#endif
-            std::showbase(ios);
-            typedef cpp17_input_iterator<const wchar_t*> I;
-            long double ex;
-            std::ios_base::iostate err = std::ios_base::goodbit;
-            I iter = f.get(I(v.data()), I(v.data() + v.size()),
-                                                true, ios, err, ex);
-            assert(base(iter) == v.data() + v.size());
-            assert(err == std::ios_base::eofbit);
-            assert(ex == -123456789);
-            std::noshowbase(ios);
+#  if defined(TEST_HAS_GLIBC) || defined(_AIX)
+          std::wstring v = L"-" + w_currency_name + L"1,234,567.89";
+#  else
+          std::wstring v = w_currency_name + L"-1,234,567.89";
+#  endif
+          std::showbase(ios);
+          typedef cpp17_input_iterator<const wchar_t*> I;
+          long double ex;
+          std::ios_base::iostate err = std::ios_base::goodbit;
+          I iter                     = f.get(I(v.data()), I(v.data() + v.size()), true, ios, err, ex);
+          assert(base(iter) == v.data() + v.size());
+          assert(err == std::ios_base::eofbit);
+          assert(ex == -123456789);
+          std::noshowbase(ios);
         }
         {   // negative, showbase
             std::wstring v = w_currency_symbol + L"-1,234,567.89";
diff --git a/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_fr_FR.pass.cpp b/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_fr_FR.pass.cpp
index e36e73f3e8..47a48deb33 100644
--- a/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_fr_FR.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_fr_FR.pass.cpp
@@ -32,9 +32,9 @@
 
 #ifdef _AIX
 // the AIX libc expects U202F as LC_MONETARY thousands_sep
-#define THOUSANDS_SEP L"\u202F"
+#  define THOUSANDS_SEP L"\u202F"
 #else
-#define THOUSANDS_SEP L" "
+#  define THOUSANDS_SEP L" "
 #endif
 
 typedef std::money_put<char, cpp17_output_iterator<char*> > Fn;
diff --git a/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_zh_CN.pass.cpp b/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_zh_CN.pass.cpp
index d7c926f955..4d581032d5 100644
--- a/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_zh_CN.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_zh_CN.pass.cpp
@@ -363,11 +363,11 @@ int main(int, char**)
         wchar_t str[100];
         cpp17_output_iterator<wchar_t*> iter = f.put(cpp17_output_iterator<wchar_t*>(str), false, ios, '*', v);
         std::wstring ex(str, base(iter));
-#ifdef _AIX
+#  ifdef _AIX
         assert(ex == L"-" + currency_symbol + L"0.01");
-#else
+#  else
         assert(ex == currency_symbol + L"-0.01");
-#endif
+#  endif
     }
     {   // positive, showbase
         long double v = 123456789;
@@ -383,11 +383,11 @@ int main(int, char**)
         wchar_t str[100];
         cpp17_output_iterator<wchar_t*> iter = f.put(cpp17_output_iterator<wchar_t*>(str), false, ios, '*', v);
         std::wstring ex(str, base(iter));
-#ifdef _AIX
+#  ifdef _AIX
         assert(ex == L"-" + currency_symbol + L"1,234,567.89");
-#else
+#  else
         assert(ex == currency_symbol + L"-1,234,567.89");
-#endif
+#  endif
     }
     {   // negative, showbase, left
         long double v = -123456789;
@@ -397,11 +397,11 @@ int main(int, char**)
         wchar_t str[100];
         cpp17_output_iterator<wchar_t*> iter = f.put(cpp17_output_iterator<wchar_t*>(str), false, ios, ' ', v);
         std::wstring ex(str, base(iter));
-#ifdef _AIX
+#  ifdef _AIX
         assert(ex == L"-" + currency_symbol + L"1,234,567.89      ");
-#else
+#  else
         assert(ex == currency_symbol + L"-1,234,567.89      ");
-#endif
+#  endif
         assert(ios.width() == 0);
     }
     {   // negative, showbase, internal
@@ -412,11 +412,11 @@ int main(int, char**)
         wchar_t str[100];
         cpp17_output_iterator<wchar_t*> iter = f.put(cpp17_output_iterator<wchar_t*>(str), false, ios, ' ', v);
         std::wstring ex(str, base(iter));
-#ifdef _AIX
+#  ifdef _AIX
         assert(ex == L"-" + currency_symbol + L"      1,234,567.89");
-#else
+#  else
         assert(ex == currency_symbol + L"-      1,234,567.89");
-#endif
+#  endif
         assert(ios.width() == 0);
     }
     {   // negative, showbase, right
@@ -427,11 +427,11 @@ int main(int, char**)
         wchar_t str[100];
         cpp17_output_iterator<wchar_t*> iter = f.put(cpp17_output_iterator<wchar_t*>(str), false, ios, ' ', v);
         std::wstring ex(str, base(iter));
-#ifdef _AIX
+#  ifdef _AIX
         assert(ex == L"      -" + currency_symbol + L"1,234,567.89");
-#else
+#  else
         assert(ex == L"      " + currency_symbol + L"-1,234,567.89");
-#endif
+#  endif
         assert(ios.width() == 0);
     }
 
@@ -480,7 +480,7 @@ int main(int, char**)
         wchar_t str[100];
         cpp17_output_iterator<wchar_t*> iter = f.put(cpp17_output_iterator<wchar_t*>(str), true, ios, '*', v);
         std::wstring ex(str, base(iter));
-#if defined(TEST_HAS_GLIBC) || defined(_AIX)
+#  if defined(TEST_HAS_GLIBC) || defined(_AIX)
         assert(ex == L"-" + currency_name + L"0.01");
 #else
         assert(ex == currency_name + L"-0.01");
@@ -500,7 +500,7 @@ int main(int, char**)
         wchar_t str[100];
         cpp17_output_iterator<wchar_t*> iter = f.put(cpp17_output_iterator<wchar_t*>(str), true, ios, '*', v);
         std::wstring ex(str, base(iter));
-#if defined(TEST_HAS_GLIBC) || defined(_AIX)
+#  if defined(TEST_HAS_GLIBC) || defined(_AIX)
         assert(ex == L"-" + currency_name + L"1,234,567.89");
 #else
         assert(ex == currency_name + L"-1,234,567.89");
@@ -514,7 +514,7 @@ int main(int, char**)
         wchar_t str[100];
         cpp17_output_iterator<wchar_t*> iter = f.put(cpp17_output_iterator<wchar_t*>(str), true, ios, ' ', v);
         std::wstring ex(str, base(iter));
-#if defined(TEST_HAS_GLIBC) || defined(_AIX)
+#  if defined(TEST_HAS_GLIBC) || defined(_AIX)
         assert(ex == L"-" + currency_name + L"1,234,567.89" + currency_name_padding);
 #else
         assert(ex == currency_name + L"-1,234,567.89" + currency_name_padding);
@@ -529,7 +529,7 @@ int main(int, char**)
         wchar_t str[100];
         cpp17_output_iterator<wchar_t*> iter = f.put(cpp17_output_iterator<wchar_t*>(str), true, ios, ' ', v);
         std::wstring ex(str, base(iter));
-#if defined(TEST_HAS_GLIBC) || defined(_AIX)
+#  if defined(TEST_HAS_GLIBC) || defined(_AIX)
         assert(ex == L"-" + currency_name + currency_name_padding + L"1,234,567.89");
 #else
         assert(ex == currency_name + L"-" + currency_name_padding + L"1,234,567.89");
@@ -544,7 +544,7 @@ int main(int, char**)
         wchar_t str[100];
         cpp17_output_iterator<wchar_t*> iter = f.put(cpp17_output_iterator<wchar_t*>(str), true, ios, ' ', v);
         std::wstring ex(str, base(iter));
-#if defined(TEST_HAS_GLIBC) || defined(_AIX)
+#  if defined(TEST_HAS_GLIBC) || defined(_AIX)
         assert(ex == currency_name_padding + L"-" + currency_name + L"1,234,567.89");
 #else
         assert(ex == currency_name_padding + currency_name + L"-1,234,567.89");

``````````

</details>


https://github.com/llvm/llvm-project/pull/94826


More information about the libcxx-commits mailing list