Commit ba98a8d8 by Paolo Carlini Committed by Paolo Carlini

time_members.cc (__timepunct<char>::_M_initialize_timepunct, [...]): the correct…

time_members.cc (__timepunct<char>::_M_initialize_timepunct, [...]): the correct _M_amonth07 in the "C" locale is "Jul" and L"Jul", respectively.

2004-04-07  Paolo Carlini  <pcarlini@suse.de>

	* config/locale/generic/time_members.cc
	(__timepunct<char>::_M_initialize_timepunct,
	__timepunct<wchar_t>::_M_initialize_timepunct): the correct
	_M_amonth07 in the "C" locale is "Jul" and L"Jul", respectively.
	* config/locale/gnu/time_members.cc
	(__timepunct<char>::_M_initialize_timepunct,
	__timepunct<wchar_t>::_M_initialize_timepunct): Ditto.
	* testsuite/22_locale/time_get/get_monthname/char/4.cc: New.
	* testsuite/22_locale/time_get/get_monthname/wchar_t/4.cc: New.

	* testsuite/22_locale/time_get/date_order/char/1.cc: Remove junk.
	* testsuite/22_locale/time_get/date_order/wchar_t/1.cc: Ditto.
	* testsuite/22_locale/time_get/get_date/char/1.cc: Ditto.
	* testsuite/22_locale/time_get/get_date/char/2.cc: Ditto.
	* testsuite/22_locale/time_get/get_date/wchar_t/1.cc: Ditto.
	* testsuite/22_locale/time_get/get_date/wchar_t/2.cc: Ditto.
	* testsuite/22_locale/time_get/get_monthname/char/1.cc: Ditto.
	* testsuite/22_locale/time_get/get_monthname/char/2.cc: Ditto.
	* testsuite/22_locale/time_get/get_monthname/wchar_t/1.cc: Ditto.
	* testsuite/22_locale/time_get/get_monthname/wchar_t/2.cc: Ditto.
	* testsuite/22_locale/time_get/get_time/char/1.cc: Ditto.
	* testsuite/22_locale/time_get/get_time/char/2.cc: Ditto.
	* testsuite/22_locale/time_get/get_time/wchar_t/1.cc: Ditto.
	* testsuite/22_locale/time_get/get_time/wchar_t/2.cc: Ditto.
	* testsuite/22_locale/time_get/get_weekday/char/1.cc: Ditto.
	* testsuite/22_locale/time_get/get_weekday/char/2.cc: Ditto.
	* testsuite/22_locale/time_get/get_weekday/wchar_t/1.cc: Ditto.
	* testsuite/22_locale/time_get/get_weekday/wchar_t/2.cc: Ditto.
	* testsuite/22_locale/time_get/get_year/char/1.cc: Ditto.
	* testsuite/22_locale/time_get/get_year/wchar_t/1.cc: Ditto.
	* testsuite/22_locale/time_put/put/char/1.cc: Ditto.
	* testsuite/22_locale/time_put/put/char/2.cc: Ditto.
	* testsuite/22_locale/time_put/put/char/3.cc: Ditto.
	* testsuite/22_locale/time_put/put/char/4.cc: Ditto.
	* testsuite/22_locale/time_put/put/char/5.cc: Ditto.
	* testsuite/22_locale/time_put/put/char/6.cc: Ditto.
	* testsuite/22_locale/time_put/put/char/7.cc: Ditto.
	* testsuite/22_locale/time_put/put/char/8.cc: Ditto.
	* testsuite/22_locale/time_put/put/wchar_t/1.cc: Ditto.
	* testsuite/22_locale/time_put/put/wchar_t/2.cc: Ditto.
	* testsuite/22_locale/time_put/put/wchar_t/3.cc: Ditto.
	* testsuite/22_locale/time_put/put/wchar_t/4.cc: Ditto.
	* testsuite/22_locale/time_put/put/wchar_t/5.cc: Ditto.
	* testsuite/22_locale/time_put/put/wchar_t/6.cc: Ditto.
	* testsuite/22_locale/time_put/put/wchar_t/7.cc: Ditto.
	* testsuite/22_locale/time_put/put/wchar_t/8.cc: Ditto.

	* testsuite/22_locale/time_put/put/char/9780-1.cc: Fix typos.

