More fixes to the tests. Add UTF-8 encoding to all locales that don't specify one. Undefine some stdio.h macros that break the tests.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@140252 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
David Chisnall
2011-09-21 14:59:10 +00:00
parent a824f53600
commit db2e99f852
7 changed files with 43 additions and 19 deletions

View File

@@ -34,7 +34,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");
assert(stream.getloc().name() == "en_US.UTF-8");
assert(index == 4);
++f1_called;
}
@@ -47,6 +47,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"));
std::locale l = b.imbue(std::locale("en_US.UTF-8"));
assert(f1_called == 3);
}

View File

@@ -39,7 +39,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");
assert(stream.getloc().name() == "en_US.UTF-8");
assert(index == 4);
f1_called = true;
}
@@ -52,7 +52,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");
assert(stream.getloc().name() == "en_US.UTF-8");
assert(index == 5);
f2_called = true;
}
@@ -65,7 +65,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");
assert(stream.getloc().name() == "en_US.UTF-8");
assert(index == 6);
f3_called = true;
}
@@ -78,9 +78,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"));
std::locale l = b.imbue(std::locale("en_US.UTF-8"));
assert(l.name() == std::string("C"));
assert(b.getloc().name() == std::string("en_US"));
assert(b.getloc().name() == std::string("en_US.UTF-8"));
assert(f1_called);
assert(f2_called);
assert(f3_called);