mirror of
https://gcc.gnu.org/git/gcc.git
synced 2024-11-30 07:14:09 +08:00
Reshuffle 22_locale testsuite.
2003-01-21 Benjamin Kosnik <bkoz@redhat.com> Reshuffle 22_locale testsuite. * 22_locale/(codecvt.cc money_get.cc codecvt_members_char_char.cc money_get_members_char.cc codecvt_members_unicode_char.cc money_get_members_wchar_t.cc codecvt_members_unicode_wchar_t.cc moneypunct_byname.cc codecvt_members_wchar_t_char.cc moneypunct.cc collate_byname.cc moneypunct_members_char.cc collate.cc moneypunct_members_wchar_t.cc collate_members_char.cc money_put.cc collate_members_wchar_t.cc money_put_members_char.cc ctor_copy_dtor.cc money_put_members_wchar_t.cc ctype.cc num_get.cc ctype_is_char.cc num_get_members_char.cc ctype_is_wchar_t.cc num_get_members_wchar_t.cc ctype_members_char.cc numpunct_byname.cc ctype_members_wchar_t.cc numpunct.cc ctype_narrow_char.cc numpunct_members_char.cc ctype_narrow_wchar_t.cc numpunct_members_wchar_t.cc ctype_scan_char.cc num_put.cc ctype_scan_wchar_t.cc num_put_members_char.cc ctype_to_char.cc num_put_members_wchar_t.cc ctype_to_wchar_t.cc operators.cc ctype_widen_char.cc static_members.cc ctype_widen_wchar_t.cc time_get.cc facet.cc time_get_members_char.cc global_templates.cc time_get_members_wchar_t.cc, members.cc, time_put.cc, messages_byname.cc, time_put_members_char.cc, messages.cc, time_put_members_wchar_t.cc, messages_members_char.cc): Splint up into individual test cases... * 22_locale/codecvt/1.cc: New. * 22_locale/codecvt/2.cc: New. * 22_locale/codecvt/always_noconv/char/1.cc: New. * 22_locale/codecvt/always_noconv/char/wrapped_env.cc: New. * 22_locale/codecvt/always_noconv/char/wrapped_locale.cc: New. * 22_locale/codecvt/always_noconv/wchar_t/1.cc: New. * 22_locale/codecvt/always_noconv/wchar_t/wrapped_env.cc: New. * 22_locale/codecvt/always_noconv/wchar_t/wrapped_locale.cc: New. * 22_locale/codecvt/encoding/char/1.cc: New. * 22_locale/codecvt/encoding/char/wrapped_env.cc: New. * 22_locale/codecvt/encoding/char/wrapped_locale.cc: New. * 22_locale/codecvt/encoding/wchar_t/1.cc: New. * 22_locale/codecvt/encoding/wchar_t/wrapped_env.cc: New. * 22_locale/codecvt/encoding/wchar_t/wrapped_locale.cc: New. * 22_locale/codecvt/in/char/1.cc: New. * 22_locale/codecvt/in/char/wrapped_env.cc: New. * 22_locale/codecvt/in/char/wrapped_locale.cc: New. * 22_locale/codecvt/in/wchar_t/1.cc: New. * 22_locale/codecvt/in/wchar_t/wrapped_env.cc: New. * 22_locale/codecvt/in/wchar_t/wrapped_locale.cc: New. * 22_locale/codecvt/length/char/1.cc: New. * 22_locale/codecvt/length/char/wrapped_env.cc: New. * 22_locale/codecvt/length/char/wrapped_locale.cc: New. * 22_locale/codecvt/length/wchar_t/1.cc: New. * 22_locale/codecvt/length/wchar_t/wrapped_env.cc: New. * 22_locale/codecvt/length/wchar_t/wrapped_locale.cc: New. * 22_locale/codecvt/max_length/char/1.cc: New. * 22_locale/codecvt/max_length/char/wrapped_env.cc: New. * 22_locale/codecvt/max_length/char/wrapped_locale.cc: New. * 22_locale/codecvt/max_length/wchar_t/1.cc: New. * 22_locale/codecvt/max_length/wchar_t/wrapped_env.cc: New. * 22_locale/codecvt/max_length/wchar_t/wrapped_locale.cc: New. * 22_locale/codecvt/out/char/1.cc: New. * 22_locale/codecvt/out/char/wrapped_env.cc: New. * 22_locale/codecvt/out/char/wrapped_locale.cc: New. * 22_locale/codecvt/out/wchar_t/1.cc: New. * 22_locale/codecvt/out/wchar_t/wrapped_env.cc: New. * 22_locale/codecvt/out/wchar_t/wrapped_locale.cc: New. * 22_locale/codecvt/unicode/char.cc: New. * 22_locale/codecvt/unicode/wchar_t.cc: New. * 22_locale/codecvt/unshift/char/1.cc: New. * 22_locale/codecvt/unshift/char/wrapped_env.cc: New. * 22_locale/codecvt/unshift/char/wrapped_locale.cc: New. * 22_locale/codecvt/unshift/wchar_t/1.cc: New. * 22_locale/codecvt/unshift/wchar_t/wrapped_env.cc: New. * 22_locale/codecvt/unshift/wchar_t/wrapped_locale.cc: New. * 22_locale/collate/1.cc: New. * 22_locale/collate/2.cc: New. * 22_locale/collate/compare/char/1.cc: New. * 22_locale/collate/compare/char/2.cc: New. * 22_locale/collate/compare/char/wrapped_env.cc: New. * 22_locale/collate/compare/char/wrapped_locale.cc: New. * 22_locale/collate/compare/wchar_t/1.cc: New. * 22_locale/collate/compare/wchar_t/2.cc: New. * 22_locale/collate/compare/wchar_t/wrapped_env.cc: New. * 22_locale/collate/compare/wchar_t/wrapped_locale.cc: New. * 22_locale/collate/hash/char/1.cc: New. * 22_locale/collate/hash/char/2.cc: New. * 22_locale/collate/hash/char/wrapped_env.cc: New. * 22_locale/collate/hash/char/wrapped_locale.cc: New. * 22_locale/collate/hash/wchar_t/1.cc: New. * 22_locale/collate/hash/wchar_t/2.cc: New. * 22_locale/collate/hash/wchar_t/wrapped_env.cc: New. * 22_locale/collate/hash/wchar_t/wrapped_locale.cc: New. * 22_locale/collate/transform/char/2.cc: New. * 22_locale/collate/transform/char/wrapped_env.cc: New. * 22_locale/collate/transform/char/wrapped_locale.cc: New. * 22_locale/collate/transform/wchar_t/2.cc: New. * 22_locale/collate/transform/wchar_t/wrapped_env.cc: New. * 22_locale/collate/transform/wchar_t/wrapped_locale.cc: New. * 22_locale/collate_byname/1.cc: New. * 22_locale/ctype/1.cc: New. * 22_locale/ctype/2.cc: New. * 22_locale/ctype/cons/char/1.cc: New. * 22_locale/ctype/cons/char/wrapped_env.cc: New. * 22_locale/ctype/cons/char/wrapped_locale.cc: New. * 22_locale/ctype/is/char/1.cc: New. * 22_locale/ctype/is/char/2.cc: New. * 22_locale/ctype/is/char/3.cc: New. * 22_locale/ctype/is/char/wrapped_env.cc: New. * 22_locale/ctype/is/char/wrapped_locale.cc: New. * 22_locale/ctype/is/wchar_t/1.cc: New. * 22_locale/ctype/is/wchar_t/2.cc: New. * 22_locale/ctype/is/wchar_t/wrapped_env.cc: New. * 22_locale/ctype/is/wchar_t/wrapped_locale.cc: New. * 22_locale/ctype/narrow/char/1.cc: New. * 22_locale/ctype/narrow/char/2.cc: New. * 22_locale/ctype/narrow/char/wrapped_env.cc: New. * 22_locale/ctype/narrow/char/wrapped_locale.cc: New. * 22_locale/ctype/narrow/wchar_t/1.cc: New. * 22_locale/ctype/narrow/wchar_t/2.cc: New. * 22_locale/ctype/narrow/wchar_t/wrapped_env.cc: New. * 22_locale/ctype/narrow/wchar_t/wrapped_locale.cc: New. * 22_locale/ctype/scan/char/1.cc: New. * 22_locale/ctype/scan/char/wrapped_env.cc: New. * 22_locale/ctype/scan/char/wrapped_locale.cc: New. * 22_locale/ctype/scan/wchar_t/1.cc: New. * 22_locale/ctype/scan/wchar_t/wrapped_env.cc: New. * 22_locale/ctype/scan/wchar_t/wrapped_locale.cc: New. * 22_locale/ctype/to/char/1.cc: New. * 22_locale/ctype/to/char/wrapped_env.cc: New. * 22_locale/ctype/to/char/wrapped_locale.cc: New. * 22_locale/ctype/to/wchar_t/1.cc: New. * 22_locale/ctype/to/wchar_t/wrapped_env.cc: New. * 22_locale/ctype/to/wchar_t/wrapped_locale.cc: New. * 22_locale/ctype/widen/char/1.cc: New. * 22_locale/ctype/widen/char/wrapped_env.cc: New. * 22_locale/ctype/widen/char/wrapped_locale.cc: New. * 22_locale/ctype/widen/wchar_t/1.cc: New. * 22_locale/ctype/widen/wchar_t/wrapped_env.cc: New. * 22_locale/ctype/widen/wchar_t/wrapped_locale.cc: New. * 22_locale/facet/1.cc: New. * 22_locale/facet/2.cc: New. * 22_locale/global_templates/1.cc: New. * 22_locale/locale/cons/1.cc: New. * 22_locale/locale/cons/2.cc: New. * 22_locale/locale/cons/3.cc: New. * 22_locale/locale/cons/4.cc: New. * 22_locale/locale/cons/5.cc: New. * 22_locale/locale/cons/6.cc: New. * 22_locale/locale/cons/7.cc: New. * 22_locale/locale/global_locale_objects/1.cc: New. * 22_locale/locale/global_locale_objects/2.cc: New. * 22_locale/locale/global_locale_objects/3.cc: New. * 22_locale/locale/operations/1.cc: New. * 22_locale/locale/operations/2.cc: New. * 22_locale/messages/1.cc: New. * 22_locale/messages/2.cc: New. * 22_locale/messages/members/char/1.cc: New. * 22_locale/messages/members/char/2.cc: New. * 22_locale/messages/members/char/3.cc: New. * 22_locale/messages/members/char/wrapped_env.cc: New. * 22_locale/messages/members/char/wrapped_locale.cc: New. * 22_locale/messages_byname/1.cc: New. * 22_locale/money_get/1.cc: New. * 22_locale/money_get/2.cc: New. * 22_locale/money_get/get/char/1.cc: New. * 22_locale/money_get/get/char/2.cc: New. * 22_locale/money_get/get/char/3.cc: New. * 22_locale/money_get/get/char/4.cc: New. * 22_locale/money_get/get/char/5.cc: New. * 22_locale/money_get/get/char/6.cc: New. * 22_locale/money_get/get/char/7.cc: New. * 22_locale/money_get/get/char/8.cc: New. * 22_locale/money_get/get/char/wrapped_env.cc: New. * 22_locale/money_get/get/char/wrapped_locale.cc: New. * 22_locale/money_get/get/wchar_t/1.cc: New. * 22_locale/money_get/get/wchar_t/2.cc: New. * 22_locale/money_get/get/wchar_t/3.cc: New. * 22_locale/money_get/get/wchar_t/4.cc: New. * 22_locale/money_get/get/wchar_t/5.cc: New. * 22_locale/money_get/get/wchar_t/6.cc: New. * 22_locale/money_get/get/wchar_t/7.cc: New. * 22_locale/money_get/get/wchar_t/8.cc: New. * 22_locale/money_get/get/wchar_t/wrapped_env.cc: New. * 22_locale/money_get/get/wchar_t/wrapped_locale.cc: New. * 22_locale/money_put/1.cc: New. * 22_locale/money_put/2.cc: New. * 22_locale/money_put/put/char/1.cc: New. * 22_locale/money_put/put/char/2.cc: New. * 22_locale/money_put/put/char/3.cc: New. * 22_locale/money_put/put/char/4.cc: New. * 22_locale/money_put/put/char/5.cc: New. * 22_locale/money_put/put/char/6.cc: New. * 22_locale/money_put/put/char/wrapped_env.cc: New. * 22_locale/money_put/put/char/wrapped_locale.cc: New. * 22_locale/money_put/put/wchar_t/1.cc: New. * 22_locale/money_put/put/wchar_t/2.cc: New. * 22_locale/money_put/put/wchar_t/3.cc: New. * 22_locale/money_put/put/wchar_t/4.cc: New. * 22_locale/money_put/put/wchar_t/5.cc: New. * 22_locale/money_put/put/wchar_t/6.cc: New. * 22_locale/money_put/put/wchar_t/wrapped_env.cc: New. * 22_locale/money_put/put/wchar_t/wrapped_locale.cc: New. * 22_locale/moneypunct/1.cc: New. * 22_locale/moneypunct/2.cc: New. * 22_locale/moneypunct/3.cc: New. * 22_locale/moneypunct/members/char/1.cc: New. * 22_locale/moneypunct/members/char/2.cc: New. * 22_locale/moneypunct/members/char/wrapped_env.cc: New. * 22_locale/moneypunct/members/char/wrapped_locale.cc: New. * 22_locale/moneypunct/members/wchar_t/1.cc: New. * 22_locale/moneypunct/members/wchar_t/2.cc: New. * 22_locale/moneypunct/members/wchar_t/wrapped_env.cc: New. * 22_locale/moneypunct/members/wchar_t/wrapped_locale.cc: New. * 22_locale/moneypunct_byname/1.cc: New. * 22_locale/num_get/1.cc: New. * 22_locale/num_get/2.cc: New. * 22_locale/num_get/get/char/1.cc: New. * 22_locale/num_get/get/char/2.cc: New. * 22_locale/num_get/get/char/3.cc: New. * 22_locale/num_get/get/char/4.cc: New. * 22_locale/num_get/get/char/5.cc: New. * 22_locale/num_get/get/char/6.cc: New. * 22_locale/num_get/get/char/wrapped_env.cc: New. * 22_locale/num_get/get/char/wrapped_locale.cc: New. * 22_locale/num_get/get/wchar_t/1.cc: New. * 22_locale/num_get/get/wchar_t/2.cc: New. * 22_locale/num_get/get/wchar_t/3.cc: New. * 22_locale/num_get/get/wchar_t/4.cc: New. * 22_locale/num_get/get/wchar_t/5.cc: New. * 22_locale/num_get/get/wchar_t/6.cc: New. * 22_locale/num_get/get/wchar_t/wrapped_env.cc: New. * 22_locale/num_get/get/wchar_t/wrapped_locale.cc: New. * 22_locale/num_put/1.cc: New. * 22_locale/num_put/2.cc: New. * 22_locale/num_put/put/char/1.cc: New. * 22_locale/num_put/put/char/2.cc: New. * 22_locale/num_put/put/char/3.cc: New. * 22_locale/num_put/put/char/4.cc: New. * 22_locale/num_put/put/char/5.cc: New. * 22_locale/num_put/put/char/wrapped_env.cc: New. * 22_locale/num_put/put/char/wrapped_locale.cc: New. * 22_locale/num_put/put/wchar_t/1.cc: New. * 22_locale/num_put/put/wchar_t/2.cc: New. * 22_locale/num_put/put/wchar_t/3.cc: New. * 22_locale/num_put/put/wchar_t/4.cc: New. * 22_locale/num_put/put/wchar_t/5.cc: New. * 22_locale/num_put/put/wchar_t/wrapped_env.cc: New. * 22_locale/num_put/put/wchar_t/wrapped_locale.cc: New. * 22_locale/numpunct/1.cc: New. * 22_locale/numpunct/2.cc: New. * 22_locale/numpunct/members/char/1.cc: New. * 22_locale/numpunct/members/char/2.cc: New. * 22_locale/numpunct/members/char/wrapped_env.cc: New. * 22_locale/numpunct/members/char/wrapped_locale.cc: New. * 22_locale/numpunct/members/wchar_t/1.cc: New. * 22_locale/numpunct/members/wchar_t/2.cc: New. * 22_locale/numpunct/members/wchar_t/wrapped_env.cc: New. * 22_locale/numpunct/members/wchar_t/wrapped_locale.cc: New. * 22_locale/numpunct_byname/1.cc: New. * 22_locale/numpunct_byname/2.cc: New. * 22_locale/time_get/1.cc: New. * 22_locale/time_get/2.cc: New. * 22_locale/time_get/date_order/char/1.cc: New. * 22_locale/time_get/date_order/char/wrapped_env.cc: New. * 22_locale/time_get/date_order/char/wrapped_locale.cc: New. * 22_locale/time_get/date_order/wchar_t/1.cc: New. * 22_locale/time_get/date_order/wchar_t/wrapped_env.cc: New. * 22_locale/time_get/date_order/wchar_t/wrapped_locale.cc: New. * 22_locale/time_get/get_date/char/1.cc: New. * 22_locale/time_get/get_date/char/2.cc: New. * 22_locale/time_get/get_date/char/3.cc: New. * 22_locale/time_get/get_date/char/wrapped_env.cc: New. * 22_locale/time_get/get_date/char/wrapped_locale.cc: New. * 22_locale/time_get/get_date/wchar_t/1.cc: New. * 22_locale/time_get/get_date/wchar_t/2.cc: New. * 22_locale/time_get/get_date/wchar_t/3.cc: New. * 22_locale/time_get/get_date/wchar_t/wrapped_env.cc: New. * 22_locale/time_get/get_date/wchar_t/wrapped_locale.cc: New. * 22_locale/time_get/get_monthname/char/1.cc: New. * 22_locale/time_get/get_monthname/char/2.cc: New. * 22_locale/time_get/get_monthname/char/3.cc: New. * 22_locale/time_get/get_monthname/char/wrapped_env.cc: New. * 22_locale/time_get/get_monthname/char/wrapped_locale.cc: New. * 22_locale/time_get/get_monthname/wchar_t/1.cc: New. * 22_locale/time_get/get_monthname/wchar_t/2.cc: New. * 22_locale/time_get/get_monthname/wchar_t/3.cc: New. * 22_locale/time_get/get_monthname/wchar_t/wrapped_env.cc: New. * 22_locale/time_get/get_monthname/wchar_t/wrapped_locale.cc: New. * 22_locale/time_get/get_time/char/1.cc: New. * 22_locale/time_get/get_time/char/2.cc: New. * 22_locale/time_get/get_time/char/3.cc: New. * 22_locale/time_get/get_time/char/wrapped_env.cc: New. * 22_locale/time_get/get_time/char/wrapped_locale.cc: New. * 22_locale/time_get/get_time/wchar_t/1.cc: New. * 22_locale/time_get/get_time/wchar_t/2.cc: New. * 22_locale/time_get/get_time/wchar_t/3.cc: New. * 22_locale/time_get/get_time/wchar_t/wrapped_env.cc: New. * 22_locale/time_get/get_time/wchar_t/wrapped_locale.cc: New. * 22_locale/time_get/get_weekday/char/1.cc: New. * 22_locale/time_get/get_weekday/char/2.cc: New. * 22_locale/time_get/get_weekday/char/3.cc: New. * 22_locale/time_get/get_weekday/char/wrapped_env.cc: New. * 22_locale/time_get/get_weekday/char/wrapped_locale.cc: New. * 22_locale/time_get/get_weekday/wchar_t/1.cc: New. * 22_locale/time_get/get_weekday/wchar_t/2.cc: New. * 22_locale/time_get/get_weekday/wchar_t/3.cc: New. * 22_locale/time_get/get_weekday/wchar_t/wrapped_env.cc: New. * 22_locale/time_get/get_weekday/wchar_t/wrapped_locale.cc: New. * 22_locale/time_get/get_year/char/1.cc: New. * 22_locale/time_get/get_year/char/3.cc: New. * 22_locale/time_get/get_year/char/wrapped_env.cc: New. * 22_locale/time_get/get_year/char/wrapped_locale.cc: New. * 22_locale/time_get/get_year/wchar_t/1.cc: New. * 22_locale/time_get/get_year/wchar_t/3.cc: New. * 22_locale/time_get/get_year/wchar_t/wrapped_env.cc: New. * 22_locale/time_get/get_year/wchar_t/wrapped_locale.cc: New. * 22_locale/time_put/1.cc: New. * 22_locale/time_put/2.cc: New. * 22_locale/time_put/put/char/1.cc: New. * 22_locale/time_put/put/char/10.cc: New. * 22_locale/time_put/put/char/2.cc: New. * 22_locale/time_put/put/char/3.cc: New. * 22_locale/time_put/put/char/4.cc: New. * 22_locale/time_put/put/char/5.cc: New. * 22_locale/time_put/put/char/6.cc: New. * 22_locale/time_put/put/char/7.cc: New. * 22_locale/time_put/put/char/8.cc: New. * 22_locale/time_put/put/char/9.cc: New. * 22_locale/time_put/put/char/wrapped_env.cc: New. * 22_locale/time_put/put/char/wrapped_locale.cc: New. * 22_locale/time_put/put/wchar_t/1.cc: New. * 22_locale/time_put/put/wchar_t/10.cc: New. * 22_locale/time_put/put/wchar_t/2.cc: New. * 22_locale/time_put/put/wchar_t/3.cc: New. * 22_locale/time_put/put/wchar_t/4.cc: New. * 22_locale/time_put/put/wchar_t/5.cc: New. * 22_locale/time_put/put/wchar_t/6.cc: New. * 22_locale/time_put/put/wchar_t/7.cc: New. * 22_locale/time_put/put/wchar_t/8.cc: New. * 22_locale/time_put/put/wchar_t/9.cc: New. * 22_locale/time_put/put/wchar_t/wrapped_env.cc: New. * 22_locale/time_put/put/wchar_t/wrapped_locale.cc: New. From-SVN: r61548
This commit is contained in:
parent
044b4de3d8
commit
5f8d36fe0a
@ -1,3 +1,342 @@
|
||||
2003-01-21 Benjamin Kosnik <bkoz@redhat.com>
|
||||
|
||||
Reshuffle 22_locale testsuite.
|
||||
* 22_locale/(codecvt.cc money_get.cc
|
||||
codecvt_members_char_char.cc money_get_members_char.cc
|
||||
codecvt_members_unicode_char.cc money_get_members_wchar_t.cc
|
||||
codecvt_members_unicode_wchar_t.cc moneypunct_byname.cc
|
||||
codecvt_members_wchar_t_char.cc moneypunct.cc collate_byname.cc
|
||||
moneypunct_members_char.cc collate.cc moneypunct_members_wchar_t.cc
|
||||
collate_members_char.cc money_put.cc collate_members_wchar_t.cc
|
||||
money_put_members_char.cc ctor_copy_dtor.cc
|
||||
money_put_members_wchar_t.cc ctype.cc num_get.cc ctype_is_char.cc
|
||||
num_get_members_char.cc ctype_is_wchar_t.cc num_get_members_wchar_t.cc
|
||||
ctype_members_char.cc numpunct_byname.cc ctype_members_wchar_t.cc
|
||||
numpunct.cc ctype_narrow_char.cc numpunct_members_char.cc
|
||||
ctype_narrow_wchar_t.cc numpunct_members_wchar_t.cc ctype_scan_char.cc
|
||||
num_put.cc ctype_scan_wchar_t.cc num_put_members_char.cc
|
||||
ctype_to_char.cc num_put_members_wchar_t.cc ctype_to_wchar_t.cc
|
||||
operators.cc ctype_widen_char.cc static_members.cc
|
||||
ctype_widen_wchar_t.cc time_get.cc facet.cc time_get_members_char.cc
|
||||
global_templates.cc time_get_members_wchar_t.cc, members.cc,
|
||||
time_put.cc, messages_byname.cc, time_put_members_char.cc,
|
||||
messages.cc, time_put_members_wchar_t.cc, messages_members_char.cc):
|
||||
Splint up into individual test cases...
|
||||
* 22_locale/codecvt/1.cc: New.
|
||||
* 22_locale/codecvt/2.cc: New.
|
||||
* 22_locale/codecvt/always_noconv/char/1.cc: New.
|
||||
* 22_locale/codecvt/always_noconv/char/wrapped_env.cc: New.
|
||||
* 22_locale/codecvt/always_noconv/char/wrapped_locale.cc: New.
|
||||
* 22_locale/codecvt/always_noconv/wchar_t/1.cc: New.
|
||||
* 22_locale/codecvt/always_noconv/wchar_t/wrapped_env.cc: New.
|
||||
* 22_locale/codecvt/always_noconv/wchar_t/wrapped_locale.cc: New.
|
||||
* 22_locale/codecvt/encoding/char/1.cc: New.
|
||||
* 22_locale/codecvt/encoding/char/wrapped_env.cc: New.
|
||||
* 22_locale/codecvt/encoding/char/wrapped_locale.cc: New.
|
||||
* 22_locale/codecvt/encoding/wchar_t/1.cc: New.
|
||||
* 22_locale/codecvt/encoding/wchar_t/wrapped_env.cc: New.
|
||||
* 22_locale/codecvt/encoding/wchar_t/wrapped_locale.cc: New.
|
||||
* 22_locale/codecvt/in/char/1.cc: New.
|
||||
* 22_locale/codecvt/in/char/wrapped_env.cc: New.
|
||||
* 22_locale/codecvt/in/char/wrapped_locale.cc: New.
|
||||
* 22_locale/codecvt/in/wchar_t/1.cc: New.
|
||||
* 22_locale/codecvt/in/wchar_t/wrapped_env.cc: New.
|
||||
* 22_locale/codecvt/in/wchar_t/wrapped_locale.cc: New.
|
||||
* 22_locale/codecvt/length/char/1.cc: New.
|
||||
* 22_locale/codecvt/length/char/wrapped_env.cc: New.
|
||||
* 22_locale/codecvt/length/char/wrapped_locale.cc: New.
|
||||
* 22_locale/codecvt/length/wchar_t/1.cc: New.
|
||||
* 22_locale/codecvt/length/wchar_t/wrapped_env.cc: New.
|
||||
* 22_locale/codecvt/length/wchar_t/wrapped_locale.cc: New.
|
||||
* 22_locale/codecvt/max_length/char/1.cc: New.
|
||||
* 22_locale/codecvt/max_length/char/wrapped_env.cc: New.
|
||||
* 22_locale/codecvt/max_length/char/wrapped_locale.cc: New.
|
||||
* 22_locale/codecvt/max_length/wchar_t/1.cc: New.
|
||||
* 22_locale/codecvt/max_length/wchar_t/wrapped_env.cc: New.
|
||||
* 22_locale/codecvt/max_length/wchar_t/wrapped_locale.cc: New.
|
||||
* 22_locale/codecvt/out/char/1.cc: New.
|
||||
* 22_locale/codecvt/out/char/wrapped_env.cc: New.
|
||||
* 22_locale/codecvt/out/char/wrapped_locale.cc: New.
|
||||
* 22_locale/codecvt/out/wchar_t/1.cc: New.
|
||||
* 22_locale/codecvt/out/wchar_t/wrapped_env.cc: New.
|
||||
* 22_locale/codecvt/out/wchar_t/wrapped_locale.cc: New.
|
||||
* 22_locale/codecvt/unicode/char.cc: New.
|
||||
* 22_locale/codecvt/unicode/wchar_t.cc: New.
|
||||
* 22_locale/codecvt/unshift/char/1.cc: New.
|
||||
* 22_locale/codecvt/unshift/char/wrapped_env.cc: New.
|
||||
* 22_locale/codecvt/unshift/char/wrapped_locale.cc: New.
|
||||
* 22_locale/codecvt/unshift/wchar_t/1.cc: New.
|
||||
* 22_locale/codecvt/unshift/wchar_t/wrapped_env.cc: New.
|
||||
* 22_locale/codecvt/unshift/wchar_t/wrapped_locale.cc: New.
|
||||
* 22_locale/collate/1.cc: New.
|
||||
* 22_locale/collate/2.cc: New.
|
||||
* 22_locale/collate/compare/char/1.cc: New.
|
||||
* 22_locale/collate/compare/char/2.cc: New.
|
||||
* 22_locale/collate/compare/char/wrapped_env.cc: New.
|
||||
* 22_locale/collate/compare/char/wrapped_locale.cc: New.
|
||||
* 22_locale/collate/compare/wchar_t/1.cc: New.
|
||||
* 22_locale/collate/compare/wchar_t/2.cc: New.
|
||||
* 22_locale/collate/compare/wchar_t/wrapped_env.cc: New.
|
||||
* 22_locale/collate/compare/wchar_t/wrapped_locale.cc: New.
|
||||
* 22_locale/collate/hash/char/1.cc: New.
|
||||
* 22_locale/collate/hash/char/2.cc: New.
|
||||
* 22_locale/collate/hash/char/wrapped_env.cc: New.
|
||||
* 22_locale/collate/hash/char/wrapped_locale.cc: New.
|
||||
* 22_locale/collate/hash/wchar_t/1.cc: New.
|
||||
* 22_locale/collate/hash/wchar_t/2.cc: New.
|
||||
* 22_locale/collate/hash/wchar_t/wrapped_env.cc: New.
|
||||
* 22_locale/collate/hash/wchar_t/wrapped_locale.cc: New.
|
||||
* 22_locale/collate/transform/char/2.cc: New.
|
||||
* 22_locale/collate/transform/char/wrapped_env.cc: New.
|
||||
* 22_locale/collate/transform/char/wrapped_locale.cc: New.
|
||||
* 22_locale/collate/transform/wchar_t/2.cc: New.
|
||||
* 22_locale/collate/transform/wchar_t/wrapped_env.cc: New.
|
||||
* 22_locale/collate/transform/wchar_t/wrapped_locale.cc: New.
|
||||
* 22_locale/collate_byname/1.cc: New.
|
||||
* 22_locale/ctype/1.cc: New.
|
||||
* 22_locale/ctype/2.cc: New.
|
||||
* 22_locale/ctype/cons/char/1.cc: New.
|
||||
* 22_locale/ctype/cons/char/wrapped_env.cc: New.
|
||||
* 22_locale/ctype/cons/char/wrapped_locale.cc: New.
|
||||
* 22_locale/ctype/is/char/1.cc: New.
|
||||
* 22_locale/ctype/is/char/2.cc: New.
|
||||
* 22_locale/ctype/is/char/3.cc: New.
|
||||
* 22_locale/ctype/is/char/wrapped_env.cc: New.
|
||||
* 22_locale/ctype/is/char/wrapped_locale.cc: New.
|
||||
* 22_locale/ctype/is/wchar_t/1.cc: New.
|
||||
* 22_locale/ctype/is/wchar_t/2.cc: New.
|
||||
* 22_locale/ctype/is/wchar_t/wrapped_env.cc: New.
|
||||
* 22_locale/ctype/is/wchar_t/wrapped_locale.cc: New.
|
||||
* 22_locale/ctype/narrow/char/1.cc: New.
|
||||
* 22_locale/ctype/narrow/char/2.cc: New.
|
||||
* 22_locale/ctype/narrow/char/wrapped_env.cc: New.
|
||||
* 22_locale/ctype/narrow/char/wrapped_locale.cc: New.
|
||||
* 22_locale/ctype/narrow/wchar_t/1.cc: New.
|
||||
* 22_locale/ctype/narrow/wchar_t/2.cc: New.
|
||||
* 22_locale/ctype/narrow/wchar_t/wrapped_env.cc: New.
|
||||
* 22_locale/ctype/narrow/wchar_t/wrapped_locale.cc: New.
|
||||
* 22_locale/ctype/scan/char/1.cc: New.
|
||||
* 22_locale/ctype/scan/char/wrapped_env.cc: New.
|
||||
* 22_locale/ctype/scan/char/wrapped_locale.cc: New.
|
||||
* 22_locale/ctype/scan/wchar_t/1.cc: New.
|
||||
* 22_locale/ctype/scan/wchar_t/wrapped_env.cc: New.
|
||||
* 22_locale/ctype/scan/wchar_t/wrapped_locale.cc: New.
|
||||
* 22_locale/ctype/to/char/1.cc: New.
|
||||
* 22_locale/ctype/to/char/wrapped_env.cc: New.
|
||||
* 22_locale/ctype/to/char/wrapped_locale.cc: New.
|
||||
* 22_locale/ctype/to/wchar_t/1.cc: New.
|
||||
* 22_locale/ctype/to/wchar_t/wrapped_env.cc: New.
|
||||
* 22_locale/ctype/to/wchar_t/wrapped_locale.cc: New.
|
||||
* 22_locale/ctype/widen/char/1.cc: New.
|
||||
* 22_locale/ctype/widen/char/wrapped_env.cc: New.
|
||||
* 22_locale/ctype/widen/char/wrapped_locale.cc: New.
|
||||
* 22_locale/ctype/widen/wchar_t/1.cc: New.
|
||||
* 22_locale/ctype/widen/wchar_t/wrapped_env.cc: New.
|
||||
* 22_locale/ctype/widen/wchar_t/wrapped_locale.cc: New.
|
||||
* 22_locale/facet/1.cc: New.
|
||||
* 22_locale/facet/2.cc: New.
|
||||
* 22_locale/global_templates/1.cc: New.
|
||||
* 22_locale/locale/cons/1.cc: New.
|
||||
* 22_locale/locale/cons/2.cc: New.
|
||||
* 22_locale/locale/cons/3.cc: New.
|
||||
* 22_locale/locale/cons/4.cc: New.
|
||||
* 22_locale/locale/cons/5.cc: New.
|
||||
* 22_locale/locale/cons/6.cc: New.
|
||||
* 22_locale/locale/cons/7.cc: New.
|
||||
* 22_locale/locale/global_locale_objects/1.cc: New.
|
||||
* 22_locale/locale/global_locale_objects/2.cc: New.
|
||||
* 22_locale/locale/global_locale_objects/3.cc: New.
|
||||
* 22_locale/locale/operations/1.cc: New.
|
||||
* 22_locale/locale/operations/2.cc: New.
|
||||
* 22_locale/messages/1.cc: New.
|
||||
* 22_locale/messages/2.cc: New.
|
||||
* 22_locale/messages/members/char/1.cc: New.
|
||||
* 22_locale/messages/members/char/2.cc: New.
|
||||
* 22_locale/messages/members/char/3.cc: New.
|
||||
* 22_locale/messages/members/char/wrapped_env.cc: New.
|
||||
* 22_locale/messages/members/char/wrapped_locale.cc: New.
|
||||
* 22_locale/messages_byname/1.cc: New.
|
||||
* 22_locale/money_get/1.cc: New.
|
||||
* 22_locale/money_get/2.cc: New.
|
||||
* 22_locale/money_get/get/char/1.cc: New.
|
||||
* 22_locale/money_get/get/char/2.cc: New.
|
||||
* 22_locale/money_get/get/char/3.cc: New.
|
||||
* 22_locale/money_get/get/char/4.cc: New.
|
||||
* 22_locale/money_get/get/char/5.cc: New.
|
||||
* 22_locale/money_get/get/char/6.cc: New.
|
||||
* 22_locale/money_get/get/char/7.cc: New.
|
||||
* 22_locale/money_get/get/char/8.cc: New.
|
||||
* 22_locale/money_get/get/char/wrapped_env.cc: New.
|
||||
* 22_locale/money_get/get/char/wrapped_locale.cc: New.
|
||||
* 22_locale/money_get/get/wchar_t/1.cc: New.
|
||||
* 22_locale/money_get/get/wchar_t/2.cc: New.
|
||||
* 22_locale/money_get/get/wchar_t/3.cc: New.
|
||||
* 22_locale/money_get/get/wchar_t/4.cc: New.
|
||||
* 22_locale/money_get/get/wchar_t/5.cc: New.
|
||||
* 22_locale/money_get/get/wchar_t/6.cc: New.
|
||||
* 22_locale/money_get/get/wchar_t/7.cc: New.
|
||||
* 22_locale/money_get/get/wchar_t/8.cc: New.
|
||||
* 22_locale/money_get/get/wchar_t/wrapped_env.cc: New.
|
||||
* 22_locale/money_get/get/wchar_t/wrapped_locale.cc: New.
|
||||
* 22_locale/money_put/1.cc: New.
|
||||
* 22_locale/money_put/2.cc: New.
|
||||
* 22_locale/money_put/put/char/1.cc: New.
|
||||
* 22_locale/money_put/put/char/2.cc: New.
|
||||
* 22_locale/money_put/put/char/3.cc: New.
|
||||
* 22_locale/money_put/put/char/4.cc: New.
|
||||
* 22_locale/money_put/put/char/5.cc: New.
|
||||
* 22_locale/money_put/put/char/6.cc: New.
|
||||
* 22_locale/money_put/put/char/wrapped_env.cc: New.
|
||||
* 22_locale/money_put/put/char/wrapped_locale.cc: New.
|
||||
* 22_locale/money_put/put/wchar_t/1.cc: New.
|
||||
* 22_locale/money_put/put/wchar_t/2.cc: New.
|
||||
* 22_locale/money_put/put/wchar_t/3.cc: New.
|
||||
* 22_locale/money_put/put/wchar_t/4.cc: New.
|
||||
* 22_locale/money_put/put/wchar_t/5.cc: New.
|
||||
* 22_locale/money_put/put/wchar_t/6.cc: New.
|
||||
* 22_locale/money_put/put/wchar_t/wrapped_env.cc: New.
|
||||
* 22_locale/money_put/put/wchar_t/wrapped_locale.cc: New.
|
||||
* 22_locale/moneypunct/1.cc: New.
|
||||
* 22_locale/moneypunct/2.cc: New.
|
||||
* 22_locale/moneypunct/3.cc: New.
|
||||
* 22_locale/moneypunct/members/char/1.cc: New.
|
||||
* 22_locale/moneypunct/members/char/2.cc: New.
|
||||
* 22_locale/moneypunct/members/char/wrapped_env.cc: New.
|
||||
* 22_locale/moneypunct/members/char/wrapped_locale.cc: New.
|
||||
* 22_locale/moneypunct/members/wchar_t/1.cc: New.
|
||||
* 22_locale/moneypunct/members/wchar_t/2.cc: New.
|
||||
* 22_locale/moneypunct/members/wchar_t/wrapped_env.cc: New.
|
||||
* 22_locale/moneypunct/members/wchar_t/wrapped_locale.cc: New.
|
||||
* 22_locale/moneypunct_byname/1.cc: New.
|
||||
* 22_locale/num_get/1.cc: New.
|
||||
* 22_locale/num_get/2.cc: New.
|
||||
* 22_locale/num_get/get/char/1.cc: New.
|
||||
* 22_locale/num_get/get/char/2.cc: New.
|
||||
* 22_locale/num_get/get/char/3.cc: New.
|
||||
* 22_locale/num_get/get/char/4.cc: New.
|
||||
* 22_locale/num_get/get/char/5.cc: New.
|
||||
* 22_locale/num_get/get/char/6.cc: New.
|
||||
* 22_locale/num_get/get/char/wrapped_env.cc: New.
|
||||
* 22_locale/num_get/get/char/wrapped_locale.cc: New.
|
||||
* 22_locale/num_get/get/wchar_t/1.cc: New.
|
||||
* 22_locale/num_get/get/wchar_t/2.cc: New.
|
||||
* 22_locale/num_get/get/wchar_t/3.cc: New.
|
||||
* 22_locale/num_get/get/wchar_t/4.cc: New.
|
||||
* 22_locale/num_get/get/wchar_t/5.cc: New.
|
||||
* 22_locale/num_get/get/wchar_t/6.cc: New.
|
||||
* 22_locale/num_get/get/wchar_t/wrapped_env.cc: New.
|
||||
* 22_locale/num_get/get/wchar_t/wrapped_locale.cc: New.
|
||||
* 22_locale/num_put/1.cc: New.
|
||||
* 22_locale/num_put/2.cc: New.
|
||||
* 22_locale/num_put/put/char/1.cc: New.
|
||||
* 22_locale/num_put/put/char/2.cc: New.
|
||||
* 22_locale/num_put/put/char/3.cc: New.
|
||||
* 22_locale/num_put/put/char/4.cc: New.
|
||||
* 22_locale/num_put/put/char/5.cc: New.
|
||||
* 22_locale/num_put/put/char/wrapped_env.cc: New.
|
||||
* 22_locale/num_put/put/char/wrapped_locale.cc: New.
|
||||
* 22_locale/num_put/put/wchar_t/1.cc: New.
|
||||
* 22_locale/num_put/put/wchar_t/2.cc: New.
|
||||
* 22_locale/num_put/put/wchar_t/3.cc: New.
|
||||
* 22_locale/num_put/put/wchar_t/4.cc: New.
|
||||
* 22_locale/num_put/put/wchar_t/5.cc: New.
|
||||
* 22_locale/num_put/put/wchar_t/wrapped_env.cc: New.
|
||||
* 22_locale/num_put/put/wchar_t/wrapped_locale.cc: New.
|
||||
* 22_locale/numpunct/1.cc: New.
|
||||
* 22_locale/numpunct/2.cc: New.
|
||||
* 22_locale/numpunct/members/char/1.cc: New.
|
||||
* 22_locale/numpunct/members/char/2.cc: New.
|
||||
* 22_locale/numpunct/members/char/wrapped_env.cc: New.
|
||||
* 22_locale/numpunct/members/char/wrapped_locale.cc: New.
|
||||
* 22_locale/numpunct/members/wchar_t/1.cc: New.
|
||||
* 22_locale/numpunct/members/wchar_t/2.cc: New.
|
||||
* 22_locale/numpunct/members/wchar_t/wrapped_env.cc: New.
|
||||
* 22_locale/numpunct/members/wchar_t/wrapped_locale.cc: New.
|
||||
* 22_locale/numpunct_byname/1.cc: New.
|
||||
* 22_locale/numpunct_byname/2.cc: New.
|
||||
* 22_locale/time_get/1.cc: New.
|
||||
* 22_locale/time_get/2.cc: New.
|
||||
* 22_locale/time_get/date_order/char/1.cc: New.
|
||||
* 22_locale/time_get/date_order/char/wrapped_env.cc: New.
|
||||
* 22_locale/time_get/date_order/char/wrapped_locale.cc: New.
|
||||
* 22_locale/time_get/date_order/wchar_t/1.cc: New.
|
||||
* 22_locale/time_get/date_order/wchar_t/wrapped_env.cc: New.
|
||||
* 22_locale/time_get/date_order/wchar_t/wrapped_locale.cc: New.
|
||||
* 22_locale/time_get/get_date/char/1.cc: New.
|
||||
* 22_locale/time_get/get_date/char/2.cc: New.
|
||||
* 22_locale/time_get/get_date/char/3.cc: New.
|
||||
* 22_locale/time_get/get_date/char/wrapped_env.cc: New.
|
||||
* 22_locale/time_get/get_date/char/wrapped_locale.cc: New.
|
||||
* 22_locale/time_get/get_date/wchar_t/1.cc: New.
|
||||
* 22_locale/time_get/get_date/wchar_t/2.cc: New.
|
||||
* 22_locale/time_get/get_date/wchar_t/3.cc: New.
|
||||
* 22_locale/time_get/get_date/wchar_t/wrapped_env.cc: New.
|
||||
* 22_locale/time_get/get_date/wchar_t/wrapped_locale.cc: New.
|
||||
* 22_locale/time_get/get_monthname/char/1.cc: New.
|
||||
* 22_locale/time_get/get_monthname/char/2.cc: New.
|
||||
* 22_locale/time_get/get_monthname/char/3.cc: New.
|
||||
* 22_locale/time_get/get_monthname/char/wrapped_env.cc: New.
|
||||
* 22_locale/time_get/get_monthname/char/wrapped_locale.cc: New.
|
||||
* 22_locale/time_get/get_monthname/wchar_t/1.cc: New.
|
||||
* 22_locale/time_get/get_monthname/wchar_t/2.cc: New.
|
||||
* 22_locale/time_get/get_monthname/wchar_t/3.cc: New.
|
||||
* 22_locale/time_get/get_monthname/wchar_t/wrapped_env.cc: New.
|
||||
* 22_locale/time_get/get_monthname/wchar_t/wrapped_locale.cc: New.
|
||||
* 22_locale/time_get/get_time/char/1.cc: New.
|
||||
* 22_locale/time_get/get_time/char/2.cc: New.
|
||||
* 22_locale/time_get/get_time/char/3.cc: New.
|
||||
* 22_locale/time_get/get_time/char/wrapped_env.cc: New.
|
||||
* 22_locale/time_get/get_time/char/wrapped_locale.cc: New.
|
||||
* 22_locale/time_get/get_time/wchar_t/1.cc: New.
|
||||
* 22_locale/time_get/get_time/wchar_t/2.cc: New.
|
||||
* 22_locale/time_get/get_time/wchar_t/3.cc: New.
|
||||
* 22_locale/time_get/get_time/wchar_t/wrapped_env.cc: New.
|
||||
* 22_locale/time_get/get_time/wchar_t/wrapped_locale.cc: New.
|
||||
* 22_locale/time_get/get_weekday/char/1.cc: New.
|
||||
* 22_locale/time_get/get_weekday/char/2.cc: New.
|
||||
* 22_locale/time_get/get_weekday/char/3.cc: New.
|
||||
* 22_locale/time_get/get_weekday/char/wrapped_env.cc: New.
|
||||
* 22_locale/time_get/get_weekday/char/wrapped_locale.cc: New.
|
||||
* 22_locale/time_get/get_weekday/wchar_t/1.cc: New.
|
||||
* 22_locale/time_get/get_weekday/wchar_t/2.cc: New.
|
||||
* 22_locale/time_get/get_weekday/wchar_t/3.cc: New.
|
||||
* 22_locale/time_get/get_weekday/wchar_t/wrapped_env.cc: New.
|
||||
* 22_locale/time_get/get_weekday/wchar_t/wrapped_locale.cc: New.
|
||||
* 22_locale/time_get/get_year/char/1.cc: New.
|
||||
* 22_locale/time_get/get_year/char/3.cc: New.
|
||||
* 22_locale/time_get/get_year/char/wrapped_env.cc: New.
|
||||
* 22_locale/time_get/get_year/char/wrapped_locale.cc: New.
|
||||
* 22_locale/time_get/get_year/wchar_t/1.cc: New.
|
||||
* 22_locale/time_get/get_year/wchar_t/3.cc: New.
|
||||
* 22_locale/time_get/get_year/wchar_t/wrapped_env.cc: New.
|
||||
* 22_locale/time_get/get_year/wchar_t/wrapped_locale.cc: New.
|
||||
* 22_locale/time_put/1.cc: New.
|
||||
* 22_locale/time_put/2.cc: New.
|
||||
* 22_locale/time_put/put/char/1.cc: New.
|
||||
* 22_locale/time_put/put/char/10.cc: New.
|
||||
* 22_locale/time_put/put/char/2.cc: New.
|
||||
* 22_locale/time_put/put/char/3.cc: New.
|
||||
* 22_locale/time_put/put/char/4.cc: New.
|
||||
* 22_locale/time_put/put/char/5.cc: New.
|
||||
* 22_locale/time_put/put/char/6.cc: New.
|
||||
* 22_locale/time_put/put/char/7.cc: New.
|
||||
* 22_locale/time_put/put/char/8.cc: New.
|
||||
* 22_locale/time_put/put/char/9.cc: New.
|
||||
* 22_locale/time_put/put/char/wrapped_env.cc: New.
|
||||
* 22_locale/time_put/put/char/wrapped_locale.cc: New.
|
||||
* 22_locale/time_put/put/wchar_t/1.cc: New.
|
||||
* 22_locale/time_put/put/wchar_t/10.cc: New.
|
||||
* 22_locale/time_put/put/wchar_t/2.cc: New.
|
||||
* 22_locale/time_put/put/wchar_t/3.cc: New.
|
||||
* 22_locale/time_put/put/wchar_t/4.cc: New.
|
||||
* 22_locale/time_put/put/wchar_t/5.cc: New.
|
||||
* 22_locale/time_put/put/wchar_t/6.cc: New.
|
||||
* 22_locale/time_put/put/wchar_t/7.cc: New.
|
||||
* 22_locale/time_put/put/wchar_t/8.cc: New.
|
||||
* 22_locale/time_put/put/wchar_t/9.cc: New.
|
||||
* 22_locale/time_put/put/wchar_t/wrapped_env.cc: New.
|
||||
* 22_locale/time_put/put/wchar_t/wrapped_locale.cc: New.
|
||||
|
||||
2003-01-16 Jeffrey D. Oldham <oldham@codesourcery.com>
|
||||
|
||||
* config/locale/generic/messages_members.h
|
||||
|
@ -1,6 +1,7 @@
|
||||
// { dg-do compile }
|
||||
// 2001-08-27 Benjamin Kosnik <bkoz@redhat.com>
|
||||
|
||||
// Copyright (C) 2001 Free Software Foundation
|
||||
// Copyright (C) 2001, 2003 Free Software Foundation
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
@ -20,8 +21,6 @@
|
||||
|
||||
// 22.2.1.5 Template class codecvt
|
||||
|
||||
// { dg-do compile }
|
||||
|
||||
#include <locale>
|
||||
|
||||
void test01()
|
||||
@ -38,18 +37,8 @@ void test01()
|
||||
typedef test_type::state_type state_type;
|
||||
}
|
||||
|
||||
// Should be able to instantiate this for other types besides char, wchar_t
|
||||
class gnu_codecvt: public std::codecvt<unsigned char, unsigned long, char>
|
||||
{ };
|
||||
|
||||
void test02()
|
||||
{
|
||||
gnu_codecvt facet01;
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
test01();
|
||||
test02();
|
||||
return 0;
|
||||
}
|
39
libstdc++-v3/testsuite/22_locale/codecvt/2.cc
Normal file
39
libstdc++-v3/testsuite/22_locale/codecvt/2.cc
Normal file
@ -0,0 +1,39 @@
|
||||
// { dg-do compile }
|
||||
// 2001-08-27 Benjamin Kosnik <bkoz@redhat.com>
|
||||
|
||||
// Copyright (C) 2001, 2003 Free Software Foundation
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// 22.2.1.5 Template class codecvt
|
||||
|
||||
#include <locale>
|
||||
|
||||
// Should be able to instantiate this for other types besides char, wchar_t
|
||||
class gnu_codecvt: public std::codecvt<unsigned char, unsigned long, char>
|
||||
{ };
|
||||
|
||||
void test02()
|
||||
{
|
||||
gnu_codecvt facet01;
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
test02();
|
||||
return 0;
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
// 2000-08-17 Benjamin Kosnik <bkoz@cygnus.com>
|
||||
|
||||
// Copyright (C) 2000, 2002, 2003 Free Software Foundation
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// 22.2.1.5 - Template class codecvt [lib.locale.codecvt]
|
||||
|
||||
#include <locale>
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
// Required instantiation, degenerate conversion.
|
||||
// codecvt<char, char, mbstate_t>
|
||||
void test01()
|
||||
{
|
||||
using namespace std;
|
||||
typedef codecvt_base::result result;
|
||||
typedef codecvt<char, char, mbstate_t> c_codecvt;
|
||||
|
||||
bool test = true;
|
||||
const char* c_lit = "black pearl jasmine tea";
|
||||
const char* from_next;
|
||||
int size = 25;
|
||||
char* c_arr = new char[size];
|
||||
char* c_ref = new char[size];
|
||||
char* to_next;
|
||||
|
||||
locale loc = locale::classic();
|
||||
c_codecvt::state_type state;
|
||||
const c_codecvt* cvt = &use_facet<c_codecvt>(loc);
|
||||
|
||||
// According to the resolution of DR19 (see also libstd++/9168), in
|
||||
// case of degenerate conversion ('noconv'), "there are no changes to
|
||||
// the values in [to, to_limit)."
|
||||
memset(c_ref, 'X', size);
|
||||
|
||||
VERIFY( cvt->always_noconv() );
|
||||
|
||||
delete [] c_arr;
|
||||
delete [] c_ref;
|
||||
}
|
||||
|
||||
int main ()
|
||||
{
|
||||
test01();
|
||||
return 0;
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
// 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
|
||||
|
||||
// Copyright (C) 2001, 2002, 2003 Free Software Foundation
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// 22.2.4.1.1 collate members
|
||||
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
#define main discard_main_1
|
||||
#include "1.cc"
|
||||
#undef main
|
||||
|
||||
int main()
|
||||
{
|
||||
using namespace __gnu_cxx_test;
|
||||
func_callback two;
|
||||
two.push_back(&test01);
|
||||
run_tests_wrapped_env("de_DE", "LANG", two);
|
||||
return 0;
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
// 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
|
||||
|
||||
// Copyright (C) 2001, 2002, 2003 Free Software Foundation
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// 22.2.4.1.1 collate members
|
||||
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
#define main discard_main_1
|
||||
#include "1.cc"
|
||||
#undef main
|
||||
|
||||
int main()
|
||||
{
|
||||
using namespace __gnu_cxx_test;
|
||||
func_callback two;
|
||||
two.push_back(&test01);
|
||||
run_tests_wrapped_locale("ja_JP.eucjp", two);
|
||||
return 0;
|
||||
}
|
@ -0,0 +1,75 @@
|
||||
// 2000-08-17 Benjamin Kosnik <bkoz@cygnus.com>
|
||||
|
||||
// Copyright (C) 2000, 2002, 2003 Free Software Foundation
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// 22.2.1.5 - Template class codecvt [lib.locale.codecvt]
|
||||
|
||||
#include <locale>
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
// Need to explicitly set the state(mbstate_t) to zero.
|
||||
// How to do this is not specified by the ISO C99 standard, so we
|
||||
// might need to add some operators to make the intuiative case
|
||||
// work:
|
||||
// w_codecvt::state_type state00;
|
||||
// state00 = 0;
|
||||
// or, can use this explicit "C" initialization:
|
||||
// w_codecvt::state_type state01 = {0, 0};
|
||||
// .. except Ulrich says: Use memset. Always use memset. Feel the force...
|
||||
void
|
||||
zero_state(std::mbstate_t& state)
|
||||
{ std::memset(&state, 0, sizeof(std::mbstate_t)); }
|
||||
|
||||
// Required instantiation
|
||||
// codecvt<wchar_t, char, mbstate_t>
|
||||
void test01()
|
||||
{
|
||||
using namespace std;
|
||||
typedef codecvt<wchar_t, char, mbstate_t> w_codecvt;
|
||||
typedef codecvt_base::result result;
|
||||
typedef wchar_t int_type;
|
||||
typedef char ext_type;
|
||||
typedef char_traits<wchar_t> int_traits;
|
||||
typedef char_traits<char> ext_traits;
|
||||
|
||||
bool test = true;
|
||||
const ext_type* e_lit = "black pearl jasmine tea";
|
||||
const ext_type* efrom_next;
|
||||
const int_type* i_lit = L"black pearl jasmine tea";
|
||||
const int_type* ifrom_next;
|
||||
int size = strlen(e_lit);
|
||||
ext_type* e_arr = new ext_type[size + 1];
|
||||
ext_type* eto_next;
|
||||
int_type* i_arr = new int_type[size + 1];
|
||||
int_type* ito_next;
|
||||
|
||||
locale loc;
|
||||
const w_codecvt* cvt = &use_facet<w_codecvt>(loc);
|
||||
|
||||
VERIFY( !cvt->always_noconv() );
|
||||
|
||||
delete [] e_arr;
|
||||
delete [] i_arr;
|
||||
}
|
||||
|
||||
int main ()
|
||||
{
|
||||
test01();
|
||||
return 0;
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
// 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
|
||||
|
||||
// Copyright (C) 2001, 2002, 2003 Free Software Foundation
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// 22.2.4.1.1 collate members
|
||||
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
#define main discard_main_1
|
||||
#include "1.cc"
|
||||
#undef main
|
||||
|
||||
int main()
|
||||
{
|
||||
using namespace __gnu_cxx_test;
|
||||
func_callback two;
|
||||
two.push_back(&test01);
|
||||
run_tests_wrapped_env("de_DE", "LANG", two);
|
||||
return 0;
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
// 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
|
||||
|
||||
// Copyright (C) 2001, 2002, 2003 Free Software Foundation
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// 22.2.4.1.1 collate members
|
||||
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
#define main discard_main_1
|
||||
#include "1.cc"
|
||||
#undef main
|
||||
|
||||
int main()
|
||||
{
|
||||
using namespace __gnu_cxx_test;
|
||||
func_callback two;
|
||||
two.push_back(&test01);
|
||||
run_tests_wrapped_locale("ja_JP.eucjp", two);
|
||||
return 0;
|
||||
}
|
62
libstdc++-v3/testsuite/22_locale/codecvt/encoding/char/1.cc
Normal file
62
libstdc++-v3/testsuite/22_locale/codecvt/encoding/char/1.cc
Normal file
@ -0,0 +1,62 @@
|
||||
// 2000-08-17 Benjamin Kosnik <bkoz@cygnus.com>
|
||||
|
||||
// Copyright (C) 2000, 2002, 2003 Free Software Foundation
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// 22.2.1.5 - Template class codecvt [lib.locale.codecvt]
|
||||
|
||||
#include <locale>
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
// Required instantiation, degenerate conversion.
|
||||
// codecvt<char, char, mbstate_t>
|
||||
void test01()
|
||||
{
|
||||
using namespace std;
|
||||
typedef codecvt_base::result result;
|
||||
typedef codecvt<char, char, mbstate_t> c_codecvt;
|
||||
|
||||
bool test = true;
|
||||
const char* c_lit = "black pearl jasmine tea";
|
||||
const char* from_next;
|
||||
int size = 25;
|
||||
char* c_arr = new char[size];
|
||||
char* c_ref = new char[size];
|
||||
char* to_next;
|
||||
|
||||
locale loc = locale::classic();
|
||||
c_codecvt::state_type state;
|
||||
const c_codecvt* cvt = &use_facet<c_codecvt>(loc);
|
||||
|
||||
// According to the resolution of DR19 (see also libstd++/9168), in
|
||||
// case of degenerate conversion ('noconv'), "there are no changes to
|
||||
// the values in [to, to_limit)."
|
||||
memset(c_ref, 'X', size);
|
||||
|
||||
int i = cvt->encoding();
|
||||
VERIFY( i == 1 );
|
||||
|
||||
delete [] c_arr;
|
||||
delete [] c_ref;
|
||||
}
|
||||
|
||||
int main ()
|
||||
{
|
||||
test01();
|
||||
return 0;
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
// 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
|
||||
|
||||
// Copyright (C) 2001, 2002, 2003 Free Software Foundation
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// 22.2.4.1.1 collate members
|
||||
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
#define main discard_main_1
|
||||
#include "1.cc"
|
||||
#undef main
|
||||
|
||||
int main()
|
||||
{
|
||||
using namespace __gnu_cxx_test;
|
||||
func_callback two;
|
||||
two.push_back(&test01);
|
||||
run_tests_wrapped_env("de_DE", "LANG", two);
|
||||
return 0;
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
// 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
|
||||
|
||||
// Copyright (C) 2001, 2002, 2003 Free Software Foundation
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// 22.2.4.1.1 collate members
|
||||
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
#define main discard_main_1
|
||||
#include "1.cc"
|
||||
#undef main
|
||||
|
||||
int main()
|
||||
{
|
||||
using namespace __gnu_cxx_test;
|
||||
func_callback two;
|
||||
two.push_back(&test01);
|
||||
run_tests_wrapped_locale("ja_JP.eucjp", two);
|
||||
return 0;
|
||||
}
|
@ -0,0 +1,76 @@
|
||||
// 2000-08-17 Benjamin Kosnik <bkoz@cygnus.com>
|
||||
|
||||
// Copyright (C) 2000, 2002, 2003 Free Software Foundation
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// 22.2.1.5 - Template class codecvt [lib.locale.codecvt]
|
||||
|
||||
#include <locale>
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
// Need to explicitly set the state(mbstate_t) to zero.
|
||||
// How to do this is not specified by the ISO C99 standard, so we
|
||||
// might need to add some operators to make the intuiative case
|
||||
// work:
|
||||
// w_codecvt::state_type state00;
|
||||
// state00 = 0;
|
||||
// or, can use this explicit "C" initialization:
|
||||
// w_codecvt::state_type state01 = {0, 0};
|
||||
// .. except Ulrich says: Use memset. Always use memset. Feel the force...
|
||||
void
|
||||
zero_state(std::mbstate_t& state)
|
||||
{ std::memset(&state, 0, sizeof(std::mbstate_t)); }
|
||||
|
||||
// Required instantiation
|
||||
// codecvt<wchar_t, char, mbstate_t>
|
||||
void test01()
|
||||
{
|
||||
using namespace std;
|
||||
typedef codecvt<wchar_t, char, mbstate_t> w_codecvt;
|
||||
typedef codecvt_base::result result;
|
||||
typedef wchar_t int_type;
|
||||
typedef char ext_type;
|
||||
typedef char_traits<wchar_t> int_traits;
|
||||
typedef char_traits<char> ext_traits;
|
||||
|
||||
bool test = true;
|
||||
const ext_type* e_lit = "black pearl jasmine tea";
|
||||
const ext_type* efrom_next;
|
||||
const int_type* i_lit = L"black pearl jasmine tea";
|
||||
const int_type* ifrom_next;
|
||||
int size = strlen(e_lit);
|
||||
ext_type* e_arr = new ext_type[size + 1];
|
||||
ext_type* eto_next;
|
||||
int_type* i_arr = new int_type[size + 1];
|
||||
int_type* ito_next;
|
||||
|
||||
locale loc;
|
||||
const w_codecvt* cvt = &use_facet<w_codecvt>(loc);
|
||||
|
||||
int i = cvt->encoding();
|
||||
VERIFY( i == 4 ); // Target-dependent.
|
||||
|
||||
delete [] e_arr;
|
||||
delete [] i_arr;
|
||||
}
|
||||
|
||||
int main ()
|
||||
{
|
||||
test01();
|
||||
return 0;
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
// 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
|
||||
|
||||
// Copyright (C) 2001, 2002, 2003 Free Software Foundation
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// 22.2.4.1.1 collate members
|
||||
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
#define main discard_main_1
|
||||
#include "1.cc"
|
||||
#undef main
|
||||
|
||||
int main()
|
||||
{
|
||||
using namespace __gnu_cxx_test;
|
||||
func_callback two;
|
||||
two.push_back(&test01);
|
||||
run_tests_wrapped_env("de_DE", "LANG", two);
|
||||
return 0;
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
// 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
|
||||
|
||||
// Copyright (C) 2001, 2002, 2003 Free Software Foundation
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// 22.2.4.1.1 collate members
|
||||
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
#define main discard_main_1
|
||||
#include "1.cc"
|
||||
#undef main
|
||||
|
||||
int main()
|
||||
{
|
||||
using namespace __gnu_cxx_test;
|
||||
func_callback two;
|
||||
two.push_back(&test01);
|
||||
run_tests_wrapped_locale("ja_JP.eucjp", two);
|
||||
return 0;
|
||||
}
|
68
libstdc++-v3/testsuite/22_locale/codecvt/in/char/1.cc
Normal file
68
libstdc++-v3/testsuite/22_locale/codecvt/in/char/1.cc
Normal file
@ -0,0 +1,68 @@
|
||||
// 2000-08-17 Benjamin Kosnik <bkoz@cygnus.com>
|
||||
|
||||
// Copyright (C) 2000, 2002, 2003 Free Software Foundation
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// 22.2.1.5 - Template class codecvt [lib.locale.codecvt]
|
||||
|
||||
#include <locale>
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
// Required instantiation, degenerate conversion.
|
||||
// codecvt<char, char, mbstate_t>
|
||||
void test01()
|
||||
{
|
||||
using namespace std;
|
||||
typedef codecvt_base::result result;
|
||||
typedef codecvt<char, char, mbstate_t> c_codecvt;
|
||||
|
||||
bool test = true;
|
||||
const char* c_lit = "black pearl jasmine tea";
|
||||
const char* from_next;
|
||||
int size = 25;
|
||||
char* c_arr = new char[size];
|
||||
char* c_ref = new char[size];
|
||||
char* to_next;
|
||||
|
||||
locale loc = locale::classic();
|
||||
c_codecvt::state_type state;
|
||||
const c_codecvt* cvt = &use_facet<c_codecvt>(loc);
|
||||
|
||||
// According to the resolution of DR19 (see also libstd++/9168), in
|
||||
// case of degenerate conversion ('noconv'), "there are no changes to
|
||||
// the values in [to, to_limit)."
|
||||
memset(c_ref, 'X', size);
|
||||
|
||||
// in
|
||||
memset(c_arr, 'X', size);
|
||||
result r1 = cvt->in(state, c_lit, c_lit + size, from_next,
|
||||
c_arr, c_arr + size, to_next);
|
||||
VERIFY( r1 == codecvt_base::noconv );
|
||||
VERIFY( !memcmp(c_arr, c_ref, size) );
|
||||
VERIFY( from_next == c_lit );
|
||||
VERIFY( to_next == c_arr );
|
||||
|
||||
delete [] c_arr;
|
||||
delete [] c_ref;
|
||||
}
|
||||
|
||||
int main ()
|
||||
{
|
||||
test01();
|
||||
return 0;
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
// 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
|
||||
|
||||
// Copyright (C) 2001, 2002, 2003 Free Software Foundation
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// 22.2.4.1.1 collate members
|
||||
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
#define main discard_main_1
|
||||
#include "1.cc"
|
||||
#undef main
|
||||
|
||||
int main()
|
||||
{
|
||||
using namespace __gnu_cxx_test;
|
||||
func_callback two;
|
||||
two.push_back(&test01);
|
||||
run_tests_wrapped_env("de_DE", "LANG", two);
|
||||
return 0;
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
// 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
|
||||
|
||||
// Copyright (C) 2001, 2002, 2003 Free Software Foundation
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// 22.2.4.1.1 collate members
|
||||
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
#define main discard_main_1
|
||||
#include "1.cc"
|
||||
#undef main
|
||||
|
||||
int main()
|
||||
{
|
||||
using namespace __gnu_cxx_test;
|
||||
func_callback two;
|
||||
two.push_back(&test01);
|
||||
run_tests_wrapped_locale("ja_JP.eucjp", two);
|
||||
return 0;
|
||||
}
|
83
libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/1.cc
Normal file
83
libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/1.cc
Normal file
@ -0,0 +1,83 @@
|
||||
// 2000-08-17 Benjamin Kosnik <bkoz@cygnus.com>
|
||||
|
||||
// Copyright (C) 2000, 2002, 2003 Free Software Foundation
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// 22.2.1.5 - Template class codecvt [lib.locale.codecvt]
|
||||
|
||||
#include <locale>
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
// Need to explicitly set the state(mbstate_t) to zero.
|
||||
// How to do this is not specified by the ISO C99 standard, so we
|
||||
// might need to add some operators to make the intuiative case
|
||||
// work:
|
||||
// w_codecvt::state_type state00;
|
||||
// state00 = 0;
|
||||
// or, can use this explicit "C" initialization:
|
||||
// w_codecvt::state_type state01 = {0, 0};
|
||||
// .. except Ulrich says: Use memset. Always use memset. Feel the force...
|
||||
void
|
||||
zero_state(std::mbstate_t& state)
|
||||
{ std::memset(&state, 0, sizeof(std::mbstate_t)); }
|
||||
|
||||
// Required instantiation
|
||||
// codecvt<wchar_t, char, mbstate_t>
|
||||
void test01()
|
||||
{
|
||||
using namespace std;
|
||||
typedef codecvt<wchar_t, char, mbstate_t> w_codecvt;
|
||||
typedef codecvt_base::result result;
|
||||
typedef wchar_t int_type;
|
||||
typedef char ext_type;
|
||||
typedef char_traits<wchar_t> int_traits;
|
||||
typedef char_traits<char> ext_traits;
|
||||
|
||||
bool test = true;
|
||||
const ext_type* e_lit = "black pearl jasmine tea";
|
||||
const ext_type* efrom_next;
|
||||
const int_type* i_lit = L"black pearl jasmine tea";
|
||||
const int_type* ifrom_next;
|
||||
int size = strlen(e_lit);
|
||||
ext_type* e_arr = new ext_type[size + 1];
|
||||
ext_type* eto_next;
|
||||
int_type* i_arr = new int_type[size + 1];
|
||||
int_type* ito_next;
|
||||
|
||||
locale loc;
|
||||
const w_codecvt* cvt = &use_facet<w_codecvt>(loc);
|
||||
|
||||
// in
|
||||
w_codecvt::state_type state01;
|
||||
zero_state(state01);
|
||||
result r1 = cvt->in(state01, e_lit, e_lit + size, efrom_next,
|
||||
i_arr, i_arr + size, ito_next);
|
||||
VERIFY( r1 == codecvt_base::ok );
|
||||
VERIFY( !int_traits::compare(i_arr, i_lit, size) );
|
||||
VERIFY( efrom_next == e_lit + size );
|
||||
VERIFY( ito_next == i_arr + size );
|
||||
|
||||
delete [] e_arr;
|
||||
delete [] i_arr;
|
||||
}
|
||||
|
||||
int main ()
|
||||
{
|
||||
test01();
|
||||
return 0;
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
// 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
|
||||
|
||||
// Copyright (C) 2001, 2002, 2003 Free Software Foundation
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// 22.2.4.1.1 collate members
|
||||
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
#define main discard_main_1
|
||||
#include "1.cc"
|
||||
#undef main
|
||||
|
||||
int main()
|
||||
{
|
||||
using namespace __gnu_cxx_test;
|
||||
func_callback two;
|
||||
two.push_back(&test01);
|
||||
run_tests_wrapped_env("de_DE", "LANG", two);
|
||||
return 0;
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
// 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
|
||||
|
||||
// Copyright (C) 2001, 2002, 2003 Free Software Foundation
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// 22.2.4.1.1 collate members
|
||||
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
#define main discard_main_1
|
||||
#include "1.cc"
|
||||
#undef main
|
||||
|
||||
int main()
|
||||
{
|
||||
using namespace __gnu_cxx_test;
|
||||
func_callback two;
|
||||
two.push_back(&test01);
|
||||
run_tests_wrapped_locale("ja_JP.eucjp", two);
|
||||
return 0;
|
||||
}
|
62
libstdc++-v3/testsuite/22_locale/codecvt/length/char/1.cc
Normal file
62
libstdc++-v3/testsuite/22_locale/codecvt/length/char/1.cc
Normal file
@ -0,0 +1,62 @@
|
||||
// 2000-08-17 Benjamin Kosnik <bkoz@cygnus.com>
|
||||
|
||||
// Copyright (C) 2000, 2002, 2003 Free Software Foundation
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// 22.2.1.5 - Template class codecvt [lib.locale.codecvt]
|
||||
|
||||
#include <locale>
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
// Required instantiation, degenerate conversion.
|
||||
// codecvt<char, char, mbstate_t>
|
||||
void test01()
|
||||
{
|
||||
using namespace std;
|
||||
typedef codecvt_base::result result;
|
||||
typedef codecvt<char, char, mbstate_t> c_codecvt;
|
||||
|
||||
bool test = true;
|
||||
const char* c_lit = "black pearl jasmine tea";
|
||||
const char* from_next;
|
||||
int size = 25;
|
||||
char* c_arr = new char[size];
|
||||
char* c_ref = new char[size];
|
||||
char* to_next;
|
||||
|
||||
locale loc = locale::classic();
|
||||
c_codecvt::state_type state;
|
||||
const c_codecvt* cvt = &use_facet<c_codecvt>(loc);
|
||||
|
||||
// According to the resolution of DR19 (see also libstd++/9168), in
|
||||
// case of degenerate conversion ('noconv'), "there are no changes to
|
||||
// the values in [to, to_limit)."
|
||||
memset(c_ref, 'X', size);
|
||||
|
||||
int j = cvt->length(state, c_lit, c_lit + size, 5);
|
||||
VERIFY( j == 5 );
|
||||
|
||||
delete [] c_arr;
|
||||
delete [] c_ref;
|
||||
}
|
||||
|
||||
int main ()
|
||||
{
|
||||
test01();
|
||||
return 0;
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
// 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
|
||||
|
||||
// Copyright (C) 2001, 2002, 2003 Free Software Foundation
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// 22.2.4.1.1 collate members
|
||||
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
#define main discard_main_1
|
||||
#include "1.cc"
|
||||
#undef main
|
||||
|
||||
int main()
|
||||
{
|
||||
using namespace __gnu_cxx_test;
|
||||
func_callback two;
|
||||
two.push_back(&test01);
|
||||
run_tests_wrapped_env("de_DE", "LANG", two);
|
||||
return 0;
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
// 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
|
||||
|
||||
// Copyright (C) 2001, 2002, 2003 Free Software Foundation
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// 22.2.4.1.1 collate members
|
||||
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
#define main discard_main_1
|
||||
#include "1.cc"
|
||||
#undef main
|
||||
|
||||
int main()
|
||||
{
|
||||
using namespace __gnu_cxx_test;
|
||||
func_callback two;
|
||||
two.push_back(&test01);
|
||||
run_tests_wrapped_locale("ja_JP.eucjp", two);
|
||||
return 0;
|
||||
}
|
78
libstdc++-v3/testsuite/22_locale/codecvt/length/wchar_t/1.cc
Normal file
78
libstdc++-v3/testsuite/22_locale/codecvt/length/wchar_t/1.cc
Normal file
@ -0,0 +1,78 @@
|
||||
// 2000-08-17 Benjamin Kosnik <bkoz@cygnus.com>
|
||||
|
||||
// Copyright (C) 2000, 2002, 2003 Free Software Foundation
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// 22.2.1.5 - Template class codecvt [lib.locale.codecvt]
|
||||
|
||||
#include <locale>
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
// Need to explicitly set the state(mbstate_t) to zero.
|
||||
// How to do this is not specified by the ISO C99 standard, so we
|
||||
// might need to add some operators to make the intuiative case
|
||||
// work:
|
||||
// w_codecvt::state_type state00;
|
||||
// state00 = 0;
|
||||
// or, can use this explicit "C" initialization:
|
||||
// w_codecvt::state_type state01 = {0, 0};
|
||||
// .. except Ulrich says: Use memset. Always use memset. Feel the force...
|
||||
void
|
||||
zero_state(std::mbstate_t& state)
|
||||
{ std::memset(&state, 0, sizeof(std::mbstate_t)); }
|
||||
|
||||
// Required instantiation
|
||||
// codecvt<wchar_t, char, mbstate_t>
|
||||
void test01()
|
||||
{
|
||||
using namespace std;
|
||||
typedef codecvt<wchar_t, char, mbstate_t> w_codecvt;
|
||||
typedef codecvt_base::result result;
|
||||
typedef wchar_t int_type;
|
||||
typedef char ext_type;
|
||||
typedef char_traits<wchar_t> int_traits;
|
||||
typedef char_traits<char> ext_traits;
|
||||
|
||||
bool test = true;
|
||||
const ext_type* e_lit = "black pearl jasmine tea";
|
||||
const ext_type* efrom_next;
|
||||
const int_type* i_lit = L"black pearl jasmine tea";
|
||||
const int_type* ifrom_next;
|
||||
int size = strlen(e_lit);
|
||||
ext_type* e_arr = new ext_type[size + 1];
|
||||
ext_type* eto_next;
|
||||
int_type* i_arr = new int_type[size + 1];
|
||||
int_type* ito_next;
|
||||
|
||||
locale loc;
|
||||
const w_codecvt* cvt = &use_facet<w_codecvt>(loc);
|
||||
|
||||
w_codecvt::state_type state04;
|
||||
zero_state(state04);
|
||||
int j = cvt->length(state04, e_lit, e_lit + size, 5);
|
||||
VERIFY( j == 5 );
|
||||
|
||||
delete [] e_arr;
|
||||
delete [] i_arr;
|
||||
}
|
||||
|
||||
int main ()
|
||||
{
|
||||
test01();
|
||||
return 0;
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
// 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
|
||||
|
||||
// Copyright (C) 2001, 2002, 2003 Free Software Foundation
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// 22.2.4.1.1 collate members
|
||||
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
#define main discard_main_1
|
||||
#include "1.cc"
|
||||
#undef main
|
||||
|
||||
int main()
|
||||
{
|
||||
using namespace __gnu_cxx_test;
|
||||
func_callback two;
|
||||
two.push_back(&test01);
|
||||
run_tests_wrapped_env("de_DE", "LANG", two);
|
||||
return 0;
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
// 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
|
||||
|
||||
// Copyright (C) 2001, 2002, 2003 Free Software Foundation
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// 22.2.4.1.1 collate members
|
||||
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
#define main discard_main_1
|
||||
#include "1.cc"
|
||||
#undef main
|
||||
|
||||
int main()
|
||||
{
|
||||
using namespace __gnu_cxx_test;
|
||||
func_callback two;
|
||||
two.push_back(&test01);
|
||||
run_tests_wrapped_locale("ja_JP.eucjp", two);
|
||||
return 0;
|
||||
}
|
@ -0,0 +1,62 @@
|
||||
// 2000-08-17 Benjamin Kosnik <bkoz@cygnus.com>
|
||||
|
||||
// Copyright (C) 2000, 2002, 2003 Free Software Foundation
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// 22.2.1.5 - Template class codecvt [lib.locale.codecvt]
|
||||
|
||||
#include <locale>
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
// Required instantiation, degenerate conversion.
|
||||
// codecvt<char, char, mbstate_t>
|
||||
void test01()
|
||||
{
|
||||
using namespace std;
|
||||
typedef codecvt_base::result result;
|
||||
typedef codecvt<char, char, mbstate_t> c_codecvt;
|
||||
|
||||
bool test = true;
|
||||
const char* c_lit = "black pearl jasmine tea";
|
||||
const char* from_next;
|
||||
int size = 25;
|
||||
char* c_arr = new char[size];
|
||||
char* c_ref = new char[size];
|
||||
char* to_next;
|
||||
|
||||
locale loc = locale::classic();
|
||||
c_codecvt::state_type state;
|
||||
const c_codecvt* cvt = &use_facet<c_codecvt>(loc);
|
||||
|
||||
// According to the resolution of DR19 (see also libstd++/9168), in
|
||||
// case of degenerate conversion ('noconv'), "there are no changes to
|
||||
// the values in [to, to_limit)."
|
||||
memset(c_ref, 'X', size);
|
||||
|
||||
int k = cvt->max_length();
|
||||
VERIFY( k == 1 );
|
||||
|
||||
delete [] c_arr;
|
||||
delete [] c_ref;
|
||||
}
|
||||
|
||||
int main ()
|
||||
{
|
||||
test01();
|
||||
return 0;
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
// 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
|
||||
|
||||
// Copyright (C) 2001, 2002, 2003 Free Software Foundation
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// 22.2.4.1.1 collate members
|
||||
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
#define main discard_main_1
|
||||
#include "1.cc"
|
||||
#undef main
|
||||
|
||||
int main()
|
||||
{
|
||||
using namespace __gnu_cxx_test;
|
||||
func_callback two;
|
||||
two.push_back(&test01);
|
||||
run_tests_wrapped_env("de_DE", "LANG", two);
|
||||
return 0;
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
// 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
|
||||
|
||||
// Copyright (C) 2001, 2002, 2003 Free Software Foundation
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// 22.2.4.1.1 collate members
|
||||
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
#define main discard_main_1
|
||||
#include "1.cc"
|
||||
#undef main
|
||||
|
||||
int main()
|
||||
{
|
||||
using namespace __gnu_cxx_test;
|
||||
func_callback two;
|
||||
two.push_back(&test01);
|
||||
run_tests_wrapped_locale("ja_JP.eucjp", two);
|
||||
return 0;
|
||||
}
|
@ -0,0 +1,77 @@
|
||||
// 2000-08-17 Benjamin Kosnik <bkoz@cygnus.com>
|
||||
|
||||
// Copyright (C) 2000, 2002, 2003 Free Software Foundation
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// 22.2.1.5 - Template class codecvt [lib.locale.codecvt]
|
||||
|
||||
#include <locale>
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
|
||||
// Need to explicitly set the state(mbstate_t) to zero.
|
||||
// How to do this is not specified by the ISO C99 standard, so we
|
||||
// might need to add some operators to make the intuiative case
|
||||
// work:
|
||||
// w_codecvt::state_type state00;
|
||||
// state00 = 0;
|
||||
// or, can use this explicit "C" initialization:
|
||||
// w_codecvt::state_type state01 = {0, 0};
|
||||
// .. except Ulrich says: Use memset. Always use memset. Feel the force...
|
||||
void
|
||||
zero_state(std::mbstate_t& state)
|
||||
{ std::memset(&state, 0, sizeof(std::mbstate_t)); }
|
||||
|
||||
// Required instantiation
|
||||
// codecvt<wchar_t, char, mbstate_t>
|
||||
void test01()
|
||||
{
|
||||
using namespace std;
|
||||
typedef codecvt<wchar_t, char, mbstate_t> w_codecvt;
|
||||
typedef codecvt_base::result result;
|
||||
typedef wchar_t int_type;
|
||||
typedef char ext_type;
|
||||
typedef char_traits<wchar_t> int_traits;
|
||||
typedef char_traits<char> ext_traits;
|
||||
|
||||
bool test = true;
|
||||
const ext_type* e_lit = "black pearl jasmine tea";
|
||||
const ext_type* efrom_next;
|
||||
const int_type* i_lit = L"black pearl jasmine tea";
|
||||
const int_type* ifrom_next;
|
||||
int size = strlen(e_lit);
|
||||
ext_type* e_arr = new ext_type[size + 1];
|
||||
ext_type* eto_next;
|
||||
int_type* i_arr = new int_type[size + 1];
|
||||
int_type* ito_next;
|
||||
|
||||
locale loc;
|
||||
const w_codecvt* cvt = &use_facet<w_codecvt>(loc);
|
||||
|
||||
int k = cvt->max_length();
|
||||
VERIFY( k == 1 );
|
||||
|
||||
delete [] e_arr;
|
||||
delete [] i_arr;
|
||||
}
|
||||
|
||||
int main ()
|
||||
{
|
||||
test01();
|
||||
return 0;
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
// 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
|
||||
|
||||
// Copyright (C) 2001, 2002, 2003 Free Software Foundation
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// 22.2.4.1.1 collate members
|
||||
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
#define main discard_main_1
|
||||
#include "1.cc"
|
||||
#undef main
|
||||
|
||||
int main()
|
||||
{
|
||||
using namespace __gnu_cxx_test;
|
||||
func_callback two;
|
||||
two.push_back(&test01);
|
||||
run_tests_wrapped_env("de_DE", "LANG", two);
|
||||
return 0;
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
// 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
|
||||
|
||||
// Copyright (C) 2001, 2002, 2003 Free Software Foundation
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// 22.2.4.1.1 collate members
|
||||
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
#define main discard_main_1
|
||||
#include "1.cc"
|
||||
#undef main
|
||||
|
||||
int main()
|
||||
{
|
||||
using namespace __gnu_cxx_test;
|
||||
func_callback two;
|
||||
two.push_back(&test01);
|
||||
run_tests_wrapped_locale("ja_JP.eucjp", two);
|
||||
return 0;
|
||||
}
|
68
libstdc++-v3/testsuite/22_locale/codecvt/out/char/1.cc
Normal file
68
libstdc++-v3/testsuite/22_locale/codecvt/out/char/1.cc
Normal file
@ -0,0 +1,68 @@
|
||||
// 2000-08-17 Benjamin Kosnik <bkoz@cygnus.com>
|
||||
|
||||
// Copyright (C) 2000, 2002, 2003 Free Software Foundation
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// 22.2.1.5 - Template class codecvt [lib.locale.codecvt]
|
||||
|
||||
#include <locale>
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
// Required instantiation, degenerate conversion.
|
||||
// codecvt<char, char, mbstate_t>
|
||||
void test01()
|
||||
{
|
||||
using namespace std;
|
||||
typedef codecvt_base::result result;
|
||||
typedef codecvt<char, char, mbstate_t> c_codecvt;
|
||||
|
||||
bool test = true;
|
||||
const char* c_lit = "black pearl jasmine tea";
|
||||
const char* from_next;
|
||||
int size = 25;
|
||||
char* c_arr = new char[size];
|
||||
char* c_ref = new char[size];
|
||||
char* to_next;
|
||||
|
||||
locale loc = locale::classic();
|
||||
c_codecvt::state_type state;
|
||||
const c_codecvt* cvt = &use_facet<c_codecvt>(loc);
|
||||
|
||||
// According to the resolution of DR19 (see also libstd++/9168), in
|
||||
// case of degenerate conversion ('noconv'), "there are no changes to
|
||||
// the values in [to, to_limit)."
|
||||
memset(c_ref, 'X', size);
|
||||
|
||||
// out
|
||||
memset(c_arr, 'X', size);
|
||||
result r2 = cvt->out(state, c_lit, c_lit + size, from_next,
|
||||
c_arr, c_arr + size, to_next);
|
||||
VERIFY( r2 == codecvt_base::noconv );
|
||||
VERIFY( !memcmp(c_arr, c_ref, size) );
|
||||
VERIFY( from_next == c_lit );
|
||||
VERIFY( to_next == c_arr );
|
||||
|
||||
delete [] c_arr;
|
||||
delete [] c_ref;
|
||||
}
|
||||
|
||||
int main ()
|
||||
{
|
||||
test01();
|
||||
return 0;
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
// 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
|
||||
|
||||
// Copyright (C) 2001, 2002, 2003 Free Software Foundation
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// 22.2.4.1.1 collate members
|
||||
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
#define main discard_main_1
|
||||
#include "1.cc"
|
||||
#undef main
|
||||
|
||||
int main()
|
||||
{
|
||||
using namespace __gnu_cxx_test;
|
||||
func_callback two;
|
||||
two.push_back(&test01);
|
||||
run_tests_wrapped_env("de_DE", "LANG", two);
|
||||
return 0;
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
// 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
|
||||
|
||||
// Copyright (C) 2001, 2002, 2003 Free Software Foundation
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// 22.2.4.1.1 collate members
|
||||
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
#define main discard_main_1
|
||||
#include "1.cc"
|
||||
#undef main
|
||||
|
||||
int main()
|
||||
{
|
||||
using namespace __gnu_cxx_test;
|
||||
func_callback two;
|
||||
two.push_back(&test01);
|
||||
run_tests_wrapped_locale("ja_JP.eucjp", two);
|
||||
return 0;
|
||||
}
|
83
libstdc++-v3/testsuite/22_locale/codecvt/out/wchar_t/1.cc
Normal file
83
libstdc++-v3/testsuite/22_locale/codecvt/out/wchar_t/1.cc
Normal file
@ -0,0 +1,83 @@
|
||||
// 2000-08-17 Benjamin Kosnik <bkoz@cygnus.com>
|
||||
|
||||
// Copyright (C) 2000, 2002, 2003 Free Software Foundation
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// 22.2.1.5 - Template class codecvt [lib.locale.codecvt]
|
||||
|
||||
#include <locale>
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
// Need to explicitly set the state(mbstate_t) to zero.
|
||||
// How to do this is not specified by the ISO C99 standard, so we
|
||||
// might need to add some operators to make the intuiative case
|
||||
// work:
|
||||
// w_codecvt::state_type state00;
|
||||
// state00 = 0;
|
||||
// or, can use this explicit "C" initialization:
|
||||
// w_codecvt::state_type state01 = {0, 0};
|
||||
// .. except Ulrich says: Use memset. Always use memset. Feel the force...
|
||||
void
|
||||
zero_state(std::mbstate_t& state)
|
||||
{ std::memset(&state, 0, sizeof(std::mbstate_t)); }
|
||||
|
||||
// Required instantiation
|
||||
// codecvt<wchar_t, char, mbstate_t>
|
||||
void test01()
|
||||
{
|
||||
using namespace std;
|
||||
typedef codecvt<wchar_t, char, mbstate_t> w_codecvt;
|
||||
typedef codecvt_base::result result;
|
||||
typedef wchar_t int_type;
|
||||
typedef char ext_type;
|
||||
typedef char_traits<wchar_t> int_traits;
|
||||
typedef char_traits<char> ext_traits;
|
||||
|
||||
bool test = true;
|
||||
const ext_type* e_lit = "black pearl jasmine tea";
|
||||
const ext_type* efrom_next;
|
||||
const int_type* i_lit = L"black pearl jasmine tea";
|
||||
const int_type* ifrom_next;
|
||||
int size = strlen(e_lit);
|
||||
ext_type* e_arr = new ext_type[size + 1];
|
||||
ext_type* eto_next;
|
||||
int_type* i_arr = new int_type[size + 1];
|
||||
int_type* ito_next;
|
||||
|
||||
locale loc;
|
||||
const w_codecvt* cvt = &use_facet<w_codecvt>(loc);
|
||||
|
||||
// out
|
||||
w_codecvt::state_type state02;
|
||||
zero_state(state02);
|
||||
result r2 = cvt->out(state02, i_lit, i_lit + size, ifrom_next,
|
||||
e_arr, e_arr + size, eto_next);
|
||||
VERIFY( r2 == codecvt_base::ok );
|
||||
VERIFY( !ext_traits::compare(e_arr, e_lit, size) );
|
||||
VERIFY( ifrom_next == i_lit + size );
|
||||
VERIFY( eto_next == e_arr + size );
|
||||
|
||||
delete [] e_arr;
|
||||
delete [] i_arr;
|
||||
}
|
||||
|
||||
int main ()
|
||||
{
|
||||
test01();
|
||||
return 0;
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
// 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
|
||||
|
||||
// Copyright (C) 2001, 2002, 2003 Free Software Foundation
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// 22.2.4.1.1 collate members
|
||||
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
#define main discard_main_1
|
||||
#include "1.cc"
|
||||
#undef main
|
||||
|
||||
int main()
|
||||
{
|
||||
using namespace __gnu_cxx_test;
|
||||
func_callback two;
|
||||
two.push_back(&test01);
|
||||
run_tests_wrapped_env("de_DE", "LANG", two);
|
||||
return 0;
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
// 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
|
||||
|
||||
// Copyright (C) 2001, 2002, 2003 Free Software Foundation
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// 22.2.4.1.1 collate members
|
||||
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
#define main discard_main_1
|
||||
#include "1.cc"
|
||||
#undef main
|
||||
|
||||
int main()
|
||||
{
|
||||
using namespace __gnu_cxx_test;
|
||||
func_callback two;
|
||||
two.push_back(&test01);
|
||||
run_tests_wrapped_locale("ja_JP.eucjp", two);
|
||||
return 0;
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
// 2000-08-17 Benjamin Kosnik <bkoz@cygnus.com>
|
||||
|
||||
// Copyright (C) 2000, 2002 Free Software Foundation
|
||||
// Copyright (C) 2000, 2002, 2003 Free Software Foundation
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
@ -39,7 +39,7 @@ void test01()
|
||||
char* c_ref = new char[size];
|
||||
char* to_next;
|
||||
|
||||
locale loc;
|
||||
locale loc = locale::classic();
|
||||
c_codecvt::state_type state;
|
||||
const c_codecvt* cvt = &use_facet<c_codecvt>(loc);
|
||||
|
||||
@ -73,58 +73,12 @@ void test01()
|
||||
VERIFY( !strcmp(c_arr, c_lit) );
|
||||
VERIFY( to_next == c_arr );
|
||||
|
||||
int i = cvt->encoding();
|
||||
VERIFY( i == 1 );
|
||||
|
||||
VERIFY( cvt->always_noconv() );
|
||||
|
||||
int j = cvt->length(state, c_lit, c_lit + size, 5);
|
||||
VERIFY( j == 5 );
|
||||
|
||||
int k = cvt->max_length();
|
||||
VERIFY( k == 1 );
|
||||
|
||||
delete [] c_arr;
|
||||
delete [] c_ref;
|
||||
}
|
||||
|
||||
// libstdc++/5280
|
||||
void test02()
|
||||
{
|
||||
#ifdef _GLIBCPP_HAVE_SETENV
|
||||
// Set the global locale to non-"C".
|
||||
std::locale loc_de("de_DE");
|
||||
std::locale::global(loc_de);
|
||||
|
||||
// Set LANG environment variable to de_DE.
|
||||
const char* oldLANG = getenv("LANG");
|
||||
if (!setenv("LANG", "de_DE", 1))
|
||||
{
|
||||
test01();
|
||||
setenv("LANG", oldLANG ? oldLANG : "", 1);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
// http://gcc.gnu.org/ml/libstdc++/2002-05/msg00038.html
|
||||
void test03()
|
||||
{
|
||||
bool test = true;
|
||||
|
||||
const char* tentLANG = std::setlocale(LC_ALL, "ja_JP.eucjp");
|
||||
if (tentLANG != NULL)
|
||||
{
|
||||
std::string preLANG = tentLANG;
|
||||
test01();
|
||||
std::string postLANG = std::setlocale(LC_ALL, NULL);
|
||||
VERIFY( preLANG == postLANG );
|
||||
}
|
||||
}
|
||||
|
||||
int main ()
|
||||
{
|
||||
test01();
|
||||
test02();
|
||||
test03();
|
||||
return 0;
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
// 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
|
||||
|
||||
// Copyright (C) 2001, 2002, 2003 Free Software Foundation
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// 22.2.4.1.1 collate members
|
||||
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
#define main discard_main_1
|
||||
#include "1.cc"
|
||||
#undef main
|
||||
|
||||
int main()
|
||||
{
|
||||
using namespace __gnu_cxx_test;
|
||||
func_callback two;
|
||||
two.push_back(&test01);
|
||||
run_tests_wrapped_env("de_DE", "LANG", two);
|
||||
return 0;
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
// 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
|
||||
|
||||
// Copyright (C) 2001, 2002, 2003 Free Software Foundation
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// 22.2.4.1.1 collate members
|
||||
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
#define main discard_main_1
|
||||
#include "1.cc"
|
||||
#undef main
|
||||
|
||||
int main()
|
||||
{
|
||||
using namespace __gnu_cxx_test;
|
||||
func_callback two;
|
||||
two.push_back(&test01);
|
||||
run_tests_wrapped_locale("ja_JP.eucjp", two);
|
||||
return 0;
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
// 2000-08-18 Benjamin Kosnik <bkoz@cygnus.com>
|
||||
// 2000-08-17 Benjamin Kosnik <bkoz@cygnus.com>
|
||||
|
||||
// Copyright (C) 2000, 2002 Free Software Foundation
|
||||
// Copyright (C) 2000, 2002, 2003 Free Software Foundation
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
@ -20,11 +20,9 @@
|
||||
|
||||
// 22.2.1.5 - Template class codecvt [lib.locale.codecvt]
|
||||
|
||||
#include <cwchar> // for mbstate_t
|
||||
#include <locale>
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
|
||||
// Need to explicitly set the state(mbstate_t) to zero.
|
||||
// How to do this is not specified by the ISO C99 standard, so we
|
||||
// might need to add some operators to make the intuiative case
|
||||
@ -34,7 +32,6 @@
|
||||
// or, can use this explicit "C" initialization:
|
||||
// w_codecvt::state_type state01 = {0, 0};
|
||||
// .. except Ulrich says: Use memset. Always use memset. Feel the force...
|
||||
#ifdef _GLIBCPP_USE_WCHAR_T
|
||||
void
|
||||
zero_state(std::mbstate_t& state)
|
||||
{ std::memset(&state, 0, sizeof(std::mbstate_t)); }
|
||||
@ -93,66 +90,10 @@ void test01()
|
||||
VERIFY( r3 == codecvt_base::noconv );
|
||||
VERIFY( !strcmp(e_arr, e_lit) );
|
||||
VERIFY( eto_next == e_arr );
|
||||
|
||||
int i = cvt->encoding();
|
||||
VERIFY( i == 4 ); // Target-dependent.
|
||||
|
||||
VERIFY( !cvt->always_noconv() );
|
||||
|
||||
w_codecvt::state_type state04;
|
||||
zero_state(state04);
|
||||
int j = cvt->length(state03, e_lit, e_lit + size, 5);
|
||||
VERIFY( j == 5 );
|
||||
|
||||
int k = cvt->max_length();
|
||||
VERIFY( k == 1 );
|
||||
|
||||
delete [] e_arr;
|
||||
delete [] i_arr;
|
||||
}
|
||||
|
||||
// libstdc++/5280
|
||||
void test02()
|
||||
{
|
||||
#ifdef _GLIBCPP_HAVE_SETENV
|
||||
// Set the global locale to non-"C".
|
||||
std::locale loc_de("de_DE");
|
||||
std::locale::global(loc_de);
|
||||
|
||||
// Set LANG environment variable to de_DE.
|
||||
const char* oldLANG = getenv("LANG");
|
||||
if (!setenv("LANG", "de_DE", 1))
|
||||
{
|
||||
test01();
|
||||
setenv("LANG", oldLANG ? oldLANG : "", 1);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
// http://gcc.gnu.org/ml/libstdc++/2002-05/msg00038.html
|
||||
void test03()
|
||||
{
|
||||
bool test = true;
|
||||
|
||||
const char* tentLANG = std::setlocale(LC_ALL, "ja_JP.eucjp");
|
||||
if (tentLANG != NULL)
|
||||
{
|
||||
std::string preLANG = tentLANG;
|
||||
test01();
|
||||
std::string postLANG = std::setlocale(LC_ALL, NULL);
|
||||
VERIFY( preLANG == postLANG );
|
||||
}
|
||||
}
|
||||
#endif /* !defined(_GLIBCPP_USE_WCHAR_T) */
|
||||
|
||||
|
||||
int main ()
|
||||
{
|
||||
#if _GLIBCPP_USE_WCHAR_T
|
||||
test01();
|
||||
test02();
|
||||
test03();
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
// 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
|
||||
|
||||
// Copyright (C) 2001, 2002, 2003 Free Software Foundation
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// 22.2.4.1.1 collate members
|
||||
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
#define main discard_main_1
|
||||
#include "1.cc"
|
||||
#undef main
|
||||
|
||||
int main()
|
||||
{
|
||||
using namespace __gnu_cxx_test;
|
||||
func_callback two;
|
||||
two.push_back(&test01);
|
||||
run_tests_wrapped_env("de_DE", "LANG", two);
|
||||
return 0;
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
// 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
|
||||
|
||||
// Copyright (C) 2001, 2002, 2003 Free Software Foundation
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// 22.2.4.1.1 collate members
|
||||
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
#define main discard_main_1
|
||||
#include "1.cc"
|
||||
#undef main
|
||||
|
||||
int main()
|
||||
{
|
||||
using namespace __gnu_cxx_test;
|
||||
func_callback two;
|
||||
two.push_back(&test01);
|
||||
run_tests_wrapped_locale("ja_JP.eucjp", two);
|
||||
return 0;
|
||||
}
|
@ -1,3 +1,4 @@
|
||||
// { dg-do compile }
|
||||
// 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
|
||||
|
||||
// Copyright (C) 2001 Free Software Foundation
|
||||
@ -20,8 +21,6 @@
|
||||
|
||||
// 22.2.4 The collate category
|
||||
|
||||
// { dg-do compile }
|
||||
|
||||
#include <locale>
|
||||
|
||||
void test01()
|
||||
@ -37,18 +36,8 @@ void test01()
|
||||
typedef test_type::string_type string_type;
|
||||
}
|
||||
|
||||
// Should be able to instantiate this for other types besides char, wchar_t
|
||||
class gnu_collate: public std::collate<unsigned char>
|
||||
{ };
|
||||
|
||||
void test02()
|
||||
{
|
||||
gnu_collate facet01;
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
test01();
|
||||
test02();
|
||||
return 0;
|
||||
}
|
39
libstdc++-v3/testsuite/22_locale/collate/2.cc
Normal file
39
libstdc++-v3/testsuite/22_locale/collate/2.cc
Normal file
@ -0,0 +1,39 @@
|
||||
// { dg-do compile }
|
||||
// 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
|
||||
|
||||
// Copyright (C) 2001 Free Software Foundation
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// 22.2.4 The collate category
|
||||
|
||||
#include <locale>
|
||||
|
||||
// Should be able to instantiate this for other types besides char, wchar_t
|
||||
class gnu_collate: public std::collate<unsigned char>
|
||||
{ };
|
||||
|
||||
void test02()
|
||||
{
|
||||
gnu_collate facet01;
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
test02();
|
||||
return 0;
|
||||
}
|
79
libstdc++-v3/testsuite/22_locale/collate/compare/char/1.cc
Normal file
79
libstdc++-v3/testsuite/22_locale/collate/compare/char/1.cc
Normal file
@ -0,0 +1,79 @@
|
||||
// 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
|
||||
|
||||
// Copyright (C) 2001, 2002, 2003 Free Software Foundation
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// 22.2.4.1.1 collate members
|
||||
|
||||
#include <locale>
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
// Check "C" locale.
|
||||
void test01()
|
||||
{
|
||||
using namespace std;
|
||||
typedef std::collate<char>::string_type string_type;
|
||||
|
||||
bool test = true;
|
||||
|
||||
// basic construction
|
||||
locale loc_c = locale::classic();
|
||||
locale loc_us("en_US");
|
||||
locale loc_fr("fr_FR");
|
||||
locale loc_de("de_DE");
|
||||
VERIFY( loc_c != loc_de );
|
||||
VERIFY( loc_us != loc_fr );
|
||||
VERIFY( loc_us != loc_de );
|
||||
VERIFY( loc_de != loc_fr );
|
||||
|
||||
// cache the collate facets
|
||||
const collate<char>& coll_c = use_facet<collate<char> >(loc_c);
|
||||
const collate<char>& coll_us = use_facet<collate<char> >(loc_us);
|
||||
const collate<char>& coll_fr = use_facet<collate<char> >(loc_fr);
|
||||
const collate<char>& coll_de = use_facet<collate<char> >(loc_de);
|
||||
|
||||
// int compare(const charT*, const charT*, const charT*, const charT*) const
|
||||
|
||||
const char* strlit1 = "monkey picked tikuanyin oolong";
|
||||
const char* strlit2 = "imperial tea court green oolong";
|
||||
|
||||
int i1;
|
||||
int i2;
|
||||
int size1 = char_traits<char>::length(strlit1) - 1;
|
||||
int size2 = char_traits<char>::length(strlit2) - 1;
|
||||
|
||||
i1 = coll_c.compare(strlit1, strlit1 + size1, strlit1, strlit1 + 7);
|
||||
VERIFY ( i1 == 1 );
|
||||
i1 = coll_c.compare(strlit1, strlit1 + 7, strlit1, strlit1 + size1);
|
||||
VERIFY ( i1 == -1 );
|
||||
i1 = coll_c.compare(strlit1, strlit1 + 7, strlit1, strlit1 + 7);
|
||||
VERIFY ( i1 == 0 );
|
||||
|
||||
i2 = coll_c.compare(strlit2, strlit2 + size2, strlit2, strlit2 + 13);
|
||||
VERIFY ( i2 == 1 );
|
||||
i2 = coll_c.compare(strlit2, strlit2 + 13, strlit2, strlit2 + size2);
|
||||
VERIFY ( i2 == -1 );
|
||||
i2 = coll_c.compare(strlit2, strlit2 + size2, strlit2, strlit2 + size2);
|
||||
VERIFY ( i2 == 0 );
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
test01();
|
||||
return 0;
|
||||
}
|
86
libstdc++-v3/testsuite/22_locale/collate/compare/char/2.cc
Normal file
86
libstdc++-v3/testsuite/22_locale/collate/compare/char/2.cc
Normal file
@ -0,0 +1,86 @@
|
||||
// 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
|
||||
|
||||
// Copyright (C) 2001, 2002, 2003 Free Software Foundation
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// 22.2.4.1.1 collate members
|
||||
|
||||
#include <locale>
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
// Check German "de_DE" locale.
|
||||
void test02()
|
||||
{
|
||||
using namespace std;
|
||||
typedef std::collate<char>::string_type string_type;
|
||||
|
||||
bool test = true;
|
||||
|
||||
// basic construction
|
||||
locale loc_c = locale::classic();
|
||||
locale loc_us("en_US");
|
||||
locale loc_fr("fr_FR");
|
||||
locale loc_de("de_DE");
|
||||
VERIFY( loc_c != loc_de );
|
||||
VERIFY( loc_us != loc_fr );
|
||||
VERIFY( loc_us != loc_de );
|
||||
VERIFY( loc_de != loc_fr );
|
||||
|
||||
// cache the collate facets
|
||||
const collate<char>& coll_c = use_facet<collate<char> >(loc_c);
|
||||
const collate<char>& coll_us = use_facet<collate<char> >(loc_us);
|
||||
const collate<char>& coll_fr = use_facet<collate<char> >(loc_fr);
|
||||
const collate<char>& coll_de = use_facet<collate<char> >(loc_de);
|
||||
|
||||
// int compare(const charT*, const charT*, const charT*, const charT*) const
|
||||
|
||||
const char* strlit1 = "monkey picked tikuanyin oolong";
|
||||
const char* strlit2 = "imperial tea court green oolong";
|
||||
const char* strlit3 = "Äuglein Augment"; // "C" == "Augment Äuglein"
|
||||
const char* strlit4 = "Base baß Baß Bast"; // "C" == "Base baß Baß Bast"
|
||||
|
||||
int i1;
|
||||
int i2;
|
||||
int size1 = char_traits<char>::length(strlit1) - 1;
|
||||
int size2 = char_traits<char>::length(strlit2) - 1;
|
||||
int size3 = char_traits<char>::length(strlit3) - 1;
|
||||
int size4 = char_traits<char>::length(strlit4) - 1;
|
||||
|
||||
i1 = coll_de.compare(strlit3, strlit3 + size3, strlit3, strlit3 + 7);
|
||||
VERIFY ( i1 == 1 );
|
||||
i1 = coll_de.compare(strlit3, strlit3 + 7, strlit3, strlit3 + size1);
|
||||
VERIFY ( i1 == -1 );
|
||||
i1 = coll_de.compare(strlit3, strlit3 + 7, strlit3, strlit3 + 7);
|
||||
VERIFY ( i1 == 0 );
|
||||
|
||||
i1 = coll_de.compare(strlit3, strlit3 + 6, strlit3 + 8, strlit3 + 14);
|
||||
VERIFY ( i1 == -1 );
|
||||
|
||||
i2 = coll_de.compare(strlit4, strlit4 + size4, strlit4, strlit4 + 13);
|
||||
VERIFY ( i2 == 1 );
|
||||
i2 = coll_de.compare(strlit4, strlit4 + 13, strlit4, strlit4 + size4);
|
||||
VERIFY ( i2 == -1 );
|
||||
i2 = coll_de.compare(strlit4, strlit4 + size4, strlit4, strlit4 + size4);
|
||||
VERIFY ( i2 == 0 );
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
test02();
|
||||
return 0;
|
||||
}
|
@ -0,0 +1,41 @@
|
||||
// 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
|
||||
|
||||
// Copyright (C) 2001, 2002, 2003 Free Software Foundation
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// 22.2.4.1.1 collate members
|
||||
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
#define main discard_main_1
|
||||
#include "1.cc"
|
||||
#undef main
|
||||
|
||||
#define main discard_main_2
|
||||
#include "2.cc"
|
||||
#undef main
|
||||
|
||||
int main()
|
||||
{
|
||||
using namespace __gnu_cxx_test;
|
||||
func_callback two;
|
||||
two.push_back(&test01);
|
||||
two.push_back(&test02);
|
||||
run_tests_wrapped_env("de_DE", "LANG", two);
|
||||
return 0;
|
||||
}
|
@ -0,0 +1,41 @@
|
||||
// 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
|
||||
|
||||
// Copyright (C) 2001, 2002, 2003 Free Software Foundation
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// 22.2.4.1.1 collate members
|
||||
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
#define main discard_main_1
|
||||
#include "1.cc"
|
||||
#undef main
|
||||
|
||||
#define main discard_main_2
|
||||
#include "2.cc"
|
||||
#undef main
|
||||
|
||||
int main()
|
||||
{
|
||||
using namespace __gnu_cxx_test;
|
||||
func_callback two;
|
||||
two.push_back(&test01);
|
||||
two.push_back(&test02);
|
||||
run_tests_wrapped_locale("ja_JP.eucjp", two);
|
||||
return 0;
|
||||
}
|
@ -0,0 +1,79 @@
|
||||
// 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
|
||||
|
||||
// Copyright (C) 2001, 2002, 2003 Free Software Foundation
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// 22.2.4.1.1 collate members
|
||||
|
||||
#include <locale>
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
// Check "C" locale.
|
||||
void test01()
|
||||
{
|
||||
using namespace std;
|
||||
typedef std::collate<wchar_t>::string_type string_type;
|
||||
|
||||
bool test = true;
|
||||
|
||||
// basic construction
|
||||
locale loc_c = locale::classic();
|
||||
locale loc_us("en_US");
|
||||
locale loc_fr("fr_FR");
|
||||
locale loc_de("de_DE");
|
||||
VERIFY( loc_c != loc_de );
|
||||
VERIFY( loc_us != loc_fr );
|
||||
VERIFY( loc_us != loc_de );
|
||||
VERIFY( loc_de != loc_fr );
|
||||
|
||||
// cache the collate facets
|
||||
const collate<wchar_t>& coll_c = use_facet<collate<wchar_t> >(loc_c);
|
||||
const collate<wchar_t>& coll_us = use_facet<collate<wchar_t> >(loc_us);
|
||||
const collate<wchar_t>& coll_fr = use_facet<collate<wchar_t> >(loc_fr);
|
||||
const collate<wchar_t>& coll_de = use_facet<collate<wchar_t> >(loc_de);
|
||||
|
||||
// int compare(const charT*, const charT*, const charT*, const charT*) const
|
||||
|
||||
const wchar_t* strlit1 = L"monkey picked tikuanyin oolong";
|
||||
const wchar_t* strlit2 = L"imperial tea court green oolong";
|
||||
|
||||
int i1;
|
||||
int i2;
|
||||
int size1 = char_traits<wchar_t>::length(strlit1) - 1;
|
||||
int size2 = char_traits<wchar_t>::length(strlit2) - 1;
|
||||
|
||||
i1 = coll_c.compare(strlit1, strlit1 + size1, strlit1, strlit1 + 7);
|
||||
VERIFY ( i1 == 1 );
|
||||
i1 = coll_c.compare(strlit1, strlit1 + 7, strlit1, strlit1 + size1);
|
||||
VERIFY ( i1 == -1 );
|
||||
i1 = coll_c.compare(strlit1, strlit1 + 7, strlit1, strlit1 + 7);
|
||||
VERIFY ( i1 == 0 );
|
||||
|
||||
i2 = coll_c.compare(strlit2, strlit2 + size2, strlit2, strlit2 + 13);
|
||||
VERIFY ( i2 == 1 );
|
||||
i2 = coll_c.compare(strlit2, strlit2 + 13, strlit2, strlit2 + size2);
|
||||
VERIFY ( i2 == -1 );
|
||||
i2 = coll_c.compare(strlit2, strlit2 + size2, strlit2, strlit2 + size2);
|
||||
VERIFY ( i2 == 0 );
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
test01();
|
||||
return 0;
|
||||
}
|
@ -0,0 +1,86 @@
|
||||
// 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
|
||||
|
||||
// Copyright (C) 2001, 2002, 2003 Free Software Foundation
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// 22.2.4.1.1 collate members
|
||||
|
||||
#include <locale>
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
// Check German "de_DE" locale.
|
||||
void test02()
|
||||
{
|
||||
using namespace std;
|
||||
typedef std::collate<wchar_t>::string_type string_type;
|
||||
|
||||
bool test = true;
|
||||
|
||||
// basic construction
|
||||
locale loc_c = locale::classic();
|
||||
locale loc_us("en_US");
|
||||
locale loc_fr("fr_FR");
|
||||
locale loc_de("de_DE");
|
||||
VERIFY( loc_c != loc_de );
|
||||
VERIFY( loc_us != loc_fr );
|
||||
VERIFY( loc_us != loc_de );
|
||||
VERIFY( loc_de != loc_fr );
|
||||
|
||||
// cache the collate facets
|
||||
const collate<wchar_t>& coll_c = use_facet<collate<wchar_t> >(loc_c);
|
||||
const collate<wchar_t>& coll_us = use_facet<collate<wchar_t> >(loc_us);
|
||||
const collate<wchar_t>& coll_fr = use_facet<collate<wchar_t> >(loc_fr);
|
||||
const collate<wchar_t>& coll_de = use_facet<collate<wchar_t> >(loc_de);
|
||||
|
||||
// int compare(const charT*, const charT*, const charT*, const charT*) const
|
||||
|
||||
const wchar_t* strlit1 = L"monkey picked tikuanyin oolong";
|
||||
const wchar_t* strlit2 = L"imperial tea court green oolong";
|
||||
const wchar_t* strlit3 = L"Äuglein Augment"; // "C" == "Augment Äuglein"
|
||||
const wchar_t* strlit4 = L"Base baß Baß Bast"; // "C" == "Base baß Baß Bast"
|
||||
|
||||
int i1;
|
||||
int i2;
|
||||
int size1 = char_traits<wchar_t>::length(strlit1) - 1;
|
||||
int size2 = char_traits<wchar_t>::length(strlit2) - 1;
|
||||
int size3 = char_traits<wchar_t>::length(strlit3) - 1;
|
||||
int size4 = char_traits<wchar_t>::length(strlit4) - 1;
|
||||
|
||||
i1 = coll_de.compare(strlit3, strlit3 + size3, strlit3, strlit3 + 7);
|
||||
VERIFY ( i1 == 1 );
|
||||
i1 = coll_de.compare(strlit3, strlit3 + 7, strlit3, strlit3 + size1);
|
||||
VERIFY ( i1 == -1 );
|
||||
i1 = coll_de.compare(strlit3, strlit3 + 7, strlit3, strlit3 + 7);
|
||||
VERIFY ( i1 == 0 );
|
||||
|
||||
i1 = coll_de.compare(strlit3, strlit3 + 6, strlit3 + 8, strlit3 + 14);
|
||||
VERIFY ( i1 == -1 );
|
||||
|
||||
i2 = coll_de.compare(strlit4, strlit4 + size4, strlit4, strlit4 + 13);
|
||||
VERIFY ( i2 == 1 );
|
||||
i2 = coll_de.compare(strlit4, strlit4 + 13, strlit4, strlit4 + size4);
|
||||
VERIFY ( i2 == -1 );
|
||||
i2 = coll_de.compare(strlit4, strlit4 + size4, strlit4, strlit4 + size4);
|
||||
VERIFY ( i2 == 0 );
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
test02();
|
||||
return 0;
|
||||
}
|
@ -0,0 +1,41 @@
|
||||
// 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
|
||||
|
||||
// Copyright (C) 2001, 2002, 2003 Free Software Foundation
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// 22.2.4.1.1 collate members
|
||||
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
#define main discard_main_1
|
||||
#include "1.cc"
|
||||
#undef main
|
||||
|
||||
#define main discard_main_2
|
||||
#include "2.cc"
|
||||
#undef main
|
||||
|
||||
int main()
|
||||
{
|
||||
using namespace __gnu_cxx_test;
|
||||
func_callback two;
|
||||
two.push_back(&test01);
|
||||
two.push_back(&test02);
|
||||
run_tests_wrapped_env("de_DE", "LANG", two);
|
||||
return 0;
|
||||
}
|
@ -0,0 +1,41 @@
|
||||
// 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
|
||||
|
||||
// Copyright (C) 2001, 2002, 2003 Free Software Foundation
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// 22.2.4.1.1 collate members
|
||||
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
#define main discard_main_1
|
||||
#include "1.cc"
|
||||
#undef main
|
||||
|
||||
#define main discard_main_2
|
||||
#include "2.cc"
|
||||
#undef main
|
||||
|
||||
int main()
|
||||
{
|
||||
using namespace __gnu_cxx_test;
|
||||
func_callback two;
|
||||
two.push_back(&test01);
|
||||
two.push_back(&test02);
|
||||
run_tests_wrapped_locale("ja_JP.eucjp", two);
|
||||
return 0;
|
||||
}
|
46
libstdc++-v3/testsuite/22_locale/collate/hash/char/1.cc
Normal file
46
libstdc++-v3/testsuite/22_locale/collate/hash/char/1.cc
Normal file
@ -0,0 +1,46 @@
|
||||
// 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
|
||||
|
||||
// Copyright (C) 2001, 2002, 2003 Free Software Foundation
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// 22.2.4.1.1 collate members
|
||||
|
||||
#include <locale>
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
// Check "C" locale.
|
||||
void test01()
|
||||
{
|
||||
bool test = true;
|
||||
|
||||
std::string str1("fffff");
|
||||
std::string str2("ffffffffffff");
|
||||
|
||||
const std::locale cloc = std::locale::classic();
|
||||
const std::collate<char> &col = std::use_facet<std::collate<char> >(cloc);
|
||||
|
||||
long l1 = col.hash(str1.c_str(), str1.c_str() + str1.size());
|
||||
long l2 = col.hash(str2.c_str(), str2.c_str() + str2.size());
|
||||
VERIFY( l1 != l2 );
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
test01();
|
||||
return 0;
|
||||
}
|
75
libstdc++-v3/testsuite/22_locale/collate/hash/char/2.cc
Normal file
75
libstdc++-v3/testsuite/22_locale/collate/hash/char/2.cc
Normal file
@ -0,0 +1,75 @@
|
||||
// 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
|
||||
|
||||
// Copyright (C) 2001, 2002, 2003 Free Software Foundation
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// 22.2.4.1.1 collate members
|
||||
|
||||
#include <locale>
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
// Check German "de_DE" locale.
|
||||
void test02()
|
||||
{
|
||||
using namespace std;
|
||||
typedef std::collate<char>::string_type string_type;
|
||||
|
||||
bool test = true;
|
||||
|
||||
// basic construction
|
||||
locale loc_c = locale::classic();
|
||||
locale loc_us("en_US");
|
||||
locale loc_fr("fr_FR");
|
||||
locale loc_de("de_DE");
|
||||
VERIFY( loc_c != loc_de );
|
||||
VERIFY( loc_us != loc_fr );
|
||||
VERIFY( loc_us != loc_de );
|
||||
VERIFY( loc_de != loc_fr );
|
||||
|
||||
// cache the collate facets
|
||||
const collate<char>& coll_c = use_facet<collate<char> >(loc_c);
|
||||
const collate<char>& coll_us = use_facet<collate<char> >(loc_us);
|
||||
const collate<char>& coll_fr = use_facet<collate<char> >(loc_fr);
|
||||
const collate<char>& coll_de = use_facet<collate<char> >(loc_de);
|
||||
|
||||
// long hash(const charT*, const charT*) cosnt
|
||||
const char* strlit1 = "monkey picked tikuanyin oolong";
|
||||
const char* strlit2 = "imperial tea court green oolong";
|
||||
const char* strlit3 = "Äuglein Augment"; // "C" == "Augment Äuglein"
|
||||
const char* strlit4 = "Base baß Baß Bast"; // "C" == "Base baß Baß Bast"
|
||||
|
||||
int i1;
|
||||
int i2;
|
||||
long l1;
|
||||
long l2;
|
||||
int size3 = char_traits<char>::length(strlit4) - 1;
|
||||
int size4 = char_traits<char>::length(strlit3) - 1;
|
||||
|
||||
l1 = coll_de.hash(strlit3, strlit3 + size3);
|
||||
l2 = coll_de.hash(strlit3, strlit3 + size3 - 1);
|
||||
VERIFY ( l1 != l2 );
|
||||
l1 = coll_de.hash(strlit3, strlit3 + size3);
|
||||
l2 = coll_de.hash(strlit4, strlit4 + size4);
|
||||
VERIFY ( l1 != l2 );
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
test02();
|
||||
return 0;
|
||||
}
|
@ -0,0 +1,41 @@
|
||||
// 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
|
||||
|
||||
// Copyright (C) 2001, 2002, 2003 Free Software Foundation
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// 22.2.4.1.1 collate members
|
||||
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
#define main discard_main_1
|
||||
#include "1.cc"
|
||||
#undef main
|
||||
|
||||
#define main discard_main_2
|
||||
#include "2.cc"
|
||||
#undef main
|
||||
|
||||
int main()
|
||||
{
|
||||
using namespace __gnu_cxx_test;
|
||||
func_callback two;
|
||||
two.push_back(&test01);
|
||||
two.push_back(&test02);
|
||||
run_tests_wrapped_env("de_DE", "LANG", two);
|
||||
return 0;
|
||||
}
|
@ -0,0 +1,41 @@
|
||||
// 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
|
||||
|
||||
// Copyright (C) 2001, 2002, 2003 Free Software Foundation
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// 22.2.4.1.1 collate members
|
||||
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
#define main discard_main_1
|
||||
#include "1.cc"
|
||||
#undef main
|
||||
|
||||
#define main discard_main_2
|
||||
#include "2.cc"
|
||||
#undef main
|
||||
|
||||
int main()
|
||||
{
|
||||
using namespace __gnu_cxx_test;
|
||||
func_callback two;
|
||||
two.push_back(&test01);
|
||||
two.push_back(&test02);
|
||||
run_tests_wrapped_locale("ja_JP.eucjp", two);
|
||||
return 0;
|
||||
}
|
48
libstdc++-v3/testsuite/22_locale/collate/hash/wchar_t/1.cc
Normal file
48
libstdc++-v3/testsuite/22_locale/collate/hash/wchar_t/1.cc
Normal file
@ -0,0 +1,48 @@
|
||||
// 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
|
||||
|
||||
// Copyright (C) 2001, 2002, 2003 Free Software Foundation
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// 22.2.4.1.1 collate members
|
||||
|
||||
#include <locale>
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
// Check "C" locale.
|
||||
void test01()
|
||||
{
|
||||
using namespace std;
|
||||
typedef std::collate<wchar_t>::string_type string_type;
|
||||
bool test = true;
|
||||
|
||||
string_type str1(L"fffff");
|
||||
string_type str2(L"ffffffffffff");
|
||||
|
||||
const std::locale cloc = std::locale::classic();
|
||||
const std::collate<wchar_t> &col = std::use_facet<std::collate<wchar_t> >(cloc);
|
||||
|
||||
long l1 = col.hash(str1.c_str(), str1.c_str() + str1.size());
|
||||
long l2 = col.hash(str2.c_str(), str2.c_str() + str2.size());
|
||||
VERIFY( l1 != l2 );
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
test01();
|
||||
return 0;
|
||||
}
|
74
libstdc++-v3/testsuite/22_locale/collate/hash/wchar_t/2.cc
Normal file
74
libstdc++-v3/testsuite/22_locale/collate/hash/wchar_t/2.cc
Normal file
@ -0,0 +1,74 @@
|
||||
// 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
|
||||
|
||||
// Copyright (C) 2001, 2002, 2003 Free Software Foundation
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// 22.2.4.1.1 collate members
|
||||
|
||||
#include <locale>
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
// Check German "de_DE" locale.
|
||||
void test02()
|
||||
{
|
||||
using namespace std;
|
||||
typedef std::collate<wchar_t>::string_type string_type;
|
||||
bool test = true;
|
||||
|
||||
// basic construction
|
||||
locale loc_c = locale::classic();
|
||||
locale loc_us("en_US");
|
||||
locale loc_fr("fr_FR");
|
||||
locale loc_de("de_DE");
|
||||
VERIFY( loc_c != loc_de );
|
||||
VERIFY( loc_us != loc_fr );
|
||||
VERIFY( loc_us != loc_de );
|
||||
VERIFY( loc_de != loc_fr );
|
||||
|
||||
// cache the collate facets
|
||||
const collate<wchar_t>& coll_c = use_facet<collate<wchar_t> >(loc_c);
|
||||
const collate<wchar_t>& coll_us = use_facet<collate<wchar_t> >(loc_us);
|
||||
const collate<wchar_t>& coll_fr = use_facet<collate<wchar_t> >(loc_fr);
|
||||
const collate<wchar_t>& coll_de = use_facet<collate<wchar_t> >(loc_de);
|
||||
|
||||
// long hash(const charT*, const charT*) cosnt
|
||||
const wchar_t* strlit1 = L"monkey picked tikuanyin oolong";
|
||||
const wchar_t* strlit2 = L"imperial tea court green oolong";
|
||||
const wchar_t* strlit3 = L"Äuglein Augment"; // "C" == "Augment Äuglein"
|
||||
const wchar_t* strlit4 = L"Base baß Baß Bast"; // "C" == "Base baß Baß Bast"
|
||||
|
||||
int i1;
|
||||
int i2;
|
||||
long l1;
|
||||
long l2;
|
||||
int size3 = char_traits<wchar_t>::length(strlit4) - 1;
|
||||
int size4 = char_traits<wchar_t>::length(strlit3) - 1;
|
||||
|
||||
l1 = coll_de.hash(strlit3, strlit3 + size3);
|
||||
l2 = coll_de.hash(strlit3, strlit3 + size3 - 1);
|
||||
VERIFY ( l1 != l2 );
|
||||
l1 = coll_de.hash(strlit3, strlit3 + size3);
|
||||
l2 = coll_de.hash(strlit4, strlit4 + size4);
|
||||
VERIFY ( l1 != l2 );
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
test02();
|
||||
return 0;
|
||||
}
|
@ -0,0 +1,41 @@
|
||||
// 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
|
||||
|
||||
// Copyright (C) 2001, 2002, 2003 Free Software Foundation
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// 22.2.4.1.1 collate members
|
||||
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
#define main discard_main_1
|
||||
#include "1.cc"
|
||||
#undef main
|
||||
|
||||
#define main discard_main_2
|
||||
#include "2.cc"
|
||||
#undef main
|
||||
|
||||
int main()
|
||||
{
|
||||
using namespace __gnu_cxx_test;
|
||||
func_callback two;
|
||||
two.push_back(&test01);
|
||||
two.push_back(&test02);
|
||||
run_tests_wrapped_env("de_DE", "LANG", two);
|
||||
return 0;
|
||||
}
|
@ -0,0 +1,41 @@
|
||||
// 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
|
||||
|
||||
// Copyright (C) 2001, 2002, 2003 Free Software Foundation
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// 22.2.4.1.1 collate members
|
||||
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
#define main discard_main_1
|
||||
#include "1.cc"
|
||||
#undef main
|
||||
|
||||
#define main discard_main_2
|
||||
#include "2.cc"
|
||||
#undef main
|
||||
|
||||
int main()
|
||||
{
|
||||
using namespace __gnu_cxx_test;
|
||||
func_callback two;
|
||||
two.push_back(&test01);
|
||||
two.push_back(&test02);
|
||||
run_tests_wrapped_locale("ja_JP.eucjp", two);
|
||||
return 0;
|
||||
}
|
72
libstdc++-v3/testsuite/22_locale/collate/transform/char/2.cc
Normal file
72
libstdc++-v3/testsuite/22_locale/collate/transform/char/2.cc
Normal file
@ -0,0 +1,72 @@
|
||||
// 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
|
||||
|
||||
// Copyright (C) 2001, 2002, 2003 Free Software Foundation
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// 22.2.4.1.1 collate members
|
||||
|
||||
#include <locale>
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
void test02()
|
||||
{
|
||||
using namespace std;
|
||||
typedef std::collate<char>::string_type string_type;
|
||||
|
||||
bool test = true;
|
||||
|
||||
// basic construction
|
||||
locale loc_c = locale::classic();
|
||||
locale loc_us("en_US");
|
||||
locale loc_fr("fr_FR");
|
||||
locale loc_de("de_DE");
|
||||
VERIFY( loc_c != loc_de );
|
||||
VERIFY( loc_us != loc_fr );
|
||||
VERIFY( loc_us != loc_de );
|
||||
VERIFY( loc_de != loc_fr );
|
||||
|
||||
// cache the collate facets
|
||||
const collate<char>& coll_c = use_facet<collate<char> >(loc_c);
|
||||
const collate<char>& coll_us = use_facet<collate<char> >(loc_us);
|
||||
const collate<char>& coll_fr = use_facet<collate<char> >(loc_fr);
|
||||
const collate<char>& coll_de = use_facet<collate<char> >(loc_de);
|
||||
|
||||
// long hash(const charT*, const charT*) cosnt
|
||||
const char* strlit1 = "monkey picked tikuanyin oolong";
|
||||
const char* strlit2 = "imperial tea court green oolong";
|
||||
const char* strlit3 = "Äuglein Augment"; // "C" == "Augment Äuglein"
|
||||
const char* strlit4 = "Base baß Baß Bast"; // "C" == "Base baß Baß Bast"
|
||||
|
||||
int i1;
|
||||
int i2;
|
||||
int size3 = char_traits<char>::length(strlit3) - 1;
|
||||
int size4 = char_traits<char>::length(strlit4) - 1;
|
||||
|
||||
string_type str3 = coll_de.transform(strlit3, strlit3 + size3);
|
||||
string_type str4 = coll_de.transform(strlit4, strlit4 + size4);
|
||||
i1 = str3.compare(str4);
|
||||
i2 = coll_de.compare(strlit3, strlit3 + size3, strlit4, strlit4 + size4);
|
||||
VERIFY ( i2 == -1 );
|
||||
VERIFY ( i1 * i2 > 0 );
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
test02();
|
||||
return 0;
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
// 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
|
||||
|
||||
// Copyright (C) 2001, 2002, 2003 Free Software Foundation
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// 22.2.4.1.1 collate members
|
||||
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
#define main discard_main_2
|
||||
#include "2.cc"
|
||||
#undef main
|
||||
|
||||
int main()
|
||||
{
|
||||
using namespace __gnu_cxx_test;
|
||||
func_callback two;
|
||||
two.push_back(&test02);
|
||||
run_tests_wrapped_env("de_DE", "LANG", two);
|
||||
return 0;
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
// 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
|
||||
|
||||
// Copyright (C) 2001, 2002, 2003 Free Software Foundation
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// 22.2.4.1.1 collate members
|
||||
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
#define main discard_main_2
|
||||
#include "2.cc"
|
||||
#undef main
|
||||
|
||||
int main()
|
||||
{
|
||||
using namespace __gnu_cxx_test;
|
||||
func_callback two;
|
||||
two.push_back(&test02);
|
||||
run_tests_wrapped_locale("ja_JP.eucjp", two);
|
||||
return 0;
|
||||
}
|
@ -0,0 +1,72 @@
|
||||
// 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
|
||||
|
||||
// Copyright (C) 2001, 2002, 2003 Free Software Foundation
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// 22.2.4.1.1 collate members
|
||||
|
||||
#include <locale>
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
void test02()
|
||||
{
|
||||
using namespace std;
|
||||
typedef std::collate<wchar_t>::string_type string_type;
|
||||
|
||||
bool test = true;
|
||||
|
||||
// basic construction
|
||||
locale loc_c = locale::classic();
|
||||
locale loc_us("en_US");
|
||||
locale loc_fr("fr_FR");
|
||||
locale loc_de("de_DE");
|
||||
VERIFY( loc_c != loc_de );
|
||||
VERIFY( loc_us != loc_fr );
|
||||
VERIFY( loc_us != loc_de );
|
||||
VERIFY( loc_de != loc_fr );
|
||||
|
||||
// cache the collate facets
|
||||
const collate<wchar_t>& coll_c = use_facet<collate<wchar_t> >(loc_c);
|
||||
const collate<wchar_t>& coll_us = use_facet<collate<wchar_t> >(loc_us);
|
||||
const collate<wchar_t>& coll_fr = use_facet<collate<wchar_t> >(loc_fr);
|
||||
const collate<wchar_t>& coll_de = use_facet<collate<wchar_t> >(loc_de);
|
||||
|
||||
// long hash(const charT*, const charT*) cosnt
|
||||
const wchar_t* strlit1 = L"monkey picked tikuanyin oolong";
|
||||
const wchar_t* strlit2 = L"imperial tea court green oolong";
|
||||
const wchar_t* strlit3 = L"Äuglein Augment"; // "C" == "Augment Äuglein"
|
||||
const wchar_t* strlit4 = L"Base baß Baß Bast"; // "C" == "Base baß Baß Bast"
|
||||
|
||||
int i1;
|
||||
int i2;
|
||||
int size3 = char_traits<wchar_t>::length(strlit3) - 1;
|
||||
int size4 = char_traits<wchar_t>::length(strlit4) - 1;
|
||||
|
||||
string_type str3 = coll_de.transform(strlit3, strlit3 + size3);
|
||||
string_type str4 = coll_de.transform(strlit4, strlit4 + size4);
|
||||
i1 = str3.compare(str4);
|
||||
i2 = coll_de.compare(strlit3, strlit3 + size3, strlit4, strlit4 + size4);
|
||||
VERIFY ( i2 == -1 );
|
||||
VERIFY ( i1 * i2 > 0 );
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
test02();
|
||||
return 0;
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
// 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
|
||||
|
||||
// Copyright (C) 2001, 2002, 2003 Free Software Foundation
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// 22.2.4.1.1 collate members
|
||||
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
#define main discard_main_2
|
||||
#include "2.cc"
|
||||
#undef main
|
||||
|
||||
int main()
|
||||
{
|
||||
using namespace __gnu_cxx_test;
|
||||
func_callback two;
|
||||
two.push_back(&test02);
|
||||
run_tests_wrapped_env("de_DE", "LANG", two);
|
||||
return 0;
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
// 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
|
||||
|
||||
// Copyright (C) 2001, 2002, 2003 Free Software Foundation
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// 22.2.4.1.1 collate members
|
||||
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
#define main discard_main_2
|
||||
#include "2.cc"
|
||||
#undef main
|
||||
|
||||
int main()
|
||||
{
|
||||
using namespace __gnu_cxx_test;
|
||||
func_callback two;
|
||||
two.push_back(&test02);
|
||||
run_tests_wrapped_locale("ja_JP.eucjp", two);
|
||||
return 0;
|
||||
}
|
@ -23,9 +23,6 @@
|
||||
#include <locale>
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
// XXX This test is not working for non-glibc locale models.
|
||||
// { dg-do run { xfail *-*-* } }
|
||||
|
||||
void test01()
|
||||
{
|
||||
using namespace std;
|
||||
@ -135,6 +132,5 @@ void test01()
|
||||
int main()
|
||||
{
|
||||
test01();
|
||||
|
||||
return 0;
|
||||
}
|
@ -1,187 +0,0 @@
|
||||
// 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
|
||||
|
||||
// Copyright (C) 2001, 2002 Free Software Foundation
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// 22.2.4.1.1 collate members
|
||||
|
||||
#include <locale>
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
// XXX This may not work for non-glibc locale models.
|
||||
// { dg-do run { xfail *-*-* } }
|
||||
|
||||
void test01()
|
||||
{
|
||||
using namespace std;
|
||||
typedef std::collate<char>::string_type string_type;
|
||||
|
||||
bool test = true;
|
||||
|
||||
// basic construction
|
||||
locale loc_c = locale::classic();
|
||||
locale loc_us("en_US");
|
||||
locale loc_fr("fr_FR");
|
||||
locale loc_de("de_DE");
|
||||
VERIFY( loc_c != loc_de );
|
||||
VERIFY( loc_us != loc_fr );
|
||||
VERIFY( loc_us != loc_de );
|
||||
VERIFY( loc_de != loc_fr );
|
||||
|
||||
// cache the collate facets
|
||||
const collate<char>& coll_c = use_facet<collate<char> >(loc_c);
|
||||
const collate<char>& coll_us = use_facet<collate<char> >(loc_us);
|
||||
const collate<char>& coll_fr = use_facet<collate<char> >(loc_fr);
|
||||
const collate<char>& coll_de = use_facet<collate<char> >(loc_de);
|
||||
|
||||
// int compare(const charT*, const charT*, const charT*, const charT*) const
|
||||
// long hash(const charT*, const charT*) cosnt
|
||||
// string_type transform(const charT*, const charT*) const
|
||||
|
||||
// Check "C" locale.
|
||||
const char* strlit1 = "monkey picked tikuanyin oolong";
|
||||
const char* strlit2 = "imperial tea court green oolong";
|
||||
|
||||
int i1;
|
||||
int size1 = strlen(strlit1) - 1;
|
||||
i1 = coll_c.compare(strlit1, strlit1 + size1, strlit1, strlit1 + 7);
|
||||
VERIFY ( i1 == 1 );
|
||||
i1 = coll_c.compare(strlit1, strlit1 + 7, strlit1, strlit1 + size1);
|
||||
VERIFY ( i1 == -1 );
|
||||
i1 = coll_c.compare(strlit1, strlit1 + 7, strlit1, strlit1 + 7);
|
||||
VERIFY ( i1 == 0 );
|
||||
|
||||
int i2;
|
||||
int size2 = strlen(strlit2) - 1;
|
||||
i2 = coll_c.compare(strlit2, strlit2 + size2, strlit2, strlit2 + 13);
|
||||
VERIFY ( i2 == 1 );
|
||||
i2 = coll_c.compare(strlit2, strlit2 + 13, strlit2, strlit2 + size2);
|
||||
VERIFY ( i2 == -1 );
|
||||
i2 = coll_c.compare(strlit2, strlit2 + size2, strlit2, strlit2 + size2);
|
||||
VERIFY ( i2 == 0 );
|
||||
|
||||
long l1;
|
||||
long l2;
|
||||
l1 = coll_c.hash(strlit1, strlit1 + size1);
|
||||
l2 = coll_c.hash(strlit1, strlit1 + size1 - 1);
|
||||
VERIFY ( l1 != l2 );
|
||||
l1 = coll_c.hash(strlit1, strlit1 + size1);
|
||||
l2 = coll_c.hash(strlit2, strlit2 + size2);
|
||||
VERIFY ( l1 != l2 );
|
||||
|
||||
string str1 = coll_c.transform(strlit1, strlit1 + size1);
|
||||
string str2 = coll_c.transform(strlit2, strlit2 + size2);
|
||||
i1 = str1.compare(str2);
|
||||
i2 = coll_c.compare(strlit1, strlit1 + size1, strlit2, strlit2 + size2);
|
||||
VERIFY ( i2 == 1 );
|
||||
VERIFY ( i1 * i2 > 0 );
|
||||
|
||||
// Check German "de_DE" locale.
|
||||
const char* strlit3 = "Äuglein Augment"; // "C" == "Augment Äuglein"
|
||||
const char* strlit4 = "Base baß Baß Bast"; // "C" == "Base baß Baß Bast"
|
||||
|
||||
int size3 = strlen(strlit3) - 1;
|
||||
i1 = coll_de.compare(strlit3, strlit3 + size3, strlit3, strlit3 + 7);
|
||||
VERIFY ( i1 == 1 );
|
||||
i1 = coll_de.compare(strlit3, strlit3 + 7, strlit3, strlit3 + size1);
|
||||
VERIFY ( i1 == -1 );
|
||||
i1 = coll_de.compare(strlit3, strlit3 + 7, strlit3, strlit3 + 7);
|
||||
VERIFY ( i1 == 0 );
|
||||
|
||||
i1 = coll_de.compare(strlit3, strlit3 + 6, strlit3 + 8, strlit3 + 14);
|
||||
VERIFY ( i1 == -1 );
|
||||
|
||||
int size4 = strlen(strlit4) - 1;
|
||||
i2 = coll_de.compare(strlit4, strlit4 + size4, strlit4, strlit4 + 13);
|
||||
VERIFY ( i2 == 1 );
|
||||
i2 = coll_de.compare(strlit4, strlit4 + 13, strlit4, strlit4 + size4);
|
||||
VERIFY ( i2 == -1 );
|
||||
i2 = coll_de.compare(strlit4, strlit4 + size4, strlit4, strlit4 + size4);
|
||||
VERIFY ( i2 == 0 );
|
||||
|
||||
l1 = coll_de.hash(strlit3, strlit3 + size3);
|
||||
l2 = coll_de.hash(strlit3, strlit3 + size3 - 1);
|
||||
VERIFY ( l1 != l2 );
|
||||
l1 = coll_de.hash(strlit3, strlit3 + size3);
|
||||
l2 = coll_de.hash(strlit4, strlit4 + size4);
|
||||
VERIFY ( l1 != l2 );
|
||||
|
||||
string str3 = coll_de.transform(strlit3, strlit3 + size3);
|
||||
string str4 = coll_de.transform(strlit4, strlit4 + size4);
|
||||
i1 = str3.compare(str4);
|
||||
i2 = coll_de.compare(strlit3, strlit3 + size3, strlit4, strlit4 + size4);
|
||||
VERIFY ( i2 == -1 );
|
||||
VERIFY ( i1 * i2 > 0 );
|
||||
}
|
||||
|
||||
// libstdc++/5280
|
||||
void test02()
|
||||
{
|
||||
#ifdef _GLIBCPP_HAVE_SETENV
|
||||
// Set the global locale to non-"C".
|
||||
std::locale loc_de("de_DE");
|
||||
std::locale::global(loc_de);
|
||||
|
||||
// Set LANG environment variable to de_DE.
|
||||
const char* oldLANG = getenv("LANG");
|
||||
if (!setenv("LANG", "de_DE", 1))
|
||||
{
|
||||
test01();
|
||||
setenv("LANG", oldLANG ? oldLANG : "", 1);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void test03()
|
||||
{
|
||||
bool test = true;
|
||||
std::string str1("fffff");
|
||||
std::string str2("ffffffffffff");
|
||||
|
||||
const std::locale cloc = std::locale::classic();
|
||||
const std::collate<char> &col = std::use_facet<std::collate<char> >(cloc);
|
||||
|
||||
long l1 = col.hash(str1.c_str(), str1.c_str() + str1.size());
|
||||
long l2 = col.hash(str2.c_str(), str2.c_str() + str2.size());
|
||||
VERIFY( l1 != l2 );
|
||||
}
|
||||
|
||||
// http://gcc.gnu.org/ml/libstdc++/2002-05/msg00038.html
|
||||
void test04()
|
||||
{
|
||||
bool test = true;
|
||||
|
||||
const char* tentLANG = std::setlocale(LC_ALL, "ja_JP.eucjp");
|
||||
if (tentLANG != NULL)
|
||||
{
|
||||
std::string preLANG = tentLANG;
|
||||
test01();
|
||||
test03();
|
||||
std::string postLANG = std::setlocale(LC_ALL, NULL);
|
||||
VERIFY( preLANG == postLANG );
|
||||
}
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
test01();
|
||||
test02();
|
||||
test03();
|
||||
test04();
|
||||
return 0;
|
||||
}
|
@ -1,190 +0,0 @@
|
||||
// 2001-08-17 Benjamin Kosnik <bkoz@redhat.com>
|
||||
|
||||
// Copyright (C) 2001, 2002 Free Software Foundation
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// 22.2.4.1.1 collate members
|
||||
|
||||
#include <locale>
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
// XXX This may not work for non-glibc locale models.
|
||||
// { dg-do run { xfail *-*-* } }
|
||||
#ifdef _GLIBCPP_USE_WCHAR_T
|
||||
void test01()
|
||||
{
|
||||
using namespace std;
|
||||
typedef std::collate<wchar_t>::string_type string_type;
|
||||
|
||||
bool test = true;
|
||||
|
||||
// basic construction
|
||||
locale loc_c = locale::classic();
|
||||
locale loc_us("en_US");
|
||||
locale loc_fr("fr_FR");
|
||||
locale loc_de("de_DE");
|
||||
VERIFY( loc_c != loc_de );
|
||||
VERIFY( loc_us != loc_fr );
|
||||
VERIFY( loc_us != loc_de );
|
||||
VERIFY( loc_de != loc_fr );
|
||||
|
||||
// cache the collate facets
|
||||
const collate<wchar_t>& coll_c = use_facet<collate<wchar_t> >(loc_c);
|
||||
const collate<wchar_t>& coll_us = use_facet<collate<wchar_t> >(loc_us);
|
||||
const collate<wchar_t>& coll_fr = use_facet<collate<wchar_t> >(loc_fr);
|
||||
const collate<wchar_t>& coll_de = use_facet<collate<wchar_t> >(loc_de);
|
||||
|
||||
// int compare(const charT*, const charT*, const charT*, const charT*) const
|
||||
// long hash(const charT*, const charT*) cosnt
|
||||
// string_type transform(const charT*, const charT*) const
|
||||
|
||||
// Check "C" locale.
|
||||
const wchar_t* strlit1 = L"monkey picked tikuanyin oolong";
|
||||
const wchar_t* strlit2 = L"imperial tea court green oolong";
|
||||
|
||||
int i1;
|
||||
int size1 = char_traits<wchar_t>::length(strlit1) - 1;
|
||||
i1 = coll_c.compare(strlit1, strlit1 + size1, strlit1, strlit1 + 7);
|
||||
VERIFY ( i1 == 1 );
|
||||
i1 = coll_c.compare(strlit1, strlit1 + 7, strlit1, strlit1 + size1);
|
||||
VERIFY ( i1 == -1 );
|
||||
i1 = coll_c.compare(strlit1, strlit1 + 7, strlit1, strlit1 + 7);
|
||||
VERIFY ( i1 == 0 );
|
||||
|
||||
int i2;
|
||||
int size2 = char_traits<wchar_t>::length(strlit2) - 1;
|
||||
i2 = coll_c.compare(strlit2, strlit2 + size2, strlit2, strlit2 + 13);
|
||||
VERIFY ( i2 == 1 );
|
||||
i2 = coll_c.compare(strlit2, strlit2 + 13, strlit2, strlit2 + size2);
|
||||
VERIFY ( i2 == -1 );
|
||||
i2 = coll_c.compare(strlit2, strlit2 + size2, strlit2, strlit2 + size2);
|
||||
VERIFY ( i2 == 0 );
|
||||
|
||||
long l1;
|
||||
long l2;
|
||||
l1 = coll_c.hash(strlit1, strlit1 + size1);
|
||||
l2 = coll_c.hash(strlit1, strlit1 + size1 - 1);
|
||||
VERIFY ( l1 != l2 );
|
||||
l1 = coll_c.hash(strlit1, strlit1 + size1);
|
||||
l2 = coll_c.hash(strlit2, strlit2 + size2);
|
||||
VERIFY ( l1 != l2 );
|
||||
|
||||
wstring str1 = coll_c.transform(strlit1, strlit1 + size1);
|
||||
wstring str2 = coll_c.transform(strlit2, strlit2 + size2);
|
||||
i1 = str1.compare(str2);
|
||||
i2 = coll_c.compare(strlit1, strlit1 + size1, strlit2, strlit2 + size2);
|
||||
VERIFY ( i2 == 1 );
|
||||
VERIFY ( i1 * i2 > 0 );
|
||||
|
||||
// Check German "de_DE" locale.
|
||||
const wchar_t* strlit3 = L"Äuglein Augment"; // "C" == "Augment Äuglein"
|
||||
const wchar_t* strlit4 = L"Base baß Baß Bast"; // "C" == "Base baß Baß Bast"
|
||||
|
||||
int size3 = char_traits<wchar_t>::length(strlit3) - 1;
|
||||
i1 = coll_de.compare(strlit3, strlit3 + size3, strlit3, strlit3 + 7);
|
||||
VERIFY ( i1 == 1 );
|
||||
i1 = coll_de.compare(strlit3, strlit3 + 7, strlit3, strlit3 + size1);
|
||||
VERIFY ( i1 == -1 );
|
||||
i1 = coll_de.compare(strlit3, strlit3 + 7, strlit3, strlit3 + 7);
|
||||
VERIFY ( i1 == 0 );
|
||||
|
||||
i1 = coll_de.compare(strlit3, strlit3 + 6, strlit3 + 8, strlit3 + 14);
|
||||
VERIFY ( i1 == -1 );
|
||||
|
||||
int size4 = char_traits<wchar_t>::length(strlit4) - 1;
|
||||
i2 = coll_de.compare(strlit4, strlit4 + size4, strlit4, strlit4 + 13);
|
||||
VERIFY ( i2 == 1 );
|
||||
i2 = coll_de.compare(strlit4, strlit4 + 13, strlit4, strlit4 + size4);
|
||||
VERIFY ( i2 == -1 );
|
||||
i2 = coll_de.compare(strlit4, strlit4 + size4, strlit4, strlit4 + size4);
|
||||
VERIFY ( i2 == 0 );
|
||||
|
||||
l1 = coll_de.hash(strlit3, strlit3 + size3);
|
||||
l2 = coll_de.hash(strlit3, strlit3 + size3 - 1);
|
||||
VERIFY ( l1 != l2 );
|
||||
l1 = coll_de.hash(strlit3, strlit3 + size3);
|
||||
l2 = coll_de.hash(strlit4, strlit4 + size4);
|
||||
VERIFY ( l1 != l2 );
|
||||
|
||||
wstring str3 = coll_de.transform(strlit3, strlit3 + size3);
|
||||
wstring str4 = coll_de.transform(strlit4, strlit4 + size4);
|
||||
i1 = str3.compare(str4);
|
||||
i2 = coll_de.compare(strlit3, strlit3 + size3, strlit4, strlit4 + size4);
|
||||
VERIFY ( i2 == -1 );
|
||||
VERIFY ( i1 * i2 > 0 );
|
||||
}
|
||||
|
||||
// libstdc++/5280
|
||||
void test02()
|
||||
{
|
||||
#ifdef _GLIBCPP_HAVE_SETENV
|
||||
// Set the global locale to non-"C".
|
||||
std::locale loc_de("de_DE");
|
||||
std::locale::global(loc_de);
|
||||
|
||||
// Set LANG environment variable to de_DE.
|
||||
const char* oldLANG = getenv("LANG");
|
||||
if (!setenv("LANG", "de_DE", 1))
|
||||
{
|
||||
test01();
|
||||
setenv("LANG", oldLANG ? oldLANG : "", 1);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void test03()
|
||||
{
|
||||
bool test = true;
|
||||
std::wstring str1(L"fffff");
|
||||
std::wstring str2(L"ffffffffffff");
|
||||
|
||||
const std::locale cloc = std::locale::classic();
|
||||
const std::collate<wchar_t> &col = std::use_facet<std::collate<wchar_t> >(cloc);
|
||||
|
||||
long l1 = col.hash(str1.c_str(), str1.c_str() + str1.size());
|
||||
long l2 = col.hash(str2.c_str(), str2.c_str() + str2.size());
|
||||
VERIFY( l1 != l2 );
|
||||
}
|
||||
|
||||
// http://gcc.gnu.org/ml/libstdc++/2002-05/msg00038.html
|
||||
void test04()
|
||||
{
|
||||
bool test = true;
|
||||
|
||||
const char* tentLANG = std::setlocale(LC_ALL, "ja_JP.eucjp");
|
||||
if (tentLANG != NULL)
|
||||
{
|
||||
std::string preLANG = tentLANG;
|
||||
test01();
|
||||
test03();
|
||||
std::string postLANG = std::setlocale(LC_ALL, NULL);
|
||||
VERIFY( preLANG == postLANG );
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
int main()
|
||||
{
|
||||
#if _GLIBCPP_USE_WCHAR_T
|
||||
test01();
|
||||
test02();
|
||||
test03();
|
||||
test04();
|
||||
#endif
|
||||
return 0;
|
||||
}
|
@ -1,6 +1,7 @@
|
||||
// { dg-do compile }
|
||||
// 1999-08-24 bkoz
|
||||
|
||||
// Copyright (C) 2000, 1999 Free Software Foundation
|
||||
// Copyright (C) 1999, 2000, 2003 Free Software Foundation
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
@ -20,8 +21,6 @@
|
||||
|
||||
// 22.2.1 The ctype category
|
||||
|
||||
// { dg-do compile }
|
||||
|
||||
// 1: Test that the locale headers are picking up the correct declaration
|
||||
// of the internal type `ctype_base::mask'.
|
||||
int mask ();
|
||||
@ -155,21 +154,8 @@ test01()
|
||||
m01 ^= m02;
|
||||
}
|
||||
|
||||
class gnu_obj
|
||||
{ };
|
||||
|
||||
class gnu_ctype2: public std::ctype<gnu_obj>
|
||||
{ };
|
||||
|
||||
// libstdc++/3017
|
||||
void test02()
|
||||
{
|
||||
gnu_ctype2 obj;
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
test01();
|
||||
test02();
|
||||
return 0;
|
||||
}
|
43
libstdc++-v3/testsuite/22_locale/ctype/2.cc
Normal file
43
libstdc++-v3/testsuite/22_locale/ctype/2.cc
Normal file
@ -0,0 +1,43 @@
|
||||
// { dg-do compile }
|
||||
// 1999-08-24 bkoz
|
||||
|
||||
// Copyright (C) 1999, 2000, 2003 Free Software Foundation
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// 22.2.1 The ctype category
|
||||
|
||||
#include <locale>
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
class gnu_obj
|
||||
{ };
|
||||
|
||||
class gnu_ctype2: public std::ctype<gnu_obj>
|
||||
{ };
|
||||
|
||||
// libstdc++/3017
|
||||
void test02()
|
||||
{
|
||||
gnu_ctype2 obj;
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
test02();
|
||||
return 0;
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
// 2000-02-16 bkoz
|
||||
|
||||
// Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
|
||||
// Copyright (C) 2000, 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
|
||||
@ -37,11 +37,31 @@ class comma_ctype: public std::ctype<char>
|
||||
{
|
||||
public:
|
||||
comma_ctype(): std::ctype<char>() { }
|
||||
static void get_table()
|
||||
{ classic_table(); }
|
||||
};
|
||||
comma_ctype(const std::ctype_base::mask* m): std::ctype<char>(m) { }
|
||||
|
||||
const mask*
|
||||
get_classic_table()
|
||||
{ return std::ctype<char>::classic_table(); }
|
||||
|
||||
const mask*
|
||||
get_table()
|
||||
{ return this->table(); }
|
||||
};
|
||||
|
||||
void test01()
|
||||
{
|
||||
using namespace std;
|
||||
|
||||
comma_ctype obj;
|
||||
const ctype_base::mask* tmp = obj.get_classic_table();
|
||||
|
||||
comma_ctype obj2(tmp);
|
||||
const ctype_base::mask* ctable = obj2.get_table();
|
||||
VERIFY ( tmp = ctable );
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
test01();
|
||||
return 0;
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
// 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
|
||||
|
||||
// Copyright (C) 2001, 2002, 2003 Free Software Foundation
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// 22.2.4.1.1 collate members
|
||||
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
#define main discard_main_1
|
||||
#include "1.cc"
|
||||
#undef main
|
||||
|
||||
int main()
|
||||
{
|
||||
using namespace __gnu_cxx_test;
|
||||
func_callback two;
|
||||
two.push_back(&test01);
|
||||
run_tests_wrapped_env("de_DE", "LANG", two);
|
||||
return 0;
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
// 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
|
||||
|
||||
// Copyright (C) 2001, 2002, 2003 Free Software Foundation
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// 22.2.4.1.1 collate members
|
||||
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
#define main discard_main_1
|
||||
#include "1.cc"
|
||||
#undef main
|
||||
|
||||
int main()
|
||||
{
|
||||
using namespace __gnu_cxx_test;
|
||||
func_callback two;
|
||||
two.push_back(&test01);
|
||||
run_tests_wrapped_locale("ja_JP.eucjp", two);
|
||||
return 0;
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
|
||||
// Copyright (C) 2000, 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
|
||||
@ -28,12 +28,8 @@
|
||||
// 22.2.1.3.2 ctype<char> members
|
||||
|
||||
#include <locale>
|
||||
#include <vector>
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
// XXX This test (test02) is not working for non-glibc locale models.
|
||||
// { dg-do run { xfail *-*-* } }
|
||||
|
||||
typedef char char_type;
|
||||
class gnu_ctype: public std::ctype<char_type> { };
|
||||
|
||||
@ -147,129 +143,8 @@ void test01()
|
||||
VERIFY( gctype.is(m02[8], cc0[8]) );
|
||||
}
|
||||
|
||||
// libstdc++/4456, libstdc++/4457, libstdc++/4458
|
||||
void test02()
|
||||
{
|
||||
using namespace std;
|
||||
typedef ctype_base::mask mask;
|
||||
typedef vector<mask> vector_type;
|
||||
|
||||
bool test = true;
|
||||
|
||||
// const int max = numeric_limits<char>::max();
|
||||
const int max = 255;
|
||||
const int ctype_mask_max = 10;
|
||||
vector_type v_c(max);
|
||||
vector_type v_de(max);
|
||||
|
||||
// "C"
|
||||
locale loc_c = locale::classic();
|
||||
const ctype<char>& ctype_c = use_facet<ctype<char> >(loc_c);
|
||||
for (int i = 0; i < max; ++i)
|
||||
{
|
||||
char_type c = static_cast<char>(i);
|
||||
mask mask_test = static_cast<mask>(0);
|
||||
mask mask_is = static_cast<mask>(0);
|
||||
for (int j = 0; j <= ctype_mask_max; ++j)
|
||||
{
|
||||
mask_test = static_cast<mask>(1 << j);
|
||||
if (ctype_c.is(mask_test, c))
|
||||
mask_is |= mask_test;
|
||||
}
|
||||
v_c[i] = mask_is;
|
||||
}
|
||||
|
||||
// "de_DE"
|
||||
locale loc_de("de_DE");
|
||||
const ctype<char>& ctype_de = use_facet<ctype<char> >(loc_de);
|
||||
for (int i = 0; i < max; ++i)
|
||||
{
|
||||
char_type c = static_cast<char>(i);
|
||||
mask mask_test = static_cast<mask>(0);
|
||||
mask mask_is = static_cast<mask>(0);
|
||||
for (int j = 0; j <= ctype_mask_max; ++j)
|
||||
{
|
||||
mask_test = static_cast<mask>(1 << j);
|
||||
if (ctype_de.is(mask_test, c))
|
||||
mask_is |= mask_test;
|
||||
}
|
||||
v_de[i] = mask_is;
|
||||
}
|
||||
|
||||
#if QUANNUM_VERBOSE_LYRICALLY_ADEPT_BAY_AREA_MCS_MODE
|
||||
for (int i = 0; i < max; ++i)
|
||||
{
|
||||
char_type mark = v_c[i] == v_de[i] ? ' ' : '-';
|
||||
cout << i << ' ' << mark << ' ' << static_cast<char>(i) << '\t' ;
|
||||
cout << "v_c: " << setw(4) << v_c[i] << '\t';
|
||||
cout << "v_de: " << setw(4) << v_de[i] << endl;
|
||||
}
|
||||
cout << (v_c == v_de) << endl;
|
||||
#endif
|
||||
|
||||
VERIFY( v_c != v_de );
|
||||
}
|
||||
|
||||
// Per Liboriussen <liborius@stofanet.dk>
|
||||
void test03()
|
||||
{
|
||||
bool test = true;
|
||||
std::ctype_base::mask maskdata[256];
|
||||
for (int i = 0; i < 256; ++i)
|
||||
maskdata[i] = std::ctype_base::alpha;
|
||||
std::ctype<char>* f = new std::ctype<char>(maskdata);
|
||||
std::locale global;
|
||||
std::locale loc(global, f);
|
||||
for (int i = 0; i < 256; ++i)
|
||||
{
|
||||
char_type ch = i;
|
||||
VERIFY( std::isalpha(ch, loc) );
|
||||
}
|
||||
}
|
||||
|
||||
// libstdc++/5280
|
||||
void test04()
|
||||
{
|
||||
#ifdef _GLIBCPP_HAVE_SETENV
|
||||
// Set the global locale to non-"C".
|
||||
std::locale loc_de("de_DE");
|
||||
std::locale::global(loc_de);
|
||||
|
||||
// Set LANG environment variable to de_DE.
|
||||
const char* oldLANG = getenv("LANG");
|
||||
if (!setenv("LANG", "de_DE", 1))
|
||||
{
|
||||
test01();
|
||||
test02();
|
||||
test03();
|
||||
setenv("LANG", oldLANG ? oldLANG : "", 1);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
// http://gcc.gnu.org/ml/libstdc++/2002-05/msg00038.html
|
||||
void test05()
|
||||
{
|
||||
bool test = true;
|
||||
|
||||
const char* tentLANG = std::setlocale(LC_ALL, "ja_JP.eucjp");
|
||||
if (tentLANG != NULL)
|
||||
{
|
||||
std::string preLANG = tentLANG;
|
||||
test01();
|
||||
test02();
|
||||
test03();
|
||||
std::string postLANG = std::setlocale(LC_ALL, NULL);
|
||||
VERIFY( preLANG == postLANG );
|
||||
}
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
test01();
|
||||
test02();
|
||||
test03();
|
||||
test04();
|
||||
test05();
|
||||
return 0;
|
||||
}
|
104
libstdc++-v3/testsuite/22_locale/ctype/is/char/2.cc
Normal file
104
libstdc++-v3/testsuite/22_locale/ctype/is/char/2.cc
Normal file
@ -0,0 +1,104 @@
|
||||
// { dg-do run { xfail *-*-![linux]* } }
|
||||
// Copyright (C) 2000, 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
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// As a special exception, you may use this file as part of a free software
|
||||
// library without restriction. Specifically, if other files instantiate
|
||||
// templates or use macros or inline functions from this file, or you compile
|
||||
// this file and link it with other files to produce an executable, this
|
||||
// file does not by itself cause the resulting executable to be covered by
|
||||
// the GNU General Public License. This exception does not however
|
||||
// invalidate any other reasons why the executable file might be covered by
|
||||
// the GNU General Public License.
|
||||
|
||||
// 22.2.1.3.2 ctype<char> members
|
||||
|
||||
#include <locale>
|
||||
#include <vector>
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
typedef char char_type;
|
||||
|
||||
// libstdc++/4456, libstdc++/4457, libstdc++/4458
|
||||
void test02()
|
||||
{
|
||||
using namespace std;
|
||||
typedef ctype_base::mask mask;
|
||||
typedef vector<mask> vector_type;
|
||||
|
||||
bool test = true;
|
||||
|
||||
// const int max = numeric_limits<char>::max();
|
||||
const int max = 255;
|
||||
const int ctype_mask_max = 10;
|
||||
vector_type v_c(max);
|
||||
vector_type v_de(max);
|
||||
|
||||
// "C"
|
||||
locale loc_c = locale::classic();
|
||||
const ctype<char>& ctype_c = use_facet<ctype<char> >(loc_c);
|
||||
for (int i = 0; i < max; ++i)
|
||||
{
|
||||
char_type c = static_cast<char>(i);
|
||||
mask mask_test = static_cast<mask>(0);
|
||||
mask mask_is = static_cast<mask>(0);
|
||||
for (int j = 0; j <= ctype_mask_max; ++j)
|
||||
{
|
||||
mask_test = static_cast<mask>(1 << j);
|
||||
if (ctype_c.is(mask_test, c))
|
||||
mask_is |= mask_test;
|
||||
}
|
||||
v_c[i] = mask_is;
|
||||
}
|
||||
|
||||
// "de_DE"
|
||||
locale loc_de("de_DE");
|
||||
const ctype<char>& ctype_de = use_facet<ctype<char> >(loc_de);
|
||||
for (int i = 0; i < max; ++i)
|
||||
{
|
||||
char_type c = static_cast<char>(i);
|
||||
mask mask_test = static_cast<mask>(0);
|
||||
mask mask_is = static_cast<mask>(0);
|
||||
for (int j = 0; j <= ctype_mask_max; ++j)
|
||||
{
|
||||
mask_test = static_cast<mask>(1 << j);
|
||||
if (ctype_de.is(mask_test, c))
|
||||
mask_is |= mask_test;
|
||||
}
|
||||
v_de[i] = mask_is;
|
||||
}
|
||||
|
||||
#if QUANNUM_VERBOSE_LYRICALLY_ADEPT_BAY_AREA_MCS_MODE
|
||||
for (int i = 0; i < max; ++i)
|
||||
{
|
||||
char_type mark = v_c[i] == v_de[i] ? ' ' : '-';
|
||||
cout << i << ' ' << mark << ' ' << static_cast<char>(i) << '\t' ;
|
||||
cout << "v_c: " << setw(4) << v_c[i] << '\t';
|
||||
cout << "v_de: " << setw(4) << v_de[i] << endl;
|
||||
}
|
||||
cout << (v_c == v_de) << endl;
|
||||
#endif
|
||||
|
||||
VERIFY( v_c != v_de );
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
test02();
|
||||
return 0;
|
||||
}
|
@ -0,0 +1,46 @@
|
||||
// 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
|
||||
|
||||
// Copyright (C) 2001, 2002, 2003 Free Software Foundation
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// 22.2.4.1.1 collate members
|
||||
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
#define main discard_main_1
|
||||
#include "1.cc"
|
||||
#undef main
|
||||
|
||||
#define main discard_main_2
|
||||
#include "2.cc"
|
||||
#undef main
|
||||
|
||||
#define main discard_main_3
|
||||
#include "3.cc"
|
||||
#undef main
|
||||
|
||||
int main()
|
||||
{
|
||||
using namespace __gnu_cxx_test;
|
||||
func_callback two;
|
||||
two.push_back(&test01);
|
||||
two.push_back(&test02);
|
||||
two.push_back(&test03);
|
||||
run_tests_wrapped_env("de_DE", "LANG", two);
|
||||
return 0;
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
|
||||
// Copyright (C) 2000, 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
|
||||
@ -28,13 +28,8 @@
|
||||
// 22.2.1.3.2 ctype<char> members
|
||||
|
||||
#include <locale>
|
||||
#include <vector>
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
// XXX This test (test02) is not working for non-glibc locale models.
|
||||
// { dg-do run { xfail *-*-* } }
|
||||
|
||||
#ifdef _GLIBCPP_USE_WCHAR_T
|
||||
typedef wchar_t char_type;
|
||||
class gnu_ctype: public std::ctype<char_type> { };
|
||||
|
||||
@ -117,12 +112,6 @@ void test01()
|
||||
VERIFY( m01[1] == m00 );
|
||||
VERIFY( m01[2] == m00 );
|
||||
|
||||
cc0 = strlit00;
|
||||
m01[0] = m00;
|
||||
m01[1] = m00;
|
||||
m01[2] = m00;
|
||||
cc2 = gctype.is(cc0, cc0 + 3, m01);
|
||||
VERIFY( cc2 == strlit00 + 3);
|
||||
#if 0
|
||||
VERIFY( m01[0] != m00 );
|
||||
VERIFY( m01[1] != m00 );
|
||||
@ -152,46 +141,8 @@ void test01()
|
||||
#endif
|
||||
}
|
||||
|
||||
// libstdc++/5280
|
||||
void test04()
|
||||
{
|
||||
#ifdef _GLIBCPP_HAVE_SETENV
|
||||
// Set the global locale to non-"C".
|
||||
std::locale loc_de("de_DE");
|
||||
std::locale::global(loc_de);
|
||||
|
||||
// Set LANG environment variable to de_DE.
|
||||
const char* oldLANG = getenv("LANG");
|
||||
if (!setenv("LANG", "de_DE", 1))
|
||||
{
|
||||
test01();
|
||||
setenv("LANG", oldLANG ? oldLANG : "", 1);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
// http://gcc.gnu.org/ml/libstdc++/2002-05/msg00038.html
|
||||
void test05()
|
||||
{
|
||||
bool test = true;
|
||||
|
||||
const char* tentLANG = std::setlocale(LC_ALL, "ja_JP.eucjp");
|
||||
if (tentLANG != NULL)
|
||||
{
|
||||
std::string preLANG = tentLANG;
|
||||
test01();
|
||||
std::string postLANG = std::setlocale(LC_ALL, NULL);
|
||||
VERIFY( preLANG == postLANG );
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
int main()
|
||||
{
|
||||
#ifdef _GLIBCPP_USE_WCHAR_T
|
||||
test01();
|
||||
test04();
|
||||
test05();
|
||||
#endif
|
||||
return 0;
|
||||
}
|
104
libstdc++-v3/testsuite/22_locale/ctype/is/wchar_t/2.cc
Normal file
104
libstdc++-v3/testsuite/22_locale/ctype/is/wchar_t/2.cc
Normal file
@ -0,0 +1,104 @@
|
||||
// { dg-do run { xfail *-*-![linux]* } }
|
||||
// Copyright (C) 2000, 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
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// As a special exception, you may use this file as part of a free software
|
||||
// library without restriction. Specifically, if other files instantiate
|
||||
// templates or use macros or inline functions from this file, or you compile
|
||||
// this file and link it with other files to produce an executable, this
|
||||
// file does not by itself cause the resulting executable to be covered by
|
||||
// the GNU General Public License. This exception does not however
|
||||
// invalidate any other reasons why the executable file might be covered by
|
||||
// the GNU General Public License.
|
||||
|
||||
// 22.2.1.3.2 ctype<char> members
|
||||
|
||||
#include <locale>
|
||||
#include <vector>
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
typedef wchar_t char_type;
|
||||
|
||||
// libstdc++/4456, libstdc++/4457, libstdc++/4458
|
||||
void test02()
|
||||
{
|
||||
using namespace std;
|
||||
typedef ctype_base::mask mask;
|
||||
typedef vector<mask> vector_type;
|
||||
|
||||
bool test = true;
|
||||
|
||||
// const int max = numeric_limits<char>::max();
|
||||
const int max = 255;
|
||||
const int ctype_mask_max = 10;
|
||||
vector_type v_c(max);
|
||||
vector_type v_de(max);
|
||||
|
||||
// "C"
|
||||
locale loc_c = locale::classic();
|
||||
const ctype<wchar_t>& ctype_c = use_facet<ctype<wchar_t> >(loc_c);
|
||||
for (int i = 0; i < max; ++i)
|
||||
{
|
||||
char_type c = static_cast<wchar_t>(i);
|
||||
mask mask_test = static_cast<mask>(0);
|
||||
mask mask_is = static_cast<mask>(0);
|
||||
for (int j = 0; j <= ctype_mask_max; ++j)
|
||||
{
|
||||
mask_test = static_cast<mask>(1 << j);
|
||||
if (ctype_c.is(mask_test, c))
|
||||
mask_is |= mask_test;
|
||||
}
|
||||
v_c[i] = mask_is;
|
||||
}
|
||||
|
||||
// "de_DE"
|
||||
locale loc_de("de_DE");
|
||||
const ctype<wchar_t>& ctype_de = use_facet<ctype<wchar_t> >(loc_de);
|
||||
for (int i = 0; i < max; ++i)
|
||||
{
|
||||
char_type c = static_cast<wchar_t>(i);
|
||||
mask mask_test = static_cast<mask>(0);
|
||||
mask mask_is = static_cast<mask>(0);
|
||||
for (int j = 0; j <= ctype_mask_max; ++j)
|
||||
{
|
||||
mask_test = static_cast<mask>(1 << j);
|
||||
if (ctype_de.is(mask_test, c))
|
||||
mask_is |= mask_test;
|
||||
}
|
||||
v_de[i] = mask_is;
|
||||
}
|
||||
|
||||
#if QUANNUM_VERBOSE_LYRICALLY_ADEPT_BAY_AREA_MCS_MODE
|
||||
for (int i = 0; i < max; ++i)
|
||||
{
|
||||
char_type mark = v_c[i] == v_de[i] ? ' ' : '-';
|
||||
cout << i << ' ' << mark << ' ' << static_cast<wchar_t>(i) << '\t' ;
|
||||
cout << "v_c: " << setw(4) << v_c[i] << '\t';
|
||||
cout << "v_de: " << setw(4) << v_de[i] << endl;
|
||||
}
|
||||
cout << (v_c == v_de) << endl;
|
||||
#endif
|
||||
|
||||
VERIFY( v_c != v_de );
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
test02();
|
||||
return 0;
|
||||
}
|
@ -0,0 +1,41 @@
|
||||
// 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
|
||||
|
||||
// Copyright (C) 2001, 2002, 2003 Free Software Foundation
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// 22.2.4.1.1 collate members
|
||||
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
#define main discard_main_1
|
||||
#include "1.cc"
|
||||
#undef main
|
||||
|
||||
#define main discard_main_2
|
||||
#include "2.cc"
|
||||
#undef main
|
||||
|
||||
int main()
|
||||
{
|
||||
using namespace __gnu_cxx_test;
|
||||
func_callback two;
|
||||
two.push_back(&test01);
|
||||
two.push_back(&test02);
|
||||
run_tests_wrapped_env("de_DE", "LANG", two);
|
||||
return 0;
|
||||
}
|
@ -0,0 +1,41 @@
|
||||
// 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
|
||||
|
||||
// Copyright (C) 2001, 2002, 2003 Free Software Foundation
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// 22.2.4.1.1 collate members
|
||||
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
#define main discard_main_1
|
||||
#include "1.cc"
|
||||
#undef main
|
||||
|
||||
#define main discard_main_2
|
||||
#include "2.cc"
|
||||
#undef main
|
||||
|
||||
int main()
|
||||
{
|
||||
using namespace __gnu_cxx_test;
|
||||
func_callback two;
|
||||
two.push_back(&test01);
|
||||
two.push_back(&test02);
|
||||
run_tests_wrapped_locale("ja_JP.eucjp", two);
|
||||
return 0;
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
// 2000-09-01 Benjamin Kosnik <bkoz@redhat.com>
|
||||
// 2002-05-24 bkoz
|
||||
|
||||
// Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
|
||||
// Copyright (C) 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
|
||||
@ -30,20 +30,40 @@
|
||||
// 22.2.1.3.2 ctype<char> members
|
||||
|
||||
#include <locale>
|
||||
#include <vector>
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
#if _GLIBCPP_USE_WCHAR_T
|
||||
// libstdc++/6701
|
||||
void test01()
|
||||
{
|
||||
// Nothing, right now.
|
||||
using namespace std;
|
||||
typedef char wide_type;
|
||||
|
||||
bool test = true;
|
||||
const char dfault = '?';
|
||||
const locale loc_c = locale::classic();
|
||||
const ctype<wide_type>& ctype_c = use_facet<ctype<wide_type> >(loc_c);
|
||||
|
||||
basic_string<wide_type> wide("wibble");
|
||||
basic_string<char> narrow("wibble");
|
||||
vector<char> narrow_chars(wide.length() + 1);
|
||||
|
||||
// narrow(charT c, char dfault) const
|
||||
for (int i = 0; i < wide.length(); ++i)
|
||||
{
|
||||
char c = ctype_c.narrow(wide[i], dfault);
|
||||
VERIFY( c == narrow[i] );
|
||||
}
|
||||
|
||||
// narrow(const charT* low, const charT* high, char dfault, char* dest) const
|
||||
ctype_c.narrow(&wide[0], &wide[wide.length()], dfault, &narrow_chars[0]);
|
||||
VERIFY( narrow_chars[0] != dfault );
|
||||
for (int i = 0; i < wide.length(); ++i)
|
||||
VERIFY( narrow_chars[i] == narrow[i] );
|
||||
}
|
||||
#endif /* !defined(_GLIBCPP_USE_WCHAR_T) */
|
||||
|
||||
int main()
|
||||
{
|
||||
#if _GLIBCPP_USE_WCHAR_T
|
||||
test01();
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
// 2002-05-24 bkoz
|
||||
|
||||
// Copyright (C) 2002 Free Software Foundation, Inc.
|
||||
// Copyright (C) 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
|
||||
@ -33,35 +33,6 @@
|
||||
#include <vector>
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
// libstdc++/6701
|
||||
void test01()
|
||||
{
|
||||
using namespace std;
|
||||
typedef char wide_type;
|
||||
|
||||
bool test = true;
|
||||
const char dfault = '?';
|
||||
const locale loc_c = locale::classic();
|
||||
const ctype<wide_type>& ctype_c = use_facet<ctype<wide_type> >(loc_c);
|
||||
|
||||
basic_string<wide_type> wide("wibble");
|
||||
basic_string<char> narrow("wibble");
|
||||
vector<char> narrow_chars(wide.length() + 1);
|
||||
|
||||
// narrow(charT c, char dfault) const
|
||||
for (int i = 0; i < wide.length(); ++i)
|
||||
{
|
||||
char c = ctype_c.narrow(wide[i], dfault);
|
||||
VERIFY( c == narrow[i] );
|
||||
}
|
||||
|
||||
// narrow(const charT* low, const charT* high, char dfault, char* dest) const
|
||||
ctype_c.narrow(&wide[0], &wide[wide.length()], dfault, &narrow_chars[0]);
|
||||
VERIFY( narrow_chars[0] != dfault );
|
||||
for (int i = 0; i < wide.length(); ++i)
|
||||
VERIFY( narrow_chars[i] == narrow[i] );
|
||||
}
|
||||
|
||||
void test02()
|
||||
{
|
||||
using namespace std;
|
||||
@ -97,7 +68,6 @@ void test02()
|
||||
|
||||
int main()
|
||||
{
|
||||
test01();
|
||||
test02();
|
||||
return 0;
|
||||
}
|
@ -0,0 +1,41 @@
|
||||
// 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
|
||||
|
||||
// Copyright (C) 2001, 2002, 2003 Free Software Foundation
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// 22.2.4.1.1 collate members
|
||||
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
#define main discard_main_1
|
||||
#include "1.cc"
|
||||
#undef main
|
||||
|
||||
#define main discard_main_2
|
||||
#include "2.cc"
|
||||
#undef main
|
||||
|
||||
int main()
|
||||
{
|
||||
using namespace __gnu_cxx_test;
|
||||
func_callback two;
|
||||
two.push_back(&test01);
|
||||
two.push_back(&test02);
|
||||
run_tests_wrapped_env("de_DE", "LANG", two);
|
||||
return 0;
|
||||
}
|
@ -0,0 +1,41 @@
|
||||
// 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
|
||||
|
||||
// Copyright (C) 2001, 2002, 2003 Free Software Foundation
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// 22.2.4.1.1 collate members
|
||||
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
#define main discard_main_1
|
||||
#include "1.cc"
|
||||
#undef main
|
||||
|
||||
#define main discard_main_2
|
||||
#include "2.cc"
|
||||
#undef main
|
||||
|
||||
int main()
|
||||
{
|
||||
using namespace __gnu_cxx_test;
|
||||
func_callback two;
|
||||
two.push_back(&test01);
|
||||
two.push_back(&test02);
|
||||
run_tests_wrapped_locale("ja_JP.eucjp", two);
|
||||
return 0;
|
||||
}
|
69
libstdc++-v3/testsuite/22_locale/ctype/narrow/wchar_t/1.cc
Normal file
69
libstdc++-v3/testsuite/22_locale/ctype/narrow/wchar_t/1.cc
Normal file
@ -0,0 +1,69 @@
|
||||
// 2002-05-24 bkoz
|
||||
|
||||
// Copyright (C) 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
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// As a special exception, you may use this file as part of a free software
|
||||
// library without restriction. Specifically, if other files instantiate
|
||||
// templates or use macros or inline functions from this file, or you compile
|
||||
// this file and link it with other files to produce an executable, this
|
||||
// file does not by itself cause the resulting executable to be covered by
|
||||
// the GNU General Public License. This exception does not however
|
||||
// invalidate any other reasons why the executable file might be covered by
|
||||
// the GNU General Public License.
|
||||
|
||||
// 22.2.1.3.2 ctype<char> members
|
||||
|
||||
#include <locale>
|
||||
#include <vector>
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
// libstdc++/6701
|
||||
void test01()
|
||||
{
|
||||
using namespace std;
|
||||
typedef wchar_t wide_type;
|
||||
|
||||
bool test = true;
|
||||
const char dfault = '?';
|
||||
const locale loc_c = locale::classic();
|
||||
const ctype<wide_type>& ctype_c = use_facet<ctype<wide_type> >(loc_c);
|
||||
|
||||
basic_string<wide_type> wide(L"wibble");
|
||||
basic_string<char> narrow("wibble");
|
||||
vector<char> narrow_chars(wide.length() + 1);
|
||||
|
||||
// narrow(charT c, char dfault) const
|
||||
for (int i = 0; i < wide.length(); ++i)
|
||||
{
|
||||
char c = ctype_c.narrow(wide[i], dfault);
|
||||
VERIFY( c == narrow[i] );
|
||||
}
|
||||
|
||||
// narrow(const charT* low, const charT* high, char dfault, char* dest) const
|
||||
ctype_c.narrow(&wide[0], &wide[wide.length()], dfault, &narrow_chars[0]);
|
||||
VERIFY( narrow_chars[0] != dfault );
|
||||
for (int i = 0; i < wide.length(); ++i)
|
||||
VERIFY( narrow_chars[i] == narrow[i] );
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
test01();
|
||||
return 0;
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
// 2002-05-24 bkoz
|
||||
|
||||
// Copyright (C) 2002 Free Software Foundation, Inc.
|
||||
// Copyright (C) 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
|
||||
@ -33,36 +33,6 @@
|
||||
#include <vector>
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
#ifdef _GLIBCPP_USE_WCHAR_T
|
||||
// libstdc++/6701
|
||||
void test01()
|
||||
{
|
||||
using namespace std;
|
||||
typedef wchar_t wide_type;
|
||||
|
||||
bool test = true;
|
||||
const char dfault = '?';
|
||||
const locale loc_c = locale::classic();
|
||||
const ctype<wide_type>& ctype_c = use_facet<ctype<wide_type> >(loc_c);
|
||||
|
||||
basic_string<wide_type> wide(L"wibble");
|
||||
basic_string<char> narrow("wibble");
|
||||
vector<char> narrow_chars(wide.length() + 1);
|
||||
|
||||
// narrow(charT c, char dfault) const
|
||||
for (int i = 0; i < wide.length(); ++i)
|
||||
{
|
||||
char c = ctype_c.narrow(wide[i], dfault);
|
||||
VERIFY( c == narrow[i] );
|
||||
}
|
||||
|
||||
// narrow(const charT* low, const charT* high, char dfault, char* dest) const
|
||||
ctype_c.narrow(&wide[0], &wide[wide.length()], dfault, &narrow_chars[0]);
|
||||
VERIFY( narrow_chars[0] != dfault );
|
||||
for (int i = 0; i < wide.length(); ++i)
|
||||
VERIFY( narrow_chars[i] == narrow[i] );
|
||||
}
|
||||
|
||||
void test02()
|
||||
{
|
||||
using namespace std;
|
||||
@ -95,13 +65,9 @@ void test02()
|
||||
for (int i = 0; i < wide.length(); ++i)
|
||||
VERIFY( narrow_chars[i] == narrow[i] );
|
||||
}
|
||||
#endif
|
||||
|
||||
int main()
|
||||
{
|
||||
#ifdef _GLIBCPP_USE_WCHAR_T
|
||||
test01();
|
||||
test02();
|
||||
#endif
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
@ -0,0 +1,41 @@
|
||||
// 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
|
||||
|
||||
// Copyright (C) 2001, 2002, 2003 Free Software Foundation
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// 22.2.4.1.1 collate members
|
||||
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
#define main discard_main_1
|
||||
#include "1.cc"
|
||||
#undef main
|
||||
|
||||
#define main discard_main_2
|
||||
#include "2.cc"
|
||||
#undef main
|
||||
|
||||
int main()
|
||||
{
|
||||
using namespace __gnu_cxx_test;
|
||||
func_callback two;
|
||||
two.push_back(&test01);
|
||||
two.push_back(&test02);
|
||||
run_tests_wrapped_env("de_DE", "LANG", two);
|
||||
return 0;
|
||||
}
|
@ -0,0 +1,41 @@
|
||||
// 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
|
||||
|
||||
// Copyright (C) 2001, 2002, 2003 Free Software Foundation
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// 22.2.4.1.1 collate members
|
||||
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
#define main discard_main_1
|
||||
#include "1.cc"
|
||||
#undef main
|
||||
|
||||
#define main discard_main_2
|
||||
#include "2.cc"
|
||||
#undef main
|
||||
|
||||
int main()
|
||||
{
|
||||
using namespace __gnu_cxx_test;
|
||||
func_callback two;
|
||||
two.push_back(&test01);
|
||||
two.push_back(&test02);
|
||||
run_tests_wrapped_locale("ja_JP.eucjp", two);
|
||||
return 0;
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
// 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
|
||||
|
||||
// Copyright (C) 2001, 2002, 2003 Free Software Foundation
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// 22.2.4.1.1 collate members
|
||||
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
#define main discard_main_1
|
||||
#include "1.cc"
|
||||
#undef main
|
||||
|
||||
int main()
|
||||
{
|
||||
using namespace __gnu_cxx_test;
|
||||
func_callback two;
|
||||
two.push_back(&test01);
|
||||
run_tests_wrapped_env("de_DE", "LANG", two);
|
||||
return 0;
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
// 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
|
||||
|
||||
// Copyright (C) 2001, 2002, 2003 Free Software Foundation
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// 22.2.4.1.1 collate members
|
||||
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
#define main discard_main_1
|
||||
#include "1.cc"
|
||||
#undef main
|
||||
|
||||
int main()
|
||||
{
|
||||
using namespace __gnu_cxx_test;
|
||||
func_callback two;
|
||||
two.push_back(&test01);
|
||||
run_tests_wrapped_locale("ja_JP.eucjp", two);
|
||||
return 0;
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
// 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
|
||||
|
||||
// Copyright (C) 2001, 2002, 2003 Free Software Foundation
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
// 22.2.4.1.1 collate members
|
||||
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
#define main discard_main_1
|
||||
#include "1.cc"
|
||||
#undef main
|
||||
|
||||
int main()
|
||||
{
|
||||
using namespace __gnu_cxx_test;
|
||||
func_callback two;
|
||||
two.push_back(&test01);
|
||||
run_tests_wrapped_locale("ja_JP.eucjp", two);
|
||||
return 0;
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
|
||||
// Copyright (C) 2000, 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
|
||||
@ -98,43 +98,8 @@ void test01()
|
||||
VERIFY( !std::char_traits<char_type>::compare(c_array, strlit02, len - 1) );
|
||||
}
|
||||
|
||||
// libstdc++/5280
|
||||
void test04()
|
||||
{
|
||||
#ifdef _GLIBCPP_HAVE_SETENV
|
||||
// Set the global locale to non-"C".
|
||||
std::locale loc_de("de_DE");
|
||||
std::locale::global(loc_de);
|
||||
|
||||
// Set LANG environment variable to de_DE.
|
||||
const char* oldLANG = getenv("LANG");
|
||||
if (!setenv("LANG", "de_DE", 1))
|
||||
{
|
||||
test01();
|
||||
setenv("LANG", oldLANG ? oldLANG : "", 1);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
// http://gcc.gnu.org/ml/libstdc++/2002-05/msg00038.html
|
||||
void test05()
|
||||
{
|
||||
bool test = true;
|
||||
|
||||
const char* tentLANG = std::setlocale(LC_ALL, "ja_JP.eucjp");
|
||||
if (tentLANG != NULL)
|
||||
{
|
||||
std::string preLANG = tentLANG;
|
||||
test01();
|
||||
std::string postLANG = std::setlocale(LC_ALL, NULL);
|
||||
VERIFY( preLANG == postLANG );
|
||||
}
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
test01();
|
||||
test04();
|
||||
test05();
|
||||
return 0;
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user