[cfe-commits] [libcxx] r140252 - in /libcxx/trunk/test/input.output: file.streams/c.files/cstdio.pass.cpp iostream.format/ext.manip/get_money.pass.cpp iostream.format/ext.manip/get_time.pass.cpp iostream.format/ext.manip/put_money.pass.cpp iostream.format/ext.manip/put_time.pass.cpp iostreams.base/ios.base/ios.base.callback/register_callback.pass.cpp iostreams.base/ios.base/ios.base.locales/imbue.pass.cpp

David Chisnall csdavec at swan.ac.uk
Wed Sep 21 07:59:10 PDT 2011


Author: theraven
Date: Wed Sep 21 09:59:10 2011
New Revision: 140252

URL: http://llvm.org/viewvc/llvm-project?rev=140252&view=rev
Log:
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.


Modified:
    libcxx/trunk/test/input.output/file.streams/c.files/cstdio.pass.cpp
    libcxx/trunk/test/input.output/iostream.format/ext.manip/get_money.pass.cpp
    libcxx/trunk/test/input.output/iostream.format/ext.manip/get_time.pass.cpp
    libcxx/trunk/test/input.output/iostream.format/ext.manip/put_money.pass.cpp
    libcxx/trunk/test/input.output/iostream.format/ext.manip/put_time.pass.cpp
    libcxx/trunk/test/input.output/iostreams.base/ios.base/ios.base.callback/register_callback.pass.cpp
    libcxx/trunk/test/input.output/iostreams.base/ios.base/ios.base.locales/imbue.pass.cpp

Modified: libcxx/trunk/test/input.output/file.streams/c.files/cstdio.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/input.output/file.streams/c.files/cstdio.pass.cpp?rev=140252&r1=140251&r2=140252&view=diff
==============================================================================
--- libcxx/trunk/test/input.output/file.streams/c.files/cstdio.pass.cpp (original)
+++ libcxx/trunk/test/input.output/file.streams/c.files/cstdio.pass.cpp Wed Sep 21 09:59:10 2011
@@ -76,6 +76,30 @@
 #error stdout not defined
 #endif
 
+// As an optimisation, these may be defined as macros in the C header.  We want
+// to check the functions, not the macros.
+#ifdef puts
+#undef puts
+#endif
+#ifdef putc
+#undef putc
+#endif
+#ifdef getc
+#undef getc
+#endif
+#ifdef putchar
+#undef putchar
+#endif
+#ifdef clearerr 
+#undef clearerr
+#endif
+#ifdef feof
+#undef feof
+#endif
+#ifdef ferror
+#undef ferror
+#endif
+
 #include <cstdarg>
 
 int main()

Modified: libcxx/trunk/test/input.output/iostream.format/ext.manip/get_money.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/input.output/iostream.format/ext.manip/get_money.pass.cpp?rev=140252&r1=140251&r2=140252&view=diff
==============================================================================
--- libcxx/trunk/test/input.output/iostream.format/ext.manip/get_money.pass.cpp (original)
+++ libcxx/trunk/test/input.output/iostream.format/ext.manip/get_money.pass.cpp Wed Sep 21 09:59:10 2011
@@ -39,7 +39,7 @@
     {
         testbuf<char> sb("  -$1,234,567.89");
         std::istream is(&sb);
-        is.imbue(std::locale("en_US"));
+        is.imbue(std::locale("en_US.UTF-8"));
         long double x = 0;
         is >> std::get_money(x, false);
         assert(x == -123456789);
@@ -47,7 +47,7 @@
     {
         testbuf<char> sb("  -USD 1,234,567.89");
         std::istream is(&sb);
-        is.imbue(std::locale("en_US"));
+        is.imbue(std::locale("en_US.UTF-8"));
         long double x = 0;
         is >> std::get_money(x, true);
         assert(x == -123456789);
@@ -55,7 +55,7 @@
     {
         testbuf<wchar_t> sb(L"  -$1,234,567.89");
         std::wistream is(&sb);
-        is.imbue(std::locale("en_US"));
+        is.imbue(std::locale("en_US.UTF-8"));
         long double x = 0;
         is >> std::get_money(x, false);
         assert(x == -123456789);
@@ -63,7 +63,7 @@
     {
         testbuf<wchar_t> sb(L"  -USD 1,234,567.89");
         std::wistream is(&sb);
-        is.imbue(std::locale("en_US"));
+        is.imbue(std::locale("en_US.UTF-8"));
         long double x = 0;
         is >> std::get_money(x, true);
         assert(x == -123456789);

Modified: libcxx/trunk/test/input.output/iostream.format/ext.manip/get_time.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/input.output/iostream.format/ext.manip/get_time.pass.cpp?rev=140252&r1=140251&r2=140252&view=diff
==============================================================================
--- libcxx/trunk/test/input.output/iostream.format/ext.manip/get_time.pass.cpp (original)
+++ libcxx/trunk/test/input.output/iostream.format/ext.manip/get_time.pass.cpp Wed Sep 21 09:59:10 2011
@@ -39,7 +39,7 @@
     {
         testbuf<char> sb("  Sat Dec 31 23:55:59 2061");
         std::istream is(&sb);
-        is.imbue(std::locale("en_US"));
+        is.imbue(std::locale("en_US.UTF-8"));
         std::tm t = {0};
         is >> std::get_time(&t, "%c");
         assert(t.tm_sec == 59);
@@ -55,7 +55,7 @@
     {
         testbuf<wchar_t> sb(L"  Sat Dec 31 23:55:59 2061");
         std::wistream is(&sb);
-        is.imbue(std::locale("en_US"));
+        is.imbue(std::locale("en_US.UTF-8"));
         std::tm t = {0};
         is >> std::get_time(&t, L"%c");
         assert(t.tm_sec == 59);

Modified: libcxx/trunk/test/input.output/iostream.format/ext.manip/put_money.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/input.output/iostream.format/ext.manip/put_money.pass.cpp?rev=140252&r1=140251&r2=140252&view=diff
==============================================================================
--- libcxx/trunk/test/input.output/iostream.format/ext.manip/put_money.pass.cpp (original)
+++ libcxx/trunk/test/input.output/iostream.format/ext.manip/put_money.pass.cpp Wed Sep 21 09:59:10 2011
@@ -51,7 +51,7 @@
     {
         testbuf<char> sb;
         std::ostream os(&sb);
-        os.imbue(std::locale("en_US"));
+        os.imbue(std::locale("en_US.UTF-8"));
         showbase(os);
         long double x = -123456789;
         os << std::put_money(x, false);
@@ -60,7 +60,7 @@
     {
         testbuf<char> sb;
         std::ostream os(&sb);
-        os.imbue(std::locale("en_US"));
+        os.imbue(std::locale("en_US.UTF-8"));
         showbase(os);
         long double x = -123456789;
         os << std::put_money(x, true);
@@ -69,7 +69,7 @@
     {
         testbuf<wchar_t> sb;
         std::wostream os(&sb);
-        os.imbue(std::locale("en_US"));
+        os.imbue(std::locale("en_US.UTF-8"));
         showbase(os);
         long double x = -123456789;
         os << std::put_money(x, false);
@@ -78,7 +78,7 @@
     {
         testbuf<wchar_t> sb;
         std::wostream os(&sb);
-        os.imbue(std::locale("en_US"));
+        os.imbue(std::locale("en_US.UTF-8"));
         showbase(os);
         long double x = -123456789;
         os << std::put_money(x, true);

Modified: libcxx/trunk/test/input.output/iostream.format/ext.manip/put_time.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/input.output/iostream.format/ext.manip/put_time.pass.cpp?rev=140252&r1=140251&r2=140252&view=diff
==============================================================================
--- libcxx/trunk/test/input.output/iostream.format/ext.manip/put_time.pass.cpp (original)
+++ libcxx/trunk/test/input.output/iostream.format/ext.manip/put_time.pass.cpp Wed Sep 21 09:59:10 2011
@@ -51,7 +51,7 @@
     {
         testbuf<char> sb;
         std::ostream os(&sb);
-        os.imbue(std::locale("en_US"));
+        os.imbue(std::locale("en_US.UTF-8"));
         std::tm t = {0};
         t.tm_sec = 59;
         t.tm_min = 55;
@@ -66,7 +66,7 @@
     {
         testbuf<wchar_t> sb;
         std::wostream os(&sb);
-        os.imbue(std::locale("en_US"));
+        os.imbue(std::locale("en_US.UTF-8"));
         std::tm t = {0};
         t.tm_sec = 59;
         t.tm_min = 55;

Modified: libcxx/trunk/test/input.output/iostreams.base/ios.base/ios.base.callback/register_callback.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/input.output/iostreams.base/ios.base/ios.base.callback/register_callback.pass.cpp?rev=140252&r1=140251&r2=140252&view=diff
==============================================================================
--- libcxx/trunk/test/input.output/iostreams.base/ios.base/ios.base.callback/register_callback.pass.cpp (original)
+++ libcxx/trunk/test/input.output/iostreams.base/ios.base/ios.base.callback/register_callback.pass.cpp Wed Sep 21 09:59:10 2011
@@ -34,7 +34,7 @@
 {
     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 @@
     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);
 }

Modified: libcxx/trunk/test/input.output/iostreams.base/ios.base/ios.base.locales/imbue.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/input.output/iostreams.base/ios.base/ios.base.locales/imbue.pass.cpp?rev=140252&r1=140251&r2=140252&view=diff
==============================================================================
--- libcxx/trunk/test/input.output/iostreams.base/ios.base/ios.base.locales/imbue.pass.cpp (original)
+++ libcxx/trunk/test/input.output/iostreams.base/ios.base/ios.base.locales/imbue.pass.cpp Wed Sep 21 09:59:10 2011
@@ -39,7 +39,7 @@
         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 @@
         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 @@
         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 @@
     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);





More information about the cfe-commits mailing list