aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t')
-rw-r--r--gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/1.cc82
-rw-r--r--gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/10.cc64
-rw-r--r--gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/12439_1.cc63
-rw-r--r--gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/12439_2.cc59
-rw-r--r--gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/12439_3.cc61
-rw-r--r--gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/17038.cc64
-rw-r--r--gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/2.cc79
-rw-r--r--gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/3.cc80
-rw-r--r--gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/4.cc78
-rw-r--r--gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/5.cc68
-rw-r--r--gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/6.cc67
-rw-r--r--gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/7.cc67
-rw-r--r--gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/8.cc66
-rw-r--r--gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/9.cc66
-rw-r--r--gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/wrapped_env.cc82
-rw-r--r--gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/wrapped_locale.cc82
16 files changed, 1128 insertions, 0 deletions
diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/1.cc b/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/1.cc
new file mode 100644
index 000000000..2ed02a5da
--- /dev/null
+++ b/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/1.cc
@@ -0,0 +1,82 @@
+// 2001-09-17 Benjamin Kosnik <bkoz@redhat.com>
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2009
+// Free Software Foundation
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// 22.2.5.3.1 time_put members
+
+// { dg-do run { xfail dummy_wcsftime } }
+
+#include <locale>
+#include <sstream>
+#include <testsuite_hooks.h>
+
+void test01()
+{
+ using namespace std;
+ typedef ostreambuf_iterator<wchar_t> iterator_type;
+
+ bool test __attribute__((unused)) = true;
+
+ // create "C" time objects
+ const tm time1 = __gnu_test::test_tm(0, 0, 12, 4, 3, 71, 0, 93, 0);
+
+ // basic construction
+ locale loc_c = locale::classic();
+
+ // create an ostream-derived object, cache the time_put facet
+ const wstring empty;
+ wostringstream oss;
+ oss.imbue(loc_c);
+ const time_put<wchar_t>& tim_put = use_facet<time_put<wchar_t> >(oss.getloc());
+
+ // 1
+ // iter_type
+ // put(iter_type s, ios_base& str, char_type fill, const tm* t,
+ // char format, char modifier = 0) const;
+ oss.str(empty);
+ iterator_type os_it01 = tim_put.put(oss.rdbuf(), oss, L'*', &time1, 'a');
+ wstring result1 = oss.str();
+ VERIFY( result1 == L"Sun" );
+
+ oss.str(empty);
+ iterator_type os_it21 = tim_put.put(oss.rdbuf(), oss, L'*', &time1, 'x');
+ wstring result21 = oss.str(); // "04/04/71"
+ VERIFY( result21 == L"04/04/71" );
+
+ oss.str(empty);
+ iterator_type os_it22 = tim_put.put(oss.rdbuf(), oss, L'*', &time1, 'X');
+ wstring result22 = oss.str(); // "12:00:00"
+ VERIFY( result22 == L"12:00:00" );
+
+ oss.str(empty);
+ iterator_type os_it31 = tim_put.put(oss.rdbuf(), oss, L'*', &time1, 'x', 'E');
+ wstring result31 = oss.str(); // "04/04/71"
+ VERIFY( result31 == L"04/04/71" );
+
+ oss.str(empty);
+ iterator_type os_it32 = tim_put.put(oss.rdbuf(), oss, L'*', &time1, 'X', 'E');
+ wstring result32 = oss.str(); // "12:00:00"
+ VERIFY( result32 == L"12:00:00" );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/10.cc b/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/10.cc
new file mode 100644
index 000000000..7e102346c
--- /dev/null
+++ b/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/10.cc
@@ -0,0 +1,64 @@
+// 2001-09-17 Benjamin Kosnik <bkoz@redhat.com>
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2009
+// Free Software Foundation
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// 22.2.5.3.1 time_put members
+
+// { dg-do run { xfail dummy_wcsftime } }
+
+#include <locale>
+#include <sstream>
+#include <testsuite_hooks.h>
+
+void test10()
+{
+ using namespace std;
+ bool test __attribute__((unused)) = true;
+
+ // Check time_put works with other iterators besides streambuf
+ // output iterators. (As long as output_iterator requirements are met.)
+ typedef wstring::iterator iter_type;
+ typedef char_traits<wchar_t> traits;
+ typedef time_put<wchar_t, iter_type> time_put_type;
+ const ios_base::iostate goodbit = ios_base::goodbit;
+
+ ios_base::iostate err = goodbit;
+ const locale loc_c = locale::classic();
+ const wstring x(50, 'x'); // have to have allocated wstring!
+ wstring res;
+ const tm time_sanity = __gnu_test::test_tm(0, 0, 12, 26, 5, 97, 2, 0, 0);
+
+ wostringstream oss;
+ oss.imbue(locale(loc_c, new time_put_type));
+ const time_put_type& tp = use_facet<time_put_type>(oss.getloc());
+
+ // 02 char format
+ res = x;
+ iter_type ret2 = tp.put(res.begin(), oss, L' ', &time_sanity, 'A');
+ wstring sanity2(res.begin(), ret2);
+ VERIFY( err == goodbit );
+ VERIFY( res == L"Tuesdayxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" );
+ VERIFY( sanity2 == L"Tuesday" );
+}
+
+int main()
+{
+ test10();
+ return 0;
+}
diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/12439_1.cc b/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/12439_1.cc
new file mode 100644
index 000000000..159b8f193
--- /dev/null
+++ b/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/12439_1.cc
@@ -0,0 +1,63 @@
+// Copyright (C) 2003, 2009 Free Software Foundation
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// 22.2.5.3.1 time_put members
+
+#include <locale>
+#include <sstream>
+#include <ctime>
+#include <cstring>
+#include <testsuite_hooks.h>
+
+class TP : public std::time_put<wchar_t>
+{
+public:
+ mutable std::wstring fill_chars;
+
+protected:
+ iter_type do_put(iter_type s, std::ios_base&, char_type fill,
+ const std::tm*, char, char) const
+ {
+ fill_chars.push_back(fill);
+ return s;
+ }
+};
+
+// libstdc++/12439
+// time_put::put doesn't pass fill character to do_put
+void test01()
+{
+ using namespace std;
+ bool test __attribute__((unused)) = true;
+
+ wostringstream stream;
+ time_t tt = time(NULL);
+
+ const wchar_t* fmt = L"%c";
+
+ TP tp;
+ tp.put(TP::iter_type(stream), stream, L'W', localtime(&tt),
+ fmt, fmt + wcslen(fmt));
+ VERIFY( !tp.fill_chars.empty() );
+ VERIFY( tp.fill_chars[tp.fill_chars.length() - 1] == L'W' );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/12439_2.cc b/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/12439_2.cc
new file mode 100644
index 000000000..515c998c2
--- /dev/null
+++ b/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/12439_2.cc
@@ -0,0 +1,59 @@
+// Copyright (C) 2003, 2009 Free Software Foundation
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// 22.2.5.3.1 time_put members
+
+#include <locale>
+#include <sstream>
+#include <ctime>
+#include <cstring>
+#include <testsuite_hooks.h>
+
+// libstdc++/12439
+// time_put::put writes narrowed characters to output iterator
+void test02()
+{
+ using namespace std;
+ bool test __attribute__((unused)) = true;
+
+ typedef time_put<wchar_t> tp_type;
+
+ const wchar_t fmt[] = {
+ 0xa0, 0x103, 0xfc, 0xb3, 0xa0c3,
+ L'%', L'c'
+ };
+
+ const size_t len = sizeof(fmt) / sizeof(fmt[0]);
+ const size_t cmplen = wcschr(fmt, L'%') - fmt;
+
+ locale loc;
+ const tp_type& tp = use_facet<tp_type>(loc);
+ time_t tt = time(NULL);
+ wostringstream stream;
+
+ tp.put(tp_type::iter_type(stream), stream, stream.fill(),
+ localtime(&tt), fmt, fmt + len);
+ wstring str = stream.str();
+ VERIFY( str.length() >= cmplen );
+ VERIFY( !wmemcmp(str.data(), fmt, cmplen) );
+}
+
+int main()
+{
+ test02();
+ return 0;
+}
diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/12439_3.cc b/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/12439_3.cc
new file mode 100644
index 000000000..8127c75ea
--- /dev/null
+++ b/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/12439_3.cc
@@ -0,0 +1,61 @@
+// Copyright (C) 2003, 2009 Free Software Foundation
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// 22.2.5.3.1 time_put members
+
+#include <locale>
+#include <sstream>
+#include <ctime>
+#include <testsuite_hooks.h>
+
+class TP : public std::time_put<wchar_t>
+{
+public:
+ mutable std::string format_chars;
+
+protected:
+ iter_type do_put(iter_type s, std::ios_base&, char_type,
+ const std::tm*, char format, char) const
+ {
+ format_chars.push_back(format);
+ return s;
+ }
+};
+
+// libstdc++/12439
+// time_put::put reads past end of format string
+void test03()
+{
+ using namespace std;
+ bool test __attribute__((unused)) = true;
+
+ wostringstream stream;
+ time_t tt = time(NULL);
+
+ const wchar_t* fmt = L"%c";
+
+ TP tp;
+ tp.put(TP::iter_type(stream), stream, stream.fill(), localtime(&tt),
+ fmt, fmt + 1);
+ VERIFY( tp.format_chars.empty() );
+}
+
+int main()
+{
+ test03();
+ return 0;
+}
diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/17038.cc b/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/17038.cc
new file mode 100644
index 000000000..d4f904688
--- /dev/null
+++ b/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/17038.cc
@@ -0,0 +1,64 @@
+// { dg-require-namedlocale "" }
+
+// 2004-08-25 Paolo Carlini <pcarlini@suse.de>
+
+// Copyright (C) 2004, 2005, 2006, 2009 Free Software Foundation
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// 22.2.5.3.1 time_put members
+
+#include <locale>
+#include <sstream>
+#include <testsuite_hooks.h>
+
+// libstdc++/17038
+void test01()
+{
+ using namespace std;
+ typedef ostreambuf_iterator<wchar_t> iterator_type;
+
+ bool test __attribute__((unused)) = true;
+
+ // create "C" time objects
+ const tm time1 = __gnu_test::test_tm(0, 0, 12, 4, 3, 71, 0, 93, 0);
+
+ // basic construction
+ locale loc_c = locale::classic();
+ locale loc_in = locale("ta_IN");
+ VERIFY( loc_in != loc_c );
+
+ // create an ostream-derived object, cache the time_put facet
+ wostringstream oss;
+ oss.imbue(loc_in);
+ const time_put<wchar_t>& tim_put =
+ use_facet<time_put<wchar_t> >(oss.getloc());
+
+ iterator_type os_it01 = tim_put.put(oss.rdbuf(), oss, L'*', &time1, 'c');
+ wstring result1 = oss.str();
+
+ wchar_t time_buffer[128];
+ setlocale(LC_ALL, "ta_IN");
+ VERIFY( wcsftime(time_buffer, 128, L"%c", &time1) );
+
+ VERIFY( result1 == time_buffer );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/2.cc b/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/2.cc
new file mode 100644
index 000000000..c8cc42c2c
--- /dev/null
+++ b/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/2.cc
@@ -0,0 +1,79 @@
+// { dg-require-namedlocale "" }
+
+// 2001-09-17 Benjamin Kosnik <bkoz@redhat.com>
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2009
+// Free Software Foundation
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// 22.2.5.3.1 time_put members
+
+#include <locale>
+#include <sstream>
+#include <testsuite_hooks.h>
+
+void test02()
+{
+ using namespace std;
+ typedef ostreambuf_iterator<wchar_t> iterator_type;
+
+ bool test __attribute__((unused)) = true;
+
+ // create "C" time objects
+ const tm time1 = __gnu_test::test_tm(0, 0, 12, 4, 3, 71, 0, 93, 0);
+
+ // basic construction and sanity check
+ locale loc_c = locale::classic();
+ locale loc_de = locale("de_DE");
+ VERIFY( loc_de != loc_c );
+
+ // create an ostream-derived object, cache the time_put facet
+ const wstring empty;
+ wostringstream oss;
+ oss.imbue(loc_de);
+ const time_put<wchar_t>& tim_put = use_facet<time_put<wchar_t> >(oss.getloc());
+
+ iterator_type os_it02 = tim_put.put(oss.rdbuf(), oss, L'*', &time1, 'a');
+ wstring result2 = oss.str();
+ VERIFY( result2 == L"Son" || result2 == L"So" );
+
+ oss.str(empty); // "%d.%m.%Y"
+ iterator_type os_it23 = tim_put.put(oss.rdbuf(), oss, L'*', &time1, 'x');
+ wstring result23 = oss.str(); // "04.04.1971"
+ VERIFY( result23 == L"04.04.1971" );
+
+ oss.str(empty); // "%T"
+ iterator_type os_it24 = tim_put.put(oss.rdbuf(), oss, L'*', &time1, 'X');
+ wstring result24 = oss.str(); // "12:00:00"
+ VERIFY( result24 == L"12:00:00" );
+
+ oss.str(empty);
+ iterator_type os_it33 = tim_put.put(oss.rdbuf(), oss, L'*', &time1, 'x', 'E');
+ wstring result33 = oss.str(); // "04.04.1971"
+ VERIFY( result33 == L"04.04.1971" );
+
+ oss.str(empty);
+ iterator_type os_it34 = tim_put.put(oss.rdbuf(), oss, L'*', &time1, 'X', 'E');
+ wstring result34 = oss.str(); // "12:00:00"
+ VERIFY( result34 == L"12:00:00" );
+}
+
+int main()
+{
+ test02();
+ return 0;
+}
diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/3.cc b/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/3.cc
new file mode 100644
index 000000000..eec2fa7a3
--- /dev/null
+++ b/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/3.cc
@@ -0,0 +1,80 @@
+// { dg-require-namedlocale "" }
+
+// 2001-09-17 Benjamin Kosnik <bkoz@redhat.com>
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2009
+// Free Software Foundation
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// 22.2.5.3.1 time_put members
+
+#include <locale>
+#include <sstream>
+#include <testsuite_hooks.h>
+
+void test03()
+{
+ using namespace std;
+ typedef ostreambuf_iterator<wchar_t> iterator_type;
+
+ bool test __attribute__((unused)) = true;
+
+ // create "C" time objects
+ const tm time1 = __gnu_test::test_tm(0, 0, 12, 4, 3, 71, 0, 93, 0);
+
+ // basic construction and sanity check
+ locale loc_c = locale::classic();
+ locale loc_hk = locale("en_HK");
+ VERIFY( loc_hk != loc_c );
+
+ // create an ostream-derived object, cache the time_put facet
+ const wstring empty;
+ wostringstream oss;
+ oss.imbue(loc_hk);
+ const time_put<wchar_t>& tim_put = use_facet<time_put<wchar_t> >(oss.getloc());
+
+ iterator_type os_it03 = tim_put.put(oss.rdbuf(), oss, L'*', &time1, 'a');
+ wstring result3 = oss.str();
+ VERIFY( result3 == L"Sun" );
+
+ oss.str(empty); // "%A, %B %d, %Y"
+ iterator_type os_it25 = tim_put.put(oss.rdbuf(), oss, L'*', &time1, 'x');
+ wstring result25 = oss.str(); // "Sunday, April 04, 1971"
+ VERIFY( result25 == L"Sunday, April 04, 1971" );
+
+ oss.str(empty); // "%I:%M:%S %Z"
+ iterator_type os_it26 = tim_put.put(oss.rdbuf(), oss, L'*', &time1, 'X');
+ wstring result26 = oss.str(); // "12:00:00 CET" or whatever timezone
+ VERIFY( result26.find(L"12:00:00") != wstring::npos );
+
+ oss.str(empty);
+ iterator_type os_it35 = tim_put.put(oss.rdbuf(), oss, L'*', &time1, 'x', 'E');
+ wstring result35 = oss.str(); // "Sunday, April 04, 1971"
+ VERIFY( result35 == L"Sunday, April 04, 1971" );
+
+ oss.str(empty);
+ iterator_type os_it36 = tim_put.put(oss.rdbuf(), oss, L'*', &time1, 'X', 'E');
+ wstring result36 = oss.str(); // "12:00:00 CET"
+ VERIFY( result36.find(L"12:00:00") != wstring::npos );
+
+}
+
+int main()
+{
+ test03();
+ return 0;
+}
diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/4.cc b/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/4.cc
new file mode 100644
index 000000000..e56f14ebb
--- /dev/null
+++ b/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/4.cc
@@ -0,0 +1,78 @@
+// { dg-require-namedlocale "" }
+
+// 2001-09-17 Benjamin Kosnik <bkoz@redhat.com>
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Free Software Foundation
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// 22.2.5.3.1 time_put members
+
+#include <locale>
+#include <sstream>
+#include <testsuite_hooks.h>
+
+void test04()
+{
+ using namespace std;
+ typedef ostreambuf_iterator<wchar_t> iterator_type;
+
+ bool test __attribute__((unused)) = true;
+
+ // create "C" time objects
+ const tm time1 = __gnu_test::test_tm(0, 0, 12, 4, 3, 71, 0, 93, 0);
+
+ // basic construction and sanity check
+ locale loc_c = locale::classic();
+ locale loc_es = locale("es_ES");
+ VERIFY( loc_es != loc_c );
+
+ // create an ostream-derived object, cache the time_put facet
+ const wstring empty;
+ wostringstream oss;
+ oss.imbue(loc_es);
+ const time_put<wchar_t>& tim_put = use_facet<time_put<wchar_t> >(oss.getloc());
+ iterator_type os_it04 = tim_put.put(oss.rdbuf(), oss, L'*', &time1, 'a');
+ wstring result4 = oss.str();
+ VERIFY( result4 == L"dom" );
+
+ oss.str(empty); // "%d/%m/%y"
+ iterator_type os_it27 = tim_put.put(oss.rdbuf(), oss, L'*', &time1, 'x');
+ wstring result27 = oss.str(); // "04/04/71"
+ VERIFY( result27 == L"04/04/71" );
+
+ oss.str(empty); // "%T"
+ iterator_type os_it28 = tim_put.put(oss.rdbuf(), oss, L'*', &time1, 'X');
+ wstring result28 = oss.str(); // "12:00:00"
+ VERIFY( result28 == L"12:00:00" );
+
+ oss.str(empty);
+ iterator_type os_it37 = tim_put.put(oss.rdbuf(), oss, L'*', &time1, 'x', 'E');
+ wstring result37 = oss.str(); // "04/04/71"
+ VERIFY( result37 == L"04/04/71" );
+
+ oss.str(empty);
+ iterator_type os_it38 = tim_put.put(oss.rdbuf(), oss, L'*', &time1, 'X', 'E');
+ wstring result38 = oss.str(); // "12:00:00"
+ VERIFY( result38 == L"12:00:00" );
+}
+
+int main()
+{
+ test04();
+ return 0;
+}
diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/5.cc b/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/5.cc
new file mode 100644
index 000000000..77f7798ab
--- /dev/null
+++ b/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/5.cc
@@ -0,0 +1,68 @@
+// 2001-09-17 Benjamin Kosnik <bkoz@redhat.com>
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009
+// Free Software Foundation
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// 22.2.5.3.1 time_put members
+
+// { dg-do run { xfail dummy_wcsftime } }
+
+#include <locale>
+#include <sstream>
+#include <testsuite_hooks.h>
+
+void test05()
+{
+ using namespace std;
+ typedef ostreambuf_iterator<wchar_t> iterator_type;
+ typedef char_traits<wchar_t> traits;
+
+ bool test __attribute__((unused)) = true;
+
+ // create "C" time objects
+ const tm time1 = __gnu_test::test_tm(0, 0, 12, 4, 3, 71, 0, 93, 0);
+ const wchar_t* date = L"%A, the second of %B";
+ const wchar_t* date_ex = L"%Ex";
+
+ // basic construction
+ locale loc_c = locale::classic();
+
+ // create an ostream-derived object, cache the time_put facet
+ const wstring empty;
+ wostringstream oss;
+ oss.imbue(loc_c);
+ const time_put<wchar_t>& tim_put = use_facet<time_put<wchar_t> >(oss.getloc());
+
+ // 2
+ oss.str(empty);
+ iterator_type os_it05 = tim_put.put(oss.rdbuf(), oss, L'*', &time1,
+ date, date + traits::length(date));
+ wstring result5 = oss.str();
+ VERIFY( result5 == L"Sunday, the second of April");
+ iterator_type os_it06 = tim_put.put(oss.rdbuf(), oss, L'*', &time1,
+ date_ex,
+ date_ex + traits::length(date_ex));
+ wstring result6 = oss.str();
+ VERIFY( result6 != result5 );
+}
+
+int main()
+{
+ test05();
+ return 0;
+}
diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/6.cc b/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/6.cc
new file mode 100644
index 000000000..91a68a05c
--- /dev/null
+++ b/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/6.cc
@@ -0,0 +1,67 @@
+// { dg-require-namedlocale "" }
+
+// 2001-09-17 Benjamin Kosnik <bkoz@redhat.com>
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2009
+// Free Software Foundation
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// 22.2.5.3.1 time_put members
+
+#include <locale>
+#include <sstream>
+#include <testsuite_hooks.h>
+
+void test06()
+{
+ using namespace std;
+ typedef ostreambuf_iterator<wchar_t> iterator_type;
+ typedef char_traits<wchar_t> traits;
+
+ bool test __attribute__((unused)) = true;
+
+ // create "C" time objects
+ const tm time1 = __gnu_test::test_tm(0, 0, 12, 4, 3, 71, 0, 93, 0);
+ const wchar_t* date = L"%A, the second of %B";
+ const wchar_t* date_ex = L"%Ex";
+
+ // basic construction and sanity check
+ locale loc_c = locale::classic();
+ locale loc_de = locale("de_DE");
+ VERIFY( loc_de != loc_c );
+
+ // create an ostream-derived object, cache the time_put facet
+ const wstring empty;
+ wostringstream oss;
+ oss.imbue(loc_de);
+ const time_put<wchar_t>& tim_put = use_facet<time_put<wchar_t> >(oss.getloc());
+
+ iterator_type os_it07 = tim_put.put(oss.rdbuf(), oss, L'*', &time1,
+ date, date + traits::length(date));
+ wstring result7 = oss.str();
+ VERIFY( result7 == L"Sonntag, the second of April");
+ iterator_type os_it08 = tim_put.put(oss.rdbuf(), oss, L'*', &time1,
+ date_ex, date_ex + traits::length(date));
+ wstring result8 = oss.str();
+ VERIFY( result8 != result7 );
+}
+
+int main()
+{
+ test06();
+ return 0;
+}
diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/7.cc b/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/7.cc
new file mode 100644
index 000000000..439d6086c
--- /dev/null
+++ b/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/7.cc
@@ -0,0 +1,67 @@
+// { dg-require-namedlocale "" }
+
+// 2001-09-17 Benjamin Kosnik <bkoz@redhat.com>
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2009
+// Free Software Foundation
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// 22.2.5.3.1 time_put members
+
+#include <locale>
+#include <sstream>
+#include <testsuite_hooks.h>
+
+void test07()
+{
+ using namespace std;
+ typedef ostreambuf_iterator<wchar_t> iterator_type;
+ typedef char_traits<wchar_t> traits;
+
+ bool test __attribute__((unused)) = true;
+
+ // create "C" time objects
+ const tm time1 = __gnu_test::test_tm(0, 0, 12, 4, 3, 71, 0, 93, 0);
+ const wchar_t* date = L"%A, the second of %B";
+ const wchar_t* date_ex = L"%Ex";
+
+ // basic construction and sanity check
+ locale loc_c = locale::classic();
+ locale loc_hk = locale("en_HK");
+ VERIFY( loc_hk != loc_c );
+
+ // create an ostream-derived object, cache the time_put facet
+ const wstring empty;
+ wostringstream oss;
+ oss.imbue(loc_hk);
+ const time_put<wchar_t>& tim_put = use_facet<time_put<wchar_t> >(oss.getloc());
+
+ iterator_type os_it09 = tim_put.put(oss.rdbuf(), oss, L'*', &time1,
+ date, date + traits::length(date));
+ wstring result9 = oss.str();
+ VERIFY( result9 == L"Sunday, the second of April");
+ iterator_type os_it10 = tim_put.put(oss.rdbuf(), oss, L'*', &time1,
+ date_ex, date_ex + traits::length(date));
+ wstring result10 = oss.str();
+ VERIFY( result10 != result9 );
+}
+
+int main()
+{
+ test07();
+ return 0;
+}
diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/8.cc b/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/8.cc
new file mode 100644
index 000000000..b073e8b92
--- /dev/null
+++ b/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/8.cc
@@ -0,0 +1,66 @@
+// { dg-require-namedlocale "" }
+
+// 2001-09-17 Benjamin Kosnik <bkoz@redhat.com>
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2009
+// Free Software Foundation
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// 22.2.5.3.1 time_put members
+
+#include <locale>
+#include <sstream>
+#include <testsuite_hooks.h>
+
+void test08()
+{
+ using namespace std;
+ typedef ostreambuf_iterator<wchar_t> iterator_type;
+ typedef char_traits<wchar_t> traits;
+
+ bool test __attribute__((unused)) = true;
+
+ // create "C" time objects
+ const tm time1 = __gnu_test::test_tm(0, 0, 12, 4, 3, 71, 0, 93, 0);
+ const wchar_t* date = L"%A, the second of %B";
+ const wchar_t* date_ex = L"%Ex";
+
+ // basic construction and sanity check
+ locale loc_c = locale::classic();
+ locale loc_fr = locale("fr_FR@euro");
+ VERIFY( loc_fr != loc_c );
+
+ // create an ostream-derived object, cache the time_put facet
+ const wstring empty;
+ wostringstream oss;
+ oss.imbue(loc_fr);
+ const time_put<wchar_t>& tim_put = use_facet<time_put<wchar_t> >(oss.getloc());
+ iterator_type os_it11 = tim_put.put(oss.rdbuf(), oss, L'*', &time1,
+ date, date + traits::length(date));
+ wstring result11 = oss.str();
+ VERIFY( result11 == L"dimanche, the second of avril");
+ iterator_type os_it12 = tim_put.put(oss.rdbuf(), oss, L'*', &time1,
+ date_ex, date_ex + traits::length(date));
+ wstring result12 = oss.str();
+ VERIFY( result12 != result11 );
+}
+
+int main()
+{
+ test08();
+ return 0;
+}
diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/9.cc b/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/9.cc
new file mode 100644
index 000000000..de1f2d44a
--- /dev/null
+++ b/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/9.cc
@@ -0,0 +1,66 @@
+// 2001-09-17 Benjamin Kosnik <bkoz@redhat.com>
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2009
+// Free Software Foundation
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// 22.2.5.3.1 time_put members
+
+// { dg-do run { xfail dummy_wcsftime } }
+
+#include <locale>
+#include <sstream>
+#include <testsuite_hooks.h>
+
+void test09()
+{
+ using namespace std;
+ bool test __attribute__((unused)) = true;
+
+ // Check time_put works with other iterators besides streambuf
+ // output iterators. (As long as output_iterator requirements are met.)
+ typedef wstring::iterator iter_type;
+ typedef char_traits<wchar_t> traits;
+ typedef time_put<wchar_t, iter_type> time_put_type;
+ const ios_base::iostate goodbit = ios_base::goodbit;
+
+ ios_base::iostate err = goodbit;
+ const locale loc_c = locale::classic();
+ const wstring x(50, L'x'); // have to have allocated wstring!
+ wstring res;
+ const tm time_sanity = __gnu_test::test_tm(0, 0, 12, 26, 5, 97, 2, 0, 0);
+ const wchar_t* date = L"%X, %A, the second of %B, %Y";
+
+ wostringstream oss;
+ oss.imbue(locale(loc_c, new time_put_type));
+ const time_put_type& tp = use_facet<time_put_type>(oss.getloc());
+
+ // 01 date format
+ res = x;
+ iter_type ret1 = tp.put(res.begin(), oss, L' ', &time_sanity,
+ date, date + traits::length(date));
+ wstring sanity1(res.begin(), ret1);
+ VERIFY( err == goodbit );
+ VERIFY( res == L"12:00:00, Tuesday, the second of June, 1997xxxxxxx" );
+ VERIFY( sanity1 == L"12:00:00, Tuesday, the second of June, 1997" );
+}
+
+int main()
+{
+ test09();
+ return 0;
+}
diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/wrapped_env.cc b/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/wrapped_env.cc
new file mode 100644
index 000000000..5c6a8f2a1
--- /dev/null
+++ b/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/wrapped_env.cc
@@ -0,0 +1,82 @@
+// { dg-require-namedlocale "" }
+
+// 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
+
+// Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// 22.2.4.1.1 collate members
+
+#include <testsuite_hooks.h>
+
+#define main discard_main_1
+#include "1.cc"
+#undef main
+
+#define main discard_main_2
+#include "2.cc"
+#undef main
+
+#define main discard_main_3
+#include "3.cc"
+#undef main
+
+#define main discard_main_4
+#include "4.cc"
+#undef main
+
+#define main discard_main_5
+#include "5.cc"
+#undef main
+
+#define main discard_main_6
+#include "6.cc"
+#undef main
+
+#define main discard_main_7
+#include "7.cc"
+#undef main
+
+#define main discard_main_8
+#include "8.cc"
+#undef main
+
+#define main discard_main_9
+#include "9.cc"
+#undef main
+
+#define main discard_main_10
+#include "10.cc"
+#undef main
+
+int main()
+{
+ using namespace __gnu_test;
+ func_callback two;
+ two.push_back(&test01);
+ two.push_back(&test02);
+ two.push_back(&test03);
+ two.push_back(&test04);
+ two.push_back(&test05);
+ two.push_back(&test06);
+ two.push_back(&test07);
+ two.push_back(&test08);
+ two.push_back(&test09);
+ two.push_back(&test10);
+ run_tests_wrapped_env("de_DE", "LANG", two);
+ return 0;
+}
diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/wrapped_locale.cc b/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/wrapped_locale.cc
new file mode 100644
index 000000000..44776e518
--- /dev/null
+++ b/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/wrapped_locale.cc
@@ -0,0 +1,82 @@
+// { dg-require-namedlocale "" }
+
+// 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
+
+// Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// 22.2.4.1.1 collate members
+
+#include <testsuite_hooks.h>
+
+#define main discard_main_1
+#include "1.cc"
+#undef main
+
+#define main discard_main_2
+#include "2.cc"
+#undef main
+
+#define main discard_main_3
+#include "3.cc"
+#undef main
+
+#define main discard_main_4
+#include "4.cc"
+#undef main
+
+#define main discard_main_5
+#include "5.cc"
+#undef main
+
+#define main discard_main_6
+#include "6.cc"
+#undef main
+
+#define main discard_main_7
+#include "7.cc"
+#undef main
+
+#define main discard_main_8
+#include "8.cc"
+#undef main
+
+#define main discard_main_9
+#include "9.cc"
+#undef main
+
+#define main discard_main_10
+#include "10.cc"
+#undef main
+
+int main()
+{
+ using namespace __gnu_test;
+ func_callback two;
+ two.push_back(&test01);
+ two.push_back(&test02);
+ two.push_back(&test03);
+ two.push_back(&test04);
+ two.push_back(&test05);
+ two.push_back(&test06);
+ two.push_back(&test07);
+ two.push_back(&test08);
+ two.push_back(&test09);
+ two.push_back(&test10);
+ run_tests_wrapped_locale("ja_JP.eucjp", two);
+ return 0;
+}