Windows porting work by Ruben Van Boxem

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@141003 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Howard Hinnant
2011-10-03 15:23:59 +00:00
parent 8452d21f41
commit c0d0cbad9e
90 changed files with 558 additions and 343 deletions

View File

@@ -24,10 +24,12 @@
#include <stdio.h>
#include "../../../../platform_support.h" // locale name macros
int main()
{
{
std::locale l("en_US.UTF-8");
std::locale l(LOCALE_en_US_UTF_8);
{
const std::collate<char>& f = std::use_facet<std::collate<char> >(l);
std::string s2("aaaaaaA");

View File

@@ -19,9 +19,11 @@
#include <string>
#include <cassert>
#include "../../../../platform_support.h" // locale name macros
int main()
{
std::locale l("en_US.UTF-8");
std::locale l(LOCALE_en_US_UTF_8);
{
std::string x1("1234");
std::string x2("12345");

View File

@@ -19,12 +19,14 @@
#include <stdio.h>
#include "../../../../platform_support.h" // locale name macros
int main()
{
// Ensure that the default locale is not C. If it is, the second tests will fail.
setenv("LANG", "en_US.UTF-8", 1);
putenv(const_cast<char*>("LANG=" LOCALE_en_US_UTF_8));
{
std::locale l("en_US.UTF-8");
std::locale l(LOCALE_en_US_UTF_8);
{
std::string x("1234");
const std::collate<char>& f = std::use_facet<std::collate<char> >(l);

View File

@@ -27,9 +27,11 @@
#include <stdio.h>
#include "../../../../platform_support.h" // locale name macros
int main()
{
std::locale l("en_US.UTF-8");
std::locale l(LOCALE_en_US_UTF_8);
{
assert(std::has_facet<std::collate_byname<char> >(l));
assert(&std::use_facet<std::collate<char> >(l)

View File

@@ -17,6 +17,8 @@
#include <locale>
#include <cassert>
#include "../../../../platform_support.h" // locale name macros
typedef std::codecvt_byname<wchar_t, char, std::mbstate_t> F;
class my_facet
@@ -38,12 +40,12 @@ int my_facet::count = 0;
int main()
{
{
std::locale l(std::locale::classic(), new my_facet("en_US.UTF-8"));
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("en_US.UTF-8", 1);
my_facet f(LOCALE_en_US_UTF_8, 1);
assert(my_facet::count == 1);
{
std::locale l(std::locale::classic(), &f);
@@ -53,12 +55,12 @@ int main()
}
assert(my_facet::count == 0);
{
std::locale l(std::locale::classic(), new my_facet(std::string("en_US.UTF-8")));
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("en_US.UTF-8"), 1);
my_facet f(std::string(LOCALE_en_US_UTF_8), 1);
assert(my_facet::count == 1);
{
std::locale l(std::locale::classic(), &f);

View File

@@ -17,10 +17,12 @@
#include <type_traits>
#include <cassert>
#include "../../../../platform_support.h" // locale name macros
int main()
{
{
std::locale l("en_US.UTF-8");
std::locale l(LOCALE_en_US_UTF_8);
{
typedef std::ctype<wchar_t> F;
const F& f = std::use_facet<F>(l);

View File

@@ -20,10 +20,12 @@
#include <stdio.h>
#include "../../../../platform_support.h" // locale name macros
int main()
{
{
std::locale l("en_US.UTF-8");
std::locale l(LOCALE_en_US_UTF_8);
{
typedef std::ctype<wchar_t> F;
const F& f = std::use_facet<F>(l);

View File

@@ -16,10 +16,12 @@
#include <locale>
#include <cassert>
#include "../../../../platform_support.h" // locale name macros
int main()
{
{
std::locale l(std::string("fr_CA.ISO8859-1"));
std::locale l(std::string(LOCALE_fr_CA_ISO8859_1));
{
typedef std::ctype<wchar_t> F;
const F& f = std::use_facet<F>(l);
@@ -34,7 +36,7 @@ int main()
}
}
{
std::locale l("en_US.UTF-8");
std::locale l(LOCALE_en_US_UTF_8);
{
typedef std::ctype<wchar_t> F;
const F& f = std::use_facet<F>(l);

View File

@@ -18,10 +18,12 @@
#include <vector>
#include <cassert>
#include "../../../../platform_support.h" // locale name macros
int main()
{
{
std::locale l("fr_CA.ISO8859-1");
std::locale l(LOCALE_fr_CA_ISO8859_1);
{
typedef std::ctype<wchar_t> F;
const F& f = std::use_facet<F>(l);
@@ -39,7 +41,7 @@ int main()
}
}
{
std::locale l("en_US.UTF-8");
std::locale l(LOCALE_en_US_UTF_8);
{
typedef std::ctype<wchar_t> F;
const F& f = std::use_facet<F>(l);

View File

@@ -20,10 +20,12 @@
#include <stdio.h>
#include "../../../../platform_support.h" // locale name macros
int main()
{
{
std::locale l("en_US.UTF-8");
std::locale l(LOCALE_en_US_UTF_8);
{
typedef std::ctype<wchar_t> F;
const F& f = std::use_facet<F>(l);

View File

@@ -20,10 +20,12 @@
#include <stdio.h>
#include "../../../../platform_support.h" // locale name macros
int main()
{
{
std::locale l("en_US.UTF-8");
std::locale l(LOCALE_en_US_UTF_8);
{
typedef std::ctype<wchar_t> F;
const F& f = std::use_facet<F>(l);

View File

@@ -16,10 +16,12 @@
#include <locale>
#include <cassert>
#include "../../../../platform_support.h" // locale name macros
int main()
{
{
std::locale l("en_US.UTF-8");
std::locale l(LOCALE_en_US_UTF_8);
{
typedef std::ctype<char> F;
const F& f = std::use_facet<F>(l);
@@ -51,7 +53,7 @@ int main()
}
}
{
std::locale l("en_US.UTF-8");
std::locale l(LOCALE_en_US_UTF_8);
{
typedef std::ctype<wchar_t> F;
const F& f = std::use_facet<F>(l);

View File

@@ -17,10 +17,12 @@
#include <string>
#include <cassert>
#include "../../../../platform_support.h" // locale name macros
int main()
{
{
std::locale l("en_US.UTF-8");
std::locale l(LOCALE_en_US_UTF_8);
{
typedef std::ctype<char> F;
const F& f = std::use_facet<F>(l);
@@ -54,7 +56,7 @@ int main()
}
}
{
std::locale l("en_US.UTF-8");
std::locale l(LOCALE_en_US_UTF_8);
{
typedef std::ctype<wchar_t> F;
const F& f = std::use_facet<F>(l);

View File

@@ -16,10 +16,12 @@
#include <locale>
#include <cassert>
#include "../../../../platform_support.h" // locale name macros
int main()
{
{
std::locale l("en_US.UTF-8");
std::locale l(LOCALE_en_US_UTF_8);
{
typedef std::ctype<char> F;
const F& f = std::use_facet<F>(l);
@@ -51,7 +53,7 @@ int main()
}
}
{
std::locale l("en_US.UTF-8");
std::locale l(LOCALE_en_US_UTF_8);
{
typedef std::ctype<wchar_t> F;
const F& f = std::use_facet<F>(l);

View File

@@ -17,10 +17,12 @@
#include <string>
#include <cassert>
#include "../../../../platform_support.h" // locale name macros
int main()
{
{
std::locale l("en_US.UTF-8");
std::locale l(LOCALE_en_US_UTF_8);
{
typedef std::ctype<char> F;
const F& f = std::use_facet<F>(l);
@@ -54,7 +56,7 @@ int main()
}
}
{
std::locale l("en_US.UTF-8");
std::locale l(LOCALE_en_US_UTF_8);
{
typedef std::ctype<wchar_t> F;
const F& f = std::use_facet<F>(l);

View File

@@ -25,10 +25,12 @@
#include <type_traits>
#include <cassert>
#include "../../../../platform_support.h" // locale name macros
int main()
{
{
std::locale l("en_US.UTF-8");
std::locale l(LOCALE_en_US_UTF_8);
{
assert(std::has_facet<std::ctype_byname<char> >(l));
assert(&std::use_facet<std::ctype<char> >(l)

View File

@@ -19,10 +19,12 @@
#include <cassert>
#include <limits.h>
#include "../../../../platform_support.h" // locale name macros
int main()
{
{
std::locale l("en_US.UTF-8");
std::locale l(LOCALE_en_US_UTF_8);
{
typedef std::ctype<wchar_t> F;
const F& f = std::use_facet<F>(l);

View File

@@ -20,10 +20,12 @@
#include <vector>
#include <cassert>
#include "../../../../platform_support.h" // locale name macros
int main()
{
{
std::locale l("en_US.UTF-8");
std::locale l(LOCALE_en_US_UTF_8);
{
typedef std::ctype<wchar_t> F;
const F& f = std::use_facet<F>(l);

View File

@@ -20,6 +20,8 @@
#include <cassert>
#include "iterators.h"
#include "../../../../../platform_support.h" // locale name macros
typedef std::money_get<char, input_iterator<const char*> > Fn;
class my_facet
@@ -43,7 +45,7 @@ public:
int main()
{
std::ios ios(0);
std::string loc_name("en_US.UTF-8");
std::string loc_name(LOCALE_en_US_UTF_8);
ios.imbue(std::locale(ios.getloc(),
new std::moneypunct_byname<char, false>(loc_name)));
ios.imbue(std::locale(ios.getloc(),

View File

@@ -20,6 +20,8 @@
#include <cassert>
#include "iterators.h"
#include "../../../../../platform_support.h" // locale name macros
typedef std::money_get<char, input_iterator<const char*> > Fn;
class my_facet
@@ -43,7 +45,7 @@ public:
int main()
{
std::ios ios(0);
std::string loc_name("fr_FR.UTF-8");
std::string loc_name(LOCALE_fr_FR_UTF_8);
ios.imbue(std::locale(ios.getloc(),
new std::moneypunct_byname<char, false>(loc_name)));
ios.imbue(std::locale(ios.getloc(),

View File

@@ -20,6 +20,8 @@
#include <cassert>
#include "iterators.h"
#include "../../../../../platform_support.h" // locale name macros
typedef std::money_get<char, input_iterator<const char*> > Fn;
class my_facet
@@ -43,7 +45,7 @@ public:
int main()
{
std::ios ios(0);
std::string loc_name("ru_RU.UTF-8");
std::string loc_name("LOCALE_ru_RU_UTF_8");
ios.imbue(std::locale(ios.getloc(),
new std::moneypunct_byname<char, false>(loc_name)));
ios.imbue(std::locale(ios.getloc(),

View File

@@ -20,6 +20,8 @@
#include <cassert>
#include "iterators.h"
#include "../../../../../platform_support.h" // locale name macros
typedef std::money_get<char, input_iterator<const char*> > Fn;
class my_facet
@@ -43,7 +45,7 @@ public:
int main()
{
std::ios ios(0);
std::string loc_name("zh_CN.UTF-8");
std::string loc_name(LOCALE_zh_CN_UTF_8);
ios.imbue(std::locale(ios.getloc(),
new std::moneypunct_byname<char, false>(loc_name)));
ios.imbue(std::locale(ios.getloc(),

View File

@@ -20,6 +20,8 @@
#include <cassert>
#include "iterators.h"
#include "../../../../../platform_support.h" // locale name macros
typedef std::money_get<char, input_iterator<const char*> > Fn;
class my_facet
@@ -43,7 +45,7 @@ public:
int main()
{
std::ios ios(0);
std::string loc_name("en_US.UTF-8");
std::string loc_name(LOCALE_en_US_UTF_8);
ios.imbue(std::locale(ios.getloc(),
new std::moneypunct_byname<char, false>(loc_name)));
ios.imbue(std::locale(ios.getloc(),

View File

@@ -20,6 +20,8 @@
#include <cassert>
#include "iterators.h"
#include "../../../../../platform_support.h" // locale name macros
typedef std::money_put<char, output_iterator<char*> > Fn;
class my_facet
@@ -43,7 +45,7 @@ public:
int main()
{
std::ios ios(0);
std::string loc_name("en_US.UTF-8");
std::string loc_name(LOCALE_en_US_UTF_8);
ios.imbue(std::locale(ios.getloc(),
new std::moneypunct_byname<char, false>(loc_name)));
ios.imbue(std::locale(ios.getloc(),

View File

@@ -20,6 +20,8 @@
#include <cassert>
#include "iterators.h"
#include "../../../../../platform_support.h" // locale name macros
typedef std::money_put<char, output_iterator<char*> > Fn;
class my_facet
@@ -43,7 +45,7 @@ public:
int main()
{
std::ios ios(0);
std::string loc_name("fr_FR.UTF-8");
std::string loc_name(LOCALE_fr_FR_UTF_8);
ios.imbue(std::locale(ios.getloc(),
new std::moneypunct_byname<char, false>(loc_name)));
ios.imbue(std::locale(ios.getloc(),

View File

@@ -20,6 +20,8 @@
#include <cassert>
#include "iterators.h"
#include "../../../../../platform_support.h" // locale name macros
typedef std::money_put<char, output_iterator<char*> > Fn;
class my_facet
@@ -43,7 +45,7 @@ public:
int main()
{
std::ios ios(0);
std::string loc_name("ru_RU.UTF-8");
std::string loc_name(LOCALE_ru_RU_UTF_8);
ios.imbue(std::locale(ios.getloc(),
new std::moneypunct_byname<char, false>(loc_name)));
ios.imbue(std::locale(ios.getloc(),

View File

@@ -20,6 +20,8 @@
#include <cassert>
#include "iterators.h"
#include "../../../../../platform_support.h" // locale name macros
typedef std::money_put<char, output_iterator<char*> > Fn;
class my_facet
@@ -43,7 +45,7 @@ public:
int main()
{
std::ios ios(0);
std::string loc_name("zh_CN.UTF-8");
std::string loc_name(LOCALE_zh_CN_UTF_8);
ios.imbue(std::locale(ios.getloc(),
new std::moneypunct_byname<char, false>(loc_name)));
ios.imbue(std::locale(ios.getloc(),

View File

@@ -20,6 +20,8 @@
#include <cassert>
#include "iterators.h"
#include "../../../../../platform_support.h" // locale name macros
typedef std::money_put<char, output_iterator<char*> > Fn;
class my_facet
@@ -43,7 +45,7 @@ public:
int main()
{
std::ios ios(0);
std::string loc_name("en_US.UTF-8");
std::string loc_name(LOCALE_en_US_UTF_8);
ios.imbue(std::locale(ios.getloc(),
new std::moneypunct_byname<char, false>(loc_name)));
ios.imbue(std::locale(ios.getloc(),

View File

@@ -17,6 +17,8 @@
#include <limits>
#include <cassert>
#include "../../../../platform_support.h" // locale name macros
class Fnf
: public std::moneypunct_byname<char, false>
{
@@ -69,70 +71,70 @@ int main()
}
{
Fnf f("en_US.UTF-8", 1);
Fnf f(LOCALE_en_US_UTF_8, 1);
assert(f.curr_symbol() == "$");
}
{
Fnt f("en_US.UTF-8", 1);
Fnt f(LOCALE_en_US_UTF_8, 1);
assert(f.curr_symbol() == "USD ");
}
{
Fwf f("en_US.UTF-8", 1);
Fwf f(LOCALE_en_US_UTF_8, 1);
assert(f.curr_symbol() == L"$");
}
{
Fwt f("en_US.UTF-8", 1);
Fwt f(LOCALE_en_US_UTF_8, 1);
assert(f.curr_symbol() == L"USD ");
}
{
Fnf f("fr_FR.UTF-8", 1);
Fnf f(LOCALE_fr_FR_UTF_8, 1);
assert(f.curr_symbol() == "Eu");
}
{
Fnt f("fr_FR.UTF-8", 1);
Fnt f(LOCALE_fr_FR_UTF_8, 1);
assert(f.curr_symbol() == "EUR ");
}
{
Fwf f("fr_FR.UTF-8", 1);
Fwf f(LOCALE_fr_FR_UTF_8, 1);
assert(f.curr_symbol() == L"Eu");
}
{
Fwt f("fr_FR.UTF-8", 1);
Fwt f(LOCALE_fr_FR_UTF_8, 1);
assert(f.curr_symbol() == L"EUR ");
}
{
Fnf f("ru_RU.UTF-8", 1);
Fnf f(LOCALE_ru_RU_UTF_8, 1);
assert(f.curr_symbol() == "\xD1\x80\xD1\x83\xD0\xB1"".");
}
{
Fnt f("ru_RU.UTF-8", 1);
Fnt f(LOCALE_ru_RU_UTF_8, 1);
assert(f.curr_symbol() == "RUB ");
}
{
Fwf f("ru_RU.UTF-8", 1);
Fwf f(LOCALE_ru_RU_UTF_8, 1);
assert(f.curr_symbol() == L"\x440\x443\x431"".");
}
{
Fwt f("ru_RU.UTF-8", 1);
Fwt f(LOCALE_ru_RU_UTF_8, 1);
assert(f.curr_symbol() == L"RUB ");
}
{
Fnf f("zh_CN.UTF-8", 1);
Fnf f(LOCALE_zh_CN_UTF_8, 1);
assert(f.curr_symbol() == "\xEF\xBF\xA5");
}
{
Fnt f("zh_CN.UTF-8", 1);
Fnt f(LOCALE_zh_CN_UTF_8, 1);
assert(f.curr_symbol() == "CNY ");
}
{
Fwf f("zh_CN.UTF-8", 1);
Fwf f(LOCALE_zh_CN_UTF_8, 1);
assert(f.curr_symbol() == L"\xFFE5");
}
{
Fwt f("zh_CN.UTF-8", 1);
Fwt f(LOCALE_zh_CN_UTF_8, 1);
assert(f.curr_symbol() == L"CNY ");
}
}

View File

@@ -17,6 +17,8 @@
#include <limits>
#include <cassert>
#include "../../../../platform_support.h" // locale name macros
class Fnf
: public std::moneypunct_byname<char, false>
{
@@ -69,70 +71,70 @@ int main()
}
{
Fnf f("en_US.UTF-8", 1);
Fnf f(LOCALE_en_US_UTF_8, 1);
assert(f.decimal_point() == '.');
}
{
Fnt f("en_US.UTF-8", 1);
Fnt f(LOCALE_en_US_UTF_8, 1);
assert(f.decimal_point() == '.');
}
{
Fwf f("en_US.UTF-8", 1);
Fwf f(LOCALE_en_US_UTF_8, 1);
assert(f.decimal_point() == L'.');
}
{
Fwt f("en_US.UTF-8", 1);
Fwt f(LOCALE_en_US_UTF_8, 1);
assert(f.decimal_point() == L'.');
}
{
Fnf f("fr_FR.UTF-8", 1);
Fnf f(LOCALE_fr_FR_UTF_8, 1);
assert(f.decimal_point() == ',');
}
{
Fnt f("fr_FR.UTF-8", 1);
Fnt f(LOCALE_fr_FR_UTF_8, 1);
assert(f.decimal_point() == ',');
}
{
Fwf f("fr_FR.UTF-8", 1);
Fwf f(LOCALE_fr_FR_UTF_8, 1);
assert(f.decimal_point() == L',');
}
{
Fwt f("fr_FR.UTF-8", 1);
Fwt f(LOCALE_fr_FR_UTF_8, 1);
assert(f.decimal_point() == L',');
}
{
Fnf f("ru_RU.UTF-8", 1);
Fnf f(LOCALE_ru_RU_UTF_8, 1);
assert(f.decimal_point() == ',');
}
{
Fnt f("ru_RU.UTF-8", 1);
Fnt f(LOCALE_ru_RU_UTF_8, 1);
assert(f.decimal_point() == ',');
}
{
Fwf f("ru_RU.UTF-8", 1);
Fwf f(LOCALE_ru_RU_UTF_8, 1);
assert(f.decimal_point() == L',');
}
{
Fwt f("ru_RU.UTF-8", 1);
Fwt f(LOCALE_ru_RU_UTF_8, 1);
assert(f.decimal_point() == L',');
}
{
Fnf f("zh_CN.UTF-8", 1);
Fnf f(LOCALE_zh_CN_UTF_8, 1);
assert(f.decimal_point() == '.');
}
{
Fnt f("zh_CN.UTF-8", 1);
Fnt f(LOCALE_zh_CN_UTF_8, 1);
assert(f.decimal_point() == '.');
}
{
Fwf f("zh_CN.UTF-8", 1);
Fwf f(LOCALE_zh_CN_UTF_8, 1);
assert(f.decimal_point() == L'.');
}
{
Fwt f("zh_CN.UTF-8", 1);
Fwt f(LOCALE_zh_CN_UTF_8, 1);
assert(f.decimal_point() == L'.');
}
}

View File

@@ -17,6 +17,8 @@
#include <limits>
#include <cassert>
#include "../../../../platform_support.h" // locale name macros
class Fnf
: public std::moneypunct_byname<char, false>
{
@@ -69,70 +71,70 @@ int main()
}
{
Fnf f("en_US.UTF-8", 1);
Fnf f(LOCALE_en_US_UTF_8, 1);
assert(f.frac_digits() == 2);
}
{
Fnt f("en_US.UTF-8", 1);
Fnt f(LOCALE_en_US_UTF_8, 1);
assert(f.frac_digits() == 2);
}
{
Fwf f("en_US.UTF-8", 1);
Fwf f(LOCALE_en_US_UTF_8, 1);
assert(f.frac_digits() == 2);
}
{
Fwt f("en_US.UTF-8", 1);
Fwt f(LOCALE_en_US_UTF_8, 1);
assert(f.frac_digits() == 2);
}
{
Fnf f("fr_FR.UTF-8", 1);
Fnf f(LOCALE_fr_FR_UTF_8, 1);
assert(f.frac_digits() == 2);
}
{
Fnt f("fr_FR.UTF-8", 1);
Fnt f(LOCALE_fr_FR_UTF_8, 1);
assert(f.frac_digits() == 2);
}
{
Fwf f("fr_FR.UTF-8", 1);
Fwf f(LOCALE_fr_FR_UTF_8, 1);
assert(f.frac_digits() == 2);
}
{
Fwt f("fr_FR.UTF-8", 1);
Fwt f(LOCALE_fr_FR_UTF_8, 1);
assert(f.frac_digits() == 2);
}
{
Fnf f("ru_RU.UTF-8", 1);
Fnf f(LOCALE_ru_RU_UTF_8, 1);
assert(f.frac_digits() == 2);
}
{
Fnt f("ru_RU.UTF-8", 1);
Fnt f(LOCALE_ru_RU_UTF_8, 1);
assert(f.frac_digits() == 2);
}
{
Fwf f("ru_RU.UTF-8", 1);
Fwf f(LOCALE_ru_RU_UTF_8, 1);
assert(f.frac_digits() == 2);
}
{
Fwt f("ru_RU.UTF-8", 1);
Fwt f(LOCALE_ru_RU_UTF_8, 1);
assert(f.frac_digits() == 2);
}
{
Fnf f("zh_CN.UTF-8", 1);
Fnf f(LOCALE_zh_CN_UTF_8, 1);
assert(f.frac_digits() == 2);
}
{
Fnt f("zh_CN.UTF-8", 1);
Fnt f(LOCALE_zh_CN_UTF_8, 1);
assert(f.frac_digits() == 2);
}
{
Fwf f("zh_CN.UTF-8", 1);
Fwf f(LOCALE_zh_CN_UTF_8, 1);
assert(f.frac_digits() == 2);
}
{
Fwt f("zh_CN.UTF-8", 1);
Fwt f(LOCALE_zh_CN_UTF_8, 1);
assert(f.frac_digits() == 2);
}
}

View File

@@ -17,6 +17,8 @@
#include <limits>
#include <cassert>
#include "../../../../platform_support.h" // locale name macros
class Fnf
: public std::moneypunct_byname<char, false>
{
@@ -72,70 +74,70 @@ int main()
}
{
Fnf f("en_US.UTF-8", 1);
Fnf f(LOCALE_en_US_UTF_8, 1);
assert(f.grouping() == "\3\3");
}
{
Fnt f("en_US.UTF-8", 1);
Fnt f(LOCALE_en_US_UTF_8, 1);
assert(f.grouping() == "\3\3");
}
{
Fwf f("en_US.UTF-8", 1);
Fwf f(LOCALE_en_US_UTF_8, 1);
assert(f.grouping() == "\3\3");
}
{
Fwt f("en_US.UTF-8", 1);
Fwt f(LOCALE_en_US_UTF_8, 1);
assert(f.grouping() == "\3\3");
}
{
Fnf f("fr_FR.UTF-8", 1);
Fnf f(LOCALE_fr_FR_UTF_8, 1);
assert(f.grouping() == "\3\3");
}
{
Fnt f("fr_FR.UTF-8", 1);
Fnt f(LOCALE_fr_FR_UTF_8, 1);
assert(f.grouping() == "\3\3");
}
{
Fwf f("fr_FR.UTF-8", 1);
Fwf f(LOCALE_fr_FR_UTF_8, 1);
assert(f.grouping() == "\3\3");
}
{
Fwt f("fr_FR.UTF-8", 1);
Fwt f(LOCALE_fr_FR_UTF_8, 1);
assert(f.grouping() == "\3\3");
}
{
Fnf f("ru_RU.UTF-8", 1);
Fnf f(LOCALE_ru_RU_UTF_8, 1);
assert(f.grouping() == "\3\3");
}
{
Fnt f("ru_RU.UTF-8", 1);
Fnt f(LOCALE_ru_RU_UTF_8, 1);
assert(f.grouping() == "\3\3");
}
{
Fwf f("ru_RU.UTF-8", 1);
Fwf f(LOCALE_ru_RU_UTF_8, 1);
assert(f.grouping() == "\3\3");
}
{
Fwt f("ru_RU.UTF-8", 1);
Fwt f(LOCALE_ru_RU_UTF_8, 1);
assert(f.grouping() == "\3\3");
}
{
Fnf f("zh_CN.UTF-8", 1);
Fnf f(LOCALE_zh_CN_UTF_8, 1);
assert(f.grouping() == "\3\3");
}
{
Fnt f("zh_CN.UTF-8", 1);
Fnt f(LOCALE_zh_CN_UTF_8, 1);
assert(f.grouping() == "\3\3");
}
{
Fwf f("zh_CN.UTF-8", 1);
Fwf f(LOCALE_zh_CN_UTF_8, 1);
assert(f.grouping() == "\3\3");
}
{
Fwt f("zh_CN.UTF-8", 1);
Fwt f(LOCALE_zh_CN_UTF_8, 1);
assert(f.grouping() == "\3\3");
}
}

View File

@@ -17,6 +17,8 @@
#include <limits>
#include <cassert>
#include "../../../../platform_support.h" // locale name macros
class Fnf
: public std::moneypunct_byname<char, false>
{
@@ -85,7 +87,7 @@ int main()
}
{
Fnf f("en_US.UTF-8", 1);
Fnf f(LOCALE_en_US_UTF_8, 1);
std::money_base::pattern p = f.neg_format();
assert(p.field[0] == std::money_base::sign);
assert(p.field[1] == std::money_base::symbol);
@@ -93,7 +95,7 @@ int main()
assert(p.field[3] == std::money_base::value);
}
{
Fnt f("en_US.UTF-8", 1);
Fnt f(LOCALE_en_US_UTF_8, 1);
std::money_base::pattern p = f.neg_format();
assert(p.field[0] == std::money_base::sign);
assert(p.field[1] == std::money_base::symbol);
@@ -101,7 +103,7 @@ int main()
assert(p.field[3] == std::money_base::value);
}
{
Fwf f("en_US.UTF-8", 1);
Fwf f(LOCALE_en_US_UTF_8, 1);
std::money_base::pattern p = f.neg_format();
assert(p.field[0] == std::money_base::sign);
assert(p.field[1] == std::money_base::symbol);
@@ -109,7 +111,7 @@ int main()
assert(p.field[3] == std::money_base::value);
}
{
Fwt f("en_US.UTF-8", 1);
Fwt f(LOCALE_en_US_UTF_8, 1);
std::money_base::pattern p = f.neg_format();
assert(p.field[0] == std::money_base::sign);
assert(p.field[1] == std::money_base::symbol);
@@ -118,7 +120,7 @@ int main()
}
{
Fnf f("fr_FR.UTF-8", 1);
Fnf f(LOCALE_fr_FR_UTF_8, 1);
std::money_base::pattern p = f.neg_format();
assert(p.field[0] == std::money_base::value);
assert(p.field[1] == std::money_base::space);
@@ -126,7 +128,7 @@ int main()
assert(p.field[3] == std::money_base::sign);
}
{
Fnt f("fr_FR.UTF-8", 1);
Fnt f(LOCALE_fr_FR_UTF_8, 1);
std::money_base::pattern p = f.neg_format();
assert(p.field[0] == std::money_base::value);
assert(p.field[1] == std::money_base::space);
@@ -134,7 +136,7 @@ int main()
assert(p.field[3] == std::money_base::sign);
}
{
Fwf f("fr_FR.UTF-8", 1);
Fwf f(LOCALE_fr_FR_UTF_8, 1);
std::money_base::pattern p = f.neg_format();
assert(p.field[0] == std::money_base::value);
assert(p.field[1] == std::money_base::space);
@@ -142,7 +144,7 @@ int main()
assert(p.field[3] == std::money_base::sign);
}
{
Fwt f("fr_FR.UTF-8", 1);
Fwt f(LOCALE_fr_FR_UTF_8, 1);
std::money_base::pattern p = f.neg_format();
assert(p.field[0] == std::money_base::value);
assert(p.field[1] == std::money_base::space);
@@ -151,7 +153,7 @@ int main()
}
{
Fnf f("ru_RU.UTF-8", 1);
Fnf f(LOCALE_ru_RU_UTF_8, 1);
std::money_base::pattern p = f.neg_format();
assert(p.field[0] == std::money_base::sign);
assert(p.field[1] == std::money_base::value);
@@ -159,7 +161,7 @@ int main()
assert(p.field[3] == std::money_base::symbol);
}
{
Fnt f("ru_RU.UTF-8", 1);
Fnt f(LOCALE_ru_RU_UTF_8, 1);
std::money_base::pattern p = f.neg_format();
assert(p.field[0] == std::money_base::sign);
assert(p.field[1] == std::money_base::value);
@@ -167,7 +169,7 @@ int main()
assert(p.field[3] == std::money_base::symbol);
}
{
Fwf f("ru_RU.UTF-8", 1);
Fwf f(LOCALE_ru_RU_UTF_8, 1);
std::money_base::pattern p = f.neg_format();
assert(p.field[0] == std::money_base::sign);
assert(p.field[1] == std::money_base::value);
@@ -175,7 +177,7 @@ int main()
assert(p.field[3] == std::money_base::symbol);
}
{
Fwt f("ru_RU.UTF-8", 1);
Fwt f(LOCALE_ru_RU_UTF_8, 1);
std::money_base::pattern p = f.neg_format();
assert(p.field[0] == std::money_base::sign);
assert(p.field[1] == std::money_base::value);
@@ -184,7 +186,7 @@ int main()
}
{
Fnf f("zh_CN.UTF-8", 1);
Fnf f(LOCALE_zh_CN_UTF_8, 1);
std::money_base::pattern p = f.neg_format();
assert(p.field[0] == std::money_base::symbol);
assert(p.field[1] == std::money_base::sign);
@@ -192,7 +194,7 @@ int main()
assert(p.field[3] == std::money_base::value);
}
{
Fnt f("zh_CN.UTF-8", 1);
Fnt f(LOCALE_zh_CN_UTF_8, 1);
std::money_base::pattern p = f.neg_format();
assert(p.field[0] == std::money_base::symbol);
assert(p.field[1] == std::money_base::sign);
@@ -200,7 +202,7 @@ int main()
assert(p.field[3] == std::money_base::value);
}
{
Fwf f("zh_CN.UTF-8", 1);
Fwf f(LOCALE_zh_CN_UTF_8, 1);
std::money_base::pattern p = f.neg_format();
assert(p.field[0] == std::money_base::symbol);
assert(p.field[1] == std::money_base::sign);
@@ -208,7 +210,7 @@ int main()
assert(p.field[3] == std::money_base::value);
}
{
Fwt f("zh_CN.UTF-8", 1);
Fwt f(LOCALE_zh_CN_UTF_8, 1);
std::money_base::pattern p = f.neg_format();
assert(p.field[0] == std::money_base::symbol);
assert(p.field[1] == std::money_base::sign);

View File

@@ -17,6 +17,8 @@
#include <limits>
#include <cassert>
#include "../../../../platform_support.h" // locale name macros
class Fnf
: public std::moneypunct_byname<char, false>
{
@@ -69,70 +71,70 @@ int main()
}
{
Fnf f("en_US.UTF-8", 1);
Fnf f(LOCALE_en_US_UTF_8, 1);
assert(f.negative_sign() == "-");
}
{
Fnt f("en_US.UTF-8", 1);
Fnt f(LOCALE_en_US_UTF_8, 1);
assert(f.negative_sign() == "-");
}
{
Fwf f("en_US.UTF-8", 1);
Fwf f(LOCALE_en_US_UTF_8, 1);
assert(f.negative_sign() == L"-");
}
{
Fwt f("en_US.UTF-8", 1);
Fwt f(LOCALE_en_US_UTF_8, 1);
assert(f.negative_sign() == L"-");
}
{
Fnf f("fr_FR.UTF-8", 1);
Fnf f(LOCALE_fr_FR_UTF_8, 1);
assert(f.negative_sign() == "-");
}
{
Fnt f("fr_FR.UTF-8", 1);
Fnt f(LOCALE_fr_FR_UTF_8, 1);
assert(f.negative_sign() == "-");
}
{
Fwf f("fr_FR.UTF-8", 1);
Fwf f(LOCALE_fr_FR_UTF_8, 1);
assert(f.negative_sign() == L"-");
}
{
Fwt f("fr_FR.UTF-8", 1);
Fwt f(LOCALE_fr_FR_UTF_8, 1);
assert(f.negative_sign() == L"-");
}
{
Fnf f("ru_RU.UTF-8", 1);
Fnf f(LOCALE_ru_RU_UTF_8, 1);
assert(f.negative_sign() == "-");
}
{
Fnt f("ru_RU.UTF-8", 1);
Fnt f(LOCALE_ru_RU_UTF_8, 1);
assert(f.negative_sign() == "-");
}
{
Fwf f("ru_RU.UTF-8", 1);
Fwf f(LOCALE_ru_RU_UTF_8, 1);
assert(f.negative_sign() == L"-");
}
{
Fwt f("ru_RU.UTF-8", 1);
Fwt f(LOCALE_ru_RU_UTF_8, 1);
assert(f.negative_sign() == L"-");
}
{
Fnf f("zh_CN.UTF-8", 1);
Fnf f(LOCALE_zh_CN_UTF_8, 1);
assert(f.negative_sign() == "-");
}
{
Fnt f("zh_CN.UTF-8", 1);
Fnt f(LOCALE_zh_CN_UTF_8, 1);
assert(f.negative_sign() == "-");
}
{
Fwf f("zh_CN.UTF-8", 1);
Fwf f(LOCALE_zh_CN_UTF_8, 1);
assert(f.negative_sign() == L"-");
}
{
Fwt f("zh_CN.UTF-8", 1);
Fwt f(LOCALE_zh_CN_UTF_8, 1);
assert(f.negative_sign() == L"-");
}
}

View File

@@ -17,6 +17,8 @@
#include <limits>
#include <cassert>
#include "../../../../platform_support.h" // locale name macros
class Fnf
: public std::moneypunct_byname<char, false>
{
@@ -85,7 +87,7 @@ int main()
}
{
Fnf f("en_US.UTF-8", 1);
Fnf f(LOCALE_en_US_UTF_8, 1);
std::money_base::pattern p = f.pos_format();
assert(p.field[0] == std::money_base::sign);
assert(p.field[1] == std::money_base::symbol);
@@ -93,7 +95,7 @@ int main()
assert(p.field[3] == std::money_base::value);
}
{
Fnt f("en_US.UTF-8", 1);
Fnt f(LOCALE_en_US_UTF_8, 1);
std::money_base::pattern p = f.pos_format();
assert(p.field[0] == std::money_base::sign);
assert(p.field[1] == std::money_base::symbol);
@@ -101,7 +103,7 @@ int main()
assert(p.field[3] == std::money_base::value);
}
{
Fwf f("en_US.UTF-8", 1);
Fwf f(LOCALE_en_US_UTF_8, 1);
std::money_base::pattern p = f.pos_format();
assert(p.field[0] == std::money_base::sign);
assert(p.field[1] == std::money_base::symbol);
@@ -109,7 +111,7 @@ int main()
assert(p.field[3] == std::money_base::value);
}
{
Fwt f("en_US.UTF-8", 1);
Fwt f(LOCALE_en_US_UTF_8, 1);
std::money_base::pattern p = f.pos_format();
assert(p.field[0] == std::money_base::sign);
assert(p.field[1] == std::money_base::symbol);
@@ -118,7 +120,7 @@ int main()
}
{
Fnf f("fr_FR.UTF-8", 1);
Fnf f(LOCALE_fr_FR_UTF_8, 1);
std::money_base::pattern p = f.pos_format();
assert(p.field[0] == std::money_base::sign);
assert(p.field[1] == std::money_base::value);
@@ -126,7 +128,7 @@ int main()
assert(p.field[3] == std::money_base::symbol);
}
{
Fnt f("fr_FR.UTF-8", 1);
Fnt f(LOCALE_fr_FR_UTF_8, 1);
std::money_base::pattern p = f.pos_format();
assert(p.field[0] == std::money_base::sign);
assert(p.field[1] == std::money_base::value);
@@ -134,7 +136,7 @@ int main()
assert(p.field[3] == std::money_base::symbol);
}
{
Fwf f("fr_FR.UTF-8", 1);
Fwf f(LOCALE_fr_FR_UTF_8, 1);
std::money_base::pattern p = f.pos_format();
assert(p.field[0] == std::money_base::sign);
assert(p.field[1] == std::money_base::value);
@@ -142,7 +144,7 @@ int main()
assert(p.field[3] == std::money_base::symbol);
}
{
Fwt f("fr_FR.UTF-8", 1);
Fwt f(LOCALE_fr_FR_UTF_8, 1);
std::money_base::pattern p = f.pos_format();
assert(p.field[0] == std::money_base::sign);
assert(p.field[1] == std::money_base::value);
@@ -151,7 +153,7 @@ int main()
}
{
Fnf f("ru_RU.UTF-8", 1);
Fnf f(LOCALE_ru_RU_UTF_8, 1);
std::money_base::pattern p = f.pos_format();
assert(p.field[0] == std::money_base::sign);
assert(p.field[1] == std::money_base::value);
@@ -159,7 +161,7 @@ int main()
assert(p.field[3] == std::money_base::symbol);
}
{
Fnt f("ru_RU.UTF-8", 1);
Fnt f(LOCALE_ru_RU_UTF_8, 1);
std::money_base::pattern p = f.pos_format();
assert(p.field[0] == std::money_base::sign);
assert(p.field[1] == std::money_base::value);
@@ -167,7 +169,7 @@ int main()
assert(p.field[3] == std::money_base::symbol);
}
{
Fwf f("ru_RU.UTF-8", 1);
Fwf f(LOCALE_ru_RU_UTF_8, 1);
std::money_base::pattern p = f.pos_format();
assert(p.field[0] == std::money_base::sign);
assert(p.field[1] == std::money_base::value);
@@ -175,7 +177,7 @@ int main()
assert(p.field[3] == std::money_base::symbol);
}
{
Fwt f("ru_RU.UTF-8", 1);
Fwt f(LOCALE_ru_RU_UTF_8, 1);
std::money_base::pattern p = f.pos_format();
assert(p.field[0] == std::money_base::sign);
assert(p.field[1] == std::money_base::value);
@@ -184,7 +186,7 @@ int main()
}
{
Fnf f("zh_CN.UTF-8", 1);
Fnf f(LOCALE_zh_CN_UTF_8, 1);
std::money_base::pattern p = f.pos_format();
assert(p.field[0] == std::money_base::sign);
assert(p.field[1] == std::money_base::symbol);
@@ -192,7 +194,7 @@ int main()
assert(p.field[3] == std::money_base::value);
}
{
Fnt f("zh_CN.UTF-8", 1);
Fnt f(LOCALE_zh_CN_UTF_8, 1);
std::money_base::pattern p = f.pos_format();
assert(p.field[0] == std::money_base::sign);
assert(p.field[1] == std::money_base::symbol);
@@ -200,7 +202,7 @@ int main()
assert(p.field[3] == std::money_base::value);
}
{
Fwf f("zh_CN.UTF-8", 1);
Fwf f(LOCALE_zh_CN_UTF_8, 1);
std::money_base::pattern p = f.pos_format();
assert(p.field[0] == std::money_base::sign);
assert(p.field[1] == std::money_base::symbol);
@@ -208,7 +210,7 @@ int main()
assert(p.field[3] == std::money_base::value);
}
{
Fwt f("zh_CN.UTF-8", 1);
Fwt f(LOCALE_zh_CN_UTF_8, 1);
std::money_base::pattern p = f.pos_format();
assert(p.field[0] == std::money_base::sign);
assert(p.field[1] == std::money_base::symbol);

View File

@@ -17,6 +17,8 @@
#include <limits>
#include <cassert>
#include "../../../../platform_support.h" // locale name macros
class Fnf
: public std::moneypunct_byname<char, false>
{
@@ -69,70 +71,70 @@ int main()
}
{
Fnf f("en_US.UTF-8", 1);
Fnf f(LOCALE_en_US_UTF_8, 1);
assert(f.positive_sign() == "");
}
{
Fnt f("en_US.UTF-8", 1);
Fnt f(LOCALE_en_US_UTF_8, 1);
assert(f.positive_sign() == "");
}
{
Fwf f("en_US.UTF-8", 1);
Fwf f(LOCALE_en_US_UTF_8, 1);
assert(f.positive_sign() == L"");
}
{
Fwt f("en_US.UTF-8", 1);
Fwt f(LOCALE_en_US_UTF_8, 1);
assert(f.positive_sign() == L"");
}
{
Fnf f("fr_FR.UTF-8", 1);
Fnf f(LOCALE_fr_FR_UTF_8, 1);
assert(f.positive_sign() == "");
}
{
Fnt f("fr_FR.UTF-8", 1);
Fnt f(LOCALE_fr_FR_UTF_8, 1);
assert(f.positive_sign() == "");
}
{
Fwf f("fr_FR.UTF-8", 1);
Fwf f(LOCALE_fr_FR_UTF_8, 1);
assert(f.positive_sign() == L"");
}
{
Fwt f("fr_FR.UTF-8", 1);
Fwt f(LOCALE_fr_FR_UTF_8, 1);
assert(f.positive_sign() == L"");
}
{
Fnf f("ru_RU.UTF-8", 1);
Fnf f(LOCALE_ru_RU_UTF_8, 1);
assert(f.positive_sign() == "");
}
{
Fnt f("ru_RU.UTF-8", 1);
Fnt f(LOCALE_ru_RU_UTF_8, 1);
assert(f.positive_sign() == "");
}
{
Fwf f("ru_RU.UTF-8", 1);
Fwf f(LOCALE_ru_RU_UTF_8, 1);
assert(f.positive_sign() == L"");
}
{
Fwt f("ru_RU.UTF-8", 1);
Fwt f(LOCALE_ru_RU_UTF_8, 1);
assert(f.positive_sign() == L"");
}
{
Fnf f("zh_CN.UTF-8", 1);
Fnf f(LOCALE_zh_CN_UTF_8, 1);
assert(f.positive_sign() == "");
}
{
Fnt f("zh_CN.UTF-8", 1);
Fnt f(LOCALE_zh_CN_UTF_8, 1);
assert(f.positive_sign() == "");
}
{
Fwf f("zh_CN.UTF-8", 1);
Fwf f(LOCALE_zh_CN_UTF_8, 1);
assert(f.positive_sign() == L"");
}
{
Fwt f("zh_CN.UTF-8", 1);
Fwt f(LOCALE_zh_CN_UTF_8, 1);
assert(f.positive_sign() == L"");
}
}

View File

@@ -17,6 +17,8 @@
#include <limits>
#include <cassert>
#include "../../../../platform_support.h" // locale name macros
class Fnf
: public std::moneypunct_byname<char, false>
{
@@ -69,70 +71,70 @@ int main()
}
{
Fnf f("en_US.UTF-8", 1);
Fnf f(LOCALE_en_US_UTF_8, 1);
assert(f.thousands_sep() == ',');
}
{
Fnt f("en_US.UTF-8", 1);
Fnt f(LOCALE_en_US_UTF_8, 1);
assert(f.thousands_sep() == ',');
}
{
Fwf f("en_US.UTF-8", 1);
Fwf f(LOCALE_en_US_UTF_8, 1);
assert(f.thousands_sep() == L',');
}
{
Fwt f("en_US.UTF-8", 1);
Fwt f(LOCALE_en_US_UTF_8, 1);
assert(f.thousands_sep() == L',');
}
{
Fnf f("fr_FR.UTF-8", 1);
Fnf f(LOCALE_fr_FR_UTF_8, 1);
assert(f.thousands_sep() == ' ');
}
{
Fnt f("fr_FR.UTF-8", 1);
Fnt f(LOCALE_fr_FR_UTF_8, 1);
assert(f.thousands_sep() == ' ');
}
{
Fwf f("fr_FR.UTF-8", 1);
Fwf f(LOCALE_fr_FR_UTF_8, 1);
assert(f.thousands_sep() == L' ');
}
{
Fwt f("fr_FR.UTF-8", 1);
Fwt f(LOCALE_fr_FR_UTF_8, 1);
assert(f.thousands_sep() == L' ');
}
{
Fnf f("ru_RU.UTF-8", 1);
Fnf f(LOCALE_ru_RU_UTF_8, 1);
assert(f.thousands_sep() == ' ');
}
{
Fnt f("ru_RU.UTF-8", 1);
Fnt f(LOCALE_ru_RU_UTF_8, 1);
assert(f.thousands_sep() == ' ');
}
{
Fwf f("ru_RU.UTF-8", 1);
Fwf f(LOCALE_ru_RU_UTF_8, 1);
assert(f.thousands_sep() == L' ');
}
{
Fwt f("ru_RU.UTF-8", 1);
Fwt f(LOCALE_ru_RU_UTF_8, 1);
assert(f.thousands_sep() == L' ');
}
{
Fnf f("zh_CN.UTF-8", 1);
Fnf f(LOCALE_zh_CN_UTF_8, 1);
assert(f.thousands_sep() == ',');
}
{
Fnt f("zh_CN.UTF-8", 1);
Fnt f(LOCALE_zh_CN_UTF_8, 1);
assert(f.thousands_sep() == ',');
}
{
Fwf f("zh_CN.UTF-8", 1);
Fwf f(LOCALE_zh_CN_UTF_8, 1);
assert(f.thousands_sep() == L',');
}
{
Fwt f("zh_CN.UTF-8", 1);
Fwt f(LOCALE_zh_CN_UTF_8, 1);
assert(f.thousands_sep() == L',');
}
}

View File

@@ -17,6 +17,8 @@
#include <cassert>
#include "iterators.h"
#include "../../../../platform_support.h" // locale name macros
typedef std::time_get_byname<char, input_iterator<const char*> > F;
class my_facet
@@ -30,19 +32,19 @@ public:
int main()
{
{
const my_facet f("en_US.UTF-8", 1);
const my_facet f(LOCALE_en_US_UTF_8, 1);
assert(f.date_order() == std::time_base::mdy);
}
{
const my_facet f("fr_FR.UTF-8", 1);
const my_facet f(LOCALE_fr_FR_UTF_8, 1);
assert(f.date_order() == std::time_base::dmy);
}
{
const my_facet f("ru_RU.UTF-8", 1);
const my_facet f(LOCALE_ru_RU_UTF_8, 1);
assert(f.date_order() == std::time_base::dmy);
}
{
const my_facet f("zh_CN.UTF-8", 1);
const my_facet f(LOCALE_zh_CN_UTF_8, 1);
assert(f.date_order() == std::time_base::ymd);
}
}

View File

@@ -17,6 +17,8 @@
#include <cassert>
#include "iterators.h"
#include "../../../../platform_support.h" // locale name macros
typedef std::time_get_byname<wchar_t, input_iterator<const wchar_t*> > F;
class my_facet
@@ -30,19 +32,19 @@ public:
int main()
{
{
const my_facet f("en_US.UTF-8", 1);
const my_facet f(LOCALE_en_US_UTF_8, 1);
assert(f.date_order() == std::time_base::mdy);
}
{
const my_facet f("fr_FR.UTF-8", 1);
const my_facet f(LOCALE_fr_FR_UTF_8, 1);
assert(f.date_order() == std::time_base::dmy);
}
{
const my_facet f("ru_RU.UTF-8", 1);
const my_facet f(LOCALE_ru_RU_UTF_8, 1);
assert(f.date_order() == std::time_base::dmy);
}
{
const my_facet f("zh_CN.UTF-8", 1);
const my_facet f(LOCALE_zh_CN_UTF_8, 1);
assert(f.date_order() == std::time_base::ymd);
}
}

View File

@@ -19,6 +19,8 @@
#include <cassert>
#include "iterators.h"
#include "../../../../platform_support.h" // locale name macros
typedef input_iterator<const char*> I;
typedef std::time_get_byname<char, I> F;
@@ -37,7 +39,7 @@ int main()
std::ios_base::iostate err;
std::tm t;
{
const my_facet f("en_US.UTF-8", 1);
const my_facet f(LOCALE_en_US_UTF_8, 1);
const char in[] = "06/10/2009";
err = std::ios_base::goodbit;
t = std::tm();
@@ -49,7 +51,7 @@ int main()
assert(err == std::ios_base::eofbit);
}
{
const my_facet f("fr_FR.UTF-8", 1);
const my_facet f(LOCALE_fr_FR_UTF_8, 1);
const char in[] = "10.06.2009";
err = std::ios_base::goodbit;
t = std::tm();
@@ -61,7 +63,7 @@ int main()
assert(err == std::ios_base::eofbit);
}
{
const my_facet f("ru_RU.UTF-8", 1);
const my_facet f(LOCALE_ru_RU_UTF_8, 1);
const char in[] = "10.06.2009";
err = std::ios_base::goodbit;
t = std::tm();
@@ -73,7 +75,7 @@ int main()
assert(err == std::ios_base::eofbit);
}
{
const my_facet f("zh_CN.UTF-8", 1);
const my_facet f(LOCALE_zh_CN_UTF_8, 1);
const char in[] = "2009/06/10";
err = std::ios_base::goodbit;
t = std::tm();

View File

@@ -19,6 +19,8 @@
#include <cassert>
#include "iterators.h"
#include "../../../../platform_support.h" // locale name macros
typedef input_iterator<const wchar_t*> I;
typedef std::time_get_byname<wchar_t, I> F;
@@ -37,7 +39,7 @@ int main()
std::ios_base::iostate err;
std::tm t;
{
const my_facet f("en_US.UTF-8", 1);
const my_facet f(LOCALE_en_US_UTF_8, 1);
const wchar_t in[] = L"06/10/2009";
err = std::ios_base::goodbit;
t = std::tm();
@@ -49,7 +51,7 @@ int main()
assert(err == std::ios_base::eofbit);
}
{
const my_facet f("fr_FR.UTF-8", 1);
const my_facet f(LOCALE_fr_FR_UTF_8, 1);
const wchar_t in[] = L"10.06.2009";
err = std::ios_base::goodbit;
t = std::tm();
@@ -61,7 +63,7 @@ int main()
assert(err == std::ios_base::eofbit);
}
{
const my_facet f("ru_RU.UTF-8", 1);
const my_facet f(LOCALE_ru_RU_UTF_8, 1);
const wchar_t in[] = L"10.06.2009";
err = std::ios_base::goodbit;
t = std::tm();
@@ -73,7 +75,7 @@ int main()
assert(err == std::ios_base::eofbit);
}
{
const my_facet f("zh_CN.UTF-8", 1);
const my_facet f(LOCALE_zh_CN_UTF_8, 1);
const wchar_t in[] = L"2009/06/10";
err = std::ios_base::goodbit;
t = std::tm();

View File

@@ -19,6 +19,8 @@
#include <cassert>
#include "iterators.h"
#include "../../../../platform_support.h" // locale name macros
typedef input_iterator<const char*> I;
typedef std::time_get_byname<char, I> F;
@@ -37,7 +39,7 @@ int main()
std::ios_base::iostate err;
std::tm t;
{
const my_facet f("en_US.UTF-8", 1);
const my_facet f(LOCALE_en_US_UTF_8, 1);
const char in[] = "June";
err = std::ios_base::goodbit;
t = std::tm();
@@ -47,7 +49,7 @@ int main()
assert(err == std::ios_base::eofbit);
}
{
const my_facet f("fr_FR.UTF-8", 1);
const my_facet f(LOCALE_fr_FR_UTF_8, 1);
const char in[] = "juin";
err = std::ios_base::goodbit;
t = std::tm();
@@ -57,7 +59,7 @@ int main()
assert(err == std::ios_base::eofbit);
}
{
const my_facet f("ru_RU.UTF-8", 1);
const my_facet f(LOCALE_ru_RU_UTF_8, 1);
const char in[] = "\xD0\xB8\xD1\x8E\xD0\xBD\xD1\x8F";
err = std::ios_base::goodbit;
t = std::tm();
@@ -67,7 +69,7 @@ int main()
assert(err == std::ios_base::eofbit);
}
{
const my_facet f("zh_CN.UTF-8", 1);
const my_facet f(LOCALE_zh_CN_UTF_8, 1);
const char in[] = "\xE5\x85\xAD\xE6\x9C\x88";
err = std::ios_base::goodbit;
t = std::tm();

View File

@@ -19,6 +19,8 @@
#include <cassert>
#include "iterators.h"
#include "../../../../platform_support.h" // locale name macros
typedef input_iterator<const wchar_t*> I;
typedef std::time_get_byname<wchar_t, I> F;
@@ -46,7 +48,7 @@ int main()
std::ios_base::iostate err;
std::tm t;
{
const my_facet f("en_US.UTF-8", 1);
const my_facet f(LOCALE_en_US_UTF_8, 1);
const wchar_t in[] = L"June";
err = std::ios_base::goodbit;
t = std::tm();
@@ -56,7 +58,7 @@ int main()
assert(err == std::ios_base::eofbit);
}
{
const my_facet f("fr_FR.UTF-8", 1);
const my_facet f(LOCALE_fr_FR_UTF_8, 1);
const wchar_t in[] = L"juin";
err = std::ios_base::goodbit;
t = std::tm();
@@ -66,7 +68,7 @@ int main()
assert(err == std::ios_base::eofbit);
}
{
const my_facet f("ru_RU.UTF-8", 1);
const my_facet f(LOCALE_ru_RU_UTF_8, 1);
const wchar_t in[] = L"\x438\x44E\x43D\x44F";
err = std::ios_base::goodbit;
t = std::tm();
@@ -76,7 +78,7 @@ int main()
assert(err == std::ios_base::eofbit);
}
{
const my_facet f("zh_CN.UTF-8", 1);
const my_facet f(LOCALE_zh_CN_UTF_8, 1);
const wchar_t in[] = L"\x516D\x6708";
err = std::ios_base::goodbit;
t = std::tm();

View File

@@ -18,6 +18,8 @@
#include <cassert>
#include "iterators.h"
#include "../../../../platform_support.h" // locale name macros
typedef input_iterator<const char*> I;
typedef std::time_get_byname<char, I> F;
@@ -36,7 +38,7 @@ int main()
std::ios_base::iostate err;
std::tm t;
{
const my_facet f("en_US.UTF-8", 1);
const my_facet f(LOCALE_en_US_UTF_8, 1);
const char in[] = "Sat Dec 31 23:55:59 2061";
err = std::ios_base::goodbit;
t = std::tm();
@@ -52,7 +54,7 @@ int main()
assert(err == std::ios_base::eofbit);
}
{
const my_facet f("en_US.UTF-8", 1);
const my_facet f(LOCALE_en_US_UTF_8, 1);
const char in[] = "23:55:59";
err = std::ios_base::goodbit;
t = std::tm();
@@ -64,7 +66,7 @@ int main()
assert(err == std::ios_base::eofbit);
}
{
const my_facet f("fr_FR.UTF-8", 1);
const my_facet f(LOCALE_fr_FR_UTF_8, 1);
const char in[] = "Sam 31 d""\xC3\xA9""c 23:55:59 2061";
err = std::ios_base::goodbit;
t = std::tm();
@@ -80,7 +82,7 @@ int main()
assert(err == std::ios_base::eofbit);
}
{
const my_facet f("fr_FR.UTF-8", 1);
const my_facet f(LOCALE_fr_FR_UTF_8, 1);
const char in[] = "23:55:59";
err = std::ios_base::goodbit;
t = std::tm();
@@ -92,7 +94,7 @@ int main()
assert(err == std::ios_base::eofbit);
}
{
const my_facet f("ru_RU.UTF-8", 1);
const my_facet f(LOCALE_ru_RU_UTF_8, 1);
const char in[] = "\xD1\x81\xD1\x83\xD0\xB1\xD0\xB1"
"\xD0\xBE\xD1\x82\xD0\xB0"
", 31 "
@@ -115,7 +117,7 @@ int main()
assert(err == std::ios_base::eofbit);
}
{
const my_facet f("ru_RU.UTF-8", 1);
const my_facet f(LOCALE_ru_RU_UTF_8, 1);
const char in[] = "23:55:59";
err = std::ios_base::goodbit;
t = std::tm();
@@ -127,7 +129,7 @@ int main()
assert(err == std::ios_base::eofbit);
}
{
const my_facet f("zh_CN.UTF-8", 1);
const my_facet f(LOCALE_zh_CN_UTF_8, 1);
const char in[] = "\xE5\x85\xAD"
" 12/31 23:55:59 2061";
err = std::ios_base::goodbit;
@@ -144,7 +146,7 @@ int main()
assert(err == std::ios_base::eofbit);
}
{
const my_facet f("zh_CN.UTF-8", 1);
const my_facet f(LOCALE_zh_CN_UTF_8, 1);
const char in[] = "23""\xE6\x97\xB6""55""\xE5\x88\x86""59""\xE7\xA7\x92";
err = std::ios_base::goodbit;
t = std::tm();

View File

@@ -18,6 +18,8 @@
#include <cassert>
#include "iterators.h"
#include "../../../../platform_support.h" // locale name macros
typedef input_iterator<const wchar_t*> I;
typedef std::time_get_byname<wchar_t, I> F;
@@ -36,7 +38,7 @@ int main()
std::ios_base::iostate err;
std::tm t;
{
const my_facet f("en_US.UTF-8", 1);
const my_facet f(LOCALE_en_US_UTF_8, 1);
const wchar_t in[] = L"Sat Dec 31 23:55:59 2061";
err = std::ios_base::goodbit;
t = std::tm();
@@ -52,7 +54,7 @@ int main()
assert(err == std::ios_base::eofbit);
}
{
const my_facet f("en_US.UTF-8", 1);
const my_facet f(LOCALE_en_US_UTF_8, 1);
const wchar_t in[] = L"23:55:59";
err = std::ios_base::goodbit;
t = std::tm();
@@ -64,7 +66,7 @@ int main()
assert(err == std::ios_base::eofbit);
}
{
const my_facet f("fr_FR.UTF-8", 1);
const my_facet f(LOCALE_fr_FR_UTF_8, 1);
const wchar_t in[] = L"Sam 31 d""\xE9""c 23:55:59 2061";
err = std::ios_base::goodbit;
t = std::tm();
@@ -80,7 +82,7 @@ int main()
assert(err == std::ios_base::eofbit);
}
{
const my_facet f("fr_FR.UTF-8", 1);
const my_facet f(LOCALE_fr_FR_UTF_8, 1);
const wchar_t in[] = L"23:55:59";
err = std::ios_base::goodbit;
t = std::tm();
@@ -115,7 +117,7 @@ int main()
}
#endif
{
const my_facet f("ru_RU.UTF-8", 1);
const my_facet f(LOCALE_ru_RU_UTF_8, 1);
const wchar_t in[] = L"23:55:59";
err = std::ios_base::goodbit;
t = std::tm();
@@ -144,8 +146,9 @@ int main()
assert(t.tm_wday == 6);
assert(err == std::ios_base::eofbit);
}
#endif
{
const my_facet f("zh_CN.UTF-8", 1);
const my_facet f(LOCALE_zh_CN_UTF_8, 1);
const wchar_t in[] = L"23""\x65F6""55""\x5206""59""\x79D2";
err = std::ios_base::goodbit;
t = std::tm();
@@ -156,5 +159,4 @@ int main()
assert(t.tm_hour == 23);
assert(err == std::ios_base::eofbit);
}
#endif
}

View File

@@ -19,6 +19,8 @@
#include <cassert>
#include "iterators.h"
#include "../../../../platform_support.h" // locale name macros
typedef input_iterator<const char*> I;
typedef std::time_get_byname<char, I> F;
@@ -37,7 +39,7 @@ int main()
std::ios_base::iostate err;
std::tm t;
{
const my_facet f("en_US.UTF-8", 1);
const my_facet f(LOCALE_en_US_UTF_8, 1);
const char in[] = "13:14:15";
err = std::ios_base::goodbit;
t = std::tm();
@@ -49,7 +51,7 @@ int main()
assert(err == std::ios_base::eofbit);
}
{
const my_facet f("fr_FR.UTF-8", 1);
const my_facet f(LOCALE_fr_FR_UTF_8, 1);
const char in[] = "13:14:15";
err = std::ios_base::goodbit;
t = std::tm();
@@ -61,7 +63,7 @@ int main()
assert(err == std::ios_base::eofbit);
}
{
const my_facet f("ru_RU.UTF-8", 1);
const my_facet f(LOCALE_ru_RU_UTF_8, 1);
const char in[] = "13:14:15";
err = std::ios_base::goodbit;
t = std::tm();
@@ -73,7 +75,7 @@ int main()
assert(err == std::ios_base::eofbit);
}
{
const my_facet f("zh_CN.UTF-8", 1);
const my_facet f(LOCALE_zh_CN_UTF_8, 1);
const char in[] = "13:14:15";
err = std::ios_base::goodbit;
t = std::tm();

View File

@@ -19,6 +19,8 @@
#include <cassert>
#include "iterators.h"
#include "../../../../platform_support.h" // locale name macros
typedef input_iterator<const wchar_t*> I;
typedef std::time_get_byname<wchar_t, I> F;
@@ -37,7 +39,7 @@ int main()
std::ios_base::iostate err;
std::tm t;
{
const my_facet f("en_US.UTF-8", 1);
const my_facet f(LOCALE_en_US_UTF_8, 1);
const wchar_t in[] = L"13:14:15";
err = std::ios_base::goodbit;
t = std::tm();
@@ -49,7 +51,7 @@ int main()
assert(err == std::ios_base::eofbit);
}
{
const my_facet f("fr_FR.UTF-8", 1);
const my_facet f(LOCALE_fr_FR_UTF_8, 1);
const wchar_t in[] = L"13:14:15";
err = std::ios_base::goodbit;
t = std::tm();
@@ -61,7 +63,7 @@ int main()
assert(err == std::ios_base::eofbit);
}
{
const my_facet f("ru_RU.UTF-8", 1);
const my_facet f(LOCALE_ru_RU_UTF_8, 1);
const wchar_t in[] = L"13:14:15";
err = std::ios_base::goodbit;
t = std::tm();
@@ -73,7 +75,7 @@ int main()
assert(err == std::ios_base::eofbit);
}
{
const my_facet f("zh_CN.UTF-8", 1);
const my_facet f(LOCALE_zh_CN_UTF_8, 1);
const wchar_t in[] = L"13:14:15";
err = std::ios_base::goodbit;
t = std::tm();

View File

@@ -19,6 +19,8 @@
#include <cassert>
#include "iterators.h"
#include "../../../../platform_support.h" // locale name macros
typedef input_iterator<const char*> I;
typedef std::time_get_byname<char, I> F;
@@ -37,7 +39,7 @@ int main()
std::ios_base::iostate err;
std::tm t;
{
const my_facet f("en_US.UTF-8", 1);
const my_facet f(LOCALE_en_US_UTF_8, 1);
const char in[] = "Monday";
err = std::ios_base::goodbit;
t = std::tm();
@@ -47,7 +49,7 @@ int main()
assert(err == std::ios_base::eofbit);
}
{
const my_facet f("fr_FR.UTF-8", 1);
const my_facet f(LOCALE_fr_FR_UTF_8, 1);
const char in[] = "Lundi";
err = std::ios_base::goodbit;
t = std::tm();
@@ -57,7 +59,7 @@ int main()
assert(err == std::ios_base::eofbit);
}
{
const my_facet f("ru_RU.UTF-8", 1);
const my_facet f(LOCALE_ru_RU_UTF_8, 1);
const char in[] = "\xD0\xBF\xD0\xBE\xD0\xBD\xD0\xB5"
"\xD0\xB4\xD0\xB5\xD0\xBB\xD1\x8C"
"\xD0\xBD\xD0\xB8\xD0\xBA";
@@ -69,7 +71,7 @@ int main()
assert(err == std::ios_base::eofbit);
}
{
const my_facet f("zh_CN.UTF-8", 1);
const my_facet f(LOCALE_zh_CN_UTF_8, 1);
const char in[] = "\xE6\x98\x9F\xE6\x9C\x9F\xE4\xB8\x80";
err = std::ios_base::goodbit;
t = std::tm();

View File

@@ -19,6 +19,8 @@
#include <cassert>
#include "iterators.h"
#include "../../../../platform_support.h" // locale name macros
typedef input_iterator<const wchar_t*> I;
typedef std::time_get_byname<wchar_t, I> F;
@@ -37,7 +39,7 @@ int main()
std::ios_base::iostate err;
std::tm t;
{
const my_facet f("en_US.UTF-8", 1);
const my_facet f(LOCALE_en_US_UTF_8, 1);
const wchar_t in[] = L"Monday";
err = std::ios_base::goodbit;
t = std::tm();
@@ -47,7 +49,7 @@ int main()
assert(err == std::ios_base::eofbit);
}
{
const my_facet f("fr_FR.UTF-8", 1);
const my_facet f(LOCALE_fr_FR_UTF_8, 1);
const wchar_t in[] = L"Lundi";
err = std::ios_base::goodbit;
t = std::tm();
@@ -57,7 +59,7 @@ int main()
assert(err == std::ios_base::eofbit);
}
{
const my_facet f("ru_RU.UTF-8", 1);
const my_facet f(LOCALE_ru_RU_UTF_8, 1);
const wchar_t in[] = L"\x43F\x43E\x43D\x435\x434\x435\x43B\x44C\x43D\x438\x43A";
err = std::ios_base::goodbit;
t = std::tm();
@@ -67,7 +69,7 @@ int main()
assert(err == std::ios_base::eofbit);
}
{
const my_facet f("zh_CN.UTF-8", 1);
const my_facet f(LOCALE_zh_CN_UTF_8, 1);
const wchar_t in[] = L"\x661F\x671F\x4E00";
err = std::ios_base::goodbit;
t = std::tm();

View File

@@ -18,6 +18,8 @@
#include <cassert>
#include "iterators.h"
#include "../../../../platform_support.h" // locale name macros
typedef input_iterator<const char*> I;
typedef std::time_get_byname<char, I> F;
@@ -36,7 +38,7 @@ int main()
std::ios_base::iostate err;
std::tm t;
{
const my_facet f("en_US.UTF-8", 1);
const my_facet f(LOCALE_en_US_UTF_8, 1);
const char in[] = "2009";
err = std::ios_base::goodbit;
t = std::tm();
@@ -46,7 +48,7 @@ int main()
assert(err == std::ios_base::eofbit);
}
{
const my_facet f("fr_FR.UTF-8", 1);
const my_facet f(LOCALE_fr_FR_UTF_8, 1);
const char in[] = "2009";
err = std::ios_base::goodbit;
t = std::tm();
@@ -56,7 +58,7 @@ int main()
assert(err == std::ios_base::eofbit);
}
{
const my_facet f("ru_RU.UTF-8", 1);
const my_facet f(LOCALE_ru_RU_UTF_8, 1);
const char in[] = "2009";
err = std::ios_base::goodbit;
t = std::tm();
@@ -66,7 +68,7 @@ int main()
assert(err == std::ios_base::eofbit);
}
{
const my_facet f("zh_CN.UTF-8", 1);
const my_facet f(LOCALE_zh_CN_UTF_8, 1);
const char in[] = "2009";
err = std::ios_base::goodbit;
t = std::tm();

View File

@@ -18,6 +18,8 @@
#include <cassert>
#include "iterators.h"
#include "../../../../platform_support.h" // locale name macros
typedef input_iterator<const wchar_t*> I;
typedef std::time_get_byname<wchar_t, I> F;
@@ -36,7 +38,7 @@ int main()
std::ios_base::iostate err;
std::tm t;
{
const my_facet f("en_US.UTF-8", 1);
const my_facet f(LOCALE_en_US_UTF_8, 1);
const wchar_t in[] = L"2009";
err = std::ios_base::goodbit;
t = std::tm();
@@ -46,7 +48,7 @@ int main()
assert(err == std::ios_base::eofbit);
}
{
const my_facet f("fr_FR.UTF-8", 1);
const my_facet f(LOCALE_fr_FR_UTF_8, 1);
const wchar_t in[] = L"2009";
err = std::ios_base::goodbit;
t = std::tm();
@@ -56,7 +58,7 @@ int main()
assert(err == std::ios_base::eofbit);
}
{
const my_facet f("ru_RU.UTF-8", 1);
const my_facet f(LOCALE_ru_RU_UTF_8, 1);
const wchar_t in[] = L"2009";
err = std::ios_base::goodbit;
t = std::tm();
@@ -66,7 +68,7 @@ int main()
assert(err == std::ios_base::eofbit);
}
{
const my_facet f("zh_CN.UTF-8", 1);
const my_facet f(LOCALE_zh_CN_UTF_8, 1);
const wchar_t in[] = L"2009";
err = std::ios_base::goodbit;
t = std::tm();

View File

@@ -25,6 +25,8 @@
#include <cassert>
#include "iterators.h"
#include "../../../../platform_support.h" // locale name macros
typedef std::time_put_byname<char, output_iterator<char*> > F;
class my_facet
@@ -51,7 +53,7 @@ int main()
t.tm_isdst = 1;
std::ios ios(0);
{
const my_facet f("en_US.UTF-8", 1);
const my_facet f(LOCALE_en_US_UTF_8, 1);
std::string pat("Today is %A which is abreviated %a.");
iter = f.put(output_iterator<char*>(str), ios, '*', &t,
pat.data(), pat.data() + pat.size());
@@ -59,7 +61,7 @@ int main()
assert(ex == "Today is Saturday which is abreviated Sat.");
}
{
const my_facet f("fr_FR.UTF-8", 1);
const my_facet f(LOCALE_fr_FR_UTF_8, 1);
std::string pat("Today is %A which is abreviated %a.");
iter = f.put(output_iterator<char*>(str), ios, '*', &t,
pat.data(), pat.data() + pat.size());

View File

@@ -16,6 +16,8 @@
#include <locale>
#include <cassert>
#include "../../../../platform_support.h" // locale name macros
int main()
{
{
@@ -32,7 +34,7 @@ int main()
}
}
{
std::locale l("en_US.UTF-8");
std::locale l(LOCALE_en_US_UTF_8);
{
typedef char C;
const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l);
@@ -45,7 +47,7 @@ int main()
}
}
{
std::locale l("fr_FR.UTF-8");
std::locale l(LOCALE_fr_FR_UTF_8);
{
typedef char C;
const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l);

View File

@@ -16,6 +16,8 @@
#include <locale>
#include <cassert>
#include "../../../../platform_support.h" // locale name macros
int main()
{
{
@@ -32,7 +34,7 @@ int main()
}
}
{
std::locale l("en_US.UTF-8");
std::locale l(LOCALE_en_US_UTF_8);
{
typedef char C;
const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l);
@@ -45,7 +47,7 @@ int main()
}
}
{
std::locale l("fr_FR.UTF-8");
std::locale l(LOCALE_fr_FR_UTF_8);
{
typedef char C;
const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l);

View File

@@ -16,6 +16,8 @@
#include <locale>
#include <cassert>
#include "../../../../platform_support.h" // locale name macros
int main()
{
{
@@ -32,7 +34,7 @@ int main()
}
}
{
std::locale l("en_US.UTF-8");
std::locale l(LOCALE_en_US_UTF_8);
{
typedef char C;
const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l);
@@ -45,7 +47,7 @@ int main()
}
}
{
std::locale l("fr_FR.UTF-8");
std::locale l(LOCALE_fr_FR_UTF_8);
{
typedef char C;
const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l);

View File

@@ -15,6 +15,8 @@
#include <cassert>
#include <new>
#include "../../../../platform_support.h" // locale name macros
int new_called = 0;
void* operator new(std::size_t s) throw(std::bad_alloc)
@@ -67,7 +69,7 @@ void check(const std::locale& loc)
int main()
{
{
std::locale loc("ru_RU.UTF-8");
std::locale loc(LOCALE_ru_RU_UTF_8);
std::locale loc2;
loc2 = loc;
assert(loc == loc2);

View File

@@ -15,6 +15,8 @@
#include <new>
#include <cassert>
#include "../../../../platform_support.h" // locale name macros
int new_called = 0;
void* operator new(std::size_t s) throw(std::bad_alloc)
@@ -67,12 +69,12 @@ void check(const std::locale& loc)
int main()
{
{
std::locale loc("ru_RU.UTF-8");
std::locale loc(LOCALE_ru_RU_UTF_8);
check(loc);
std::locale loc2("ru_RU.UTF-8");
std::locale loc2(LOCALE_ru_RU_UTF_8);
check(loc2);
assert(loc == loc2);
std::locale loc3("zh_CN.UTF-8");
std::locale loc3(LOCALE_zh_CN_UTF_8);
check(loc3);
assert(!(loc == loc3));
assert(loc != loc3);

View File

@@ -15,6 +15,8 @@
#include <cassert>
#include <new>
#include "../../../../platform_support.h" // locale name macros
int new_called = 0;
void* operator new(std::size_t s) throw(std::bad_alloc)
@@ -67,7 +69,7 @@ void check(const std::locale& loc)
int main()
{
{
std::locale loc("fr_FR.UTF-8");
std::locale loc(LOCALE_fr_FR_UTF_8);
std::locale loc2 = loc;
assert(loc == loc2);
check(loc);

View File

@@ -15,6 +15,8 @@
#include <new>
#include <cassert>
#include "../../../../platform_support.h" // locale name macros
int new_called = 0;
void* operator new(std::size_t s) throw(std::bad_alloc)
@@ -74,13 +76,13 @@ int main()
assert(new_called == 0);
check(loc);
assert(new_called == 0);
assert(std::locale::global(std::locale("en_US.UTF-8")) == loc);
assert(std::locale::global(std::locale(LOCALE_en_US_UTF_8)) == loc);
ok = new_called;
std::locale loc2;
assert(new_called == ok);
check(loc2);
assert(new_called == ok);
assert(loc2 == std::locale("en_US.UTF-8"));
assert(loc2 == std::locale(LOCALE_en_US_UTF_8));
assert(new_called == ok);
}
assert(new_called == ok);

View File

@@ -15,6 +15,8 @@
#include <new>
#include <cassert>
#include "../../../../platform_support.h" // locale name macros
int new_called = 0;
void* operator new(std::size_t s) throw(std::bad_alloc)
@@ -67,9 +69,9 @@ void check(const std::locale& loc)
int main()
{
{
std::locale loc("ru_RU.UTF-8");
std::locale loc(LOCALE_ru_RU_UTF_8);
check(loc);
std::locale loc2(loc, "en_US.UTF-8", std::locale::monetary);
std::locale loc2(loc, LOCALE_en_US_UTF_8, std::locale::monetary);
check(loc2);
}
assert(new_called == 0);

View File

@@ -15,6 +15,8 @@
#include <new>
#include <cassert>
#include "../../../../platform_support.h" // locale name macros
int new_called = 0;
void* operator new(std::size_t s) throw(std::bad_alloc)
@@ -78,7 +80,7 @@ int main()
{
{
{
std::locale loc("ru_RU.UTF-8");
std::locale loc(LOCALE_ru_RU_UTF_8);
check(loc);
std::locale loc2(loc, new my_facet);
check(loc2);

View File

@@ -15,6 +15,8 @@
#include <new>
#include <cassert>
#include "../../../../platform_support.h" // locale name macros
int new_called = 0;
void* operator new(std::size_t s) throw(std::bad_alloc)
@@ -67,9 +69,9 @@ void check(const std::locale& loc)
int main()
{
{
std::locale loc("ru_RU.UTF-8");
std::locale loc(LOCALE_ru_RU_UTF_8);
check(loc);
std::locale loc2(loc, std::locale("en_US.UTF-8"), std::locale::monetary);
std::locale loc2(loc, std::locale(LOCALE_en_US_UTF_8), std::locale::monetary);
check(loc2);
}
assert(new_called == 0);

View File

@@ -15,6 +15,8 @@
#include <new>
#include <cassert>
#include "../../../../platform_support.h" // locale name macros
int new_called = 0;
void* operator new(std::size_t s) throw(std::bad_alloc)
@@ -67,9 +69,9 @@ void check(const std::locale& loc)
int main()
{
{
std::locale loc("ru_RU.UTF-8");
std::locale loc(LOCALE_ru_RU_UTF_8);
check(loc);
std::locale loc2(loc, std::string("en_US.UTF-8"), std::locale::monetary);
std::locale loc2(loc, std::string(LOCALE_en_US_UTF_8), std::locale::monetary);
check(loc2);
}
assert(new_called == 0);

View File

@@ -15,6 +15,8 @@
#include <new>
#include <cassert>
#include "../../../../platform_support.h" // locale name macros
int new_called = 0;
void* operator new(std::size_t s) throw(std::bad_alloc)
@@ -67,12 +69,12 @@ void check(const std::locale& loc)
int main()
{
{
std::locale loc(std::string("ru_RU.UTF-8"));
std::locale loc(std::string(LOCALE_ru_RU_UTF_8));
check(loc);
std::locale loc2(std::string("ru_RU.UTF-8"));
std::locale loc2(std::string(LOCALE_ru_RU_UTF_8));
check(loc2);
assert(loc == loc2);
std::locale loc3(std::string("zh_CN.UTF-8"));
std::locale loc3(std::string(LOCALE_zh_CN_UTF_8));
check(loc3);
assert(!(loc == loc3));
assert(loc != loc3);

View File

@@ -14,6 +14,8 @@
#include <locale>
#include <cassert>
#include "../../../../platform_support.h" // locale name macros
int main()
{
{
@@ -21,7 +23,7 @@ int main()
assert(loc.name() == "C");
}
{
std::locale loc("en_US.UTF-8");
assert(loc.name() == "en_US.UTF-8");
std::locale loc(LOCALE_en_US_UTF_8);
assert(loc.name() == LOCALE_en_US_UTF_8);
}
}

View File

@@ -14,12 +14,14 @@
#include <locale>
#include <cassert>
#include "../../../../platform_support.h" // locale name macros
int main()
{
std::locale cloc;
std::locale copy(cloc);
std::locale n1("en_US.UTF-8");
std::locale n2("en_US.UTF-8");
std::locale n1(LOCALE_en_US_UTF_8);
std::locale n2(LOCALE_en_US_UTF_8);
std::locale noname1 = n1.combine<std::ctype<char> >(cloc);
std::locale nonamec = noname1;
std::locale noname2 = n1.combine<std::ctype<char> >(cloc);

View File

@@ -14,6 +14,8 @@
#include <locale>
#include <cassert>
#include "../../../../platform_support.h" // locale name macros
void check(const std::locale& loc)
{
assert(std::has_facet<std::collate<char> >(loc));
@@ -54,8 +56,8 @@ int main()
std::locale loc;
assert(loc.name() == "C");
check(loc);
assert(std::locale::global(std::locale("en_US.UTF-8")) == loc);
assert(std::locale::global(std::locale(LOCALE_en_US_UTF_8)) == loc);
std::locale loc2;
check(loc2);
assert(loc2 == std::locale("en_US.UTF-8"));
assert(loc2 == std::locale(LOCALE_en_US_UTF_8));
}