diff options
author | bkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-03-15 04:53:52 +0000 |
---|---|---|
committer | bkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-03-15 04:53:52 +0000 |
commit | db807ea9ef138ba9484328eb666b4c0d5d199efd (patch) | |
tree | 204e3dee0d4d25d00d7dec32745c0e03db31439a /libstdc++-v3/testsuite | |
parent | fc308e433078a81b845e87acf3c7002f66a138dd (diff) | |
download | gcc-db807ea9ef138ba9484328eb666b4c0d5d199efd.tar.gz |
2003-03-14 Benjamin Kosnik <bkoz@redhat.com>
* testsuite/23_containers/bitset_members.cc: Add test variable.
* testsuite/23_containers/map_insert.cc: Same.
* testsuite/22_locale/ctype/cons/char/1.cc: Same.
* testsuite/22_locale/codecvt/max_length/wchar_t/1.cc: Same.
* testsuite/22_locale/codecvt/max_length/wchar_t/2.cc: Same.
* testsuite/22_locale/codecvt/max_length/wchar_t/3.cc: Same.
* testsuite/22_locale/codecvt/max_length/wchar_t/4.cc: Same.
* testsuite/22_locale/codecvt/always_noconv/wchar_t/1.cc: Same.
* testsuite/22_locale/codecvt/always_noconv/wchar_t/2.cc: Same.
* testsuite/22_locale/codecvt/always_noconv/wchar_t/3.cc: Same.
* testsuite/22_locale/codecvt/always_noconv/wchar_t/4.cc: Same.
* testsuite/27_io/istream_exception.cc: Same.
* testsuite/27_io/filebuf_virtuals.cc: Same.
* testsuite/27_io/stringbuf_virtuals.cc: Same.
* testsuite/27_io/ostream_inserter_arith.cc: Same.
* testsuite/26_numerics/valarray_operators.cc: Same.
* testsuite/26_numerics/slice.cc: Same.
* testsuite/26_numerics/slice_array_assignment.cc: Same.
* testsuite/24_iterators/istream_iterator.cc: Same.
* mkcheck.in (TESTS_FILE): Use dejagnu-generated file if possible.
2003-03-14 Petur Runolfsson <peturr02@ru.is>
PR libstdc++/9581
PR libstdc++/9870
* config/locale/generic/ctype_members.cc,
* config/locale/gnu/ctype_members.cc
(ctype<wchar_t>::do_widen(char)): Cast argument to
unsigned char before passing to btowc.
(ctype<wchar_t>::do_widen(const char*, const char*, wchar_t*)):
Convert characters with btowc instead of mbsrtowcs.
(ctype<wchar_t>::do_narrow(const wchar_t*, const wchar_t*,
char, char*):
Convert characters with wctob instead of wcsrtombs.
* testsuite/22_locale/ctype/narrow/wchar_t/3.cc: New test.
* testsuite/22_locale/ctype/widen/wchar_t/2.cc: New test.
* testsuite/22_locale/ctype/widen/wchar_t/3.cc: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@64391 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/testsuite')
23 files changed, 197 insertions, 8 deletions
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/wchar_t/1.cc b/libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/wchar_t/1.cc index 25d66af0d68..6b57c89232f 100644 --- a/libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/wchar_t/1.cc +++ b/libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/wchar_t/1.cc @@ -28,6 +28,7 @@ void test01() { using namespace std; + bool test = true; typedef codecvt<wchar_t, char, mbstate_t> w_codecvt; locale loc; diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/wchar_t/2.cc b/libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/wchar_t/2.cc index 19e73985f19..07b3a2dabd0 100644 --- a/libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/wchar_t/2.cc +++ b/libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/wchar_t/2.cc @@ -30,6 +30,7 @@ void test02() { using namespace std; + bool test = true; typedef codecvt<wchar_t, char, mbstate_t> w_codecvt; locale loc ("en_US.ISO-8859-1"); diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/wchar_t/3.cc b/libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/wchar_t/3.cc index 8681276f6b1..b44e86f7079 100644 --- a/libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/wchar_t/3.cc +++ b/libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/wchar_t/3.cc @@ -30,6 +30,7 @@ void test03() { using namespace std; + bool test = true; typedef codecvt<wchar_t, char, mbstate_t> w_codecvt; locale loc ("en_US.ISO-8859-15"); diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/wchar_t/4.cc b/libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/wchar_t/4.cc index 36bc3a183bd..15a8546c3d7 100644 --- a/libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/wchar_t/4.cc +++ b/libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/wchar_t/4.cc @@ -30,6 +30,7 @@ void test04() { using namespace std; + bool test = true; typedef codecvt<wchar_t, char, mbstate_t> w_codecvt; locale loc ("en_US.UTF-8"); diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/max_length/wchar_t/1.cc b/libstdc++-v3/testsuite/22_locale/codecvt/max_length/wchar_t/1.cc index b2995e3b2fb..5ecc99e0c6a 100644 --- a/libstdc++-v3/testsuite/22_locale/codecvt/max_length/wchar_t/1.cc +++ b/libstdc++-v3/testsuite/22_locale/codecvt/max_length/wchar_t/1.cc @@ -28,6 +28,7 @@ void test01() { using namespace std; + bool test = true; typedef codecvt<wchar_t, char, mbstate_t> w_codecvt; locale loc_c = locale::classic(); diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/max_length/wchar_t/2.cc b/libstdc++-v3/testsuite/22_locale/codecvt/max_length/wchar_t/2.cc index 37fdf544449..9c76752d611 100644 --- a/libstdc++-v3/testsuite/22_locale/codecvt/max_length/wchar_t/2.cc +++ b/libstdc++-v3/testsuite/22_locale/codecvt/max_length/wchar_t/2.cc @@ -28,6 +28,7 @@ void test02() { using namespace std; + bool test = true; typedef codecvt<wchar_t, char, mbstate_t> w_codecvt; locale loc ("en_US.ISO-8859-1"); diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/max_length/wchar_t/3.cc b/libstdc++-v3/testsuite/22_locale/codecvt/max_length/wchar_t/3.cc index d6778d18a07..2d312bddc31 100644 --- a/libstdc++-v3/testsuite/22_locale/codecvt/max_length/wchar_t/3.cc +++ b/libstdc++-v3/testsuite/22_locale/codecvt/max_length/wchar_t/3.cc @@ -28,6 +28,7 @@ void test03() { using namespace std; + bool test = true; typedef codecvt<wchar_t, char, mbstate_t> w_codecvt; locale loc ("en_US.ISO-8859-15"); diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/max_length/wchar_t/4.cc b/libstdc++-v3/testsuite/22_locale/codecvt/max_length/wchar_t/4.cc index fd85941ab37..cd4d08d5733 100644 --- a/libstdc++-v3/testsuite/22_locale/codecvt/max_length/wchar_t/4.cc +++ b/libstdc++-v3/testsuite/22_locale/codecvt/max_length/wchar_t/4.cc @@ -28,6 +28,7 @@ void test04() { using namespace std; + bool test = true; typedef codecvt<wchar_t, char, mbstate_t> w_codecvt; locale loc ("en_US.UTF-8"); diff --git a/libstdc++-v3/testsuite/22_locale/ctype/cons/char/1.cc b/libstdc++-v3/testsuite/22_locale/ctype/cons/char/1.cc index 5ad3877cfd8..4846aec220e 100644 --- a/libstdc++-v3/testsuite/22_locale/ctype/cons/char/1.cc +++ b/libstdc++-v3/testsuite/22_locale/ctype/cons/char/1.cc @@ -51,7 +51,8 @@ public: void test01() { using namespace std; - + bool test = true; + comma_ctype obj; const ctype_base::mask* tmp = obj.get_classic_table(); diff --git a/libstdc++-v3/testsuite/22_locale/ctype/narrow/wchar_t/3.cc b/libstdc++-v3/testsuite/22_locale/ctype/narrow/wchar_t/3.cc new file mode 100644 index 00000000000..f235d8a3661 --- /dev/null +++ b/libstdc++-v3/testsuite/22_locale/ctype/narrow/wchar_t/3.cc @@ -0,0 +1,56 @@ +// 2003-03-12 Petur Runolfsson <peturr02@ru.is> + +// Copyright (C) 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<wchar_t> members + +#include <locale> +#include <testsuite_hooks.h> + +// libstdc++/9581 +void test03() +{ + using namespace std; + bool test = true; + + locale loc ("se_NO.UTF-8"); + const ctype<wchar_t>& wct = use_facet<ctype<wchar_t> >(loc); + + const wchar_t* wstrlit = L"\x80"; + + char buf[2]; + wct.narrow(wstrlit, wstrlit + 2, ' ', buf); + VERIFY( buf[0] == wct.narrow(wstrlit[0], ' ') ); + VERIFY( buf[1] == wct.narrow(wstrlit[1], ' ') ); +} + +int main() +{ + test03(); + return 0; +} diff --git a/libstdc++-v3/testsuite/22_locale/ctype/widen/wchar_t/2.cc b/libstdc++-v3/testsuite/22_locale/ctype/widen/wchar_t/2.cc new file mode 100644 index 00000000000..e4e49676c5b --- /dev/null +++ b/libstdc++-v3/testsuite/22_locale/ctype/widen/wchar_t/2.cc @@ -0,0 +1,54 @@ +// 2003-03-12 Petur Runolfsson <peturr02@ru.is> + +// Copyright (C) 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<wchar_t> members + +#include <locale> +#include <testsuite_hooks.h> + +// libstdc++/9870 +void test02() +{ + using namespace std; + bool test = true; + + locale loc ("en_US.ISO-8859-1"); + const ctype<wchar_t>& wct = use_facet<ctype<wchar_t> >(loc); + + char c = 0xff; + wchar_t wc = wct.widen(c); + + VERIFY( wc == static_cast<wchar_t>(0xff) ); +} + +int main() +{ + test02(); + return 0; +} diff --git a/libstdc++-v3/testsuite/22_locale/ctype/widen/wchar_t/3.cc b/libstdc++-v3/testsuite/22_locale/ctype/widen/wchar_t/3.cc new file mode 100644 index 00000000000..e872a944b85 --- /dev/null +++ b/libstdc++-v3/testsuite/22_locale/ctype/widen/wchar_t/3.cc @@ -0,0 +1,57 @@ +// 2003-03-12 Petur Runolfsson <peturr02@ru.is> + +// Copyright (C) 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<wchar_t> members + +#include <locale> +#include <testsuite_hooks.h> + +// libstdc++/9581 +void test03() +{ + using namespace std; + bool test = true; + + locale loc ("se_NO.UTF-8"); + const ctype<wchar_t>& wct = use_facet<ctype<wchar_t> >(loc); + + const char* strlit = "\xc2\x80"; + + wchar_t wbuf[3]; + wct.widen(strlit, strlit + 3, wbuf); + VERIFY( wbuf[0] == wct.widen(strlit[0]) ); + VERIFY( wbuf[1] == wct.widen(strlit[1]) ); + VERIFY( wbuf[2] == wct.widen(strlit[2]) ); +} + +int main() +{ + test03(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/bitset_members.cc b/libstdc++-v3/testsuite/23_containers/bitset_members.cc index 054018df662..82e3a487ea3 100644 --- a/libstdc++-v3/testsuite/23_containers/bitset_members.cc +++ b/libstdc++-v3/testsuite/23_containers/bitset_members.cc @@ -1,6 +1,6 @@ // 2001-06-03 pme -// Copyright (C) 2001, 2002 Free Software Foundation, Inc. +// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -55,6 +55,7 @@ void test02() void test03() { + bool test = true; std::bitset<5> b; std::stringstream ss ("101"); diff --git a/libstdc++-v3/testsuite/23_containers/map_insert.cc b/libstdc++-v3/testsuite/23_containers/map_insert.cc index d870897a6c7..67c838f993a 100644 --- a/libstdc++-v3/testsuite/23_containers/map_insert.cc +++ b/libstdc++-v3/testsuite/23_containers/map_insert.cc @@ -1,6 +1,6 @@ // 2001-08-23 pme & Sylvain.Pion@sophia.inria.fr -// Copyright (C) 2001 Free Software Foundation, Inc. +// Copyright (C) 2001, 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 @@ -29,6 +29,7 @@ // http://gcc.gnu.org/ml/gcc-patches/2001-08/msg01375.html void test01() { + bool test = true; typedef std::map<int, int> Map; Map M; Map::iterator hint; diff --git a/libstdc++-v3/testsuite/23_containers/vector_bool.cc b/libstdc++-v3/testsuite/23_containers/vector_bool.cc index 17d63d1f854..17836499cf9 100644 --- a/libstdc++-v3/testsuite/23_containers/vector_bool.cc +++ b/libstdc++-v3/testsuite/23_containers/vector_bool.cc @@ -1,6 +1,6 @@ // 2002-03-05 Stephen M. Webb <stephen.webb@bregmasoft.com> -// 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 @@ -32,6 +32,7 @@ void test01() // libstdc++/6886 void test02() { + bool test = true; typedef std::vector<bool> bvec; int i, num = 0; bvec v; diff --git a/libstdc++-v3/testsuite/24_iterators/istream_iterator.cc b/libstdc++-v3/testsuite/24_iterators/istream_iterator.cc index ce41ee67ec7..d278e1994b4 100644 --- a/libstdc++-v3/testsuite/24_iterators/istream_iterator.cc +++ b/libstdc++-v3/testsuite/24_iterators/istream_iterator.cc @@ -1,6 +1,6 @@ // 2001-06-25 Benjamin Kosnik <bkoz@redhat.com> -// Copyright (C) 2001 Free Software Foundation, Inc. +// Copyright (C) 2001, 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 @@ -53,6 +53,7 @@ template class std::istream_iterator<char>; void test02() { using namespace std; + bool test = true; string st("R.Rorty"); diff --git a/libstdc++-v3/testsuite/26_numerics/slice.cc b/libstdc++-v3/testsuite/26_numerics/slice.cc index 42b2adbaa53..a02c1f5801b 100644 --- a/libstdc++-v3/testsuite/26_numerics/slice.cc +++ b/libstdc++-v3/testsuite/26_numerics/slice.cc @@ -1,6 +1,6 @@ // 20020717 gdr -// 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 @@ -51,6 +51,7 @@ assignment(int start, int size, int stride) int main() { + bool test = true; std::srand(20020717); using std::rand; VERIFY(construction(rand(), rand(), rand())); diff --git a/libstdc++-v3/testsuite/26_numerics/slice_array_assignment.cc b/libstdc++-v3/testsuite/26_numerics/slice_array_assignment.cc index 52dcfe08336..a637b872b2e 100644 --- a/libstdc++-v3/testsuite/26_numerics/slice_array_assignment.cc +++ b/libstdc++-v3/testsuite/26_numerics/slice_array_assignment.cc @@ -1,6 +1,6 @@ // 20010613 gdr -// Copyright (C) 2001, 2002 Free Software Foundation, Inc. +// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -34,6 +34,7 @@ int main() { + bool test = true; using std::valarray; using std::slice; valarray<int> v(1, 10), w(2, 10); diff --git a/libstdc++-v3/testsuite/26_numerics/valarray_operators.cc b/libstdc++-v3/testsuite/26_numerics/valarray_operators.cc index 5753e471672..84c072a4895 100644 --- a/libstdc++-v3/testsuite/26_numerics/valarray_operators.cc +++ b/libstdc++-v3/testsuite/26_numerics/valarray_operators.cc @@ -24,6 +24,7 @@ void test01() // check unary operators { + bool test = true; std::valarray<int> u(1); u[0]=1; @@ -35,6 +36,7 @@ void test01() // check unary operators void test02() // check binary operators { + bool test = true; std::valarray<int> u(1), v(1); u[0]=1; v[0]=3; diff --git a/libstdc++-v3/testsuite/27_io/filebuf_virtuals.cc b/libstdc++-v3/testsuite/27_io/filebuf_virtuals.cc index 2bccbd99d5c..a88108635c3 100644 --- a/libstdc++-v3/testsuite/27_io/filebuf_virtuals.cc +++ b/libstdc++-v3/testsuite/27_io/filebuf_virtuals.cc @@ -546,6 +546,7 @@ class MyTraits : public std::char_traits<char> public: static bool eq(char c1, char c2) { + bool test = true; VERIFY( c1 != 'X' ); VERIFY( c2 != 'X' ); return std::char_traits<char>::eq(c1, c2); diff --git a/libstdc++-v3/testsuite/27_io/istream_exception.cc b/libstdc++-v3/testsuite/27_io/istream_exception.cc index 2c3b1217f2a..055c4fb02c5 100644 --- a/libstdc++-v3/testsuite/27_io/istream_exception.cc +++ b/libstdc++-v3/testsuite/27_io/istream_exception.cc @@ -40,6 +40,7 @@ struct buf: std::streambuf void test01() { using namespace std; + bool test = true; buf b; std::istream strm (&b); diff --git a/libstdc++-v3/testsuite/27_io/ostream_inserter_arith.cc b/libstdc++-v3/testsuite/27_io/ostream_inserter_arith.cc index 6f9719f306d..2523ab6241a 100644 --- a/libstdc++-v3/testsuite/27_io/ostream_inserter_arith.cc +++ b/libstdc++-v3/testsuite/27_io/ostream_inserter_arith.cc @@ -1,7 +1,7 @@ // 1999-11-15 Kevin Ediger <kediger@licor.com> // test the floating point inserters (facet num_put) -// Copyright (C) 1999, 2002 Free Software Foundation, Inc. +// Copyright (C) 1999, 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 @@ -360,6 +360,7 @@ test04() int test05() { + bool test = true; double pi = 3.14159265358979323846; ostringstream ostr; ostr.precision(20); @@ -377,6 +378,7 @@ test05() int test06() { + bool test = true; int prec = numeric_limits<double>::digits10 + 2; double oval = numeric_limits<double>::min(); diff --git a/libstdc++-v3/testsuite/27_io/stringbuf_virtuals.cc b/libstdc++-v3/testsuite/27_io/stringbuf_virtuals.cc index c172f32b9f5..40e95bae431 100644 --- a/libstdc++-v3/testsuite/27_io/stringbuf_virtuals.cc +++ b/libstdc++-v3/testsuite/27_io/stringbuf_virtuals.cc @@ -40,6 +40,7 @@ void test01() void test02(std::stringbuf& in, bool pass) { + bool test = true; using namespace std; typedef streambuf::pos_type pos_type; typedef streambuf::off_type off_type; |