diff options
Diffstat (limited to 'gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put')
32 files changed, 0 insertions, 2327 deletions
diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/char/1.cc b/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/char/1.cc deleted file mode 100644 index 8fed3437a..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/char/1.cc +++ /dev/null @@ -1,80 +0,0 @@ -// 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 test01() -{ - using namespace std; - typedef ostreambuf_iterator<char> 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 string empty; - ostringstream oss; - oss.imbue(loc_c); - const time_put<char>& tim_put = use_facet<time_put<char> >(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, '*', &time1, 'a'); - string result1 = oss.str(); - VERIFY( result1 == "Sun" ); - - oss.str(empty); - iterator_type os_it21 = tim_put.put(oss.rdbuf(), oss, '*', &time1, 'x'); - string result21 = oss.str(); // "04/04/71" - VERIFY( result21 == "04/04/71" ); - - oss.str(empty); - iterator_type os_it22 = tim_put.put(oss.rdbuf(), oss, '*', &time1, 'X'); - string result22 = oss.str(); // "12:00:00" - VERIFY( result22 == "12:00:00" ); - - oss.str(empty); - iterator_type os_it31 = tim_put.put(oss.rdbuf(), oss, '*', &time1, 'x', 'E'); - string result31 = oss.str(); // "04/04/71" - VERIFY( result31 == "04/04/71" ); - - oss.str(empty); - iterator_type os_it32 = tim_put.put(oss.rdbuf(), oss, '*', &time1, 'X', 'E'); - string result32 = oss.str(); // "12:00:00" - VERIFY( result32 == "12:00:00" ); -} - -int main() -{ - test01(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/char/10.cc b/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/char/10.cc deleted file mode 100644 index 65f6e5f27..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/char/10.cc +++ /dev/null @@ -1,62 +0,0 @@ -// 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 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 string::iterator iter_type; - typedef char_traits<char> traits; - typedef time_put<char, 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 string x(50, 'x'); // have to have allocated string! - string res; - const tm time_sanity = __gnu_test::test_tm(0, 0, 12, 26, 5, 97, 2, 0, 0); - - ostringstream 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, ' ', &time_sanity, 'A'); - string sanity2(res.begin(), ret2); - VERIFY( err == goodbit ); - VERIFY( res == "Tuesdayxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" ); - VERIFY( sanity2 == "Tuesday" ); -} - -int main() -{ - test10(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/char/12439_1.cc b/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/char/12439_1.cc deleted file mode 100644 index 7de547149..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/char/12439_1.cc +++ /dev/null @@ -1,65 +0,0 @@ -// 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 - -// { dg-require-time "" } - -#include <locale> -#include <sstream> -#include <ctime> -#include <cstring> -#include <testsuite_hooks.h> - -class TP : public std::time_put<char> -{ -public: - mutable std::string 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; - - ostringstream stream; - time_t tt = time(NULL); - - const char* fmt = "%c"; - - TP tp; - tp.put(TP::iter_type(stream), stream, 'W', localtime(&tt), - fmt, fmt + strlen(fmt)); - VERIFY( !tp.fill_chars.empty() ); - VERIFY( tp.fill_chars[tp.fill_chars.length() - 1] == 'W' ); -} - -int main() -{ - test01(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/char/12439_3.cc b/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/char/12439_3.cc deleted file mode 100644 index 54d4cde7c..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/char/12439_3.cc +++ /dev/null @@ -1,63 +0,0 @@ -// 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 - -// { dg-require-time "" } - -#include <locale> -#include <sstream> -#include <ctime> -#include <testsuite_hooks.h> - -class TP : public std::time_put<char> -{ -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; - - ostringstream stream; - time_t tt = time(NULL); - - const char* fmt = "%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/char/17038.cc b/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/char/17038.cc deleted file mode 100644 index 318c05dc2..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/char/17038.cc +++ /dev/null @@ -1,64 +0,0 @@ -// { 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<char> 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 - ostringstream oss; - oss.imbue(loc_in); - const time_put<char>& tim_put = - use_facet<time_put<char> >(oss.getloc()); - - iterator_type os_it01 = tim_put.put(oss.rdbuf(), oss, '*', &time1, 'c'); - string result1 = oss.str(); - - char time_buffer[128]; - setlocale(LC_ALL, "ta_IN"); - VERIFY( strftime(time_buffer, 128, "%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/char/2.cc b/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/char/2.cc deleted file mode 100644 index 7c65ad998..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/char/2.cc +++ /dev/null @@ -1,79 +0,0 @@ -// { 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<char> iterator_type; - - bool test __attribute__((unused)) = true; - - // create "C" time object - 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 string empty; - ostringstream oss; - oss.imbue(loc_de); - const time_put<char>& tim_put = use_facet<time_put<char> >(oss.getloc()); - - iterator_type os_it02 = tim_put.put(oss.rdbuf(), oss, '*', &time1, 'a'); - string result2 = oss.str(); - VERIFY( result2 == "Son" || result2 == "So" ); - - oss.str(empty); // "%d.%m.%Y" - iterator_type os_it23 = tim_put.put(oss.rdbuf(), oss, '*', &time1, 'x'); - string result23 = oss.str(); // "04.04.1971" - VERIFY( result23 == "04.04.1971" ); - - oss.str(empty); // "%T" - iterator_type os_it24 = tim_put.put(oss.rdbuf(), oss, '*', &time1, 'X'); - string result24 = oss.str(); // "12:00:00" - VERIFY( result24 == "12:00:00" ); - - oss.str(empty); - iterator_type os_it33 = tim_put.put(oss.rdbuf(), oss, '*', &time1, 'x', 'E'); - string result33 = oss.str(); // "04.04.1971" - VERIFY( result33 == "04.04.1971" ); - - oss.str(empty); - iterator_type os_it34 = tim_put.put(oss.rdbuf(), oss, '*', &time1, 'X', 'E'); - string result34 = oss.str(); // "12:00:00" - VERIFY( result34 == "12:00:00" ); -} - -int main() -{ - test02(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/char/3.cc b/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/char/3.cc deleted file mode 100644 index c71b5e46d..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/char/3.cc +++ /dev/null @@ -1,79 +0,0 @@ -// { 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<char> 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 string empty; - ostringstream oss; - oss.imbue(loc_hk); - const time_put<char>& tim_put = use_facet<time_put<char> >(oss.getloc()); - - iterator_type os_it03 = tim_put.put(oss.rdbuf(), oss, '*', &time1, 'a'); - string result3 = oss.str(); - VERIFY( result3 == "Sun" ); - - oss.str(empty); // "%A, %B %d, %Y" - iterator_type os_it25 = tim_put.put(oss.rdbuf(), oss, '*', &time1, 'x'); - string result25 = oss.str(); // "Sunday, April 04, 1971" - VERIFY( result25 == "Sunday, April 04, 1971" ); - - oss.str(empty); // "%I:%M:%S %Z" - iterator_type os_it26 = tim_put.put(oss.rdbuf(), oss, '*', &time1, 'X'); - string result26 = oss.str(); // "12:00:00 CET" or whatever timezone - VERIFY( result26.find("12:00:00") != string::npos ); - - oss.str(empty); - iterator_type os_it35 = tim_put.put(oss.rdbuf(), oss, '*', &time1, 'x', 'E'); - string result35 = oss.str(); // "Sunday, April 04, 1971" - VERIFY( result35 == "Sunday, April 04, 1971" ); - - oss.str(empty); - iterator_type os_it36 = tim_put.put(oss.rdbuf(), oss, '*', &time1, 'X', 'E'); - string result36 = oss.str(); // "12:00:00 CET" - VERIFY( result36.find("12:00:00") != string::npos ); -} - -int main() -{ - test03(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/char/4.cc b/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/char/4.cc deleted file mode 100644 index 196c1aa90..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/char/4.cc +++ /dev/null @@ -1,78 +0,0 @@ -// { 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<char> 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 string empty; - ostringstream oss; - oss.imbue(loc_es); - const time_put<char>& tim_put = use_facet<time_put<char> >(oss.getloc()); - iterator_type os_it04 = tim_put.put(oss.rdbuf(), oss, '*', &time1, 'a'); - string result4 = oss.str(); - VERIFY( result4 == "dom" ); - - oss.str(empty); // "%d/%m/%y" - iterator_type os_it27 = tim_put.put(oss.rdbuf(), oss, '*', &time1, 'x'); - string result27 = oss.str(); // "04/04/71" - VERIFY( result27 == "04/04/71" ); - - oss.str(empty); // "%T" - iterator_type os_it28 = tim_put.put(oss.rdbuf(), oss, '*', &time1, 'X'); - string result28 = oss.str(); // "12:00:00" - VERIFY( result28 == "12:00:00" ); - - oss.str(empty); - iterator_type os_it37 = tim_put.put(oss.rdbuf(), oss, '*', &time1, 'x', 'E'); - string result37 = oss.str(); // "04/04/71" - VERIFY( result37 == "04/04/71" ); - - oss.str(empty); - iterator_type os_it38 = tim_put.put(oss.rdbuf(), oss, '*', &time1, 'X', 'E'); - string result38 = oss.str(); // "12:00:00" - VERIFY( result38 == "12:00:00" ); -} - -int main() -{ - test04(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/char/5.cc b/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/char/5.cc deleted file mode 100644 index 2f9c6a6bc..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/char/5.cc +++ /dev/null @@ -1,66 +0,0 @@ -// 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 - -#include <locale> -#include <sstream> -#include <testsuite_hooks.h> - -void test05() -{ - using namespace std; - typedef ostreambuf_iterator<char> iterator_type; - typedef char_traits<char> 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 char* date = "%A, the second of %B"; - const char* date_ex = "%Ex"; - - // basic construction - locale loc_c = locale::classic(); - - // create an ostream-derived object, cache the time_put facet - const string empty; - ostringstream oss; - oss.imbue(loc_c); - const time_put<char>& tim_put = use_facet<time_put<char> >(oss.getloc()); - - // 2 - oss.str(empty); - iterator_type os_it05 = tim_put.put(oss.rdbuf(), oss, '*', &time1, - date, date + traits::length(date)); - string result5 = oss.str(); - VERIFY( result5 == "Sunday, the second of April"); - iterator_type os_it06 = tim_put.put(oss.rdbuf(), oss, '*', &time1, - date_ex, - date_ex + traits::length(date_ex)); - string 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/char/6.cc b/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/char/6.cc deleted file mode 100644 index ff3938cc9..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/char/6.cc +++ /dev/null @@ -1,68 +0,0 @@ -// { dg-require-namedlocale "" } - -// 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 - -#include <locale> -#include <sstream> -#include <testsuite_hooks.h> - -void test06() -{ - using namespace std; - typedef ostreambuf_iterator<char> iterator_type; - typedef char_traits<char> 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 char* date = "%A, the second of %B"; - const char* date_ex = "%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 string empty; - ostringstream oss; - oss.imbue(loc_de); - const time_put<char>& tim_put = use_facet<time_put<char> >(oss.getloc()); - - iterator_type os_it07 = tim_put.put(oss.rdbuf(), oss, '*', &time1, - date, date + traits::length(date)); - string result7 = oss.str(); - VERIFY( result7 == "Sonntag, the second of April"); - iterator_type os_it08 = tim_put.put(oss.rdbuf(), oss, '*', &time1, - date_ex, - date_ex + traits::length(date_ex)); - string 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/char/7.cc b/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/char/7.cc deleted file mode 100644 index 93b139d95..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/char/7.cc +++ /dev/null @@ -1,68 +0,0 @@ -// { dg-require-namedlocale "" } - -// 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 - -#include <locale> -#include <sstream> -#include <testsuite_hooks.h> - -void test07() -{ - using namespace std; - typedef ostreambuf_iterator<char> iterator_type; - typedef char_traits<char> 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 char* date = "%A, the second of %B"; - const char* date_ex = "%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 string empty; - ostringstream oss; - oss.imbue(loc_hk); - const time_put<char>& tim_put = use_facet<time_put<char> >(oss.getloc()); - - iterator_type os_it09 = tim_put.put(oss.rdbuf(), oss, '*', &time1, - date, date + traits::length(date)); - string result9 = oss.str(); - VERIFY( result9 == "Sunday, the second of April"); - iterator_type os_it10 = tim_put.put(oss.rdbuf(), oss, '*', &time1, - date_ex, - date_ex + traits::length(date_ex)); - string 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/char/8.cc b/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/char/8.cc deleted file mode 100644 index 283495461..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/char/8.cc +++ /dev/null @@ -1,67 +0,0 @@ -// { dg-require-namedlocale "" } - -// 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 - -#include <locale> -#include <sstream> -#include <testsuite_hooks.h> - -void test08() -{ - using namespace std; - typedef ostreambuf_iterator<char> iterator_type; - typedef char_traits<char> 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 char* date = "%A, the second of %B"; - const char* date_ex = "%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 string empty; - ostringstream oss; - oss.imbue(loc_fr); - const time_put<char>& tim_put = use_facet<time_put<char> >(oss.getloc()); - iterator_type os_it11 = tim_put.put(oss.rdbuf(), oss, '*', &time1, - date, date + traits::length(date)); - string result11 = oss.str(); - VERIFY( result11 == "dimanche, the second of avril"); - iterator_type os_it12 = tim_put.put(oss.rdbuf(), oss, '*', &time1, - date_ex, - date_ex + traits::length(date_ex)); - string 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/char/9.cc b/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/char/9.cc deleted file mode 100644 index 0ef9bbc99..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/char/9.cc +++ /dev/null @@ -1,64 +0,0 @@ -// 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 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 string::iterator iter_type; - typedef char_traits<char> traits; - typedef time_put<char, 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 string x(50, 'x'); // have to have allocated string! - string res; - const tm time_sanity = __gnu_test::test_tm(0, 0, 12, 26, 5, 97, 2, 0, 0); - const char* date = "%X, %A, the second of %B, %Y"; - - ostringstream 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, ' ', &time_sanity, - date, date + traits::length(date)); - string sanity1(res.begin(), ret1); - VERIFY( err == goodbit ); - VERIFY( res == "12:00:00, Tuesday, the second of June, 1997xxxxxxx" ); - VERIFY( sanity1 == "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/char/9780-1.cc b/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/char/9780-1.cc deleted file mode 100644 index ea40ae998..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/char/9780-1.cc +++ /dev/null @@ -1,132 +0,0 @@ -// { dg-require-namedlocale "" } - -// Copyright (C) 2004, 2005, 2009 Free Software Foundation, Inc. -// -// 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/>. - -#include <sstream> -#include <locale> -#include <testsuite_hooks.h> - -int main() -{ - using namespace std; - - bool test __attribute__((unused)) = true; - locale l1 = locale("de_DE"); - locale l2 = locale("es_ES"); - - const time_put<char> &tp = use_facet<time_put<char> >(l1); - ostringstream oss; - oss.imbue(l2); - - tm t = tm(); - tp.put(oss.rdbuf(), oss, ' ', &t, 'A'); - string res = oss.str(); - - VERIFY( res == "domingo" ); - - return 0; -} - -// Two interpretations of the standard. - -// 1 : time_get, time_put each have their own data internally -// use internal data for time and date specifics -// use getloc for ctype info - -// 2 : time_get, time_put use the ios_base& argument and getloc to -// retrieve the necessary data. -// use getloc for ctype, time and date specifics - -// It is my opinion that the language in the standard is sufficiently -// vague to permit both interpretations. In particular, the interface -// for time_get and time_put is based on strftime, which as -// POSIX notes is dependent on LC_TIME. The C++ standard, however, -// does not specify the equivalent mappings of LC_TIME to time_get and -// time_put. - -/* -The problems with the first approach, as above, are numerous. - -1) The locale usage and design for formatters and parsers becomes - fragmented. On one side, num_put and money_put, and on the other, - time_put. This inconsistency is not useful. - -2) The data structures for time and date formatting are the largest in - the locale library. Making time_put and time_get keep separate - copies is inefficient. (Note that time_put and time_get are in the - same locale::category). -*/ - - -/* -22.2.5 - The time category [lib.category.time] - --1- Templates time_get<charT,InputIterator> and - time_put<charT,OutputIterator> provide date and time formatting and - parsing. All specifications of member functions for time_put and - time_get in the subclauses of lib.category.time only apply to the - instantiations required in Tables 51 and 52 - (lib.locale.category). Their members use their ios_base&, - ios_base::iostate&, and fill arguments as described in - (lib.locale.categories), and the ctype<> facet, to determine - formatting details. -*/ - -/* -22.2 - Standard locale categories [lib.locale.categories] - --1- Each of the standard categories includes a family of facets. Some - of these implement formatting or parsing of a datum, for use by - standard or users' iostream operators << and >>, as members put() and - get(), respectively. Each such member function takes an ios_base& - argument whose members flags(), precision(), and width(), specify the - format of the corresponding datum. (lib.ios.base). Those functions - which need to use other facets call its member getloc() to retrieve - the locale imbued there. Formatting facets use the character argument - fill to fill out the specified width where necessary. -*/ - -/* -With GCC/libstdc++, the output of the program with the arguments -of de_DE es_ES is: - domingo - lunes - martes - miércoles - jueves - viernes - sábado - -With Intel C++, it is: (this is clearly wrong) - Sunday - Monday - Tuesday - Wednesday - Thursday - Friday - Saturday - -And with RogueWave C++ - Sonntag - Montag - Dienstag - Mittwoch - Donnerstag - Freitag - Samstag -*/ diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/char/wrapped_env.cc b/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/char/wrapped_env.cc deleted file mode 100644 index 5c6a8f2a1..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/char/wrapped_env.cc +++ /dev/null @@ -1,82 +0,0 @@ -// { 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/char/wrapped_locale.cc b/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/char/wrapped_locale.cc deleted file mode 100644 index 44776e518..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/char/wrapped_locale.cc +++ /dev/null @@ -1,82 +0,0 @@ -// { 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; -} 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 deleted file mode 100644 index 2ed02a5da..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/1.cc +++ /dev/null @@ -1,82 +0,0 @@ -// 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 deleted file mode 100644 index 7e102346c..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/10.cc +++ /dev/null @@ -1,64 +0,0 @@ -// 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 deleted file mode 100644 index 159b8f193..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/12439_1.cc +++ /dev/null @@ -1,63 +0,0 @@ -// 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 deleted file mode 100644 index 515c998c2..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/12439_2.cc +++ /dev/null @@ -1,59 +0,0 @@ -// 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 deleted file mode 100644 index 8127c75ea..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/12439_3.cc +++ /dev/null @@ -1,61 +0,0 @@ -// 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 deleted file mode 100644 index d4f904688..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/17038.cc +++ /dev/null @@ -1,64 +0,0 @@ -// { 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 deleted file mode 100644 index c8cc42c2c..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/2.cc +++ /dev/null @@ -1,79 +0,0 @@ -// { 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 deleted file mode 100644 index eec2fa7a3..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/3.cc +++ /dev/null @@ -1,80 +0,0 @@ -// { 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 deleted file mode 100644 index e56f14ebb..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/4.cc +++ /dev/null @@ -1,78 +0,0 @@ -// { 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 deleted file mode 100644 index 77f7798ab..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/5.cc +++ /dev/null @@ -1,68 +0,0 @@ -// 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 deleted file mode 100644 index 91a68a05c..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/6.cc +++ /dev/null @@ -1,67 +0,0 @@ -// { 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 deleted file mode 100644 index 439d6086c..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/7.cc +++ /dev/null @@ -1,67 +0,0 @@ -// { 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 deleted file mode 100644 index b073e8b92..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/8.cc +++ /dev/null @@ -1,66 +0,0 @@ -// { 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 deleted file mode 100644 index de1f2d44a..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/9.cc +++ /dev/null @@ -1,66 +0,0 @@ -// 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 deleted file mode 100644 index 5c6a8f2a1..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/wrapped_env.cc +++ /dev/null @@ -1,82 +0,0 @@ -// { 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 deleted file mode 100644 index 44776e518..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/wrapped_locale.cc +++ /dev/null @@ -1,82 +0,0 @@ -// { 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; -} |