// iter_type get(iter_type b, iter_type e, bool intl, ios_base& iob,
// ios_base::iostate& err, long double& v) const;
-// TODO For zh_CN GLIBC puts the negative sign after the currency symbol.
-// XFAIL: target={{.*}}-linux-gnu{{.*}}
-
#include <locale>
#include <ios>
#include <streambuf>
std::noshowbase(ios);
}
{ // negative one, showbase
+#ifdef TEST_HAS_GLIBC
+ std::string v = "-" + currency_name + "0.01";
+#else
std::string v = currency_name + "-0.01";
+#endif
typedef cpp17_input_iterator<const char*> I;
long double ex;
std::ios_base::iostate err = std::ios_base::goodbit;
assert(ex == -1);
}
{ // negative one, showbase
+#ifdef TEST_HAS_GLIBC
+ std::string v = "-" + currency_name + "0.01";
+#else
std::string v = currency_name + "-0.01";
+#endif
std::showbase(ios);
typedef cpp17_input_iterator<const char*> I;
long double ex;
std::noshowbase(ios);
}
{ // negative, showbase
+#ifdef TEST_HAS_GLIBC
+ std::string v = "-" + currency_name + "1,234,567.89";
+#else
std::string v = currency_name + "-1,234,567.89";
+#endif
std::showbase(ios);
typedef cpp17_input_iterator<const char*> I;
long double ex;
std::noshowbase(ios);
}
{ // negative one, showbase
+#ifdef TEST_HAS_GLIBC
+ 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;
assert(ex == -1);
}
{ // negative one, showbase
+#ifdef TEST_HAS_GLIBC
+ 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::noshowbase(ios);
}
{ // negative, showbase
+#ifdef TEST_HAS_GLIBC
+ 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;
// iter_type put(iter_type s, bool intl, ios_base& f, char_type fill,
// long double units) const;
-// TODO For zh_CN GLIBC puts the negative sign after the currency symbol.
-// XFAIL: target={{.*}}-linux-gnu{{.*}}
-
#include <locale>
#include <ios>
#include <streambuf>
char str[100];
cpp17_output_iterator<char*> iter = f.put(cpp17_output_iterator<char*>(str), true, ios, '*', v);
std::string ex(str, base(iter));
+#ifdef TEST_HAS_GLIBC
+ assert(ex == "-" + currency_name + "0.01");
+#else
assert(ex == currency_name + "-0.01");
+#endif
}
{ // positive, showbase
long double v = 123456789;
char str[100];
cpp17_output_iterator<char*> iter = f.put(cpp17_output_iterator<char*>(str), true, ios, '*', v);
std::string ex(str, base(iter));
+#ifdef TEST_HAS_GLIBC
+ assert(ex == "-" + currency_name + "1,234,567.89");
+#else
assert(ex == currency_name + "-1,234,567.89");
+#endif
}
{ // negative, showbase, left
long double v = -123456789;
char str[100];
cpp17_output_iterator<char*> iter = f.put(cpp17_output_iterator<char*>(str), true, ios, ' ', v);
std::string ex(str, base(iter));
+#ifdef TEST_HAS_GLIBC
+ assert(ex == "-" + currency_name + "1,234,567.89" + currency_name_padding);
+#else
assert(ex == currency_name + "-1,234,567.89" + currency_name_padding);
+#endif
assert(ios.width() == 0);
}
{ // negative, showbase, internal
char str[100];
cpp17_output_iterator<char*> iter = f.put(cpp17_output_iterator<char*>(str), true, ios, ' ', v);
std::string ex(str, base(iter));
+#ifdef TEST_HAS_GLIBC
+ assert(ex == "-" + currency_name + currency_name_padding + "1,234,567.89");
+#else
assert(ex == currency_name + "-" + currency_name_padding + "1,234,567.89");
+#endif
assert(ios.width() == 0);
}
{ // negative, showbase, right
char str[100];
cpp17_output_iterator<char*> iter = f.put(cpp17_output_iterator<char*>(str), true, ios, ' ', v);
std::string ex(str, base(iter));
+#ifdef TEST_HAS_GLIBC
+ assert(ex == currency_name_padding + "-" + currency_name + "1,234,567.89");
+#else
assert(ex == currency_name_padding + currency_name + "-1,234,567.89");
+#endif
assert(ios.width() == 0);
}
}
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));
+#ifdef TEST_HAS_GLIBC
+ assert(ex == L"-" + currency_name + L"0.01");
+#else
assert(ex == currency_name + L"-0.01");
+#endif
}
{ // positive, showbase
long double v = 123456789;
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));
+#ifdef TEST_HAS_GLIBC
+ assert(ex == L"-" + currency_name + L"1,234,567.89");
+#else
assert(ex == currency_name + L"-1,234,567.89");
+#endif
}
{ // negative, showbase, left
long double v = -123456789;
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));
+#ifdef TEST_HAS_GLIBC
+ 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);
+#endif
assert(ios.width() == 0);
}
{ // negative, showbase, internal
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));
+#ifdef TEST_HAS_GLIBC
+ 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");
+#endif
assert(ios.width() == 0);
}
{ // negative, showbase, right
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));
+#ifdef TEST_HAS_GLIBC
+ 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");
+#endif
assert(ios.width() == 0);
}
}