PATCH: testsuite/22_locale/codecvt_members_char_char.cc, et al

Loren James Rittle rittle@latour.rsch.comm.mot.com
Thu Jan 31 14:44:00 GMT 2002


If someone tests without LANG set in their environment, then a core
dump happens on some platforms due to a NULL second argument to
setenv().  As an alternate, it might be better to use unsetenv() if
available when !oldLANG.  However, for all systems I know about, and
empty LANG is equivalent to an unset LANG.

Most of the affected tests either fail or are marked XFAIL but this is
the root cause of:

FAIL: 22_locale/codecvt_members_char_char.cc execution test

on *-*-freebsd*

OK to commit?

	* testsuite/22_locale/codecvt_members_char_char.cc: Do not
	allow NULL argument to be passed to setenv().
	* testsuite/22_locale/codecvt_members_wchar_t_char.cc: Likewise.
	* testsuite/22_locale/collate_members_char.cc: Likewise.
	* testsuite/22_locale/collate_members_wchar_t.cc: Likewise.
	* testsuite/22_locale/ctype_members_char.cc: Likewise.
	* testsuite/22_locale/ctype_members_wchar_t.cc: Likewise.
	* testsuite/22_locale/messages_members_char.cc: Likewise.
	* testsuite/22_locale/money_get_members_char.cc: Likewise.
	* testsuite/22_locale/money_get_members_wchar_t.cc: Likewise.
	* testsuite/22_locale/money_put_members_char.cc: Likewise.
	* testsuite/22_locale/money_put_members_wchar_t.cc: Likewise.
	* testsuite/22_locale/moneypunct_members_char.cc: Likewise.
	* testsuite/22_locale/moneypunct_members_wchar_t.cc: Likewise.
	* testsuite/22_locale/num_get_members_char.cc: Likewise.
	* testsuite/22_locale/num_get_members_wchar_t.cc: Likewise.
	* testsuite/22_locale/num_put_members_char.cc: Likewise.
	* testsuite/22_locale/num_put_members_wchar_t.cc: Likewise.
	* testsuite/22_locale/numpunct_members_char.cc: Likewise.
	* testsuite/22_locale/numpunct_members_wchar_t.cc: Likewise.
	* testsuite/22_locale/time_get_members_char.cc: Likewise.
	* testsuite/22_locale/time_get_members_wchar_t.cc: Likewise.
	* testsuite/22_locale/time_put_members_char.cc: Likewise.
	* testsuite/22_locale/time_put_members_wchar_t.cc: Likewise.