From-SVN: r80493
parent 42b343d6
2004-04-07 Paolo Carlini <pcarlini@suse.de> 2004-04-07 Paolo Carlini <pcarlini@suse.de>
* config/locale/generic/time_members.cc
(__timepunct<char>::_M_initialize_timepunct,
__timepunct<wchar_t>::_M_initialize_timepunct): the correct
_M_amonth07 in the "C" locale is "Jul" and L"Jul", respectively.
* config/locale/gnu/time_members.cc
(__timepunct<char>::_M_initialize_timepunct,
__timepunct<wchar_t>::_M_initialize_timepunct): Ditto.
* testsuite/22_locale/time_get/get_monthname/char/4.cc: New.
* testsuite/22_locale/time_get/get_monthname/wchar_t/4.cc: New.
* testsuite/22_locale/time_get/date_order/char/1.cc: Remove junk.
* testsuite/22_locale/time_get/date_order/wchar_t/1.cc: Ditto.
* testsuite/22_locale/time_get/get_date/char/1.cc: Ditto.
* testsuite/22_locale/time_get/get_date/char/2.cc: Ditto.
* testsuite/22_locale/time_get/get_date/wchar_t/1.cc: Ditto.
* testsuite/22_locale/time_get/get_date/wchar_t/2.cc: Ditto.
* testsuite/22_locale/time_get/get_monthname/char/1.cc: Ditto.
* testsuite/22_locale/time_get/get_monthname/char/2.cc: Ditto.
* testsuite/22_locale/time_get/get_monthname/wchar_t/1.cc: Ditto.
* testsuite/22_locale/time_get/get_monthname/wchar_t/2.cc: Ditto.
* testsuite/22_locale/time_get/get_time/char/1.cc: Ditto.
* testsuite/22_locale/time_get/get_time/char/2.cc: Ditto.
* testsuite/22_locale/time_get/get_time/wchar_t/1.cc: Ditto.
* testsuite/22_locale/time_get/get_time/wchar_t/2.cc: Ditto.
* testsuite/22_locale/time_get/get_weekday/char/1.cc: Ditto.
* testsuite/22_locale/time_get/get_weekday/char/2.cc: Ditto.
* testsuite/22_locale/time_get/get_weekday/wchar_t/1.cc: Ditto.
* testsuite/22_locale/time_get/get_weekday/wchar_t/2.cc: Ditto.
* testsuite/22_locale/time_get/get_year/char/1.cc: Ditto.
* testsuite/22_locale/time_get/get_year/wchar_t/1.cc: Ditto.
* testsuite/22_locale/time_put/put/char/1.cc: Ditto.
* testsuite/22_locale/time_put/put/char/2.cc: Ditto.
* testsuite/22_locale/time_put/put/char/3.cc: Ditto.
* testsuite/22_locale/time_put/put/char/4.cc: Ditto.
* testsuite/22_locale/time_put/put/char/5.cc: Ditto.
* testsuite/22_locale/time_put/put/char/6.cc: Ditto.
* testsuite/22_locale/time_put/put/char/7.cc: Ditto.
* testsuite/22_locale/time_put/put/char/8.cc: Ditto.
* testsuite/22_locale/time_put/put/wchar_t/1.cc: Ditto.
* testsuite/22_locale/time_put/put/wchar_t/2.cc: Ditto.
* testsuite/22_locale/time_put/put/wchar_t/3.cc: Ditto.
* testsuite/22_locale/time_put/put/wchar_t/4.cc: Ditto.
* testsuite/22_locale/time_put/put/wchar_t/5.cc: Ditto.
* testsuite/22_locale/time_put/put/wchar_t/6.cc: Ditto.
* testsuite/22_locale/time_put/put/wchar_t/7.cc: Ditto.
* testsuite/22_locale/time_put/put/wchar_t/8.cc: Ditto.
* testsuite/22_locale/time_put/put/char/9780-1.cc: Fix typos.
2004-04-07 Paolo Carlini <pcarlini@suse.de>
* config/locale/gnu/monetary_members.cc * config/locale/gnu/monetary_members.cc
(moneypunct<wchar_t>::_M_initialize_moneypunct): Prefer (moneypunct<wchar_t>::_M_initialize_moneypunct): Prefer
_NL_MONETARY_DECIMAL_POINT_WC, _NL_MONETARY_THOUSANDS_SEP_WC, _NL_MONETARY_DECIMAL_POINT_WC, _NL_MONETARY_THOUSANDS_SEP_WC,
......
// std::time_get, std::time_put implementation, generic version -*- C++ -*- // std::time_get, std::time_put implementation, generic version -*- C++ -*-
// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. // Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // 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 // software; you can redistribute it and/or modify it under the
...@@ -108,7 +108,7 @@ namespace std ...@@ -108,7 +108,7 @@ namespace std
_M_data->_M_amonth04 = "Apr"; _M_data->_M_amonth04 = "Apr";
_M_data->_M_amonth05 = "May"; _M_data->_M_amonth05 = "May";
_M_data->_M_amonth06 = "Jun"; _M_data->_M_amonth06 = "Jun";
_M_data->_M_amonth07 = "July"; _M_data->_M_amonth07 = "Jul";
_M_data->_M_amonth08 = "Aug"; _M_data->_M_amonth08 = "Aug";
_M_data->_M_amonth09 = "Sep"; _M_data->_M_amonth09 = "Sep";
_M_data->_M_amonth10 = "Oct"; _M_data->_M_amonth10 = "Oct";
...@@ -187,7 +187,7 @@ namespace std ...@@ -187,7 +187,7 @@ namespace std
_M_data->_M_amonth04 = L"Apr"; _M_data->_M_amonth04 = L"Apr";
_M_data->_M_amonth05 = L"May"; _M_data->_M_amonth05 = L"May";
_M_data->_M_amonth06 = L"Jun"; _M_data->_M_amonth06 = L"Jun";
_M_data->_M_amonth07 = L"July"; _M_data->_M_amonth07 = L"Jul";
_M_data->_M_amonth08 = L"Aug"; _M_data->_M_amonth08 = L"Aug";
_M_data->_M_amonth09 = L"Sep"; _M_data->_M_amonth09 = L"Sep";
_M_data->_M_amonth10 = L"Oct"; _M_data->_M_amonth10 = L"Oct";
......
// std::time_get, std::time_put implementation, GNU version -*- C++ -*- // std::time_get, std::time_put implementation, GNU version -*- C++ -*-
// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. // Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // 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 // software; you can redistribute it and/or modify it under the
...@@ -117,7 +117,7 @@ namespace std ...@@ -117,7 +117,7 @@ namespace std
_M_data->_M_amonth04 = "Apr"; _M_data->_M_amonth04 = "Apr";
_M_data->_M_amonth05 = "May"; _M_data->_M_amonth05 = "May";
_M_data->_M_amonth06 = "Jun"; _M_data->_M_amonth06 = "Jun";
_M_data->_M_amonth07 = "July"; _M_data->_M_amonth07 = "Jul";
_M_data->_M_amonth08 = "Aug"; _M_data->_M_amonth08 = "Aug";
_M_data->_M_amonth09 = "Sep"; _M_data->_M_amonth09 = "Sep";
_M_data->_M_amonth10 = "Oct"; _M_data->_M_amonth10 = "Oct";
...@@ -265,7 +265,7 @@ namespace std ...@@ -265,7 +265,7 @@ namespace std
_M_data->_M_amonth04 = L"Apr"; _M_data->_M_amonth04 = L"Apr";
_M_data->_M_amonth05 = L"May"; _M_data->_M_amonth05 = L"May";
_M_data->_M_amonth06 = L"Jun"; _M_data->_M_amonth06 = L"Jun";
_M_data->_M_amonth07 = L"July"; _M_data->_M_amonth07 = L"Jul";
_M_data->_M_amonth08 = L"Aug"; _M_data->_M_amonth08 = L"Aug";
_M_data->_M_amonth09 = L"Sep"; _M_data->_M_amonth09 = L"Sep";
_M_data->_M_amonth10 = L"Oct"; _M_data->_M_amonth10 = L"Oct";
......
// 2001-09-21 Benjamin Kosnik <bkoz@redhat.com> // 2001-09-21 Benjamin Kosnik <bkoz@redhat.com>
// Copyright (C) 2001, 2002, 2003 Free Software Foundation
// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation
// //
// This file is part of the GNU ISO C++ Library. This library is free // 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 // software; you can redistribute it and/or modify it under the
...@@ -30,17 +31,10 @@ void test01() ...@@ -30,17 +31,10 @@ void test01()
typedef time_base::dateorder dateorder; typedef time_base::dateorder dateorder;
typedef istreambuf_iterator<char> iterator_type; typedef istreambuf_iterator<char> iterator_type;
// basic construction and sanity checks. // basic construction
locale loc_c = locale::classic(); locale loc_c = locale::classic();
locale loc_hk = __gnu_test::try_named_locale("en_HK");
locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro"); const string empty;
locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
VERIFY( loc_de != loc_fr );
const string empty;
// create an ostream-derived object, cache the time_get facet // create an ostream-derived object, cache the time_get facet
iterator_type end; iterator_type end;
......
// 2001-09-21 Benjamin Kosnik <bkoz@redhat.com> // 2001-09-21 Benjamin Kosnik <bkoz@redhat.com>
// Copyright (C) 2001, 2002, 2003 Free Software Foundation // Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation
// //
// This file is part of the GNU ISO C++ Library. This library is free // 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 // software; you can redistribute it and/or modify it under the
...@@ -31,15 +31,8 @@ void test01() ...@@ -31,15 +31,8 @@ void test01()
typedef time_base::dateorder dateorder; typedef time_base::dateorder dateorder;
typedef istreambuf_iterator<wchar_t> iterator_type; typedef istreambuf_iterator<wchar_t> iterator_type;
// basic construction and sanity checks. // basic construction
locale loc_c = locale::classic(); locale loc_c = locale::classic();
locale loc_hk = __gnu_test::try_named_locale("en_HK");
locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
VERIFY( loc_de != loc_fr );
const string empty; const string empty;
......
// 2001-09-21 Benjamin Kosnik <bkoz@redhat.com> // 2001-09-21 Benjamin Kosnik <bkoz@redhat.com>
// Copyright (C) 2001, 2002, 2003 Free Software Foundation // Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation
// //
// This file is part of the GNU ISO C++ Library. This library is free // 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 // software; you can redistribute it and/or modify it under the
...@@ -27,20 +27,12 @@ ...@@ -27,20 +27,12 @@
void test01() void test01()
{ {
using namespace std; using namespace std;
typedef time_base::dateorder dateorder;
typedef istreambuf_iterator<char> iterator_type;
bool test __attribute__((unused)) = true; bool test __attribute__((unused)) = true;
// basic construction and sanity checks. typedef istreambuf_iterator<char> iterator_type;
// basic construction
locale loc_c = locale::classic(); locale loc_c = locale::classic();
locale loc_hk = __gnu_test::try_named_locale("en_HK");
locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
VERIFY( loc_de != loc_fr );
const string empty; const string empty;
......
// 2001-09-21 Benjamin Kosnik <bkoz@redhat.com> // 2001-09-21 Benjamin Kosnik <bkoz@redhat.com>
// Copyright (C) 2001, 2002, 2003 Free Software Foundation // Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation
// //
// This file is part of the GNU ISO C++ Library. This library is free // 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 // software; you can redistribute it and/or modify it under the
...@@ -27,20 +27,16 @@ ...@@ -27,20 +27,16 @@
void test02() void test02()
{ {
using namespace std; using namespace std;
typedef time_base::dateorder dateorder;
typedef istreambuf_iterator<char> iterator_type;
bool test __attribute__((unused)) = true; bool test __attribute__((unused)) = true;
typedef istreambuf_iterator<char> iterator_type;
// basic construction and sanity checks. // basic construction and sanity checks.
locale loc_c = locale::classic(); locale loc_c = locale::classic();
locale loc_hk = __gnu_test::try_named_locale("en_HK"); locale loc_hk = __gnu_test::try_named_locale("en_HK");
locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
locale loc_de = __gnu_test::try_named_locale("de_DE"); locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c ); VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de ); VERIFY( loc_hk != loc_de );
VERIFY( loc_de != loc_fr );
const string empty; const string empty;
......
// 2001-09-21 Benjamin Kosnik <bkoz@redhat.com> // 2001-09-21 Benjamin Kosnik <bkoz@redhat.com>
// Copyright (C) 2001, 2002, 2003 Free Software Foundation // Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation
// //
// This file is part of the GNU ISO C++ Library. This library is free // 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 // software; you can redistribute it and/or modify it under the
...@@ -27,20 +27,12 @@ ...@@ -27,20 +27,12 @@
void test01() void test01()
{ {
using namespace std; using namespace std;
typedef time_base::dateorder dateorder;
typedef istreambuf_iterator<wchar_t> iterator_type;
bool test __attribute__((unused)) = true; bool test __attribute__((unused)) = true;
// basic construction and sanity checks. typedef istreambuf_iterator<wchar_t> iterator_type;
// basic construction
locale loc_c = locale::classic(); locale loc_c = locale::classic();
locale loc_hk = __gnu_test::try_named_locale("en_HK");
locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
VERIFY( loc_de != loc_fr );
const wstring empty; const wstring empty;
......
...@@ -27,20 +27,16 @@ ...@@ -27,20 +27,16 @@
void test02() void test02()
{ {
using namespace std; using namespace std;
typedef time_base::dateorder dateorder;
typedef istreambuf_iterator<wchar_t> iterator_type;
bool test __attribute__((unused)) = true; bool test __attribute__((unused)) = true;
typedef istreambuf_iterator<wchar_t> iterator_type;
// basic construction and sanity checks. // basic construction and sanity checks.
locale loc_c = locale::classic(); locale loc_c = locale::classic();
locale loc_hk = __gnu_test::try_named_locale("en_HK"); locale loc_hk = __gnu_test::try_named_locale("en_HK");
locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
locale loc_de = __gnu_test::try_named_locale("de_DE"); locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c ); VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de ); VERIFY( loc_hk != loc_de );
VERIFY( loc_de != loc_fr );
const wstring empty; const wstring empty;
......
// 2001-09-21 Benjamin Kosnik <bkoz@redhat.com> // 2001-09-21 Benjamin Kosnik <bkoz@redhat.com>
// Copyright (C) 2001, 2002, 2003 Free Software Foundation // Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation
// //
// This file is part of the GNU ISO C++ Library. This library is free // 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 // software; you can redistribute it and/or modify it under the
...@@ -27,23 +27,15 @@ ...@@ -27,23 +27,15 @@
void test01() void test01()
{ {
using namespace std; using namespace std;
typedef time_base::dateorder dateorder; bool test __attribute__((unused)) = true;
typedef istreambuf_iterator<char> iterator_type; typedef istreambuf_iterator<char> iterator_type;
const ios_base::iostate good = ios_base::goodbit; const ios_base::iostate good = ios_base::goodbit;
ios_base::iostate errorstate = good; ios_base::iostate errorstate = good;
bool test __attribute__((unused)) = true; // basic construction
// basic construction and sanity checks.
locale loc_c = locale::classic(); locale loc_c = locale::classic();
locale loc_hk = __gnu_test::try_named_locale("en_HK");
locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
VERIFY( loc_de != loc_fr );
// create "C" time objects // create "C" time objects
const tm time_bday = { 0, 0, 12, 4, 3, 71, 0, 93, 0 }; const tm time_bday = { 0, 0, 12, 4, 3, 71, 0, 93, 0 };
......
...@@ -27,20 +27,16 @@ ...@@ -27,20 +27,16 @@
void test02() void test02()
{ {
using namespace std; using namespace std;
typedef time_base::dateorder dateorder;
typedef istreambuf_iterator<char> iterator_type;
bool test __attribute__((unused)) = true; bool test __attribute__((unused)) = true;
typedef istreambuf_iterator<char> iterator_type;
// basic construction and sanity checks. // basic construction and sanity checks.
locale loc_c = locale::classic(); locale loc_c = locale::classic();
locale loc_hk = __gnu_test::try_named_locale("en_HK"); locale loc_hk = __gnu_test::try_named_locale("en_HK");
locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
locale loc_de = __gnu_test::try_named_locale("de_DE"); locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c ); VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de ); VERIFY( loc_hk != loc_de );
VERIFY( loc_de != loc_fr );
const tm time_bday = { 0, 0, 12, 4, 3, 71, 0, 93, 0 }; const tm time_bday = { 0, 0, 12, 4, 3, 71, 0, 93, 0 };
......
// 2004-04-07 Paolo Carlini <pcarlini@suse.de>
// Copyright (C) 2004 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 2, 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 COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// 22.2.5.1.1 time_get members
#include <locale>
#include <sstream>
#include <testsuite_hooks.h>
void test01()
{
using namespace std;
bool test __attribute__((unused)) = true;
typedef istreambuf_iterator<char> iterator_type;
const ios_base::iostate good = ios_base::goodbit;
ios_base::iostate errorstate = good;
// basic construction
locale loc_c = locale::classic();
iterator_type end;
istringstream iss;
iss.imbue(loc_c);
const time_get<char>& tim_get =
use_facet<time_get<char> >(iss.getloc());
iss.str("Jul");
iterator_type is_it01(iss);
tm time01;
errorstate = good;
tim_get.get_monthname(is_it01, end, iss, errorstate, &time01);
VERIFY( time01.tm_mon == 6 );
VERIFY( errorstate == ios_base::eofbit );
}
int main()
{
test01();
return 0;
}
// 2001-09-21 Benjamin Kosnik <bkoz@redhat.com> // 2001-09-21 Benjamin Kosnik <bkoz@redhat.com>
// Copyright (C) 2001, 2002, 2003 Free Software Foundation // Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation
// //
// This file is part of the GNU ISO C++ Library. This library is free // 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 // software; you can redistribute it and/or modify it under the
...@@ -27,23 +27,15 @@ ...@@ -27,23 +27,15 @@
void test01() void test01()
{ {
using namespace std; using namespace std;
typedef time_base::dateorder dateorder; bool test __attribute__((unused)) = true;
typedef istreambuf_iterator<wchar_t> iterator_type; typedef istreambuf_iterator<wchar_t> iterator_type;
const ios_base::iostate good = ios_base::goodbit; const ios_base::iostate good = ios_base::goodbit;
ios_base::iostate errorstate = good; ios_base::iostate errorstate = good;
bool test __attribute__((unused)) = true; // basic construction
// basic construction and sanity checks.
locale loc_c = locale::classic(); locale loc_c = locale::classic();
locale loc_hk = __gnu_test::try_named_locale("en_HK");
locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
VERIFY( loc_de != loc_fr );
// create "C" time objects // create "C" time objects
const tm time_bday = { 0, 0, 12, 4, 3, 71, 0, 93, 0 }; const tm time_bday = { 0, 0, 12, 4, 3, 71, 0, 93, 0 };
......
// 2001-09-21 Benjamin Kosnik <bkoz@redhat.com> // 2001-09-21 Benjamin Kosnik <bkoz@redhat.com>
// Copyright (C) 2001, 2002, 2003 Free Software Foundation // Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation
// //
// This file is part of the GNU ISO C++ Library. This library is free // 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 // software; you can redistribute it and/or modify it under the
...@@ -27,20 +27,16 @@ ...@@ -27,20 +27,16 @@
void test02() void test02()
{ {
using namespace std; using namespace std;
typedef time_base::dateorder dateorder;
typedef istreambuf_iterator<wchar_t> iterator_type;
bool test __attribute__((unused)) = true; bool test __attribute__((unused)) = true;
typedef istreambuf_iterator<wchar_t> iterator_type;
// basic construction and sanity checks. // basic construction and sanity checks.
locale loc_c = locale::classic(); locale loc_c = locale::classic();
locale loc_hk = __gnu_test::try_named_locale("en_HK"); locale loc_hk = __gnu_test::try_named_locale("en_HK");
locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
locale loc_de = __gnu_test::try_named_locale("de_DE"); locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c ); VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de ); VERIFY( loc_hk != loc_de );
VERIFY( loc_de != loc_fr );
const tm time_bday = { 0, 0, 12, 4, 3, 71, 0, 93, 0 }; const tm time_bday = { 0, 0, 12, 4, 3, 71, 0, 93, 0 };
......
// 2004-04-07 Paolo Carlini <pcarlini@suse.de>
// Copyright (C) 2004 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 2, 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 COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// 22.2.5.1.1 time_get members
#include <locale>
#include <sstream>
#include <testsuite_hooks.h>
void test01()
{
using namespace std;
bool test __attribute__((unused)) = true;
typedef istreambuf_iterator<wchar_t> iterator_type;
const ios_base::iostate good = ios_base::goodbit;
ios_base::iostate errorstate = good;
// basic construction
locale loc_c = locale::classic();
iterator_type end;
wistringstream iss;
iss.imbue(loc_c);
const time_get<wchar_t>& tim_get =
use_facet<time_get<wchar_t> >(iss.getloc());
iss.str(L"Jul");
iterator_type is_it01(iss);
tm time01;
errorstate = good;
tim_get.get_monthname(is_it01, end, iss, errorstate, &time01);
VERIFY( time01.tm_mon == 6 );
VERIFY( errorstate == ios_base::eofbit );
}
int main()
{
test01();
return 0;
}
// 2001-09-21 Benjamin Kosnik <bkoz@redhat.com> // 2001-09-21 Benjamin Kosnik <bkoz@redhat.com>
// Copyright (C) 2001, 2002, 2003 Free Software Foundation // Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation
// //
// This file is part of the GNU ISO C++ Library. This library is free // 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 // software; you can redistribute it and/or modify it under the
...@@ -28,18 +28,13 @@ void test01() ...@@ -28,18 +28,13 @@ void test01()
{ {
using namespace std; using namespace std;
bool test __attribute__((unused)) = true; bool test __attribute__((unused)) = true;
typedef time_base::dateorder dateorder;
typedef istreambuf_iterator<char> iterator_type; typedef istreambuf_iterator<char> iterator_type;
// basic construction and sanity checks. // basic construction and sanity checks.
locale loc_c = locale::classic(); locale loc_c = locale::classic();
locale loc_hk = __gnu_test::try_named_locale("en_HK");
locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
locale loc_de = __gnu_test::try_named_locale("de_DE"); locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c ); VERIFY( loc_de != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
VERIFY( loc_de != loc_fr );
const string empty; const string empty;
......
// 2001-09-21 Benjamin Kosnik <bkoz@redhat.com> // 2001-09-21 Benjamin Kosnik <bkoz@redhat.com>
// Copyright (C) 2001, 2002, 2003 Free Software Foundation // Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation
// //
// This file is part of the GNU ISO C++ Library. This library is free // 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 // software; you can redistribute it and/or modify it under the
...@@ -28,18 +28,13 @@ void test02() ...@@ -28,18 +28,13 @@ void test02()
{ {
using namespace std; using namespace std;
bool test __attribute__((unused)) = true; bool test __attribute__((unused)) = true;
typedef time_base::dateorder dateorder;
typedef istreambuf_iterator<char> iterator_type; typedef istreambuf_iterator<char> iterator_type;
// basic construction and sanity checks. // basic construction and sanity check
locale loc_c = locale::classic(); locale loc_c = locale::classic();
locale loc_hk = __gnu_test::try_named_locale("en_HK"); locale loc_hk = __gnu_test::try_named_locale("en_HK");
locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c ); VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
VERIFY( loc_de != loc_fr );
const string empty; const string empty;
const tm time_bday = { 0, 0, 12, 4, 3, 71, 0, 93, 0 }; const tm time_bday = { 0, 0, 12, 4, 3, 71, 0, 93, 0 };
......
// 2001-09-21 Benjamin Kosnik <bkoz@redhat.com> // 2001-09-21 Benjamin Kosnik <bkoz@redhat.com>
// Copyright (C) 2001, 2002, 2003 Free Software Foundation // Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation
// //
// This file is part of the GNU ISO C++ Library. This library is free // 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 // software; you can redistribute it and/or modify it under the
...@@ -28,18 +28,13 @@ void test01() ...@@ -28,18 +28,13 @@ void test01()
{ {
using namespace std; using namespace std;
bool test __attribute__((unused)) = true; bool test __attribute__((unused)) = true;
typedef time_base::dateorder dateorder;
typedef istreambuf_iterator<wchar_t> iterator_type; typedef istreambuf_iterator<wchar_t> iterator_type;
// basic construction and sanity checks. // basic construction and sanity checks.
locale loc_c = locale::classic(); locale loc_c = locale::classic();
locale loc_hk = __gnu_test::try_named_locale("en_HK");
locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
locale loc_de = __gnu_test::try_named_locale("de_DE"); locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c ); VERIFY( loc_de != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
VERIFY( loc_de != loc_fr );
const wstring empty; const wstring empty;
......
// 2001-09-21 Benjamin Kosnik <bkoz@redhat.com> // 2001-09-21 Benjamin Kosnik <bkoz@redhat.com>
// Copyright (C) 2001, 2002, 2003 Free Software Foundation // Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation
// //
// This file is part of the GNU ISO C++ Library. This library is free // 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 // software; you can redistribute it and/or modify it under the
...@@ -28,18 +28,13 @@ void test02() ...@@ -28,18 +28,13 @@ void test02()
{ {
using namespace std; using namespace std;
bool test __attribute__((unused)) = true; bool test __attribute__((unused)) = true;
typedef time_base::dateorder dateorder;
typedef istreambuf_iterator<wchar_t> iterator_type; typedef istreambuf_iterator<wchar_t> iterator_type;
// basic construction and sanity checks. // basic construction and sanity check
locale loc_c = locale::classic(); locale loc_c = locale::classic();
locale loc_hk = __gnu_test::try_named_locale("en_HK"); locale loc_hk = __gnu_test::try_named_locale("en_HK");
locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c ); VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
VERIFY( loc_de != loc_fr );
const wstring empty; const wstring empty;
const tm time_bday = { 0, 0, 12, 4, 3, 71, 0, 93, 0 }; const tm time_bday = { 0, 0, 12, 4, 3, 71, 0, 93, 0 };
......
// 2001-09-21 Benjamin Kosnik <bkoz@redhat.com> // 2001-09-21 Benjamin Kosnik <bkoz@redhat.com>
// Copyright (C) 2001, 2002, 2003 Free Software Foundation // Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation
// //
// This file is part of the GNU ISO C++ Library. This library is free // 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 // software; you can redistribute it and/or modify it under the
...@@ -27,20 +27,12 @@ ...@@ -27,20 +27,12 @@
void test01() void test01()
{ {
using namespace std; using namespace std;
typedef time_base::dateorder dateorder;
typedef istreambuf_iterator<char> iterator_type;
bool test __attribute__((unused)) = true; bool test __attribute__((unused)) = true;
// basic construction and sanity checks. typedef istreambuf_iterator<char> iterator_type;
// basic construction
locale loc_c = locale::classic(); locale loc_c = locale::classic();
locale loc_hk = __gnu_test::try_named_locale("en_HK");
locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
VERIFY( loc_de != loc_fr );
const string empty; const string empty;
......
// 2001-09-21 Benjamin Kosnik <bkoz@redhat.com> // 2001-09-21 Benjamin Kosnik <bkoz@redhat.com>
// Copyright (C) 2001, 2002, 2003 Free Software Foundation // Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation
// //
// This file is part of the GNU ISO C++ Library. This library is free // 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 // software; you can redistribute it and/or modify it under the
...@@ -26,21 +26,17 @@ ...@@ -26,21 +26,17 @@
void test02() void test02()
{ {
using namespace std; using namespace std;
typedef time_base::dateorder dateorder;
typedef istreambuf_iterator<char> iterator_type;
bool test __attribute__((unused)) = true; bool test __attribute__((unused)) = true;
typedef istreambuf_iterator<char> iterator_type;
// basic construction and sanity checks. // basic construction and sanity checks.
locale loc_c = locale::classic(); locale loc_c = locale::classic();
locale loc_hk = __gnu_test::try_named_locale("en_HK"); locale loc_hk = __gnu_test::try_named_locale("en_HK");
locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
locale loc_de = __gnu_test::try_named_locale("de_DE"); locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c ); VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de ); VERIFY( loc_hk != loc_de );
VERIFY( loc_de != loc_fr );
const string empty; const string empty;
......
// 2001-09-21 Benjamin Kosnik <bkoz@redhat.com> // 2001-09-21 Benjamin Kosnik <bkoz@redhat.com>
// Copyright (C) 2001, 2002, 2003 Free Software Foundation // Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation
// //
// This file is part of the GNU ISO C++ Library. This library is free // 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 // software; you can redistribute it and/or modify it under the
...@@ -27,20 +27,12 @@ ...@@ -27,20 +27,12 @@
void test01() void test01()
{ {
using namespace std; using namespace std;
typedef time_base::dateorder dateorder;
typedef istreambuf_iterator<wchar_t> iterator_type;
bool test __attribute__((unused)) = true; bool test __attribute__((unused)) = true;
// basic construction and sanity checks. typedef istreambuf_iterator<wchar_t> iterator_type;
// basic construction
locale loc_c = locale::classic(); locale loc_c = locale::classic();
locale loc_hk = __gnu_test::try_named_locale("en_HK");
locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
VERIFY( loc_de != loc_fr );
const wstring empty; const wstring empty;
......
...@@ -26,21 +26,17 @@ ...@@ -26,21 +26,17 @@
void test02() void test02()
{ {
using namespace std; using namespace std;
typedef time_base::dateorder dateorder;
typedef istreambuf_iterator<wchar_t> iterator_type;
bool test __attribute__((unused)) = true; bool test __attribute__((unused)) = true;
typedef istreambuf_iterator<wchar_t> iterator_type;
// basic construction and sanity checks. // basic construction and sanity checks.
locale loc_c = locale::classic(); locale loc_c = locale::classic();
locale loc_hk = __gnu_test::try_named_locale("en_HK"); locale loc_hk = __gnu_test::try_named_locale("en_HK");
locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
locale loc_de = __gnu_test::try_named_locale("de_DE"); locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c ); VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de ); VERIFY( loc_hk != loc_de );
VERIFY( loc_de != loc_fr );
const wstring empty; const wstring empty;
......
// 2001-09-21 Benjamin Kosnik <bkoz@redhat.com> // 2001-09-21 Benjamin Kosnik <bkoz@redhat.com>
// Copyright (C) 2001, 2002, 2003 Free Software Foundation // Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation
// //
// This file is part of the GNU ISO C++ Library. This library is free // 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 // software; you can redistribute it and/or modify it under the
...@@ -27,20 +27,12 @@ ...@@ -27,20 +27,12 @@
void test01() void test01()
{ {
using namespace std; using namespace std;
typedef time_base::dateorder dateorder;
typedef istreambuf_iterator<char> iterator_type;
bool test __attribute__((unused)) = true; bool test __attribute__((unused)) = true;
// basic construction and sanity checks. typedef istreambuf_iterator<char> iterator_type;
// basic construction
locale loc_c = locale::classic(); locale loc_c = locale::classic();
locale loc_hk = __gnu_test::try_named_locale("en_HK");
locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
VERIFY( loc_de != loc_fr );
const string empty; const string empty;
......
// 2001-09-21 Benjamin Kosnik <bkoz@redhat.com> // 2001-09-21 Benjamin Kosnik <bkoz@redhat.com>
// Copyright (C) 2001, 2002, 2003 Free Software Foundation // Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation
// //
// This file is part of the GNU ISO C++ Library. This library is free // 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 // software; you can redistribute it and/or modify it under the
...@@ -27,20 +27,12 @@ ...@@ -27,20 +27,12 @@
void test01() void test01()
{ {
using namespace std; using namespace std;
typedef time_base::dateorder dateorder;
typedef istreambuf_iterator<wchar_t> iterator_type;
bool test __attribute__((unused)) = true; bool test __attribute__((unused)) = true;
// basic construction and sanity checks. typedef istreambuf_iterator<wchar_t> iterator_type;
// basic construction
locale loc_c = locale::classic(); locale loc_c = locale::classic();
locale loc_hk = __gnu_test::try_named_locale("en_HK");
locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
VERIFY( loc_de != loc_fr );
const wstring empty; const wstring empty;
......
// 2001-09-17 Benjamin Kosnik <bkoz@redhat.com> // 2001-09-17 Benjamin Kosnik <bkoz@redhat.com>
// Copyright (C) 2001, 2002, 2003 Free Software Foundation // Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation
// //
// This file is part of the GNU ISO C++ Library. This library is free // 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 // software; you can redistribute it and/or modify it under the
...@@ -34,15 +34,8 @@ void test01() ...@@ -34,15 +34,8 @@ void test01()
// create "C" time objects // create "C" time objects
tm time1 = { 0, 0, 12, 4, 3, 71, 0, 93, 0 }; tm time1 = { 0, 0, 12, 4, 3, 71, 0, 93, 0 };
// basic construction and sanity checks. // basic construction
locale loc_c = locale::classic(); locale loc_c = locale::classic();
locale loc_hk = __gnu_test::try_named_locale("en_HK");
locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
VERIFY( loc_de != loc_fr );
// create an ostream-derived object, cache the time_put facet // create an ostream-derived object, cache the time_put facet
const string empty; const string empty;
......
// 2001-09-17 Benjamin Kosnik <bkoz@redhat.com> // 2001-09-17 Benjamin Kosnik <bkoz@redhat.com>
// Copyright (C) 2001, 2002, 2003 Free Software Foundation // Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation
// //
// This file is part of the GNU ISO C++ Library. This library is free // 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 // software; you can redistribute it and/or modify it under the
...@@ -31,18 +31,13 @@ void test02() ...@@ -31,18 +31,13 @@ void test02()
bool test __attribute__((unused)) = true; bool test __attribute__((unused)) = true;
// create "C" time objects // create "C" time object
tm time1 = { 0, 0, 12, 4, 3, 71, 0, 93, 0 }; tm time1 = { 0, 0, 12, 4, 3, 71, 0, 93, 0 };
// basic construction and sanity checks. // basic construction and sanity check
locale loc_c = locale::classic(); locale loc_c = locale::classic();
locale loc_hk = __gnu_test::try_named_locale("en_HK");
locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
locale loc_de = __gnu_test::try_named_locale("de_DE"); locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c ); VERIFY( loc_de != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
VERIFY( loc_de != loc_fr );
// create an ostream-derived object, cache the time_put facet // create an ostream-derived object, cache the time_put facet
const string empty; const string empty;
......
// 2001-09-17 Benjamin Kosnik <bkoz@redhat.com> // 2001-09-17 Benjamin Kosnik <bkoz@redhat.com>
// Copyright (C) 2001, 2002, 2003 Free Software Foundation // Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation
// //
// This file is part of the GNU ISO C++ Library. This library is free // 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 // software; you can redistribute it and/or modify it under the
...@@ -34,15 +34,10 @@ void test03() ...@@ -34,15 +34,10 @@ void test03()
// create "C" time objects // create "C" time objects
tm time1 = { 0, 0, 12, 4, 3, 71, 0, 93, 0 }; tm time1 = { 0, 0, 12, 4, 3, 71, 0, 93, 0 };
// basic construction and sanity checks. // basic construction and sanity check.
locale loc_c = locale::classic(); locale loc_c = locale::classic();
locale loc_hk = __gnu_test::try_named_locale("en_HK"); locale loc_hk = __gnu_test::try_named_locale("en_HK");
locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c ); VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
VERIFY( loc_de != loc_fr );
// create an ostream-derived object, cache the time_put facet // create an ostream-derived object, cache the time_put facet
const string empty; const string empty;
......
// 2001-09-17 Benjamin Kosnik <bkoz@redhat.com> // 2001-09-17 Benjamin Kosnik <bkoz@redhat.com>
// Copyright (C) 2001, 2002, 2003 Free Software Foundation // Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation
// //
// This file is part of the GNU ISO C++ Library. This library is free // 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 // software; you can redistribute it and/or modify it under the
...@@ -34,15 +34,10 @@ void test04() ...@@ -34,15 +34,10 @@ void test04()
// create "C" time objects // create "C" time objects
tm time1 = { 0, 0, 12, 4, 3, 71, 0, 93, 0 }; tm time1 = { 0, 0, 12, 4, 3, 71, 0, 93, 0 };
// basic construction and sanity checks. // basic construction and sanity check
locale loc_c = locale::classic(); locale loc_c = locale::classic();
locale loc_hk = __gnu_test::try_named_locale("en_HK");
locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro"); locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
locale loc_de = __gnu_test::try_named_locale("de_DE"); VERIFY( loc_fr != loc_c );
VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
VERIFY( loc_de != loc_fr );
// create an ostream-derived object, cache the time_put facet // create an ostream-derived object, cache the time_put facet
const string empty; const string empty;
......
// 2001-09-17 Benjamin Kosnik <bkoz@redhat.com> // 2001-09-17 Benjamin Kosnik <bkoz@redhat.com>
// Copyright (C) 2001, 2002, 2003 Free Software Foundation // Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation
// //
// This file is part of the GNU ISO C++ Library. This library is free // 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 // software; you can redistribute it and/or modify it under the
...@@ -37,21 +37,14 @@ void test05() ...@@ -37,21 +37,14 @@ void test05()
const char* date = "%A, the second of %B"; const char* date = "%A, the second of %B";
const char* date_ex = "%Ex"; const char* date_ex = "%Ex";
// basic construction and sanity checks. // basic construction
locale loc_c = locale::classic(); locale loc_c = locale::classic();
locale loc_hk = __gnu_test::try_named_locale("en_HK");
locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
VERIFY( loc_de != loc_fr );
// create an ostream-derived object, cache the time_put facet // create an ostream-derived object, cache the time_put facet
const string empty; const string empty;
ostringstream oss; ostringstream oss;
oss.imbue(loc_c); oss.imbue(loc_c);
const time_put<char>& tim_put = use_facet<time_put<char> >(oss.getloc()); const time_put<char>& tim_put = use_facet<time_put<char> >(oss.getloc());
// 2 // 2
oss.str(empty); oss.str(empty);
......
// 2001-09-17 Benjamin Kosnik <bkoz@redhat.com> // 2001-09-17 Benjamin Kosnik <bkoz@redhat.com>
// Copyright (C) 2001, 2002, 2003 Free Software Foundation // Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation
// //
// This file is part of the GNU ISO C++ Library. This library is free // 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 // software; you can redistribute it and/or modify it under the
...@@ -37,15 +37,10 @@ void test06() ...@@ -37,15 +37,10 @@ void test06()
const char* date = "%A, the second of %B"; const char* date = "%A, the second of %B";
const char* date_ex = "%Ex"; const char* date_ex = "%Ex";
// basic construction and sanity checks. // basic construction and sanity check
locale loc_c = locale::classic(); locale loc_c = locale::classic();
locale loc_hk = __gnu_test::try_named_locale("en_HK");
locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
locale loc_de = __gnu_test::try_named_locale("de_DE"); locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c ); VERIFY( loc_de != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
VERIFY( loc_de != loc_fr );
// create an ostream-derived object, cache the time_put facet // create an ostream-derived object, cache the time_put facet
const string empty; const string empty;
......
// 2001-09-17 Benjamin Kosnik <bkoz@redhat.com> // 2001-09-17 Benjamin Kosnik <bkoz@redhat.com>
// Copyright (C) 2001, 2002, 2003 Free Software Foundation // Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation
// //
// This file is part of the GNU ISO C++ Library. This library is free // 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 // software; you can redistribute it and/or modify it under the
...@@ -37,16 +37,10 @@ void test07() ...@@ -37,16 +37,10 @@ void test07()
const char* date = "%A, the second of %B"; const char* date = "%A, the second of %B";
const char* date_ex = "%Ex"; const char* date_ex = "%Ex";
// basic construction and sanity check
// basic construction and sanity checks.
locale loc_c = locale::classic(); locale loc_c = locale::classic();
locale loc_hk = __gnu_test::try_named_locale("en_HK"); locale loc_hk = __gnu_test::try_named_locale("en_HK");
locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c ); VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
VERIFY( loc_de != loc_fr );
// create an ostream-derived object, cache the time_put facet // create an ostream-derived object, cache the time_put facet
const string empty; const string empty;
......
// 2001-09-17 Benjamin Kosnik <bkoz@redhat.com> // 2001-09-17 Benjamin Kosnik <bkoz@redhat.com>
// Copyright (C) 2001, 2002, 2003 Free Software Foundation // Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation
// //
// This file is part of the GNU ISO C++ Library. This library is free // 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 // software; you can redistribute it and/or modify it under the
...@@ -37,15 +37,10 @@ void test08() ...@@ -37,15 +37,10 @@ void test08()
const char* date = "%A, the second of %B"; const char* date = "%A, the second of %B";
const char* date_ex = "%Ex"; const char* date_ex = "%Ex";
// basic construction and sanity checks. // basic construction and sanity check
locale loc_c = locale::classic(); locale loc_c = locale::classic();
locale loc_hk = __gnu_test::try_named_locale("en_HK");
locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro"); locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
locale loc_de = __gnu_test::try_named_locale("de_DE"); VERIFY( loc_fr != loc_c );
VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
VERIFY( loc_de != loc_fr );
// create an ostream-derived object, cache the time_put facet // create an ostream-derived object, cache the time_put facet
const string empty; const string empty;
......
...@@ -61,7 +61,7 @@ int main() ...@@ -61,7 +61,7 @@ int main()
/* /*
The problems with the first approach, as above, are numerous. The problems with the first approach, as above, are numerous.
1) Then locale usage and design for formatters and parers becomes 1) The locale usage and design for formatters and parsers becomes
fragmented. On one side, num_put and money_put, and on the other, fragmented. On one side, num_put and money_put, and on the other,
time_put. This inconsistency is not useful. time_put. This inconsistency is not useful.
...@@ -79,7 +79,7 @@ The problems with the first approach, as above, are numerous. ...@@ -79,7 +79,7 @@ The problems with the first approach, as above, are numerous.
time_put<charT,OutputIterator> provide date and time formatting and time_put<charT,OutputIterator> provide date and time formatting and
parsing. All specifications of member functions for time_put and parsing. All specifications of member functions for time_put and
time_get in the subclauses of lib.category.time only apply to the time_get in the subclauses of lib.category.time only apply to the
instantiations required in Tables ?? and ?? instantiations required in Tables 51 and 52
(lib.locale.category). Their members use their ios_base&, (lib.locale.category). Their members use their ios_base&,
ios_base::iostate&, and fill arguments as described in ios_base::iostate&, and fill arguments as described in
(lib.locale.categories), and the ctype<> facet, to determine (lib.locale.categories), and the ctype<> facet, to determine
......
// 2001-09-17 Benjamin Kosnik <bkoz@redhat.com> // 2001-09-17 Benjamin Kosnik <bkoz@redhat.com>
// Copyright (C) 2001, 2002, 2003 Free Software Foundation // Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation
// //
// This file is part of the GNU ISO C++ Library. This library is free // 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 // software; you can redistribute it and/or modify it under the
...@@ -34,15 +34,8 @@ void test01() ...@@ -34,15 +34,8 @@ void test01()
// create "C" time objects // create "C" time objects
tm time1 = { 0, 0, 12, 4, 3, 71, 0, 93, 0 }; tm time1 = { 0, 0, 12, 4, 3, 71, 0, 93, 0 };
// basic construction and sanity checks. // basic construction
locale loc_c = locale::classic(); locale loc_c = locale::classic();
locale loc_hk = __gnu_test::try_named_locale("en_HK");
locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
VERIFY( loc_de != loc_fr );
// create an ostream-derived object, cache the time_put facet // create an ostream-derived object, cache the time_put facet
const wstring empty; const wstring empty;
......
// 2001-09-17 Benjamin Kosnik <bkoz@redhat.com> // 2001-09-17 Benjamin Kosnik <bkoz@redhat.com>
// Copyright (C) 2001, 2002, 2003 Free Software Foundation // Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation
// //
// This file is part of the GNU ISO C++ Library. This library is free // 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 // software; you can redistribute it and/or modify it under the
...@@ -34,15 +34,10 @@ void test02() ...@@ -34,15 +34,10 @@ void test02()
// create "C" time objects // create "C" time objects
tm time1 = { 0, 0, 12, 4, 3, 71, 0, 93, 0 }; tm time1 = { 0, 0, 12, 4, 3, 71, 0, 93, 0 };
// basic construction and sanity checks. // basic construction and sanity check
locale loc_c = locale::classic(); locale loc_c = locale::classic();
locale loc_hk = __gnu_test::try_named_locale("en_HK");
locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
locale loc_de = __gnu_test::try_named_locale("de_DE"); locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c ); VERIFY( loc_de != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
VERIFY( loc_de != loc_fr );
// create an ostream-derived object, cache the time_put facet // create an ostream-derived object, cache the time_put facet
const wstring empty; const wstring empty;
......
// 2001-09-17 Benjamin Kosnik <bkoz@redhat.com> // 2001-09-17 Benjamin Kosnik <bkoz@redhat.com>
// Copyright (C) 2001, 2002, 2003 Free Software Foundation // Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation
// //
// This file is part of the GNU ISO C++ Library. This library is free // 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 // software; you can redistribute it and/or modify it under the
...@@ -34,15 +34,10 @@ void test03() ...@@ -34,15 +34,10 @@ void test03()
// create "C" time objects // create "C" time objects
tm time1 = { 0, 0, 12, 4, 3, 71, 0, 93, 0 }; tm time1 = { 0, 0, 12, 4, 3, 71, 0, 93, 0 };
// basic construction and sanity checks. // basic construction and sanity check
locale loc_c = locale::classic(); locale loc_c = locale::classic();
locale loc_hk = __gnu_test::try_named_locale("en_HK"); locale loc_hk = __gnu_test::try_named_locale("en_HK");
locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c ); VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
VERIFY( loc_de != loc_fr );
// create an ostream-derived object, cache the time_put facet // create an ostream-derived object, cache the time_put facet
const wstring empty; const wstring empty;
......
// 2001-09-17 Benjamin Kosnik <bkoz@redhat.com> // 2001-09-17 Benjamin Kosnik <bkoz@redhat.com>
// Copyright (C) 2001, 2002, 2003 Free Software Foundation // Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation
// //
// This file is part of the GNU ISO C++ Library. This library is free // 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 // software; you can redistribute it and/or modify it under the
...@@ -34,15 +34,10 @@ void test04() ...@@ -34,15 +34,10 @@ void test04()
// create "C" time objects // create "C" time objects
tm time1 = { 0, 0, 12, 4, 3, 71, 0, 93, 0 }; tm time1 = { 0, 0, 12, 4, 3, 71, 0, 93, 0 };
// basic construction and sanity checks. // basic construction and sanity check
locale loc_c = locale::classic(); locale loc_c = locale::classic();
locale loc_hk = __gnu_test::try_named_locale("en_HK");
locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro"); locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
locale loc_de = __gnu_test::try_named_locale("de_DE"); VERIFY( loc_fr != loc_c );
VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
VERIFY( loc_de != loc_fr );
// create an ostream-derived object, cache the time_put facet // create an ostream-derived object, cache the time_put facet
const wstring empty; const wstring empty;
......
// 2001-09-17 Benjamin Kosnik <bkoz@redhat.com> // 2001-09-17 Benjamin Kosnik <bkoz@redhat.com>
// Copyright (C) 2001, 2002, 2003 Free Software Foundation // Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation
// //
// This file is part of the GNU ISO C++ Library. This library is free // 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 // software; you can redistribute it and/or modify it under the
...@@ -37,15 +37,8 @@ void test05() ...@@ -37,15 +37,8 @@ void test05()
const wchar_t* date = L"%A, the second of %B"; const wchar_t* date = L"%A, the second of %B";
const wchar_t* date_ex = L"%Ex"; const wchar_t* date_ex = L"%Ex";
// basic construction and sanity checks. // basic construction
locale loc_c = locale::classic(); locale loc_c = locale::classic();
locale loc_hk = __gnu_test::try_named_locale("en_HK");
locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
VERIFY( loc_de != loc_fr );
// create an ostream-derived object, cache the time_put facet // create an ostream-derived object, cache the time_put facet
const wstring empty; const wstring empty;
......
// 2001-09-17 Benjamin Kosnik <bkoz@redhat.com> // 2001-09-17 Benjamin Kosnik <bkoz@redhat.com>
// Copyright (C) 2001, 2002, 2003 Free Software Foundation // Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation
// //
// This file is part of the GNU ISO C++ Library. This library is free // 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 // software; you can redistribute it and/or modify it under the
...@@ -37,15 +37,10 @@ void test06() ...@@ -37,15 +37,10 @@ void test06()
const wchar_t* date = L"%A, the second of %B"; const wchar_t* date = L"%A, the second of %B";
const wchar_t* date_ex = L"%Ex"; const wchar_t* date_ex = L"%Ex";
// basic construction and sanity checks. // basic construction and sanity check
locale loc_c = locale::classic(); locale loc_c = locale::classic();
locale loc_hk = __gnu_test::try_named_locale("en_HK");
locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
locale loc_de = __gnu_test::try_named_locale("de_DE"); locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c ); VERIFY( loc_de != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
VERIFY( loc_de != loc_fr );
// create an ostream-derived object, cache the time_put facet // create an ostream-derived object, cache the time_put facet
const wstring empty; const wstring empty;
......
// 2001-09-17 Benjamin Kosnik <bkoz@redhat.com> // 2001-09-17 Benjamin Kosnik <bkoz@redhat.com>
// Copyright (C) 2001, 2002, 2003 Free Software Foundation // Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation
// //
// This file is part of the GNU ISO C++ Library. This library is free // 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 // software; you can redistribute it and/or modify it under the
...@@ -37,15 +37,10 @@ void test07() ...@@ -37,15 +37,10 @@ void test07()
const wchar_t* date = L"%A, the second of %B"; const wchar_t* date = L"%A, the second of %B";
const wchar_t* date_ex = L"%Ex"; const wchar_t* date_ex = L"%Ex";
// basic construction and sanity checks. // basic construction and sanity check
locale loc_c = locale::classic(); locale loc_c = locale::classic();
locale loc_hk = __gnu_test::try_named_locale("en_HK"); locale loc_hk = __gnu_test::try_named_locale("en_HK");
locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
locale loc_de = __gnu_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c ); VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
VERIFY( loc_de != loc_fr );
// create an ostream-derived object, cache the time_put facet // create an ostream-derived object, cache the time_put facet
const wstring empty; const wstring empty;
......
// 2001-09-17 Benjamin Kosnik <bkoz@redhat.com> // 2001-09-17 Benjamin Kosnik <bkoz@redhat.com>
// Copyright (C) 2001, 2002, 2003 Free Software Foundation // Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation
// //
// This file is part of the GNU ISO C++ Library. This library is free // 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 // software; you can redistribute it and/or modify it under the
...@@ -37,15 +37,10 @@ void test08() ...@@ -37,15 +37,10 @@ void test08()
const wchar_t* date = L"%A, the second of %B"; const wchar_t* date = L"%A, the second of %B";
const wchar_t* date_ex = L"%Ex"; const wchar_t* date_ex = L"%Ex";
// basic construction and sanity checks. // basic construction and sanity check
locale loc_c = locale::classic(); locale loc_c = locale::classic();
locale loc_hk = __gnu_test::try_named_locale("en_HK");
locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro"); locale loc_fr = __gnu_test::try_named_locale("fr_FR@euro");
locale loc_de = __gnu_test::try_named_locale("de_DE"); VERIFY( loc_fr != loc_c );
VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
VERIFY( loc_de != loc_fr );
// create an ostream-derived object, cache the time_put facet // create an ostream-derived object, cache the time_put facet
const wstring empty; const wstring empty;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment