diff options
author | Loren J. Rittle <ljrittle@acm.org> | 2003-03-08 08:55:54 +0000 |
---|---|---|
committer | Loren J. Rittle <ljrittle@gcc.gnu.org> | 2003-03-08 08:55:54 +0000 |
commit | 85c39c6df194ac319d07b73ca4c517fc31d8d002 (patch) | |
tree | bda4510fdc69ec9c46caaf8b5f03733b2f769199 | |
parent | feecf61403046c7a8265aa6a4a10f5c9e722efe5 (diff) | |
download | gcc-85c39c6df194ac319d07b73ca4c517fc31d8d002.zip gcc-85c39c6df194ac319d07b73ca4c517fc31d8d002.tar.gz gcc-85c39c6df194ac319d07b73ca4c517fc31d8d002.tar.bz2 |
c_locale.cc (locale::facet::_S_create_c_locale): Throw runtime exception when unsupported language is specified.
* config/locale/generic/c_locale.cc (locale::facet::_S_create_c_locale):
Throw runtime exception when unsupported language is specified.
* testsuite/testsuite_hooks.h
(run_test_wrapped_generic_locale_exception_catcher): New function.
* testsuite/testsuite_hooks.cc (run_tests_wrapped_locale):
Suppress runtime exception thrown by generic implementation.
(run_tests_wrapped_env): Likewise.
(run_test_wrapped_generic_locale_exception_catcher): New function.
* testsuite/22_locale/collate/compare/char/1.cc: New test wrap.
* testsuite/22_locale/collate/compare/char/2.cc: New test wrap.
* testsuite/22_locale/collate/compare/char/3.cc: New test wrap.
* testsuite/22_locale/collate/hash/char/2.cc: New test wrap.
* testsuite/22_locale/collate/transform/char/2.cc: New test wrap.
* testsuite/22_locale/collate/transform/char/3.cc: New test wrap.
* testsuite/22_locale/collate_byname/1.cc: New test wrap.
* testsuite/22_locale/ctype/is/char/2.cc: New test wrap.
* testsuite/22_locale/facet/2.cc: New test wrap.
* testsuite/22_locale/locale/cons/4.cc: New test wrap.
* testsuite/22_locale/locale/cons/5.cc: New test wrap.
* testsuite/22_locale/locale/cons/7.cc: New test wrap.
* testsuite/22_locale/messages/members/char/1.cc: New test wrap.
* testsuite/22_locale/messages/members/char/2.cc: New test wrap.
* testsuite/22_locale/messages/members/char/3.cc: New test wrap.
* testsuite/22_locale/messages_byname/1.cc: New test wrap.
* testsuite/22_locale/money_get/get/char/1.cc: New test wrap.
* testsuite/22_locale/money_get/get/char/2.cc: New test wrap.
* testsuite/22_locale/money_get/get/char/3.cc: New test wrap.
* testsuite/22_locale/money_get/get/char/4.cc: New test wrap.
* testsuite/22_locale/money_put/put/char/1.cc: New test wrap.
* testsuite/22_locale/money_put/put/char/2.cc: New test wrap.
* testsuite/22_locale/money_put/put/char/3.cc: New test wrap.
* testsuite/22_locale/moneypunct/members/char/2.cc: New test wrap.
* testsuite/22_locale/moneypunct_byname/1.cc: New test wrap.
* testsuite/22_locale/num_get/get/char/1.cc: New test wrap.
* testsuite/22_locale/num_get/get/char/2.cc: New test wrap.
* testsuite/22_locale/num_get/get/char/3.cc: New test wrap.
* testsuite/22_locale/num_get/get/char/5.cc: New test wrap.
* testsuite/22_locale/num_get/get/char/6.cc: New test wrap.
* testsuite/22_locale/num_put/put/char/1.cc: New test wrap.
* testsuite/22_locale/num_put/put/char/2.cc: New test wrap.
* testsuite/22_locale/num_put/put/char/3.cc: New test wrap.
* testsuite/22_locale/num_put/put/char/5.cc: New test wrap.
* testsuite/22_locale/numpunct/members/char/1.cc: New test wrap.
* testsuite/22_locale/numpunct/members/char/2.cc: New test wrap.
* testsuite/22_locale/numpunct_byname/1.cc: New test wrap.
* testsuite/22_locale/numpunct_byname/2.cc: New test wrap.
* testsuite/22_locale/time_get/date_order/char/1.cc: New test wrap.
* testsuite/22_locale/time_get/get_date/char/1.cc: New test wrap.
* testsuite/22_locale/time_get/get_date/char/2.cc: New test wrap.
* testsuite/22_locale/time_get/get_monthname/char/1.cc: New test wrap.
* testsuite/22_locale/time_get/get_monthname/char/2.cc: New test wrap.
* testsuite/22_locale/time_get/get_time/char/1.cc: New test wrap.
* testsuite/22_locale/time_get/get_time/char/2.cc: New test wrap.
* testsuite/22_locale/time_get/get_weekday/char/1.cc: New test wrap.
* testsuite/22_locale/time_get/get_weekday/char/2.cc: New test wrap.
* testsuite/22_locale/time_get/get_year/char/1.cc: New test wrap.
* testsuite/22_locale/time_put/put/char/1.cc: New test wrap.
* testsuite/22_locale/time_put/put/char/2.cc: New test wrap.
* testsuite/22_locale/time_put/put/char/3.cc: New test wrap.
* testsuite/22_locale/time_put/put/char/4.cc: New test wrap.
* testsuite/22_locale/time_put/put/char/5.cc: New test wrap.
* testsuite/22_locale/time_put/put/char/6.cc: New test wrap.
* testsuite/22_locale/time_put/put/char/7.cc: New test wrap.
* testsuite/22_locale/time_put/put/char/8.cc: New test wrap.
* testsuite/27_io/filebuf_virtuals.cc: New test wrap.
* testsuite/27_io/ios_members.cc: New test wrap.
* testsuite/27_io/ostream_inserter_arith.cc (test02): Make void.
New test wrap.
* testsuite/27_io/streambuf_members.cc: New test wrap.
* testsuite/27_io/stringbuf_virtuals.cc: New test wrap.
From-SVN: r63975
65 files changed, 186 insertions, 71 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 1ada07b..47d2f49 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,76 @@ +2003-03-08 Loren J. Rittle <ljrittle@acm.org> + + * config/locale/generic/c_locale.cc (locale::facet::_S_create_c_locale): + Throw runtime exception when unsupported language is specified. + * testsuite/testsuite_hooks.h + (run_test_wrapped_generic_locale_exception_catcher): New function. + * testsuite/testsuite_hooks.cc (run_tests_wrapped_locale): + Suppress runtime exception thrown by generic implementation. + (run_tests_wrapped_env): Likewise. + (run_test_wrapped_generic_locale_exception_catcher): New function. + * testsuite/22_locale/collate/compare/char/1.cc: New test wrap. + * testsuite/22_locale/collate/compare/char/2.cc: New test wrap. + * testsuite/22_locale/collate/compare/char/3.cc: New test wrap. + * testsuite/22_locale/collate/hash/char/2.cc: New test wrap. + * testsuite/22_locale/collate/transform/char/2.cc: New test wrap. + * testsuite/22_locale/collate/transform/char/3.cc: New test wrap. + * testsuite/22_locale/collate_byname/1.cc: New test wrap. + * testsuite/22_locale/ctype/is/char/2.cc: New test wrap. + * testsuite/22_locale/facet/2.cc: New test wrap. + * testsuite/22_locale/locale/cons/4.cc: New test wrap. + * testsuite/22_locale/locale/cons/5.cc: New test wrap. + * testsuite/22_locale/locale/cons/7.cc: New test wrap. + * testsuite/22_locale/messages/members/char/1.cc: New test wrap. + * testsuite/22_locale/messages/members/char/2.cc: New test wrap. + * testsuite/22_locale/messages/members/char/3.cc: New test wrap. + * testsuite/22_locale/messages_byname/1.cc: New test wrap. + * testsuite/22_locale/money_get/get/char/1.cc: New test wrap. + * testsuite/22_locale/money_get/get/char/2.cc: New test wrap. + * testsuite/22_locale/money_get/get/char/3.cc: New test wrap. + * testsuite/22_locale/money_get/get/char/4.cc: New test wrap. + * testsuite/22_locale/money_put/put/char/1.cc: New test wrap. + * testsuite/22_locale/money_put/put/char/2.cc: New test wrap. + * testsuite/22_locale/money_put/put/char/3.cc: New test wrap. + * testsuite/22_locale/moneypunct/members/char/2.cc: New test wrap. + * testsuite/22_locale/moneypunct_byname/1.cc: New test wrap. + * testsuite/22_locale/num_get/get/char/1.cc: New test wrap. + * testsuite/22_locale/num_get/get/char/2.cc: New test wrap. + * testsuite/22_locale/num_get/get/char/3.cc: New test wrap. + * testsuite/22_locale/num_get/get/char/5.cc: New test wrap. + * testsuite/22_locale/num_get/get/char/6.cc: New test wrap. + * testsuite/22_locale/num_put/put/char/1.cc: New test wrap. + * testsuite/22_locale/num_put/put/char/2.cc: New test wrap. + * testsuite/22_locale/num_put/put/char/3.cc: New test wrap. + * testsuite/22_locale/num_put/put/char/5.cc: New test wrap. + * testsuite/22_locale/numpunct/members/char/1.cc: New test wrap. + * testsuite/22_locale/numpunct/members/char/2.cc: New test wrap. + * testsuite/22_locale/numpunct_byname/1.cc: New test wrap. + * testsuite/22_locale/numpunct_byname/2.cc: New test wrap. + * testsuite/22_locale/time_get/date_order/char/1.cc: New test wrap. + * testsuite/22_locale/time_get/get_date/char/1.cc: New test wrap. + * testsuite/22_locale/time_get/get_date/char/2.cc: New test wrap. + * testsuite/22_locale/time_get/get_monthname/char/1.cc: New test wrap. + * testsuite/22_locale/time_get/get_monthname/char/2.cc: New test wrap. + * testsuite/22_locale/time_get/get_time/char/1.cc: New test wrap. + * testsuite/22_locale/time_get/get_time/char/2.cc: New test wrap. + * testsuite/22_locale/time_get/get_weekday/char/1.cc: New test wrap. + * testsuite/22_locale/time_get/get_weekday/char/2.cc: New test wrap. + * testsuite/22_locale/time_get/get_year/char/1.cc: New test wrap. + * testsuite/22_locale/time_put/put/char/1.cc: New test wrap. + * testsuite/22_locale/time_put/put/char/2.cc: New test wrap. + * testsuite/22_locale/time_put/put/char/3.cc: New test wrap. + * testsuite/22_locale/time_put/put/char/4.cc: New test wrap. + * testsuite/22_locale/time_put/put/char/5.cc: New test wrap. + * testsuite/22_locale/time_put/put/char/6.cc: New test wrap. + * testsuite/22_locale/time_put/put/char/7.cc: New test wrap. + * testsuite/22_locale/time_put/put/char/8.cc: New test wrap. + * testsuite/27_io/filebuf_virtuals.cc: New test wrap. + * testsuite/27_io/ios_members.cc: New test wrap. + * testsuite/27_io/ostream_inserter_arith.cc (test02): Make void. + New test wrap. + * testsuite/27_io/streambuf_members.cc: New test wrap. + * testsuite/27_io/stringbuf_virtuals.cc: New test wrap. + 2003-03-08 Paolo Carlini <pcarlini@unitus.it> Petur Runolfsson <peturr02@ru.is> diff --git a/libstdc++-v3/config/locale/generic/c_locale.cc b/libstdc++-v3/config/locale/generic/c_locale.cc index 23f7912..13bc21a 100644 --- a/libstdc++-v3/config/locale/generic/c_locale.cc +++ b/libstdc++-v3/config/locale/generic/c_locale.cc @@ -212,9 +212,13 @@ namespace std } void - locale::facet::_S_create_c_locale(__c_locale& __cloc, const char*, + locale::facet::_S_create_c_locale(__c_locale& __cloc, const char* __s, __c_locale) - { __cloc = NULL; } + { + __cloc = NULL; + 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"); + } void locale::facet::_S_destroy_c_locale(__c_locale& __cloc) diff --git a/libstdc++-v3/testsuite/22_locale/collate/compare/char/1.cc b/libstdc++-v3/testsuite/22_locale/collate/compare/char/1.cc index 7487108..bed2fb4 100644 --- a/libstdc++-v3/testsuite/22_locale/collate/compare/char/1.cc +++ b/libstdc++-v3/testsuite/22_locale/collate/compare/char/1.cc @@ -74,6 +74,6 @@ void test01() int main() { - test01(); + __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test01); return 0; } diff --git a/libstdc++-v3/testsuite/22_locale/collate/compare/char/2.cc b/libstdc++-v3/testsuite/22_locale/collate/compare/char/2.cc index 52052f9..ab29ac4 100644 --- a/libstdc++-v3/testsuite/22_locale/collate/compare/char/2.cc +++ b/libstdc++-v3/testsuite/22_locale/collate/compare/char/2.cc @@ -81,6 +81,6 @@ void test02() int main() { - test02(); + __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test02); return 0; } diff --git a/libstdc++-v3/testsuite/22_locale/collate/compare/char/3.cc b/libstdc++-v3/testsuite/22_locale/collate/compare/char/3.cc index 0cce392..c820954 100644 --- a/libstdc++-v3/testsuite/22_locale/collate/compare/char/3.cc +++ b/libstdc++-v3/testsuite/22_locale/collate/compare/char/3.cc @@ -85,6 +85,6 @@ void test03() int main() { - test03(); + __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test03); return 0; } diff --git a/libstdc++-v3/testsuite/22_locale/collate/hash/char/2.cc b/libstdc++-v3/testsuite/22_locale/collate/hash/char/2.cc index 75eb202..47fcd57 100644 --- a/libstdc++-v3/testsuite/22_locale/collate/hash/char/2.cc +++ b/libstdc++-v3/testsuite/22_locale/collate/hash/char/2.cc @@ -70,6 +70,6 @@ void test02() int main() { - test02(); + __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test02); return 0; } diff --git a/libstdc++-v3/testsuite/22_locale/collate/transform/char/2.cc b/libstdc++-v3/testsuite/22_locale/collate/transform/char/2.cc index dc2b395..24ff7cd 100644 --- a/libstdc++-v3/testsuite/22_locale/collate/transform/char/2.cc +++ b/libstdc++-v3/testsuite/22_locale/collate/transform/char/2.cc @@ -67,6 +67,6 @@ void test02() int main() { - test02(); + __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test02); return 0; } diff --git a/libstdc++-v3/testsuite/22_locale/collate/transform/char/3.cc b/libstdc++-v3/testsuite/22_locale/collate/transform/char/3.cc index a6255af..f9d16b5 100644 --- a/libstdc++-v3/testsuite/22_locale/collate/transform/char/3.cc +++ b/libstdc++-v3/testsuite/22_locale/collate/transform/char/3.cc @@ -88,6 +88,6 @@ void test03() int main() { - test03(); + __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test03); return 0; } diff --git a/libstdc++-v3/testsuite/22_locale/collate_byname/1.cc b/libstdc++-v3/testsuite/22_locale/collate_byname/1.cc index 6298662..edfb42c 100644 --- a/libstdc++-v3/testsuite/22_locale/collate_byname/1.cc +++ b/libstdc++-v3/testsuite/22_locale/collate_byname/1.cc @@ -131,6 +131,6 @@ void test01() int main() { - test01(); + __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test01); return 0; } diff --git a/libstdc++-v3/testsuite/22_locale/ctype/is/char/2.cc b/libstdc++-v3/testsuite/22_locale/ctype/is/char/2.cc index 6e54ab8..d04800a 100644 --- a/libstdc++-v3/testsuite/22_locale/ctype/is/char/2.cc +++ b/libstdc++-v3/testsuite/22_locale/ctype/is/char/2.cc @@ -99,6 +99,6 @@ void test02() int main() { - test02(); + __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test02); return 0; } diff --git a/libstdc++-v3/testsuite/22_locale/facet/2.cc b/libstdc++-v3/testsuite/22_locale/facet/2.cc index abda43e..ea63d73 100644 --- a/libstdc++-v3/testsuite/22_locale/facet/2.cc +++ b/libstdc++-v3/testsuite/22_locale/facet/2.cc @@ -89,6 +89,6 @@ void test02() int main () { - test02(); + __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test02); return 0; } diff --git a/libstdc++-v3/testsuite/22_locale/locale/cons/4.cc b/libstdc++-v3/testsuite/22_locale/locale/cons/4.cc index 26d3aaf..4864b0b 100644 --- a/libstdc++-v3/testsuite/22_locale/locale/cons/4.cc +++ b/libstdc++-v3/testsuite/22_locale/locale/cons/4.cc @@ -42,6 +42,6 @@ void test03() int main() { - test03(); + __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test03); return 0; } diff --git a/libstdc++-v3/testsuite/22_locale/locale/cons/5.cc b/libstdc++-v3/testsuite/22_locale/locale/cons/5.cc index b9e1391..5c649d0 100644 --- a/libstdc++-v3/testsuite/22_locale/locale/cons/5.cc +++ b/libstdc++-v3/testsuite/22_locale/locale/cons/5.cc @@ -193,6 +193,6 @@ void test04() int main() { - test04(); + __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test04); return 0; } diff --git a/libstdc++-v3/testsuite/22_locale/locale/cons/7.cc b/libstdc++-v3/testsuite/22_locale/locale/cons/7.cc index 75598e2..fb70966 100644 --- a/libstdc++-v3/testsuite/22_locale/locale/cons/7.cc +++ b/libstdc++-v3/testsuite/22_locale/locale/cons/7.cc @@ -99,6 +99,6 @@ test02() int main() { - test02(); + __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test02); return 0; } diff --git a/libstdc++-v3/testsuite/22_locale/messages/members/char/1.cc b/libstdc++-v3/testsuite/22_locale/messages/members/char/1.cc index 05116d9..7167fad 100644 --- a/libstdc++-v3/testsuite/22_locale/messages/members/char/1.cc +++ b/libstdc++-v3/testsuite/22_locale/messages/members/char/1.cc @@ -64,6 +64,6 @@ void test01() int main() { - test01(); + __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test01); return 0; } diff --git a/libstdc++-v3/testsuite/22_locale/messages/members/char/2.cc b/libstdc++-v3/testsuite/22_locale/messages/members/char/2.cc index 3234ef6f..61ffba6 100644 --- a/libstdc++-v3/testsuite/22_locale/messages/members/char/2.cc +++ b/libstdc++-v3/testsuite/22_locale/messages/members/char/2.cc @@ -64,6 +64,6 @@ void test02() int main() { - test02(); + __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test02); return 0; } diff --git a/libstdc++-v3/testsuite/22_locale/messages/members/char/3.cc b/libstdc++-v3/testsuite/22_locale/messages/members/char/3.cc index d8346b2..55cf801 100644 --- a/libstdc++-v3/testsuite/22_locale/messages/members/char/3.cc +++ b/libstdc++-v3/testsuite/22_locale/messages/members/char/3.cc @@ -64,6 +64,6 @@ void test03() int main() { - test03(); + __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test03); return 0; } diff --git a/libstdc++-v3/testsuite/22_locale/messages_byname/1.cc b/libstdc++-v3/testsuite/22_locale/messages_byname/1.cc index 1c6fc5b..e9d3217 100644 --- a/libstdc++-v3/testsuite/22_locale/messages_byname/1.cc +++ b/libstdc++-v3/testsuite/22_locale/messages_byname/1.cc @@ -73,6 +73,6 @@ void test01() int main() { - test01(); + __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test01); return 0; } diff --git a/libstdc++-v3/testsuite/22_locale/money_get/get/char/1.cc b/libstdc++-v3/testsuite/22_locale/money_get/get/char/1.cc index 7bbfc88..f4e5481 100644 --- a/libstdc++-v3/testsuite/22_locale/money_get/get/char/1.cc +++ b/libstdc++-v3/testsuite/22_locale/money_get/get/char/1.cc @@ -146,6 +146,6 @@ void test01() int main() { - test01(); + __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test01); return 0; } diff --git a/libstdc++-v3/testsuite/22_locale/money_get/get/char/2.cc b/libstdc++-v3/testsuite/22_locale/money_get/get/char/2.cc index 0ca281f..42e1496 100644 --- a/libstdc++-v3/testsuite/22_locale/money_get/get/char/2.cc +++ b/libstdc++-v3/testsuite/22_locale/money_get/get/char/2.cc @@ -135,6 +135,6 @@ void test02() int main() { - test02(); + __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test02); return 0; } diff --git a/libstdc++-v3/testsuite/22_locale/money_get/get/char/3.cc b/libstdc++-v3/testsuite/22_locale/money_get/get/char/3.cc index eb8ef9c..749c68c 100644 --- a/libstdc++-v3/testsuite/22_locale/money_get/get/char/3.cc +++ b/libstdc++-v3/testsuite/22_locale/money_get/get/char/3.cc @@ -91,6 +91,6 @@ void test03() int main() { - test03(); + __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test03); return 0; } diff --git a/libstdc++-v3/testsuite/22_locale/money_get/get/char/4.cc b/libstdc++-v3/testsuite/22_locale/money_get/get/char/4.cc index 3a6aa18..b245665 100644 --- a/libstdc++-v3/testsuite/22_locale/money_get/get/char/4.cc +++ b/libstdc++-v3/testsuite/22_locale/money_get/get/char/4.cc @@ -86,6 +86,6 @@ void test04() int main() { - test04(); + __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test04); return 0; } diff --git a/libstdc++-v3/testsuite/22_locale/money_put/put/char/1.cc b/libstdc++-v3/testsuite/22_locale/money_put/put/char/1.cc index cbc7889..d34d3fb 100644 --- a/libstdc++-v3/testsuite/22_locale/money_put/put/char/1.cc +++ b/libstdc++-v3/testsuite/22_locale/money_put/put/char/1.cc @@ -124,6 +124,6 @@ void test01() int main() { - test01(); + __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test01); return 0; } diff --git a/libstdc++-v3/testsuite/22_locale/money_put/put/char/2.cc b/libstdc++-v3/testsuite/22_locale/money_put/put/char/2.cc index 7242844..d1c240f 100644 --- a/libstdc++-v3/testsuite/22_locale/money_put/put/char/2.cc +++ b/libstdc++-v3/testsuite/22_locale/money_put/put/char/2.cc @@ -115,6 +115,6 @@ void test02() int main() { - test02(); + __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test02); return 0; } diff --git a/libstdc++-v3/testsuite/22_locale/money_put/put/char/3.cc b/libstdc++-v3/testsuite/22_locale/money_put/put/char/3.cc index 58e3ff4..73c84b2 100644 --- a/libstdc++-v3/testsuite/22_locale/money_put/put/char/3.cc +++ b/libstdc++-v3/testsuite/22_locale/money_put/put/char/3.cc @@ -104,6 +104,6 @@ void test03() int main() { - test03(); + __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test03); return 0; } diff --git a/libstdc++-v3/testsuite/22_locale/moneypunct/members/char/2.cc b/libstdc++-v3/testsuite/22_locale/moneypunct/members/char/2.cc index 5434ea8..7d74101 100644 --- a/libstdc++-v3/testsuite/22_locale/moneypunct/members/char/2.cc +++ b/libstdc++-v3/testsuite/22_locale/moneypunct/members/char/2.cc @@ -95,6 +95,6 @@ void test02() int main() { - test02(); + __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test02); return 0; } diff --git a/libstdc++-v3/testsuite/22_locale/moneypunct_byname/1.cc b/libstdc++-v3/testsuite/22_locale/moneypunct_byname/1.cc index 01c761b..83fc8f6 100644 --- a/libstdc++-v3/testsuite/22_locale/moneypunct_byname/1.cc +++ b/libstdc++-v3/testsuite/22_locale/moneypunct_byname/1.cc @@ -93,7 +93,7 @@ void test01() int main() { - test01(); + __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test01); return 0; } diff --git a/libstdc++-v3/testsuite/22_locale/num_get/get/char/1.cc b/libstdc++-v3/testsuite/22_locale/num_get/get/char/1.cc index 7cc897c..3723e23 100644 --- a/libstdc++-v3/testsuite/22_locale/num_get/get/char/1.cc +++ b/libstdc++-v3/testsuite/22_locale/num_get/get/char/1.cc @@ -162,7 +162,7 @@ void test01() int main() { - test01(); + __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test01); return 0; } diff --git a/libstdc++-v3/testsuite/22_locale/num_get/get/char/2.cc b/libstdc++-v3/testsuite/22_locale/num_get/get/char/2.cc index 4604d11..108fae1 100644 --- a/libstdc++-v3/testsuite/22_locale/num_get/get/char/2.cc +++ b/libstdc++-v3/testsuite/22_locale/num_get/get/char/2.cc @@ -132,7 +132,7 @@ void test02() int main() { - test02(); + __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test02); return 0; } diff --git a/libstdc++-v3/testsuite/22_locale/num_get/get/char/3.cc b/libstdc++-v3/testsuite/22_locale/num_get/get/char/3.cc index 253e735..b6c0f12 100644 --- a/libstdc++-v3/testsuite/22_locale/num_get/get/char/3.cc +++ b/libstdc++-v3/testsuite/22_locale/num_get/get/char/3.cc @@ -94,7 +94,7 @@ void test03() int main() { - test03(); + __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test03); return 0; } diff --git a/libstdc++-v3/testsuite/22_locale/num_get/get/char/5.cc b/libstdc++-v3/testsuite/22_locale/num_get/get/char/5.cc index 21f7bef..94da704 100644 --- a/libstdc++-v3/testsuite/22_locale/num_get/get/char/5.cc +++ b/libstdc++-v3/testsuite/22_locale/num_get/get/char/5.cc @@ -84,7 +84,7 @@ void test05() int main() { - test05(); + __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test05); return 0; } diff --git a/libstdc++-v3/testsuite/22_locale/num_get/get/char/6.cc b/libstdc++-v3/testsuite/22_locale/num_get/get/char/6.cc index 49f3a46..b5e0a21 100644 --- a/libstdc++-v3/testsuite/22_locale/num_get/get/char/6.cc +++ b/libstdc++-v3/testsuite/22_locale/num_get/get/char/6.cc @@ -49,7 +49,7 @@ void test06() int main() { - test06(); + __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test06); return 0; } diff --git a/libstdc++-v3/testsuite/22_locale/num_put/put/char/1.cc b/libstdc++-v3/testsuite/22_locale/num_put/put/char/1.cc index d73ceb7..87abef4 100644 --- a/libstdc++-v3/testsuite/22_locale/num_put/put/char/1.cc +++ b/libstdc++-v3/testsuite/22_locale/num_put/put/char/1.cc @@ -169,7 +169,7 @@ void test01() int main() { - test01(); + __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test01); return 0; } diff --git a/libstdc++-v3/testsuite/22_locale/num_put/put/char/2.cc b/libstdc++-v3/testsuite/22_locale/num_put/put/char/2.cc index dab9204..a62dfc1 100644 --- a/libstdc++-v3/testsuite/22_locale/num_put/put/char/2.cc +++ b/libstdc++-v3/testsuite/22_locale/num_put/put/char/2.cc @@ -105,7 +105,7 @@ void test02() int main() { - test02(); + __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test02); return 0; } diff --git a/libstdc++-v3/testsuite/22_locale/num_put/put/char/3.cc b/libstdc++-v3/testsuite/22_locale/num_put/put/char/3.cc index 201403a..0bc92b2 100644 --- a/libstdc++-v3/testsuite/22_locale/num_put/put/char/3.cc +++ b/libstdc++-v3/testsuite/22_locale/num_put/put/char/3.cc @@ -88,7 +88,7 @@ void test03() int main() { - test03(); + __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test03); return 0; } diff --git a/libstdc++-v3/testsuite/22_locale/num_put/put/char/5.cc b/libstdc++-v3/testsuite/22_locale/num_put/put/char/5.cc index 0af3d3c..eb0bd21 100644 --- a/libstdc++-v3/testsuite/22_locale/num_put/put/char/5.cc +++ b/libstdc++-v3/testsuite/22_locale/num_put/put/char/5.cc @@ -63,7 +63,7 @@ void test05() int main() { - test05(); + __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test05); return 0; } diff --git a/libstdc++-v3/testsuite/22_locale/numpunct/members/char/1.cc b/libstdc++-v3/testsuite/22_locale/numpunct/members/char/1.cc index 9babb99..aba34e2 100644 --- a/libstdc++-v3/testsuite/22_locale/numpunct/members/char/1.cc +++ b/libstdc++-v3/testsuite/22_locale/numpunct/members/char/1.cc @@ -60,6 +60,6 @@ void test01() int main() { - test01(); + __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test01); return 0; } diff --git a/libstdc++-v3/testsuite/22_locale/numpunct/members/char/2.cc b/libstdc++-v3/testsuite/22_locale/numpunct/members/char/2.cc index bb4eff5..ec9512f 100644 --- a/libstdc++-v3/testsuite/22_locale/numpunct/members/char/2.cc +++ b/libstdc++-v3/testsuite/22_locale/numpunct/members/char/2.cc @@ -82,6 +82,6 @@ void test02() int main() { - test02(); + __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test02); return 0; } diff --git a/libstdc++-v3/testsuite/22_locale/numpunct_byname/1.cc b/libstdc++-v3/testsuite/22_locale/numpunct_byname/1.cc index 4c99dda..a6c71dc 100644 --- a/libstdc++-v3/testsuite/22_locale/numpunct_byname/1.cc +++ b/libstdc++-v3/testsuite/22_locale/numpunct_byname/1.cc @@ -71,6 +71,6 @@ void test01() int main() { - test01(); + __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test01); return 0; } diff --git a/libstdc++-v3/testsuite/22_locale/numpunct_byname/2.cc b/libstdc++-v3/testsuite/22_locale/numpunct_byname/2.cc index 133607d..f096a8b 100644 --- a/libstdc++-v3/testsuite/22_locale/numpunct_byname/2.cc +++ b/libstdc++-v3/testsuite/22_locale/numpunct_byname/2.cc @@ -40,6 +40,6 @@ void test02() int main() { - test02(); + __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test02); return 0; } diff --git a/libstdc++-v3/testsuite/22_locale/time_get/date_order/char/1.cc b/libstdc++-v3/testsuite/22_locale/time_get/date_order/char/1.cc index 5b3a323..46958a2 100644 --- a/libstdc++-v3/testsuite/22_locale/time_get/date_order/char/1.cc +++ b/libstdc++-v3/testsuite/22_locale/time_get/date_order/char/1.cc @@ -64,6 +64,6 @@ void test01() int main() { - test01(); + __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test01); return 0; } diff --git a/libstdc++-v3/testsuite/22_locale/time_get/get_date/char/1.cc b/libstdc++-v3/testsuite/22_locale/time_get/get_date/char/1.cc index 659086a..f242c4b 100644 --- a/libstdc++-v3/testsuite/22_locale/time_get/get_date/char/1.cc +++ b/libstdc++-v3/testsuite/22_locale/time_get/get_date/char/1.cc @@ -107,6 +107,6 @@ void test01() int main() { - test01(); + __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test01); return 0; } diff --git a/libstdc++-v3/testsuite/22_locale/time_get/get_date/char/2.cc b/libstdc++-v3/testsuite/22_locale/time_get/get_date/char/2.cc index 434695c..274a231 100644 --- a/libstdc++-v3/testsuite/22_locale/time_get/get_date/char/2.cc +++ b/libstdc++-v3/testsuite/22_locale/time_get/get_date/char/2.cc @@ -103,6 +103,6 @@ void test02() int main() { - test02(); + __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test02); return 0; } diff --git a/libstdc++-v3/testsuite/22_locale/time_get/get_monthname/char/1.cc b/libstdc++-v3/testsuite/22_locale/time_get/get_monthname/char/1.cc index 8984069..2fd9b76 100644 --- a/libstdc++-v3/testsuite/22_locale/time_get/get_monthname/char/1.cc +++ b/libstdc++-v3/testsuite/22_locale/time_get/get_monthname/char/1.cc @@ -121,6 +121,6 @@ void test01() int main() { - test01(); + __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test01); return 0; } diff --git a/libstdc++-v3/testsuite/22_locale/time_get/get_monthname/char/2.cc b/libstdc++-v3/testsuite/22_locale/time_get/get_monthname/char/2.cc index 66ad029..c98f8d1 100644 --- a/libstdc++-v3/testsuite/22_locale/time_get/get_monthname/char/2.cc +++ b/libstdc++-v3/testsuite/22_locale/time_get/get_monthname/char/2.cc @@ -85,6 +85,6 @@ void test02() int main() { - test02(); + __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test02); return 0; } diff --git a/libstdc++-v3/testsuite/22_locale/time_get/get_time/char/1.cc b/libstdc++-v3/testsuite/22_locale/time_get/get_time/char/1.cc index ef9c2bb..80d996c 100644 --- a/libstdc++-v3/testsuite/22_locale/time_get/get_time/char/1.cc +++ b/libstdc++-v3/testsuite/22_locale/time_get/get_time/char/1.cc @@ -122,6 +122,6 @@ void test01() int main() { - test01(); + __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test01); return 0; } diff --git a/libstdc++-v3/testsuite/22_locale/time_get/get_time/char/2.cc b/libstdc++-v3/testsuite/22_locale/time_get/get_time/char/2.cc index 9adb288..1d56827 100644 --- a/libstdc++-v3/testsuite/22_locale/time_get/get_time/char/2.cc +++ b/libstdc++-v3/testsuite/22_locale/time_get/get_time/char/2.cc @@ -75,6 +75,6 @@ void test02() int main() { - test02(); + __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test02); return 0; } diff --git a/libstdc++-v3/testsuite/22_locale/time_get/get_weekday/char/1.cc b/libstdc++-v3/testsuite/22_locale/time_get/get_weekday/char/1.cc index 4fad901..ca89d1e 100644 --- a/libstdc++-v3/testsuite/22_locale/time_get/get_weekday/char/1.cc +++ b/libstdc++-v3/testsuite/22_locale/time_get/get_weekday/char/1.cc @@ -129,6 +129,6 @@ void test01() int main() { - test01(); + __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test01); return 0; } diff --git a/libstdc++-v3/testsuite/22_locale/time_get/get_weekday/char/2.cc b/libstdc++-v3/testsuite/22_locale/time_get/get_weekday/char/2.cc index 5f6e149..6e9d999 100644 --- a/libstdc++-v3/testsuite/22_locale/time_get/get_weekday/char/2.cc +++ b/libstdc++-v3/testsuite/22_locale/time_get/get_weekday/char/2.cc @@ -85,6 +85,6 @@ void test02() int main() { - test02(); + __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test02); return 0; } diff --git a/libstdc++-v3/testsuite/22_locale/time_get/get_year/char/1.cc b/libstdc++-v3/testsuite/22_locale/time_get/get_year/char/1.cc index 62f393b..aabfd6d 100644 --- a/libstdc++-v3/testsuite/22_locale/time_get/get_year/char/1.cc +++ b/libstdc++-v3/testsuite/22_locale/time_get/get_year/char/1.cc @@ -118,6 +118,6 @@ void test01() int main() { - test01(); + __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test01); return 0; } diff --git a/libstdc++-v3/testsuite/22_locale/time_put/put/char/1.cc b/libstdc++-v3/testsuite/22_locale/time_put/put/char/1.cc index e384319..f54a8c9 100644 --- a/libstdc++-v3/testsuite/22_locale/time_put/put/char/1.cc +++ b/libstdc++-v3/testsuite/22_locale/time_put/put/char/1.cc @@ -85,6 +85,6 @@ void test01() int main() { - test01(); + __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test01); return 0; } diff --git a/libstdc++-v3/testsuite/22_locale/time_put/put/char/2.cc b/libstdc++-v3/testsuite/22_locale/time_put/put/char/2.cc index e3a88b5..665036b 100644 --- a/libstdc++-v3/testsuite/22_locale/time_put/put/char/2.cc +++ b/libstdc++-v3/testsuite/22_locale/time_put/put/char/2.cc @@ -80,6 +80,6 @@ void test02() int main() { - test02(); + __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test02); return 0; } diff --git a/libstdc++-v3/testsuite/22_locale/time_put/put/char/3.cc b/libstdc++-v3/testsuite/22_locale/time_put/put/char/3.cc index 8354897..3399669 100644 --- a/libstdc++-v3/testsuite/22_locale/time_put/put/char/3.cc +++ b/libstdc++-v3/testsuite/22_locale/time_put/put/char/3.cc @@ -80,6 +80,6 @@ void test03() int main() { - test03(); + __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test03); return 0; } diff --git a/libstdc++-v3/testsuite/22_locale/time_put/put/char/4.cc b/libstdc++-v3/testsuite/22_locale/time_put/put/char/4.cc index ef59dc2..afb45ee 100644 --- a/libstdc++-v3/testsuite/22_locale/time_put/put/char/4.cc +++ b/libstdc++-v3/testsuite/22_locale/time_put/put/char/4.cc @@ -79,6 +79,6 @@ void test04() int main() { - test04(); + __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test04); return 0; } diff --git a/libstdc++-v3/testsuite/22_locale/time_put/put/char/5.cc b/libstdc++-v3/testsuite/22_locale/time_put/put/char/5.cc index dde913f5..b7b0055 100644 --- a/libstdc++-v3/testsuite/22_locale/time_put/put/char/5.cc +++ b/libstdc++-v3/testsuite/22_locale/time_put/put/char/5.cc @@ -75,6 +75,6 @@ void test05() int main() { - test05(); + __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test05); return 0; } diff --git a/libstdc++-v3/testsuite/22_locale/time_put/put/char/6.cc b/libstdc++-v3/testsuite/22_locale/time_put/put/char/6.cc index 1cec95f..9287571 100644 --- a/libstdc++-v3/testsuite/22_locale/time_put/put/char/6.cc +++ b/libstdc++-v3/testsuite/22_locale/time_put/put/char/6.cc @@ -73,6 +73,6 @@ void test06() int main() { - test06(); + __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test06); return 0; } diff --git a/libstdc++-v3/testsuite/22_locale/time_put/put/char/7.cc b/libstdc++-v3/testsuite/22_locale/time_put/put/char/7.cc index 931c6e0..00cefcf 100644 --- a/libstdc++-v3/testsuite/22_locale/time_put/put/char/7.cc +++ b/libstdc++-v3/testsuite/22_locale/time_put/put/char/7.cc @@ -74,6 +74,6 @@ void test07() int main() { - test07(); + __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test07); return 0; } diff --git a/libstdc++-v3/testsuite/22_locale/time_put/put/char/8.cc b/libstdc++-v3/testsuite/22_locale/time_put/put/char/8.cc index 4d801f3..10afde5 100644 --- a/libstdc++-v3/testsuite/22_locale/time_put/put/char/8.cc +++ b/libstdc++-v3/testsuite/22_locale/time_put/put/char/8.cc @@ -72,6 +72,6 @@ void test08() int main() { - test08(); + __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test08); return 0; } diff --git a/libstdc++-v3/testsuite/27_io/filebuf_virtuals.cc b/libstdc++-v3/testsuite/27_io/filebuf_virtuals.cc index fd45963..c60433c 100644 --- a/libstdc++-v3/testsuite/27_io/filebuf_virtuals.cc +++ b/libstdc++-v3/testsuite/27_io/filebuf_virtuals.cc @@ -769,7 +769,7 @@ main() test05(); test06(); - test07(); + __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test07); test08(); test09(); test10(); diff --git a/libstdc++-v3/testsuite/27_io/ios_members.cc b/libstdc++-v3/testsuite/27_io/ios_members.cc index 4c35980..3b7dc24 100644 --- a/libstdc++-v3/testsuite/27_io/ios_members.cc +++ b/libstdc++-v3/testsuite/27_io/ios_members.cc @@ -168,6 +168,6 @@ int main() { test01(); test02(); - test03(); + __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test03); return 0; } diff --git a/libstdc++-v3/testsuite/27_io/ostream_inserter_arith.cc b/libstdc++-v3/testsuite/27_io/ostream_inserter_arith.cc index e4e618d..6f9719f 100644 --- a/libstdc++-v3/testsuite/27_io/ostream_inserter_arith.cc +++ b/libstdc++-v3/testsuite/27_io/ostream_inserter_arith.cc @@ -253,7 +253,7 @@ test01() return 0; } -int +void test02() { bool test = true; @@ -297,7 +297,7 @@ test02() os2 << endl; os2 << fixed << setprecision(1) << val2 << endl; - return 0; + return; } template<typename T> @@ -395,7 +395,7 @@ int main() { test01(); - test02(); + __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test02); test03(); test04(); test05(); diff --git a/libstdc++-v3/testsuite/27_io/streambuf_members.cc b/libstdc++-v3/testsuite/27_io/streambuf_members.cc index d7ae569..263a95f 100644 --- a/libstdc++-v3/testsuite/27_io/streambuf_members.cc +++ b/libstdc++-v3/testsuite/27_io/streambuf_members.cc @@ -526,7 +526,7 @@ int main() test05(); test07(); - test08(); + __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test08); test09(); test10(); diff --git a/libstdc++-v3/testsuite/27_io/stringbuf_virtuals.cc b/libstdc++-v3/testsuite/27_io/stringbuf_virtuals.cc index a2a8368..c172f32 100644 --- a/libstdc++-v3/testsuite/27_io/stringbuf_virtuals.cc +++ b/libstdc++-v3/testsuite/27_io/stringbuf_virtuals.cc @@ -160,7 +160,7 @@ int main() test02(in2, false); test02(in3, false); - test08(); + __gnu_cxx_test::run_test_wrapped_generic_locale_exception_catcher(test08); test09(); return 0; } diff --git a/libstdc++-v3/testsuite/testsuite_hooks.cc b/libstdc++-v3/testsuite/testsuite_hooks.cc index 3527779..0bc67ad 100644 --- a/libstdc++-v3/testsuite/testsuite_hooks.cc +++ b/libstdc++-v3/testsuite/testsuite_hooks.cc @@ -148,9 +148,19 @@ namespace __gnu_cxx_test bool test = true; // Set the global locale. - locale loc_name(name); - locale orig = locale::global(loc_name); - + 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 + throw; + } + const char* res = setlocale(LC_ALL, name); if (res != NULL) { @@ -173,9 +183,18 @@ namespace __gnu_cxx_test #ifdef _GLIBCPP_HAVE_SETENV // Set the global locale. - locale loc_name(name); - locale orig = locale::global(loc_name); - + 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 + throw; + } // Set environment variable env to value in name. const char* oldENV = getenv(env); if (!setenv(env, name, 1)) @@ -191,6 +210,22 @@ namespace __gnu_cxx_test #endif } + void + run_test_wrapped_generic_locale_exception_catcher(const test_func f) + { + try + { + f(); + } + catch (std::runtime_error& ex) + { + if (std::strstr (ex.what(), "unhandled name in generic implementation")) + return; + else + throw; + } + } + counter::size_type counter::count = 0; unsigned int copy_constructor::count_ = 0; unsigned int copy_constructor::throw_on_ = 0; diff --git a/libstdc++-v3/testsuite/testsuite_hooks.h b/libstdc++-v3/testsuite/testsuite_hooks.h index d13e86c..28ff245 100644 --- a/libstdc++-v3/testsuite/testsuite_hooks.h +++ b/libstdc++-v3/testsuite/testsuite_hooks.h @@ -105,6 +105,9 @@ 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); // Test data types. struct pod_char |