+2003-04-14 Andreas Tobler <toa@pop.agri.ch>
+ Benjamin Kosnik <bkoz@redhat.com>
+
+ * config/os/generic/ctype_inline.h: Fix.
+
+2003-04-14 Benjamin Kosnik <bkoz@redhat.com>
+
+ * testsuite/testsuite_hooks.h
+ (__gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher):
+ Change to run_named_locale_test.
+ * testsuite/testsuite_hooks.cc (__gnu_cxx_test): Same.
+
+ * testsuite/22_locale/codecvt/always_noconv/wchar_t/2.cc: Use
+ run_test_named_locale.
+ * testsuite/22_locale/codecvt/always_noconv/wchar_t/3.cc: Same.
+ * testsuite/22_locale/codecvt/always_noconv/wchar_t/4.cc: Same.
+ * testsuite/22_locale/codecvt/encoding/wchar_t/2.cc: Same.
+ * testsuite/22_locale/codecvt/encoding/wchar_t/3.cc: Same.
+ * testsuite/22_locale/codecvt/encoding/wchar_t/4.cc: Same.
+ * testsuite/22_locale/codecvt/in/wchar_t/2.cc: Same.
+ * testsuite/22_locale/codecvt/in/wchar_t/3.cc: Same.
+ * testsuite/22_locale/codecvt/in/wchar_t/4.cc: Same.
+ * testsuite/22_locale/codecvt/in/wchar_t/7.cc: Same.
+ * testsuite/22_locale/codecvt/in/wchar_t/8.cc: Same.
+ * testsuite/22_locale/codecvt/in/wchar_t/9.cc: Same.
+ * testsuite/22_locale/codecvt/length/wchar_t/2.cc: Same.
+ * testsuite/22_locale/codecvt/length/wchar_t/3.cc: Same.
+ * testsuite/22_locale/codecvt/length/wchar_t/4.cc: Same.
+ * testsuite/22_locale/codecvt/length/wchar_t/7.cc: Same.
+ * testsuite/22_locale/codecvt/max_length/wchar_t/2.cc: Same.
+ * testsuite/22_locale/codecvt/max_length/wchar_t/3.cc: Same.
+ * testsuite/22_locale/codecvt/max_length/wchar_t/4.cc: Same.
+ * testsuite/22_locale/codecvt/out/wchar_t/2.cc: Same.
+ * testsuite/22_locale/codecvt/out/wchar_t/3.cc: Same.
+ * testsuite/22_locale/codecvt/out/wchar_t/4.cc: Same.
+ * testsuite/22_locale/codecvt/out/wchar_t/7.cc: Same.
+ * testsuite/22_locale/codecvt/unshift/wchar_t/2.cc: Same.
+ * testsuite/22_locale/codecvt/unshift/wchar_t/3.cc: Same.
+ * testsuite/22_locale/codecvt/unshift/wchar_t/4.cc: Same.
+ * testsuite/22_locale/collate/compare/char/1.cc: Same.
+ * testsuite/22_locale/collate/compare/char/2.cc: Same.
+ * testsuite/22_locale/collate/compare/char/3.cc: Same.
+ * testsuite/22_locale/collate/compare/wchar_t/1.cc: Same.
+ * testsuite/22_locale/collate/compare/wchar_t/2.cc: Same.
+ * testsuite/22_locale/collate/compare/wchar_t/3.cc: Same.
+ * testsuite/22_locale/collate/hash/char/2.cc: Same.
+ * testsuite/22_locale/collate/hash/wchar_t/2.cc: Same.
+ * testsuite/22_locale/collate/transform/char/2.cc: Same.
+ * testsuite/22_locale/collate/transform/char/3.cc: Same.
+ * testsuite/22_locale/collate/transform/wchar_t/2.cc: Same.
+ * testsuite/22_locale/collate/transform/wchar_t/3.cc: Same.
+ * testsuite/22_locale/collate_byname/1.cc: Same.
+ * testsuite/22_locale/ctype/is/char/2.cc: Same.
+ * testsuite/22_locale/ctype/is/wchar_t/2.cc: Same.
+ * testsuite/22_locale/ctype/narrow/wchar_t/3.cc: Same.
+ * testsuite/22_locale/ctype/widen/wchar_t/2.cc: Same.
+ * testsuite/22_locale/ctype/widen/wchar_t/3.cc: Same.
+ * testsuite/22_locale/facet/2.cc: Same.
+ * testsuite/22_locale/locale/cons/2.cc: Same.
+ * testsuite/22_locale/locale/cons/4.cc: Same.
+ * testsuite/22_locale/locale/cons/5.cc: Same.
+ * testsuite/22_locale/locale/cons/7.cc: Same.
+ * testsuite/22_locale/locale/cons/7222-c.cc: Same.
+ * testsuite/22_locale/locale/cons/7222-env.cc: Same.
+ * testsuite/22_locale/locale/global_locale_objects/2.cc: Same.
+ * testsuite/22_locale/messages/members/char/1.cc: Same.
+ * testsuite/22_locale/messages/members/char/2.cc: Same.
+ * testsuite/22_locale/messages/members/char/3.cc: Same.
+ * testsuite/22_locale/messages_byname/1.cc: Same.
+ * testsuite/22_locale/money_get/get/char/1.cc: Same.
+ * testsuite/22_locale/money_get/get/char/2.cc: Same.
+ * testsuite/22_locale/money_get/get/char/3.cc: Same.
+ * testsuite/22_locale/money_get/get/char/4.cc: Same.
+ * testsuite/22_locale/money_get/get/wchar_t/1.cc: Same.
+ * testsuite/22_locale/money_get/get/wchar_t/2.cc: Same.
+ * testsuite/22_locale/money_get/get/wchar_t/3.cc: Same.
+ * testsuite/22_locale/money_get/get/wchar_t/4.cc: Same.
+ * testsuite/22_locale/money_put/put/char/1.cc: Same.
+ * testsuite/22_locale/money_put/put/char/2.cc: Same.
+ * testsuite/22_locale/money_put/put/char/3.cc: Same.
+ * testsuite/22_locale/money_put/put/wchar_t/1.cc: Same.
+ * testsuite/22_locale/money_put/put/wchar_t/2.cc: Same.
+ * testsuite/22_locale/money_put/put/wchar_t/3.cc: Same.
+ * testsuite/22_locale/moneypunct/members/char/2.cc: Same.
+ * testsuite/22_locale/moneypunct/members/wchar_t/2.cc: Same.
+ * testsuite/22_locale/moneypunct_byname/1.cc: Same.
+ * testsuite/22_locale/num_get/get/char/1.cc: Same.
+ * testsuite/22_locale/num_get/get/char/2.cc: Same.
+ * testsuite/22_locale/num_get/get/char/3.cc: Same.
+ * testsuite/22_locale/num_get/get/char/5.cc: Same.
+ * testsuite/22_locale/num_get/get/char/6.cc: Same.
+ * testsuite/22_locale/num_get/get/wchar_t/1.cc: Same.
+ * testsuite/22_locale/num_get/get/wchar_t/2.cc: Same.
+ * testsuite/22_locale/num_get/get/wchar_t/3.cc: Same.
+ * testsuite/22_locale/num_get/get/wchar_t/5.cc: Same.
+ * testsuite/22_locale/num_get/get/wchar_t/6.cc: Same.
+ * testsuite/22_locale/num_put/put/char/1.cc: Same.
+ * testsuite/22_locale/num_put/put/char/2.cc: Same.
+ * testsuite/22_locale/num_put/put/char/3.cc: Same.
+ * testsuite/22_locale/num_put/put/char/5.cc: Same.
+ * testsuite/22_locale/num_put/put/wchar_t/1.cc: Same.
+ * testsuite/22_locale/num_put/put/wchar_t/2.cc: Same.
+ * testsuite/22_locale/num_put/put/wchar_t/3.cc: Same.
+ * testsuite/22_locale/num_put/put/wchar_t/5.cc: Same.
+ * testsuite/22_locale/numpunct/members/char/1.cc: Same.
+ * testsuite/22_locale/numpunct/members/char/2.cc: Same.
+ * testsuite/22_locale/numpunct/members/wchar_t/1.cc: Same.
+ * testsuite/22_locale/numpunct/members/wchar_t/2.cc: Same.
+ * testsuite/22_locale/numpunct_byname/1.cc: Same.
+ * testsuite/22_locale/numpunct_byname/2.cc: Same.
+ * testsuite/22_locale/time_get/date_order/char/1.cc: Same.
+ * testsuite/22_locale/time_get/date_order/wchar_t/1.cc: Same.
+ * testsuite/22_locale/time_get/get_date/char/1.cc: Same.
+ * testsuite/22_locale/time_get/get_date/char/2.cc: Same.
+ * testsuite/22_locale/time_get/get_date/wchar_t/1.cc: Same.
+ * testsuite/22_locale/time_get/get_date/wchar_t/2.cc: Same.
+ * testsuite/22_locale/time_get/get_monthname/char/1.cc: Same.
+ * testsuite/22_locale/time_get/get_monthname/char/2.cc: Same.
+ * testsuite/22_locale/time_get/get_monthname/wchar_t/1.cc: Same.
+ * testsuite/22_locale/time_get/get_monthname/wchar_t/2.cc: Same.
+ * testsuite/22_locale/time_get/get_time/char/1.cc: Same.
+ * testsuite/22_locale/time_get/get_time/char/2.cc: Same.
+ * testsuite/22_locale/time_get/get_time/wchar_t/1.cc: Same.
+ * testsuite/22_locale/time_get/get_time/wchar_t/2.cc: Same.
+ * testsuite/22_locale/time_get/get_weekday/char/1.cc: Same.
+ * testsuite/22_locale/time_get/get_weekday/char/2.cc: Same.
+ * testsuite/22_locale/time_get/get_weekday/wchar_t/1.cc: Same.
+ * testsuite/22_locale/time_get/get_weekday/wchar_t/2.cc: Same.
+ * testsuite/22_locale/time_get/get_year/char/1.cc: Same.
+ * testsuite/22_locale/time_get/get_year/wchar_t/1.cc: Same.
+ * testsuite/22_locale/time_put/put/char/1.cc: Same.
+ * testsuite/22_locale/time_put/put/char/2.cc: Same.
+ * testsuite/22_locale/time_put/put/char/3.cc: Same.
+ * testsuite/22_locale/time_put/put/char/4.cc: Same.
+ * testsuite/22_locale/time_put/put/char/5.cc: Same.
+ * testsuite/22_locale/time_put/put/char/6.cc: Same.
+ * testsuite/22_locale/time_put/put/char/7.cc: Same.
+ * testsuite/22_locale/time_put/put/char/8.cc: Same.
+ * testsuite/22_locale/time_put/put/wchar_t/1.cc: Same.
+ * testsuite/22_locale/time_put/put/wchar_t/2.cc: Same.
+ * testsuite/22_locale/time_put/put/wchar_t/3.cc: Same.
+ * testsuite/22_locale/time_put/put/wchar_t/4.cc: Same.
+ * testsuite/22_locale/time_put/put/wchar_t/5.cc: Same.
+ * testsuite/22_locale/time_put/put/wchar_t/6.cc: Same.
+ * testsuite/22_locale/time_put/put/wchar_t/7.cc: Same.
+ * testsuite/22_locale/time_put/put/wchar_t/8.cc: Same.
+ * testsuite/27_io/basic_filebuf/imbue/char/9322.cc: Same.
+ * testsuite/27_io/basic_ios/copyfmt/char/2.cc: Same.
+ * testsuite/27_io/basic_ostream/inserters_arithmetic/char/2.cc: Same.
+ * testsuite/27_io/basic_streambuf/imbue/char/9322.cc: Same.
+ * testsuite/27_io/basic_stringbuf/imbue/char/9322.cc: Same.
+
+2003-04-14 Andreas Tobler <toa@pop.agri.ch>
+
+ * configure.target (_cpu_incdir_fullpath): Solaris 2.9 uses
+ solaris includes, not generic.
+
2003-04-14 Loren J. Rittle <ljrittle@acm.org>
* testsuite/26_numerics/c99_classification_macros_c.cc: Add XFAIL.
// Wrapper for underlying C-language localization -*- C++ -*-
-// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+// Copyright (C) 2001, 2002, 2003 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
__c_locale)
{
__cloc = NULL;
- if (strcmp (__s, "C"))
+ if (strcmp(__s, "C"))
__throw_runtime_error("attempt to create locale from unhandled name in generic implementation; see http://gcc.gnu.org/ml/libstdc++/2003-02/msg00345.html");
}
// Locale support -*- C++ -*-
-// Copyright (C) 2000 Free Software Foundation, Inc.
+// Copyright (C) 2000, 2003 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
// functionality should be added for the native os in question: see
// the config/os/bits/ctype_*.h files.
+// Constructing a synthetic "C" table should be seriously considered...
+
bool
ctype<char>::
is(mask __m, char __c) const
{
- bool __ret;
- switch (__m)
+ if (_M_table)
+ return _M_table[static_cast<unsigned char>(__c)] & __m;
+ else
{
- case space:
- __ret = isspace(__c);
- break;
- case print:
- __ret = isprint(__c);
- break;
- case cntrl:
- __ret = iscntrl(__c);
- break;
- case upper:
- __ret = isupper(__c);
- break;
- case lower:
- __ret = islower(__c);
- break;
- case alpha:
- __ret = isalpha(__c);
- break;
- case digit:
- __ret = isdigit(__c);
- break;
- case punct:
- __ret = ispunct(__c);
- break;
- case xdigit:
- __ret = isxdigit(__c);
- break;
- case alnum:
- __ret = isalnum(__c);
- break;
- case graph:
- __ret = isgraph(__c);
- break;
- default:
- __ret = false;
- break;
+ bool __ret = true;
+ const int __bitmasksize = 11;
+ int __bitcur = 0; // Lowest bitmask in ctype_base == 0
+ for (;__ret && __bitcur < __bitmasksize; ++__bitcur)
+ {
+ mask __bit = static_cast<mask>(1 << __bitcur);
+ if (__m & __bit)
+ {
+ bool __testis;
+ switch (__bit)
+ {
+ case space:
+ __testis = isspace(__c);
+ break;
+ case print:
+ __testis = isprint(__c);
+ break;
+ case cntrl:
+ __testis = iscntrl(__c);
+ break;
+ case upper:
+ __testis = isupper(__c);
+ break;
+ case lower:
+ __testis = islower(__c);
+ break;
+ case alpha:
+ __testis = isalpha(__c);
+ break;
+ case digit:
+ __testis = isdigit(__c);
+ break;
+ case punct:
+ __testis = ispunct(__c);
+ break;
+ case xdigit:
+ __testis = isxdigit(__c);
+ break;
+ case alnum:
+ __testis = isalnum(__c);
+ break;
+ case graph:
+ __testis = isgraph(__c);
+ break;
+ default:
+ __testis = false;
+ break;
+ }
+ __ret &= __testis;
+ }
+ }
+ return __ret;
}
- return __ret;
}
const char*
ctype<char>::
is(const char* __low, const char* __high, mask* __vec) const
{
- const int __bitmasksize = 11; // Highest bitmask in ctype_base == 10
- for (;__low < __high; ++__vec, ++__low)
+ if (_M_table)
+ while (__low < __high)
+ *__vec++ = _M_table[static_cast<unsigned char>(*__low++)];
+ else
{
- mask __m = 0;
- int __i = 0; // Lowest bitmask in ctype_base == 0
- for (;__i < __bitmasksize; ++__i)
+ // Highest bitmask in ctype_base == 10.
+ const int __bitmasksize = 11;
+ for (;__low < __high; ++__vec, ++__low)
{
- mask __bit = static_cast<mask>(1 << __i);
- if (this->is(__bit, *__low))
- __m |= __bit;
+ mask __m = 0;
+ // Lowest bitmask in ctype_base == 0
+ int __i = 0;
+ for (;__i < __bitmasksize; ++__i)
+ {
+ mask __bit = static_cast<mask>(1 << __i);
+ if (this->is(__bit, *__low))
+ __m |= __bit;
+ }
+ *__vec = __m;
}
- *__vec = __m;
}
return __high;
}
ctype<char>::
scan_is(mask __m, const char* __low, const char* __high) const
{
- while (__low < __high && !this->is(__m, *__low))
- ++__low;
+ if (_M_table)
+ while (__low < __high
+ && !(_M_table[static_cast<unsigned char>(*__low)] & __m))
+ ++__low;
+ else
+ while (__low < __high && !this->is(__m, *__low))
+ ++__low;
return __low;
}
ctype<char>::
scan_not(mask __m, const char* __low, const char* __high) const
{
- while (__low < __high && this->is(__m, *__low) != 0)
- ++__low;
+ if (_M_table)
+ while (__low < __high
+ && (_M_table[static_cast<unsigned char>(*__low)] & __m) != 0)
+ ++__low;
+ else
+ while (__low < __high && this->is(__m, *__low) != 0)
+ ++__low;
return __low;
}
solaris2.6*)
os_include_dir="os/solaris/solaris2.6"
;;
- solaris2.[78]*)
+ solaris2.[789]*)
os_include_dir="os/solaris/solaris2.7"
;;
windiss*)
bool test = true;
typedef codecvt<wchar_t, char, mbstate_t> w_codecvt;
- locale loc ("en_US.ISO-8859-1");
+ locale loc = __gnu_cxx_test::try_named_locale("en_US.ISO-8859-1");
locale::global(loc);
const w_codecvt* cvt = &use_facet<w_codecvt>(loc);
bool test = true;
typedef codecvt<wchar_t, char, mbstate_t> w_codecvt;
- locale loc ("en_US.ISO-8859-15");
+ locale loc = __gnu_cxx_test::try_named_locale("en_US.ISO-8859-15");
locale::global(loc);
const w_codecvt* cvt = &use_facet<w_codecvt>(loc);
bool test = true;
typedef codecvt<wchar_t, char, mbstate_t> w_codecvt;
- locale loc ("en_US.UTF-8");
+ locale loc = __gnu_cxx_test::try_named_locale("en_US.UTF-8");
locale::global(loc);
const w_codecvt* cvt = &use_facet<w_codecvt>(loc);
typedef codecvt<wchar_t, char, mbstate_t> w_codecvt;
bool test = true;
- locale loc ("en_US.ISO-8859-1");
+ locale loc = __gnu_cxx_test::try_named_locale("en_US.ISO-8859-1");
locale::global(loc);
const w_codecvt* cvt = &use_facet<w_codecvt>(loc);
typedef codecvt<wchar_t, char, mbstate_t> w_codecvt;
bool test = true;
- locale loc ("en_US.ISO-8859-15");
+ locale loc = __gnu_cxx_test::try_named_locale("en_US.ISO-8859-15");
locale::global(loc);
const w_codecvt* cvt = &use_facet<w_codecvt>(loc);
typedef codecvt<wchar_t, char, mbstate_t> w_codecvt;
bool test = true;
- locale loc ("en_US.UTF-8");
+ locale loc = __gnu_cxx_test::try_named_locale("en_US.UTF-8");
locale::global(loc);
const w_codecvt* cvt = &use_facet<w_codecvt>(loc);
wmemset(i_ref, 0xdeadbeef, size + 1);
int_type* ito_next;
- locale loc ("en_US.ISO-8859-1");
+ locale loc = __gnu_cxx_test::try_named_locale("en_US.ISO-8859-1");
locale::global(loc);
const w_codecvt* cvt = &use_facet<w_codecvt>(loc);
wmemset(i_ref, 0xdeadbeef, size + 1);
int_type* ito_next;
- locale loc ("en_US.ISO-8859-15");
+ locale loc = __gnu_cxx_test::try_named_locale("en_US.ISO-8859-15");
locale::global(loc);
const w_codecvt* cvt = &use_facet<w_codecvt>(loc);
wmemset(i_ref, 0xdeadbeef, esize + 1);
int_type* ito_next;
- locale loc ("en_US.UTF-8");
+ locale loc = __gnu_cxx_test::try_named_locale("en_US.UTF-8");
locale::global(loc);
const w_codecvt* cvt = &use_facet<w_codecvt>(loc);
wmemset(i_ref, 0xdeadbeef, size + 1);
int_type* ito_next;
- locale loc ("en_US.UTF-8");
+ locale loc = __gnu_cxx_test::try_named_locale("en_US.UTF-8");
locale::global(loc);
const w_codecvt* cvt = &use_facet<w_codecvt>(loc);
wmemset(i_ref, 0xdeadbeef, esize + 1);
int_type* ito_next;
- locale loc ("en_US.UTF-8");
+ locale loc = __gnu_cxx_test::try_named_locale("en_US.UTF-8");
locale::global(loc);
const w_codecvt* cvt = &use_facet<w_codecvt>(loc);
int_type* ito = i_arr;
int_type* ito_next;
- locale loc ("en_US.UTF-8");
+ locale loc = __gnu_cxx_test::try_named_locale("en_US.UTF-8");
locale::global(loc);
const w_codecvt* cvt = &use_facet<w_codecvt>(loc);
"\xff";
int size = strlen(e_lit);
- locale loc ("en_US.ISO-8859-1");
+ locale loc = __gnu_cxx_test::try_named_locale("en_US.ISO-8859-1");
locale::global(loc);
const w_codecvt* cvt = &use_facet<w_codecvt>(loc);
"\xff";
int size = strlen(e_lit);
- locale loc ("en_US.ISO-8859-15");
+ locale loc = __gnu_cxx_test::try_named_locale("en_US.ISO-8859-15");
locale::global(loc);
const w_codecvt* cvt = &use_facet<w_codecvt>(loc);
int esize = strlen(e_lit);
int isize = wcslen(i_lit);
- locale loc ("en_US.UTF-8");
+ locale loc = __gnu_cxx_test::try_named_locale("en_US.UTF-8");
locale::global(loc);
const w_codecvt* cvt = &use_facet<w_codecvt>(loc);
const ext_type* efrom_next;
int size = strlen(e_lit);
- locale loc ("en_US.UTF-8");
+ locale loc = __gnu_cxx_test::try_named_locale("en_US.UTF-8");
locale::global(loc);
const w_codecvt* cvt = &use_facet<w_codecvt>(loc);
bool test = true;
typedef codecvt<wchar_t, char, mbstate_t> w_codecvt;
- locale loc ("en_US.ISO-8859-1");
+ locale loc = __gnu_cxx_test::try_named_locale("en_US.ISO-8859-1");
locale::global(loc);
const w_codecvt* cvt = &use_facet<w_codecvt>(loc);
bool test = true;
typedef codecvt<wchar_t, char, mbstate_t> w_codecvt;
- locale loc ("en_US.ISO-8859-15");
+ locale loc = __gnu_cxx_test::try_named_locale("en_US.ISO-8859-15");
locale::global(loc);
const w_codecvt* cvt = &use_facet<w_codecvt>(loc);
bool test = true;
typedef codecvt<wchar_t, char, mbstate_t> w_codecvt;
- locale loc ("en_US.UTF-8");
+ locale loc = __gnu_cxx_test::try_named_locale("en_US.UTF-8");
locale::global(loc);
const w_codecvt* cvt = &use_facet<w_codecvt>(loc);
memset(e_ref, 0xf0, size + 1);
ext_type* eto_next;
- locale loc ("en_US.ISO-8859-1");
+ locale loc = __gnu_cxx_test::try_named_locale("en_US.ISO-8859-1");
locale::global(loc);
const w_codecvt* cvt = &use_facet<w_codecvt>(loc);
memset(e_ref, 0xf0, size + 1);
ext_type* eto_next;
- locale loc ("en_US.ISO-8859-15");
+ locale loc = __gnu_cxx_test::try_named_locale("en_US.ISO-8859-15");
locale::global(loc);
const w_codecvt* cvt = &use_facet<w_codecvt>(loc);
memset(e_ref, 0xf0, esize + 1);
ext_type* eto_next;
- locale loc ("en_US.UTF-8");
+ locale loc = __gnu_cxx_test::try_named_locale("en_US.UTF-8");
locale::global(loc);
const w_codecvt* cvt = &use_facet<w_codecvt>(loc);
memset(e_ref, 0xf0, size + 1);
ext_type* eto_next;
- locale loc ("en_US.ISO-8859-1");
+ locale loc = __gnu_cxx_test::try_named_locale("en_US.ISO-8859-1");
locale::global(loc);
const w_codecvt* cvt = &use_facet<w_codecvt>(loc);
memset(e_ref, 0xf0, size + 1);
ext_type* eto_next;
- locale loc ("en_US.ISO-8859-1");
+ locale loc = __gnu_cxx_test::try_named_locale("en_US.ISO-8859-1");
locale::global(loc);
const w_codecvt* cvt = &use_facet<w_codecvt>(loc);
memset(e_ref, 0xf0, size + 1);
ext_type* eto_next;
- locale loc ("en_US.ISO-8859-15");
+ locale loc = __gnu_cxx_test::try_named_locale("en_US.ISO-8859-15");
locale::global(loc);
const w_codecvt* cvt = &use_facet<w_codecvt>(loc);
memset(e_ref, 0xf0, size + 1);
ext_type* eto_next;
- locale loc ("en_US.UTF-8");
+ locale loc = __gnu_cxx_test::try_named_locale("en_US.UTF-8");
locale::global(loc);
const w_codecvt* cvt = &use_facet<w_codecvt>(loc);
// basic construction
locale loc_c = locale::classic();
- locale loc_us("en_US");
- locale loc_fr("fr_FR");
- locale loc_de("de_DE");
+ locale loc_us = __gnu_cxx_test::try_named_locale("en_US");
+ locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR");
+ locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
VERIFY( loc_c != loc_de );
VERIFY( loc_us != loc_fr );
VERIFY( loc_us != loc_de );
int main()
{
- __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test01);
+ test01();
return 0;
}
// basic construction
locale loc_c = locale::classic();
- locale loc_us("en_US");
- locale loc_fr("fr_FR");
- locale loc_de("de_DE");
+ locale loc_us = __gnu_cxx_test::try_named_locale("en_US");
+ locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR");
+ locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
VERIFY( loc_c != loc_de );
VERIFY( loc_us != loc_fr );
VERIFY( loc_us != loc_de );
int main()
{
- __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test02);
+ test02();
return 0;
}
// basic construction
locale loc_c = locale::classic();
- locale loc_de("de_DE");
+ locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
VERIFY( loc_c != loc_de );
// cache the collate facets
int main()
{
- __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test03);
+ test03();
return 0;
}
// basic construction
locale loc_c = locale::classic();
- locale loc_us("en_US");
- locale loc_fr("fr_FR");
- locale loc_de("de_DE");
+ locale loc_us = __gnu_cxx_test::try_named_locale("en_US");
+ locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR");
+ locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
VERIFY( loc_c != loc_de );
VERIFY( loc_us != loc_fr );
VERIFY( loc_us != loc_de );
// basic construction
locale loc_c = locale::classic();
- locale loc_us("en_US");
- locale loc_fr("fr_FR");
- locale loc_de("de_DE");
+ locale loc_us = __gnu_cxx_test::try_named_locale("en_US");
+ locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR");
+ locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
VERIFY( loc_c != loc_de );
VERIFY( loc_us != loc_fr );
VERIFY( loc_us != loc_de );
// basic construction
locale loc_c = locale::classic();
- locale loc_de("de_DE");
+ locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
VERIFY( loc_c != loc_de );
// cache the collate facets
// basic construction
locale loc_c = locale::classic();
- locale loc_us("en_US");
- locale loc_fr("fr_FR");
- locale loc_de("de_DE");
+ locale loc_us = __gnu_cxx_test::try_named_locale("en_US");
+ locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR");
+ locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
VERIFY( loc_c != loc_de );
VERIFY( loc_us != loc_fr );
VERIFY( loc_us != loc_de );
int main()
{
- __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test02);
+ test02();
return 0;
}
// basic construction
locale loc_c = locale::classic();
- locale loc_us("en_US");
- locale loc_fr("fr_FR");
- locale loc_de("de_DE");
+ locale loc_us = __gnu_cxx_test::try_named_locale("en_US");
+ locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR");
+ locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
VERIFY( loc_c != loc_de );
VERIFY( loc_us != loc_fr );
VERIFY( loc_us != loc_de );
// basic construction
locale loc_c = locale::classic();
- locale loc_us("en_US");
- locale loc_fr("fr_FR");
- locale loc_de("de_DE");
+ locale loc_us = __gnu_cxx_test::try_named_locale("en_US");
+ locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR");
+ locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
VERIFY( loc_c != loc_de );
VERIFY( loc_us != loc_fr );
VERIFY( loc_us != loc_de );
int main()
{
- __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test02);
+ test02();
return 0;
}
// basic construction
locale loc_c = locale::classic();
- locale loc_de("de_DE");
+ locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
VERIFY( loc_c != loc_de );
// cache the collate facets
int main()
{
- __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test03);
+ test03();
return 0;
}
// basic construction
locale loc_c = locale::classic();
- locale loc_us("en_US");
- locale loc_fr("fr_FR");
- locale loc_de("de_DE");
+ locale loc_us = __gnu_cxx_test::try_named_locale("en_US");
+ locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR");
+ locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
VERIFY( loc_c != loc_de );
VERIFY( loc_us != loc_fr );
VERIFY( loc_us != loc_de );
// basic construction
locale loc_c = locale::classic();
- locale loc_de("de_DE");
+ locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
VERIFY( loc_c != loc_de );
// cache the collate facets
string str;
locale loc_c = locale::classic();
+ locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
+ str = loc_de.name();
+
locale loc_byname(locale::classic(), new collate_byname<char>("de_DE"));
str = loc_byname.name();
- locale loc_de("de_DE");
- str = loc_de.name();
-
VERIFY( loc_de != loc_byname );
// cache the collate facets
int main()
{
- __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test01);
+ test01();
return 0;
}
}
// "de_DE"
- locale loc_de("de_DE");
+ locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
const ctype<char>& ctype_de = use_facet<ctype<char> >(loc_de);
for (int i = 0; i < max; ++i)
{
int main()
{
- __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test02);
+ test02();
return 0;
}
}
// "de_DE"
- locale loc_de("de_DE");
+ locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
const ctype<wchar_t>& ctype_de = use_facet<ctype<wchar_t> >(loc_de);
for (int i = 0; i < max; ++i)
{
using namespace std;
bool test = true;
- locale loc ("se_NO.UTF-8");
+ locale loc = __gnu_cxx_test::try_named_locale("se_NO.UTF-8");
const ctype<wchar_t>& wct = use_facet<ctype<wchar_t> >(loc);
const wchar_t* wstrlit = L"\x80";
using namespace std;
bool test = true;
- locale loc ("en_US.ISO-8859-1");
+ locale loc = __gnu_cxx_test::try_named_locale("en_US.ISO-8859-1");
const ctype<wchar_t>& wct = use_facet<ctype<wchar_t> >(loc);
char c = 0xff;
using namespace std;
bool test = true;
- locale loc ("se_NO.UTF-8");
+ locale loc = __gnu_cxx_test::try_named_locale("se_NO.UTF-8");
const ctype<wchar_t>& wct = use_facet<ctype<wchar_t> >(loc);
const char* strlit = "\xc2\x80";
// 4: Named locale should destroy facets when it goes out of scope.
// Not quite sure how to test for this w/o valgrind at the moment.
{
- locale loc03("es_MX");
+ locale loc03 = __gnu_cxx_test::try_named_locale("es_MX");
}
}
int main ()
{
- __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test02);
+ test02();
return 0;
}
static char_type*
copy(char_type* __s1, const char_type* __s2, size_t __n)
- { return static_cast<char_type*>(memcpy(__s1, __s2, __n)); }
+ { return static_cast<char_type*>(memcpy(__s1, __s2, __n)); }
static char_type*
assign(char_type* __s, size_t __n, char_type __a);
// 3
// explicit locale(const char* std_name)
- locale loc06("fr_FR");
+ locale loc06 = __gnu_cxx_test::try_named_locale("fr_FR");
VERIFY (loc06 != loc01);
VERIFY (loc06 != loc02);
VERIFY (loc06.name() == "fr_FR");
const char* LC_ALL_orig = getenv("LC_ALL");
if (!setenv("LC_ALL", "it_IT", 1))
{
- std::locale loc("");
+ std::locale loc = __gnu_cxx_test::try_named_locale("");
VERIFY( loc.name() == "it_IT" );
setenv("LC_ALL", LC_ALL_orig ? LC_ALL_orig : "", 1);
}
int main()
{
- __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test03);
+ test03();
return 0;
}
// Check that a "POSIX" LC_ALL is equivalent to "C".
if (!setenv("LC_ALL", "POSIX", 1))
{
- locale loc("");
+ locale loc = __gnu_cxx_test::try_named_locale("");
VERIFY( loc.name() == "C" );
}
setenv("LC_ALL", "", 1);
// Check that a "en_PH" LC_ALL is equivalent to "en_PH".
if (!setenv("LC_ALL", "en_PH", 1))
{
- locale loc("");
+ locale loc = __gnu_cxx_test::try_named_locale("");
VERIFY( loc.name() == "en_PH" );
}
setenv("LC_ALL", "", 1);
{
if (!setenv("LC_ALL", "en_PH", 1))
{
- locale loc("");
+ locale loc = __gnu_cxx_test::try_named_locale("");
VERIFY( loc.name() == "en_PH" );
}
setenv("LC_ALL", "", 1);
// Check the default set by LANG.
if (!setenv("LANG", "fr_FR", 1))
{
- locale loc("");
+ locale loc = __gnu_cxx_test::try_named_locale("");
VERIFY( loc.name() == "fr_FR" );
}
// Setting a category in the "C" default.
if (!setenv("LC_COLLATE", "de_DE", 1))
{
- locale loc("");
+ locale loc = __gnu_cxx_test::try_named_locale("");
#if _GLIBCPP_NUM_CATEGORIES
VERIFY( loc.name() == "LC_CTYPE=C;LC_NUMERIC=C;LC_TIME=C;"
// Changing the LANG default while LC_COLLATE is set.
if (!setenv("LANG", "fr_FR", 1))
{
- locale loc("");
+ locale loc = __gnu_cxx_test::try_named_locale("");
#if _GLIBCPP_NUM_CATEGORIES
VERIFY( loc.name() == "LC_CTYPE=fr_FR;LC_NUMERIC=fr_FR;"
"LC_TIME=fr_FR;LC_COLLATE=de_DE;LC_MONETARY=fr_FR;"
#if _GLIBCPP_NUM_CATEGORIES
if (!setenv("LC_IDENTIFICATION", "it_IT", 1))
{
- locale loc("");
+ locale loc = __gnu_cxx_test::try_named_locale("");
VERIFY( loc.name() == "LC_CTYPE=fr_FR;LC_NUMERIC=fr_FR;"
"LC_TIME=fr_FR;LC_COLLATE=de_DE;LC_MONETARY=fr_FR;"
"LC_MESSAGES=fr_FR;LC_PAPER=fr_FR;LC_NAME=fr_FR;"
int main()
{
- __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test04);
+ test04();
return 0;
}
// construct a locale object with the specialized facet.
locale loc_c = locale::classic();
+ locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR");
locale loc_1(locale::classic(),
new numpunct_byname<char>("fr_FR"));
- locale loc_fr("fr_FR");
// check names
VERIFY( loc_c.name() == name_c );
int main()
{
- __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test02);
+ test02();
return 0;
}
bool test = true;
std::locale loc_c1("C");
- std::locale loc_c2 ("C");
+ std::locale loc_c2("C");
VERIFY( loc_c1 == loc_c2 );
}
{
bool test = true;
- std::locale loc_1("");
- std::locale loc_2("");
+ std::locale loc_1 = __gnu_cxx_test::try_named_locale("");
+ std::locale loc_2 = __gnu_cxx_test::try_named_locale("");
VERIFY( loc_1 == loc_2 );
}
int main()
{
- __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test02);
+ test02();
return 0;
}
// named locales work.
if (testph && testmx)
{
- const locale loc_ph(ph.c_str());
- const locale loc_mx(mx.c_str());
+ const locale loc_ph = __gnu_cxx_test::try_named_locale(ph.c_str());
+ const locale loc_mx = __gnu_cxx_test::try_named_locale(mx.c_str());
// Use setlocale between two calls to locale("")
- const locale loc_env_1("");
+ const locale loc_env_1 = __gnu_cxx_test::try_named_locale("");
setlocale(LC_ALL, ph.c_str());
- const locale loc_env_2("");
+ const locale loc_env_2 = __gnu_cxx_test::try_named_locale("");
VERIFY( loc_env_1 == loc_env_2 );
// Change global locale.
// basic construction
locale loc_c = locale::classic();
- locale loc_us("en_US");
- locale loc_fr("fr_FR");
- locale loc_de("de_DE");
+ locale loc_us = __gnu_cxx_test::try_named_locale("en_US");
+ locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR");
+ locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
VERIFY( loc_c != loc_de );
VERIFY( loc_us != loc_fr );
VERIFY( loc_us != loc_de );
int main()
{
- __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test01);
+ test01();
return 0;
}
// basic construction
locale loc_c = locale::classic();
- locale loc_us("en_US");
- locale loc_fr("fr_FR");
- locale loc_de("de_DE");
+ locale loc_us = __gnu_cxx_test::try_named_locale("en_US");
+ locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR");
+ locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
VERIFY( loc_c != loc_de );
VERIFY( loc_us != loc_fr );
VERIFY( loc_us != loc_de );
int main()
{
- __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test02);
+ test02();
return 0;
}
// basic construction
locale loc_c = locale::classic();
- locale loc_us("en_US");
- locale loc_fr("fr_FR");
- locale loc_de("de_DE");
+ locale loc_us = __gnu_cxx_test::try_named_locale("en_US");
+ locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR");
+ locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
VERIFY( loc_c != loc_de );
VERIFY( loc_us != loc_fr );
VERIFY( loc_us != loc_de );
int main()
{
- __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test03);
+ test03();
return 0;
}
const char* dir = LOCALEDIR;
locale loc_c = locale::classic();
+ locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
+ str = loc_de.name();
+
locale loc_byname(locale::classic(), new messages_byname<char>("de_DE"));
str = loc_byname.name();
- locale loc_de("de_DE");
- str = loc_de.name();
-
VERIFY( loc_de != loc_byname );
// cache the messages facets
int main()
{
- __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test01);
+ test01();
return 0;
}
// basic construction
locale loc_c = locale::classic();
- locale loc_hk("en_HK");
- locale loc_fr("fr_FR@euro");
- locale loc_de("de_DE@euro");
+ locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_cxx_test::try_named_locale("de_DE@euro");
VERIFY( loc_c != loc_de );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
int main()
{
- __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test01);
+ test01();
return 0;
}
// basic construction
locale loc_c = locale::classic();
- locale loc_hk("en_HK");
- locale loc_fr("fr_FR@euro");
- locale loc_de("de_DE@euro");
+ locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_cxx_test::try_named_locale("de_DE@euro");
VERIFY( loc_c != loc_de );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
int main()
{
- __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test02);
+ test02();
return 0;
}
// basic construction
locale loc_c = locale::classic();
- locale loc_hk("en_HK");
- locale loc_fr("fr_FR@euro");
- locale loc_de("de_DE@euro");
+ locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_cxx_test::try_named_locale("de_DE@euro");
VERIFY( loc_c != loc_de );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
int main()
{
- __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test03);
+ test03();
return 0;
}
// basic construction
locale loc_c = locale::classic();
- locale loc_hk("en_HK");
- locale loc_fr("fr_FR@euro");
- locale loc_de("de_DE@euro");
+ locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_cxx_test::try_named_locale("de_DE@euro");
VERIFY( loc_c != loc_de );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
int main()
{
- __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test04);
+ test04();
return 0;
}
// basic construction
locale loc_c = locale::classic();
- locale loc_hk("en_HK");
- locale loc_fr("fr_FR@euro");
- locale loc_de("de_DE@euro");
+ locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_cxx_test::try_named_locale("de_DE@euro");
VERIFY( loc_c != loc_de );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
// basic construction
locale loc_c = locale::classic();
- locale loc_hk("en_HK");
- locale loc_fr("fr_FR@euro");
- locale loc_de("de_DE@euro");
+ locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_cxx_test::try_named_locale("de_DE@euro");
VERIFY( loc_c != loc_de );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
// basic construction
locale loc_c = locale::classic();
- locale loc_hk("en_HK");
- locale loc_fr("fr_FR@euro");
- locale loc_de("de_DE@euro");
+ locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_cxx_test::try_named_locale("de_DE@euro");
VERIFY( loc_c != loc_de );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
// basic construction
locale loc_c = locale::classic();
- locale loc_hk("en_HK");
- locale loc_fr("fr_FR@euro");
- locale loc_de("de_DE@euro");
+ locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_cxx_test::try_named_locale("de_DE@euro");
VERIFY( loc_c != loc_de );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
// basic construction
locale loc_c = locale::classic();
- locale loc_hk("en_HK");
- locale loc_fr("fr_FR@euro");
- locale loc_de("de_DE@euro");
+ locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_cxx_test::try_named_locale("de_DE@euro");
VERIFY( loc_c != loc_de );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
int main()
{
- __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test01);
+ test01();
return 0;
}
// basic construction
locale loc_c = locale::classic();
- locale loc_hk("en_HK");
- locale loc_fr("fr_FR@euro");
- locale loc_de("de_DE@euro");
+ locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_cxx_test::try_named_locale("de_DE@euro");
VERIFY( loc_c != loc_de );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
int main()
{
- __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test02);
+ test02();
return 0;
}
// basic construction
locale loc_c = locale::classic();
- locale loc_hk("en_HK");
- locale loc_fr("fr_FR@euro");
- locale loc_de("de_DE@euro");
+ locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_cxx_test::try_named_locale("de_DE@euro");
VERIFY( loc_c != loc_de );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
int main()
{
- __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test03);
+ test03();
return 0;
}
// basic construction
locale loc_c = locale::classic();
- locale loc_hk("en_HK");
- locale loc_fr("fr_FR@euro");
- locale loc_de("de_DE@euro");
+ locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_cxx_test::try_named_locale("de_DE@euro");
VERIFY( loc_c != loc_de );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
// basic construction
locale loc_c = locale::classic();
- locale loc_hk("en_HK");
- locale loc_fr("fr_FR@euro");
- locale loc_de("de_DE@euro");
+ locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_cxx_test::try_named_locale("de_DE@euro");
VERIFY( loc_c != loc_de );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
// basic construction
locale loc_c = locale::classic();
- locale loc_hk("en_HK");
- locale loc_fr("fr_FR@euro");
- locale loc_de("de_DE@euro");
+ locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_cxx_test::try_named_locale("de_DE@euro");
VERIFY( loc_c != loc_de );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
// basic construction
locale loc_c = locale::classic();
- locale loc_de("de_DE");
+ locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
// cache the moneypunct facets
typedef moneypunct<char, true> __money_true;
int main()
{
- __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test02);
+ test02();
return 0;
}
// basic construction
locale loc_c = locale::classic();
- locale loc_de("de_DE");
+ locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
// cache the moneypunct facets
typedef moneypunct<wchar_t, true> __money_true;
bool test = true;
string str;
+ locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
+ str = loc_de.name();
+
locale loc_byname(locale::classic(), new moneypunct_byname<char>("de_DE"));
str = loc_byname.name();
- locale loc_de("de_DE");
- str = loc_de.name();
-
locale loc_c = locale::classic();
VERIFY( loc_de != loc_byname );
int main()
{
- __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test01);
-
+ test01();
return 0;
}
// basic construction
locale loc_c = locale::classic();
- locale loc_hk("en_HK");
- locale loc_fr("fr_FR@euro");
- locale loc_de("de_DE");
+ locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
VERIFY( loc_c != loc_de );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
int main()
{
- __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test01);
+ test01();
return 0;
}
// basic construction
locale loc_c = locale::classic();
- locale loc_hk("en_HK");
- locale loc_fr("fr_FR@euro");
- locale loc_de("de_DE");
+ locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
VERIFY( loc_c != loc_de );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
int main()
{
- __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test02);
+ test02();
return 0;
}
// basic construction
locale loc_c = locale::classic();
- locale loc_hk("en_HK");
- locale loc_fr("fr_FR@euro");
- locale loc_de("de_DE");
+ locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
VERIFY( loc_c != loc_de );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
int main()
{
- __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test03);
+ test03();
return 0;
}
istringstream iss;
// A locale that expects grouping
- locale loc_de("de_DE");
+ locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
iss.imbue(loc_de);
const num_get<char>& ng = use_facet<num_get<char> >(iss.getloc());
int main()
{
- __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test05);
+ test05();
return 0;
}
double d = 0.0;
istringstream iss;
- locale loc_de("de_DE");
+ locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
iss.imbue(loc_de);
const num_get<char>& ng = use_facet<num_get<char> >(iss.getloc());
int main()
{
- __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test06);
+ test06();
return 0;
}
// basic construction
locale loc_c = locale::classic();
- locale loc_hk("en_HK");
- locale loc_fr("fr_FR@euro");
- locale loc_de("de_DE");
+ locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
VERIFY( loc_c != loc_de );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
// basic construction
locale loc_c = locale::classic();
- locale loc_hk("en_HK");
- locale loc_fr("fr_FR@euro");
- locale loc_de("de_DE");
+ locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
VERIFY( loc_c != loc_de );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
// basic construction
locale loc_c = locale::classic();
- locale loc_hk("en_HK");
- locale loc_fr("fr_FR@euro");
- locale loc_de("de_DE");
+ locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
VERIFY( loc_c != loc_de );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
wistringstream iss;
// A locale that expects grouping
- locale loc_de("de_DE");
+ locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
iss.imbue(loc_de);
const num_get<wchar_t>& ng = use_facet<num_get<wchar_t> >(iss.getloc());
double d = 0.0;
wistringstream iss;
- locale loc_de("de_DE");
+ locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
iss.imbue(loc_de);
const num_get<wchar_t>& ng = use_facet<num_get<wchar_t> >(iss.getloc());
// basic construction
locale loc_c = locale::classic();
- locale loc_hk("en_HK");
- locale loc_fr("fr_FR@euro");
- locale loc_de("de_DE");
+ locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
VERIFY( loc_c != loc_de );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
int main()
{
- __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test01);
+ test01();
return 0;
}
// basic construction
locale loc_c = locale::classic();
- locale loc_hk("en_HK");
- locale loc_fr("fr_FR@euro");
- locale loc_de("de_DE");
+ locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
VERIFY( loc_c != loc_de );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
int main()
{
- __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test02);
+ test02();
return 0;
}
// basic construction
locale loc_c = locale::classic();
- locale loc_hk("en_HK");
- locale loc_fr("fr_FR@euro");
- locale loc_de("de_DE");
+ locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
VERIFY( loc_c != loc_de );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
int main()
{
- __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test03);
+ test03();
return 0;
}
bool test = true;
// A locale that expects grouping.
- locale loc_de("de_DE");
+ locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
const string empty;
string result;
int main()
{
- __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test05);
+ test05();
return 0;
}
// basic construction
locale loc_c = locale::classic();
- locale loc_hk("en_HK");
- locale loc_fr("fr_FR@euro");
- locale loc_de("de_DE");
+ locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
VERIFY( loc_c != loc_de );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
// basic construction
locale loc_c = locale::classic();
- locale loc_hk("en_HK");
- locale loc_fr("fr_FR@euro");
- locale loc_de("de_DE");
+ locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
VERIFY( loc_c != loc_de );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
// basic construction
locale loc_c = locale::classic();
- locale loc_hk("en_HK");
- locale loc_fr("fr_FR@euro");
- locale loc_de("de_DE");
+ locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
VERIFY( loc_c != loc_de );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
bool test = true;
// A locale that expects grouping.
- locale loc_de("de_DE");
+ locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
const wstring empty;
wstring result;
// basic construction
locale loc_c = locale::classic();
- locale loc_us("en_US");
- locale loc_fr("fr_FR");
- locale loc_de("de_DE");
+ locale loc_us = __gnu_cxx_test::try_named_locale("en_US");
+ locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR");
+ locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
VERIFY( loc_c != loc_de );
VERIFY( loc_us != loc_fr );
VERIFY( loc_us != loc_de );
int main()
{
- __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test01);
+ test01();
return 0;
}
// basic construction
locale loc_c = locale::classic();
- locale loc_us("en_US");
- locale loc_fr("fr_FR");
- locale loc_de("de_DE");
+ locale loc_us = __gnu_cxx_test::try_named_locale("en_US");
+ locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR");
+ locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
VERIFY( loc_c != loc_de );
VERIFY( loc_us != loc_fr );
VERIFY( loc_us != loc_de );
int main()
{
- __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test02);
+ test02();
return 0;
}
// basic construction
locale loc_c = locale::classic();
- locale loc_us("en_US");
- locale loc_fr("fr_FR");
- locale loc_de("de_DE");
+ locale loc_us = __gnu_cxx_test::try_named_locale("en_US");
+ locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR");
+ locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
VERIFY( loc_c != loc_de );
VERIFY( loc_us != loc_fr );
VERIFY( loc_us != loc_de );
// basic construction
locale loc_c = locale::classic();
- locale loc_us("en_US");
- locale loc_fr("fr_FR");
- locale loc_de("de_DE");
+ locale loc_us = __gnu_cxx_test::try_named_locale("en_US");
+ locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR");
+ locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
VERIFY( loc_c != loc_de );
VERIFY( loc_us != loc_fr );
VERIFY( loc_us != loc_de );
bool test = true;
string str;
+ locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
+ str = loc_de.name();
+
locale loc_byname(locale::classic(), new numpunct_byname<char>("de_DE"));
str = loc_byname.name();
- locale loc_de("de_DE");
- str = loc_de.name();
-
locale loc_c = locale::classic();
VERIFY( loc_de != loc_byname );
int main()
{
- __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test01);
+ test01();
return 0;
}
bool test = true;
- locale loc_it("it_IT");
+ locale loc_it = __gnu_cxx_test::try_named_locale("it_IT");
const numpunct<char>& nump_it = use_facet<numpunct<char> >(loc_it);
int main()
{
- __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test02);
+ test02();
return 0;
}
// basic construction and sanity checks.
locale loc_c = locale::classic();
- locale loc_hk("en_HK");
- locale loc_fr("fr_FR@euro");
- locale loc_de("de_DE");
+ locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
int main()
{
- __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test01);
+ test01();
return 0;
}
// basic construction and sanity checks.
locale loc_c = locale::classic();
- locale loc_hk("en_HK");
- locale loc_fr("fr_FR@euro");
- locale loc_de("de_DE");
+ locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
// basic construction and sanity checks.
locale loc_c = locale::classic();
- locale loc_hk("en_HK");
- locale loc_fr("fr_FR@euro");
- locale loc_de("de_DE");
+ locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
int main()
{
- __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test01);
+ test01();
return 0;
}
// basic construction and sanity checks.
locale loc_c = locale::classic();
- locale loc_hk("en_HK");
- locale loc_fr("fr_FR@euro");
- locale loc_de("de_DE");
+ locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
int main()
{
- __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test02);
+ test02();
return 0;
}
// basic construction and sanity checks.
locale loc_c = locale::classic();
- locale loc_hk("en_HK");
- locale loc_fr("fr_FR@euro");
- locale loc_de("de_DE");
+ locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
// basic construction and sanity checks.
locale loc_c = locale::classic();
- locale loc_hk("en_HK");
- locale loc_fr("fr_FR@euro");
- locale loc_de("de_DE");
+ locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
// basic construction and sanity checks.
locale loc_c = locale::classic();
- locale loc_hk("en_HK");
- locale loc_fr("fr_FR@euro");
- locale loc_de("de_DE");
+ locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
int main()
{
- __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test01);
+ test01();
return 0;
}
// basic construction and sanity checks.
locale loc_c = locale::classic();
- locale loc_hk("en_HK");
- locale loc_fr("fr_FR@euro");
- locale loc_de("de_DE");
+ locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
int main()
{
- __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test02);
+ test02();
return 0;
}
// basic construction and sanity checks.
locale loc_c = locale::classic();
- locale loc_hk("en_HK");
- locale loc_fr("fr_FR@euro");
- locale loc_de("de_DE");
+ locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
// basic construction and sanity checks.
locale loc_c = locale::classic();
- locale loc_hk("en_HK");
- locale loc_fr("fr_FR@euro");
- locale loc_de("de_DE");
+ locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
// basic construction and sanity checks.
locale loc_c = locale::classic();
- locale loc_hk("en_HK");
- locale loc_fr("fr_FR@euro");
- locale loc_de("de_DE");
+ locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
int main()
{
- __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test01);
+ test01();
return 0;
}
// basic construction and sanity checks.
locale loc_c = locale::classic();
- locale loc_hk("en_HK");
- locale loc_fr("fr_FR@euro");
- locale loc_de("de_DE");
+ locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
int main()
{
- __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test02);
+ test02();
return 0;
}
// basic construction and sanity checks.
locale loc_c = locale::classic();
- locale loc_hk("en_HK");
- locale loc_fr("fr_FR@euro");
- locale loc_de("de_DE");
+ locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
// basic construction and sanity checks.
locale loc_c = locale::classic();
- locale loc_hk("en_HK");
- locale loc_fr("fr_FR@euro");
- locale loc_de("de_DE");
+ locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
// basic construction and sanity checks.
locale loc_c = locale::classic();
- locale loc_hk("en_HK");
- locale loc_fr("fr_FR@euro");
- locale loc_de("de_DE");
+ locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
int main()
{
- __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test01);
+ test01();
return 0;
}
// basic construction and sanity checks.
locale loc_c = locale::classic();
- locale loc_hk("en_HK");
- locale loc_fr("fr_FR@euro");
- locale loc_de("de_DE");
+ locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
int main()
{
- __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test02);
+ test02();
return 0;
}
// basic construction and sanity checks.
locale loc_c = locale::classic();
- locale loc_hk("en_HK");
- locale loc_fr("fr_FR@euro");
- locale loc_de("de_DE");
+ locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
// basic construction and sanity checks.
locale loc_c = locale::classic();
- locale loc_hk("en_HK");
- locale loc_fr("fr_FR@euro");
- locale loc_de("de_DE");
+ locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
// basic construction and sanity checks.
locale loc_c = locale::classic();
- locale loc_hk("en_HK");
- locale loc_fr("fr_FR@euro");
- locale loc_de("de_DE");
+ locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
int main()
{
- __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test01);
+ test01();
return 0;
}
// basic construction and sanity checks.
locale loc_c = locale::classic();
- locale loc_hk("en_HK");
- locale loc_fr("fr_FR@euro");
- locale loc_de("de_DE");
+ locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
// basic construction and sanity checks.
locale loc_c = locale::classic();
- locale loc_hk("en_HK");
- locale loc_fr("fr_FR@euro");
- locale loc_de("de_DE");
+ locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
int main()
{
- __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test01);
+ test01();
return 0;
}
// basic construction and sanity checks.
locale loc_c = locale::classic();
- locale loc_hk("en_HK");
- locale loc_fr("fr_FR@euro");
- locale loc_de("de_DE");
+ locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
int main()
{
- __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test02);
+ test02();
return 0;
}
// basic construction and sanity checks.
locale loc_c = locale::classic();
- locale loc_hk("en_HK");
- locale loc_fr("fr_FR@euro");
- locale loc_de("de_DE");
+ locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
int main()
{
- __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test03);
+ test03();
return 0;
}
// basic construction and sanity checks.
locale loc_c = locale::classic();
- locale loc_hk("en_HK");
- locale loc_fr("fr_FR@euro");
- locale loc_de("de_DE");
+ locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
int main()
{
- __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test04);
+ test04();
return 0;
}
// basic construction and sanity checks.
locale loc_c = locale::classic();
- locale loc_hk("en_HK");
- locale loc_fr("fr_FR@euro");
- locale loc_de("de_DE");
+ locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
int main()
{
- __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test05);
+ test05();
return 0;
}
// basic construction and sanity checks.
locale loc_c = locale::classic();
- locale loc_hk("en_HK");
- locale loc_fr("fr_FR@euro");
- locale loc_de("de_DE");
+ locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
int main()
{
- __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test06);
+ test06();
return 0;
}
// basic construction and sanity checks.
locale loc_c = locale::classic();
- locale loc_hk("en_HK");
- locale loc_fr("fr_FR@euro");
- locale loc_de("de_DE");
+ locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
int main()
{
- __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test07);
+ test07();
return 0;
}
// basic construction and sanity checks.
locale loc_c = locale::classic();
- locale loc_hk("en_HK");
- locale loc_fr("fr_FR@euro");
- locale loc_de("de_DE");
+ locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
int main()
{
- __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test08);
+ test08();
return 0;
}
// basic construction and sanity checks.
locale loc_c = locale::classic();
- locale loc_hk("en_HK");
- locale loc_fr("fr_FR@euro");
- locale loc_de("de_DE");
+ locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
// basic construction and sanity checks.
locale loc_c = locale::classic();
- locale loc_hk("en_HK");
- locale loc_fr("fr_FR@euro");
- locale loc_de("de_DE");
+ locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
// basic construction and sanity checks.
locale loc_c = locale::classic();
- locale loc_hk("en_HK");
- locale loc_fr("fr_FR@euro");
- locale loc_de("de_DE");
+ locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
// basic construction and sanity checks.
locale loc_c = locale::classic();
- locale loc_hk("en_HK");
- locale loc_fr("fr_FR@euro");
- locale loc_de("de_DE");
+ locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
// basic construction and sanity checks.
locale loc_c = locale::classic();
- locale loc_hk("en_HK");
- locale loc_fr("fr_FR@euro");
- locale loc_de("de_DE");
+ locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
// basic construction and sanity checks.
locale loc_c = locale::classic();
- locale loc_hk("en_HK");
- locale loc_fr("fr_FR@euro");
- locale loc_de("de_DE");
+ locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
// basic construction and sanity checks.
locale loc_c = locale::classic();
- locale loc_hk("en_HK");
- locale loc_fr("fr_FR@euro");
- locale loc_de("de_DE");
+ locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
// basic construction and sanity checks.
locale loc_c = locale::classic();
- locale loc_hk("en_HK");
- locale loc_fr("fr_FR@euro");
- locale loc_de("de_DE");
+ locale loc_hk = __gnu_cxx_test::try_named_locale("en_HK");
+ locale loc_fr = __gnu_cxx_test::try_named_locale("fr_FR@euro");
+ locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
VERIFY( loc_hk != loc_c );
VERIFY( loc_hk != loc_fr );
VERIFY( loc_hk != loc_de );
std::filebuf ob;
VERIFY( ob.getloc() == loc );
- locale::global(locale("en_US"));
+ locale::global(__gnu_cxx_test::try_named_locale("en_US"));
VERIFY( ob.getloc() == loc );
- locale loc_de ("de_DE");
+ locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
locale ret = ob.pubimbue(loc_de);
VERIFY( ob.getloc() == loc_de );
VERIFY( ret == loc );
main()
{
- __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test07);
+ test07();
return 0;
}
typedef std::ios_base::fmtflags fmtflags;
typedef std::ios_base::iostate iostate;
locale loc_c = locale::classic();
- locale loc_de("de_DE");
+ locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
std::ios ios_01(NULL);
std::ios ios_02(NULL);
ios_01.imbue(loc_c);
int main()
{
- __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test03);
+ test03();
return 0;
}
os2.setf(ios::fixed);
// Check it can be done in a locale with grouping on.
- locale loc2("de_DE");
+ locale loc2 = __gnu_cxx_test::try_named_locale("de_DE");
os2.imbue(loc2);
os2 << fixed << setprecision(3) << val2 << endl;
os2 << endl;
int
main()
{
- __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test02);
+ test02();
return 0;
}
testbuf ob;
VERIFY( ob.getloc() == loc );
- locale::global(locale("en_US"));
+ locale::global(__gnu_cxx_test::try_named_locale("en_US"));
VERIFY( ob.getloc() == loc );
- locale loc_de ("de_DE");
+ locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
locale ret = ob.pubimbue(loc_de);
VERIFY( ob.getloc() == loc_de );
VERIFY( ret == loc );
int main()
{
- __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test08);
+ test08();
return 0;
}
std::stringbuf ob;
VERIFY( ob.getloc() == loc );
- locale::global(locale("en_US"));
+ locale::global(__gnu_cxx_test::try_named_locale("en_US"));
VERIFY( ob.getloc() == loc );
- locale loc_de ("de_DE");
+ locale loc_de = __gnu_cxx_test::try_named_locale("de_DE");
locale ret = ob.pubimbue(loc_de);
VERIFY( ob.getloc() == loc_de );
VERIFY( ret == loc );
int main()
{
using namespace std;
- __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test03);
+ test03();
return 0;
}
bool test = true;
// Set the global locale.
- try
- {
- locale loc_name(name);
- locale orig = locale::global(loc_name);
- }
- catch (std::runtime_error& ex)
- {
- if (std::strstr (ex.what(), "unhandled name in generic implementation"))
- return;
- else if (std::strstr (ex.what(), "unknown name"))
- return;
- else
- throw;
- }
+ locale loc_name = try_named_locale(name);
+ locale orig = locale::global(loc_name);
const char* res = setlocale(LC_ALL, name);
if (res != NULL)
#ifdef _GLIBCPP_HAVE_SETENV
// Set the global locale.
- try
- {
- locale loc_name(name);
- locale orig = locale::global(loc_name);
- }
- catch (std::runtime_error& ex)
- {
- if (std::strstr (ex.what(), "unhandled name in generic implementation"))
- return;
- else if (std::strstr (ex.what(), "unknown name"))
- return;
- else
- throw;
- }
+ locale loc_name = try_named_locale(name);
+ locale orig = locale::global(loc_name);
+
// Set environment variable env to value in name.
const char* oldENV = getenv(env);
if (!setenv(env, name, 1))
#endif
}
- void
- run_test_wrapped_generic_locale_exception_catcher(const test_func f)
+ std::locale
+ try_named_locale(const char* name)
{
try
{
- f();
+ return std::locale(name);
}
catch (std::runtime_error& ex)
{
- if (std::strstr (ex.what(), "unhandled name in generic implementation"))
- return;
- else if (std::strstr (ex.what(), "unknown name"))
- return;
+ // Thrown by generic implemenation.
+ if (std::strstr(ex.what(), "unhandled name in generic implementation"))
+ exit(0);
+ // Thrown by gnu implemenation.
+ else if (std::strstr(ex.what(), "unknown name"))
+ exit(0);
else
throw;
}
# define VERIFY(fn) test &= (fn)
#endif
#include <list>
+#include <locale>
namespace __gnu_cxx_test
{
void
run_tests_wrapped_env(const char*, const char*, const func_callback&);
- // Run select unit test inside exception catcher for non-C named locale
- void
- run_test_wrapped_generic_locale_exception_catcher(const test_func);
+ // Try to create a locale with the given name. If it fails, bail.
+ std::locale
+ try_named_locale(const char* name);
// Test data types.
struct pod_char