Index: testsuite/22_locale/codecvt_members_char_char.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/testsuite/22_locale/codecvt_members_char_char.cc,v
retrieving revision 1.3
diff -r1.3 codecvt_members_char_char.cc
95c95
<       setenv("LANG", oldLANG, 1);
---
>       setenv("LANG", oldLANG ? oldLANG : "", 1);
Index: testsuite/22_locale/codecvt_members_wchar_t_char.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/testsuite/22_locale/codecvt_members_wchar_t_char.cc,v
retrieving revision 1.3
diff -r1.3 codecvt_members_wchar_t_char.cc
127c127
<       setenv("LANG", oldLANG, 1);
---
>       setenv("LANG", oldLANG ? oldLANG : "", 1);
Index: testsuite/22_locale/collate_members_char.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/testsuite/22_locale/collate_members_char.cc,v
retrieving revision 1.3
diff -r1.3 collate_members_char.cc
145c145
<       setenv("LANG", oldLANG, 1);
---
>       setenv("LANG", oldLANG ? oldLANG : "", 1);
Index: testsuite/22_locale/collate_members_wchar_t.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/testsuite/22_locale/collate_members_wchar_t.cc,v
retrieving revision 1.3
diff -r1.3 collate_members_wchar_t.cc
145c145
<       setenv("LANG", oldLANG, 1);
---
>       setenv("LANG", oldLANG ? oldLANG : "", 1);
Index: testsuite/22_locale/ctype_members_char.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/testsuite/22_locale/ctype_members_char.cc,v
retrieving revision 1.6
diff -r1.6 ctype_members_char.cc
260c260
<       setenv("LANG", oldLANG, 1);
---
>       setenv("LANG", oldLANG ? oldLANG : "", 1);
Index: testsuite/22_locale/ctype_members_wchar_t.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/testsuite/22_locale/ctype_members_wchar_t.cc,v
retrieving revision 1.4
diff -r1.4 ctype_members_wchar_t.cc
113c113
<       setenv("LANG", oldLANG, 1);
---
>       setenv("LANG", oldLANG ? oldLANG : "", 1);
Index: testsuite/22_locale/messages_members_char.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/testsuite/22_locale/messages_members_char.cc,v
retrieving revision 1.3
diff -r1.3 messages_members_char.cc
97c97
<       setenv("LANG", oldLANG, 1);
---
>       setenv("LANG", oldLANG ? oldLANG : "", 1);
Index: testsuite/22_locale/money_get_members_char.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/testsuite/22_locale/money_get_members_char.cc,v
retrieving revision 1.8
diff -r1.8 money_get_members_char.cc
307c307
<       setenv("LANG", oldLANG, 1);
---
>       setenv("LANG", oldLANG ? oldLANG : "", 1);
Index: testsuite/22_locale/money_get_members_wchar_t.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/testsuite/22_locale/money_get_members_wchar_t.cc,v
retrieving revision 1.7
diff -r1.7 money_get_members_wchar_t.cc
309c309
<       setenv("LANG", oldLANG, 1);
---
>       setenv("LANG", oldLANG ? oldLANG : "", 1);
Index: testsuite/22_locale/money_put_members_char.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/testsuite/22_locale/money_put_members_char.cc,v
retrieving revision 1.9
diff -r1.9 money_put_members_char.cc
301c301
<       setenv("LANG", oldLANG, 1);
---
>       setenv("LANG", oldLANG ? oldLANG : "", 1);
Index: testsuite/22_locale/money_put_members_wchar_t.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/testsuite/22_locale/money_put_members_wchar_t.cc,v
retrieving revision 1.8
diff -r1.8 money_put_members_wchar_t.cc
301c301
<       setenv("LANG", oldLANG, 1);
---
>       setenv("LANG", oldLANG ? oldLANG : "", 1);
Index: testsuite/22_locale/moneypunct_members_char.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/testsuite/22_locale/moneypunct_members_char.cc,v
retrieving revision 1.5
diff -r1.5 moneypunct_members_char.cc
121c121
<       setenv("LANG", oldLANG, 1);
---
>       setenv("LANG", oldLANG ? oldLANG : "", 1);
Index: testsuite/22_locale/moneypunct_members_wchar_t.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/testsuite/22_locale/moneypunct_members_wchar_t.cc,v
retrieving revision 1.4
diff -r1.4 moneypunct_members_wchar_t.cc
122c122
<       setenv("LANG", oldLANG, 1);
---
>       setenv("LANG", oldLANG ? oldLANG : "", 1);
Index: testsuite/22_locale/num_get_members_char.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/testsuite/22_locale/num_get_members_char.cc,v
retrieving revision 1.6
diff -r1.6 num_get_members_char.cc
330c330
<       setenv("LANG", oldLANG, 1);
---
>       setenv("LANG", oldLANG ? oldLANG : "", 1);
Index: testsuite/22_locale/num_get_members_wchar_t.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/testsuite/22_locale/num_get_members_wchar_t.cc,v
retrieving revision 1.4
diff -r1.4 num_get_members_wchar_t.cc
332c332
<       setenv("LANG", oldLANG, 1);
---
>       setenv("LANG", oldLANG ? oldLANG : "", 1);
Index: testsuite/22_locale/num_put_members_char.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/testsuite/22_locale/num_put_members_char.cc,v
retrieving revision 1.5
diff -r1.5 num_put_members_char.cc
308c308
<       setenv("LANG", oldLANG, 1);
---
>       setenv("LANG", oldLANG ? oldLANG : "", 1);
Index: testsuite/22_locale/num_put_members_wchar_t.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/testsuite/22_locale/num_put_members_wchar_t.cc,v
retrieving revision 1.5
diff -r1.5 num_put_members_wchar_t.cc
308c308
<       setenv("LANG", oldLANG, 1);
---
>       setenv("LANG", oldLANG ? oldLANG : "", 1);
Index: testsuite/22_locale/numpunct_members_char.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/testsuite/22_locale/numpunct_members_char.cc,v
retrieving revision 1.5
diff -r1.5 numpunct_members_char.cc
99c99
<       setenv("LANG", oldLANG, 1);
---
>       setenv("LANG", oldLANG ? oldLANG : "", 1);
Index: testsuite/22_locale/numpunct_members_wchar_t.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/testsuite/22_locale/numpunct_members_wchar_t.cc,v
retrieving revision 1.4
diff -r1.4 numpunct_members_wchar_t.cc
97c97
<       setenv("LANG", oldLANG, 1);
---
>       setenv("LANG", oldLANG ? oldLANG : "", 1);
Index: testsuite/22_locale/time_get_members_char.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/testsuite/22_locale/time_get_members_char.cc,v
retrieving revision 1.6
diff -r1.6 time_get_members_char.cc
697c697
<       setenv("LANG", oldLANG, 1);
---
>       setenv("LANG", oldLANG ? oldLANG : "", 1);
Index: testsuite/22_locale/time_get_members_wchar_t.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/testsuite/22_locale/time_get_members_wchar_t.cc,v
retrieving revision 1.5
diff -r1.5 time_get_members_wchar_t.cc
697c697
<       setenv("LANG", oldLANG, 1);
---
>       setenv("LANG", oldLANG ? oldLANG : "", 1);
Index: testsuite/22_locale/time_put_members_char.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/testsuite/22_locale/time_put_members_char.cc,v
retrieving revision 1.6
diff -r1.6 time_put_members_char.cc
248c248
<       setenv("LANG", oldLANG, 1);
---
>       setenv("LANG", oldLANG ? oldLANG : "", 1);
Index: testsuite/22_locale/time_put_members_wchar_t.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/testsuite/22_locale/time_put_members_wchar_t.cc,v
retrieving revision 1.5
diff -r1.5 time_put_members_wchar_t.cc
250c250
<       setenv("LANG", oldLANG, 1);
---
>       setenv("LANG", oldLANG ? oldLANG : "", 1);



More information about the Libstdc++ mailing list