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

@@ -17,13 +17,15 @@
#include <locale>
#include <cassert>
#include "../../../platform_support.h" // locale name macros
int main()
{
std::regex r;
std::locale loc = r.imbue(std::locale("en_US.UTF-8"));
std::locale loc = r.imbue(std::locale(LOCALE_en_US_UTF_8));
assert(loc.name() == "C");
assert(r.getloc().name() == "en_US.UTF-8");
assert(r.getloc().name() == LOCALE_en_US_UTF_8);
loc = r.imbue(std::locale("C"));
assert(loc.name() == "en_US.UTF-8");
assert(loc.name() == LOCALE_en_US_UTF_8);
assert(r.getloc().name() == "C");
}

View File

@@ -17,6 +17,8 @@
#include <regex>
#include <cassert>
#include "../../platform_support.h" // locale name macros
int main()
{
{
@@ -26,10 +28,10 @@ int main()
assert(t2.getloc().name() == "C");
}
{
std::locale::global(std::locale("en_US.UTF-8"));
std::locale::global(std::locale(LOCALE_en_US_UTF_8));
std::regex_traits<char> t1;
assert(t1.getloc().name() == "en_US.UTF-8");
assert(t1.getloc().name() == LOCALE_en_US_UTF_8);
std::regex_traits<wchar_t> t2;
assert(t2.getloc().name() == "en_US.UTF-8");
assert(t2.getloc().name() == LOCALE_en_US_UTF_8);
}
}

View File

@@ -16,6 +16,8 @@
#include <regex>
#include <cassert>
#include "../../platform_support.h" // locale name macros
int main()
{
{
@@ -25,10 +27,10 @@ int main()
assert(t2.getloc().name() == "C");
}
{
std::locale::global(std::locale("en_US.UTF-8"));
std::locale::global(std::locale(LOCALE_en_US_UTF_8));
std::regex_traits<char> t1;
assert(t1.getloc().name() == "en_US.UTF-8");
assert(t1.getloc().name() == LOCALE_en_US_UTF_8);
std::regex_traits<wchar_t> t2;
assert(t2.getloc().name() == "en_US.UTF-8");
assert(t2.getloc().name() == LOCALE_en_US_UTF_8);
}
}

View File

@@ -17,12 +17,14 @@
#include <locale>
#include <cassert>
#include "../../platform_support.h" // locale name macros
int main()
{
{
std::regex_traits<char> t;
std::locale loc = t.imbue(std::locale("en_US.UTF-8"));
std::locale loc = t.imbue(std::locale(LOCALE_en_US_UTF_8));
assert(loc.name() == "C");
assert(t.getloc().name() == "en_US.UTF-8");
assert(t.getloc().name() == LOCALE_en_US_UTF_8);
}
}

View File

@@ -17,6 +17,8 @@
#include <regex>
#include <cassert>
#include "../../platform_support.h"
int main()
{
{
@@ -29,7 +31,7 @@ int main()
assert(t.translate_nocase('1') == '1');
assert(t.translate_nocase('\xDA') == '\xDA');
assert(t.translate_nocase('\xFA') == '\xFA');
t.imbue(std::locale("en_US.UTF-8"));
t.imbue(std::locale(LOCALE_en_US_UTF_8));
assert(t.translate_nocase(' ') == ' ');
assert(t.translate_nocase('A') == 'a');
assert(t.translate_nocase('\x07') == '\x07');
@@ -49,7 +51,7 @@ int main()
assert(t.translate_nocase(L'1') == L'1');
assert(t.translate_nocase(L'\xDA') == L'\xDA');
assert(t.translate_nocase(L'\xFA') == L'\xFA');
t.imbue(std::locale("en_US.UTF-8"));
t.imbue(std::locale(LOCALE_en_US_UTF_8));
assert(t.translate_nocase(L' ') == L' ');
assert(t.translate_nocase(L'A') == L'a');
assert(t.translate_nocase(L'\x07') == L'\x07');