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

@@ -18,6 +18,8 @@
#include <locale>
#include <cassert>
#include "../../../../platform_support.h" // locale name macros
class test
: public std::ios
{
@@ -34,7 +36,7 @@ void f1(std::ios_base::event ev, std::ios_base& stream, int index)
{
if (ev == std::ios_base::imbue_event)
{
assert(stream.getloc().name() == "en_US.UTF-8");
assert(stream.getloc().name() == LOCALE_en_US_UTF_8);
assert(index == 4);
++f1_called;
}
@@ -47,6 +49,6 @@ int main()
b.register_callback(f1, 4);
b.register_callback(f1, 4);
b.register_callback(f1, 4);
std::locale l = b.imbue(std::locale("en_US.UTF-8"));
std::locale l = b.imbue(std::locale(LOCALE_en_US_UTF_8));
assert(f1_called == 3);
}

View File

@@ -18,6 +18,8 @@
#include <locale>
#include <cassert>
#include "../../../../platform_support.h" // locale name macros
class test
: public std::ios
{
@@ -39,7 +41,7 @@ void f1(std::ios_base::event ev, std::ios_base& stream, int index)
assert(!f1_called);
assert( f2_called);
assert( f3_called);
assert(stream.getloc().name() == "en_US.UTF-8");
assert(stream.getloc().name() == LOCALE_en_US_UTF_8);
assert(index == 4);
f1_called = true;
}
@@ -52,7 +54,7 @@ void f2(std::ios_base::event ev, std::ios_base& stream, int index)
assert(!f1_called);
assert(!f2_called);
assert( f3_called);
assert(stream.getloc().name() == "en_US.UTF-8");
assert(stream.getloc().name() == LOCALE_en_US_UTF_8);
assert(index == 5);
f2_called = true;
}
@@ -65,7 +67,7 @@ void f3(std::ios_base::event ev, std::ios_base& stream, int index)
assert(!f1_called);
assert(!f2_called);
assert(!f3_called);
assert(stream.getloc().name() == "en_US.UTF-8");
assert(stream.getloc().name() == LOCALE_en_US_UTF_8);
assert(index == 6);
f3_called = true;
}
@@ -78,9 +80,9 @@ int main()
b.register_callback(f1, 4);
b.register_callback(f2, 5);
b.register_callback(f3, 6);
std::locale l = b.imbue(std::locale("en_US.UTF-8"));
std::locale l = b.imbue(std::locale(LOCALE_en_US_UTF_8));
assert(l.name() == std::string("C"));
assert(b.getloc().name() == std::string("en_US.UTF-8"));
assert(b.getloc().name() == std::string(LOCALE_en_US_UTF_8));
assert(f1_called);
assert(f2_called);
assert(f3_called);