diff options
Diffstat (limited to 'gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string')
137 files changed, 0 insertions, 11500 deletions
diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/append/char/1.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/append/char/1.cc deleted file mode 100644 index 850bd52b7..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/append/char/1.cc +++ /dev/null @@ -1,158 +0,0 @@ -// 1999-07-08 bkoz - -// Copyright (C) 1999, 2003, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.3.5.2 basic_string::append - -#include <string> -#include <stdexcept> -#include <testsuite_hooks.h> - -bool test01(void) -{ - bool test __attribute__((unused)) = true; - typedef std::string::size_type csize_type; - typedef std::string::const_reference cref; - typedef std::string::reference ref; - csize_type csz01; - - const char str_lit01[] = "point bolivar, texas"; - const std::string str01(str_lit01); - const std::string str02("corpus, "); - const std::string str03; - std::string str05; - - - // string& append(const string&) - str05 = str02; - str05.append(str05); - VERIFY( str05 == "corpus, corpus, " ); - str05.append(str01); - VERIFY( str05 == "corpus, corpus, point bolivar, texas" ); - str05.append(str03); - VERIFY( str05 == "corpus, corpus, point bolivar, texas" ); - std::string str06; - str06.append(str05); - VERIFY( str06 == str05 ); - - - // string& append(const string&, size_type pos, size_type n) - str05.erase(); - str06.erase(); - csz01 = str03.size(); - try { - str06.append(str03, csz01 + 1, 0); - VERIFY( false ); - } - catch(std::out_of_range& fail) { - VERIFY( true ); - } - catch(...) { - VERIFY( false ); - } - - csz01 = str01.size(); - try { - str06.append(str01, csz01 + 1, 0); - VERIFY( false ); - } - catch(std::out_of_range& fail) { - VERIFY( true ); - } - catch(...) { - VERIFY( false ); - } - - str05 = str02; - str05.append(str01, 0, std::string::npos); - VERIFY( str05 == "corpus, point bolivar, texas" ); - VERIFY( str05 != str02 ); - - str06 = str02; - str06.append(str01, 15, std::string::npos); - VERIFY( str06 == "corpus, texas" ); - VERIFY( str02 != str06 ); - - - // string& append(const char* s) - str05.erase(); - str06.erase(); - str05.append(""); - VERIFY( str05 == str03 ); - - str05.append(str_lit01); - VERIFY( str05 == str01 ); - - str06 = str02; - str06.append("corpus, "); - VERIFY( str06 == "corpus, corpus, " ); - - - // string& append(const char* s, size_type n) - str05.erase(); - str06.erase(); - str05.append("", 0); - VERIFY( str05.size() == 0 ); - VERIFY( str05 == str03 ); - - str05.append(str_lit01, sizeof(str_lit01) - 1); - VERIFY( str05 == str01 ); - - str06 = str02; - str06.append("corpus, ", 6); - VERIFY( str06 == "corpus, corpus" ); - - str06 = str02; - str06.append("corpus, ", 12); - VERIFY( str06 != "corpus, corpus, " ); - - - // string& append(size_type n, char c) - str05.erase(); - str06.erase(); - str05.append(0, 'a'); - VERIFY( str05 == str03 ); - str06.append(8, '.'); - VERIFY( str06 == "........" ); - - - // template<typename InputIter> - // string& append(InputIter first, InputIter last) - str05.erase(); - str06.erase(); - str05.append(str03.begin(), str03.end()); - VERIFY( str05 == str03 ); - - str06 = str02; - str06.append(str01.begin(), str01.begin() + str01.find('r')); - VERIFY( str06 == "corpus, point boliva" ); - VERIFY( str06 != str01 ); - VERIFY( str06 != str02 ); - - str05 = str01; - str05.append(str05.begin(), str05.begin() + str05.find('r')); - VERIFY( str05 == "point bolivar, texaspoint boliva" ); - VERIFY( str05 != str01 ); - return test; -} - -int main() -{ - test01(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/append/char/2.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/append/char/2.cc deleted file mode 100644 index acfe69d2b..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/append/char/2.cc +++ /dev/null @@ -1,66 +0,0 @@ -// 2004-25-10 Paolo Carlini <pcarlini@suse.de> - -// Copyright (C) 2004, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.3.5 string modifiers - -#include <string> -#include <testsuite_hooks.h> - -// append(const _CharT* __s, size_type __n) -// append(const _CharT* __s) -void -test02() -{ - bool test __attribute__((unused)) = true; - - using namespace std; - - string one; - string two; - string three; - const char * source = "Written in your eyes"; - - one.append(source); - VERIFY( one == "Written in your eyes" ); - - two.append(source, 20); - VERIFY( two == "Written in your eyes" ); - - three.append(source, 7); - VERIFY( three == "Written" ); - - three.clear(); - three.append(source + 8, 2); - VERIFY( three == "in" ); - - one.append(one.c_str(), 20); - VERIFY( one == "Written in your eyesWritten in your eyes" ); - - two.append(two.c_str() + 16, 4); - VERIFY( two == "Written in your eyeseyes" ); - - two.append(two.c_str(), 3); - VERIFY( two == "Written in your eyeseyesWri" ); -} - -int main() -{ - test02(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/append/char/3.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/append/char/3.cc deleted file mode 100644 index 00f2179aa..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/append/char/3.cc +++ /dev/null @@ -1,55 +0,0 @@ -// 2004-25-10 Paolo Carlini <pcarlini@suse.de> - -// Copyright (C) 2004, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.3.5 string modifiers - -#include <string> -#include <testsuite_hooks.h> - -// Upon reallocation (basic_string::reserve) we were copying from -// deallocated memory. -void -test03() -{ - bool test __attribute__((unused)) = true; - - using namespace std; - - const char * source = "Kesto"; - - for (unsigned i = 0; i < 10; ++i) - { - string one(source); - string two(source); - for (unsigned j = 0; j < 18; ++j) - { - VERIFY( one == two ); - one.append(one); - one += 'x'; - two.append(two.c_str(), two.size()); - two += 'x'; - } - } -} - -int main() -{ - test03(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/append/wchar_t/1.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/append/wchar_t/1.cc deleted file mode 100644 index 81c388980..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/append/wchar_t/1.cc +++ /dev/null @@ -1,158 +0,0 @@ -// 1999-07-08 bkoz - -// Copyright (C) 1999, 2003, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.3.5.2 basic_string::append - -#include <string> -#include <stdexcept> -#include <testsuite_hooks.h> - -bool test01(void) -{ - bool test __attribute__((unused)) = true; - typedef std::wstring::size_type csize_type; - typedef std::wstring::const_reference cref; - typedef std::wstring::reference ref; - csize_type csz01; - - const wchar_t str_lit01[] = L"point bolivar, texas"; - const std::wstring str01(str_lit01); - const std::wstring str02(L"corpus, "); - const std::wstring str03; - std::wstring str05; - - - // wstring& append(const wstring&) - str05 = str02; - str05.append(str05); - VERIFY( str05 == L"corpus, corpus, " ); - str05.append(str01); - VERIFY( str05 == L"corpus, corpus, point bolivar, texas" ); - str05.append(str03); - VERIFY( str05 == L"corpus, corpus, point bolivar, texas" ); - std::wstring str06; - str06.append(str05); - VERIFY( str06 == str05 ); - - - // wstring& append(const wstring&, size_type pos, size_type n) - str05.erase(); - str06.erase(); - csz01 = str03.size(); - try { - str06.append(str03, csz01 + 1, 0); - VERIFY( false ); - } - catch(std::out_of_range& fail) { - VERIFY( true ); - } - catch(...) { - VERIFY( false ); - } - - csz01 = str01.size(); - try { - str06.append(str01, csz01 + 1, 0); - VERIFY( false ); - } - catch(std::out_of_range& fail) { - VERIFY( true ); - } - catch(...) { - VERIFY( false ); - } - - str05 = str02; - str05.append(str01, 0, std::wstring::npos); - VERIFY( str05 == L"corpus, point bolivar, texas" ); - VERIFY( str05 != str02 ); - - str06 = str02; - str06.append(str01, 15, std::wstring::npos); - VERIFY( str06 == L"corpus, texas" ); - VERIFY( str02 != str06 ); - - - // wstring& append(const wchar_t* s) - str05.erase(); - str06.erase(); - str05.append(L""); - VERIFY( str05 == str03 ); - - str05.append(str_lit01); - VERIFY( str05 == str01 ); - - str06 = str02; - str06.append(L"corpus, "); - VERIFY( str06 == L"corpus, corpus, " ); - - - // wstring& append(const wchar_t* s, size_type n) - str05.erase(); - str06.erase(); - str05.append(L"", 0); - VERIFY( str05.size() == 0 ); - VERIFY( str05 == str03 ); - - str05.append(str_lit01, sizeof(str_lit01) / sizeof(wchar_t) - 1); - VERIFY( str05 == str01 ); - - str06 = str02; - str06.append(L"corpus, ", 6); - VERIFY( str06 == L"corpus, corpus" ); - - str06 = str02; - str06.append(L"corpus, ", 12); - VERIFY( str06 != L"corpus, corpus, " ); - - - // wstring& append(size_type n, char c) - str05.erase(); - str06.erase(); - str05.append(0, L'a'); - VERIFY( str05 == str03 ); - str06.append(8, L'.'); - VERIFY( str06 == L"........" ); - - - // template<typename InputIter> - // wstring& append(InputIter first, InputIter last) - str05.erase(); - str06.erase(); - str05.append(str03.begin(), str03.end()); - VERIFY( str05 == str03 ); - - str06 = str02; - str06.append(str01.begin(), str01.begin() + str01.find(L'r')); - VERIFY( str06 == L"corpus, point boliva" ); - VERIFY( str06 != str01 ); - VERIFY( str06 != str02 ); - - str05 = str01; - str05.append(str05.begin(), str05.begin() + str05.find(L'r')); - VERIFY( str05 == L"point bolivar, texaspoint boliva" ); - VERIFY( str05 != str01 ); - return test; -} - -int main() -{ - test01(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/append/wchar_t/2.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/append/wchar_t/2.cc deleted file mode 100644 index 3b30d412a..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/append/wchar_t/2.cc +++ /dev/null @@ -1,66 +0,0 @@ -// 2004-25-10 Paolo Carlini <pcarlini@suse.de> - -// Copyright (C) 2004, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.3.5 string modifiers - -#include <string> -#include <testsuite_hooks.h> - -// append(const _CharT* __s, size_type __n) -// append(const _CharT* __s) -void -test02() -{ - bool test __attribute__((unused)) = true; - - using namespace std; - - wstring one; - wstring two; - wstring three; - const wchar_t * source = L"Written in your eyes"; - - one.append(source); - VERIFY( one == L"Written in your eyes" ); - - two.append(source, 20); - VERIFY( two == L"Written in your eyes" ); - - three.append(source, 7); - VERIFY( three == L"Written" ); - - three.clear(); - three.append(source + 8, 2); - VERIFY( three == L"in" ); - - one.append(one.c_str(), 20); - VERIFY( one == L"Written in your eyesWritten in your eyes" ); - - two.append(two.c_str() + 16, 4); - VERIFY( two == L"Written in your eyeseyes" ); - - two.append(two.c_str(), 3); - VERIFY( two == L"Written in your eyeseyesWri" ); -} - -int main() -{ - test02(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/append/wchar_t/3.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/append/wchar_t/3.cc deleted file mode 100644 index dca5dbdaf..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/append/wchar_t/3.cc +++ /dev/null @@ -1,55 +0,0 @@ -// 2004-25-10 Paolo Carlini <pcarlini@suse.de> - -// Copyright (C) 2004, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.3.5 string modifiers - -#include <string> -#include <testsuite_hooks.h> - -// Upon reallocation (basic_string::reserve) we were copying from -// deallocated memory. -void -test03() -{ - bool test __attribute__((unused)) = true; - - using namespace std; - - const wchar_t * source = L"Kesto"; - - for (unsigned i = 0; i < 10; ++i) - { - wstring one(source); - wstring two(source); - for (unsigned j = 0; j < 18; ++j) - { - VERIFY( one == two ); - one.append(one); - one += L'x'; - two.append(two.c_str(), two.size()); - two += L'x'; - } - } -} - -int main() -{ - test03(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/assign/char/1.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/assign/char/1.cc deleted file mode 100644 index 8d3208daf..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/assign/char/1.cc +++ /dev/null @@ -1,55 +0,0 @@ -// 2001-10-30 Benjamin Kosnik <bkoz@redhat.com> - -// Copyright (C) 2001, 2003, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.3.5 string modifiers - -#include <string> -#include <cstdio> -#include <testsuite_hooks.h> - -void -test01() -{ - bool test __attribute__((unused)) = true; - - using namespace std; - - const char* strlit = "../the long pier/Hanalei Bay/Kauai/Hawaii"; - string aux = strlit; - string::size_type i = aux.rfind("/"); - if (i != string::npos) - aux.assign(aux, i + 1, string::npos); - VERIFY(aux == "Hawaii"); - - aux = strlit; - i = aux.rfind("r/"); - if (i != string::npos) - aux.assign(aux, i + 1, string::npos); - VERIFY(aux.c_str()[9] == 'B'); - VERIFY(aux == "/Hanalei Bay/Kauai/Hawaii"); - - aux.assign(10, 0); - VERIFY(aux.length() == 10); -} - -int main() -{ - test01(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/assign/char/2.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/assign/char/2.cc deleted file mode 100644 index 56ab4d280..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/assign/char/2.cc +++ /dev/null @@ -1,58 +0,0 @@ -// 2001-10-30 Benjamin Kosnik <bkoz@redhat.com> - -// Copyright (C) 2001, 2003, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.3.5 string modifiers - -#include <string> -#include <cstdio> -#include <testsuite_hooks.h> - -// assign(const basic_string& __str, size_type __pos, size_type __n) -void -test02() -{ - bool test __attribute__((unused)) = true; - - using namespace std; - - string one = "Selling England by the pound"; - string two = one; - string three = "Brilliant trees"; - - one.assign(one, 8, 100); - VERIFY( one == "England by the pound" ); - - one.assign(one, 8, 0); - VERIFY( one == "" ); - - one.assign(two, 8, 7); - VERIFY( one == "England" ); - - one.assign(three, 10, 100); - VERIFY( one == "trees" ); - - three.assign(one, 0, 3); - VERIFY( three == "tre" ); -} - -int main() -{ - test02(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/assign/char/3.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/assign/char/3.cc deleted file mode 100644 index 45e3fbabc..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/assign/char/3.cc +++ /dev/null @@ -1,58 +0,0 @@ -// 2001-10-30 Benjamin Kosnik <bkoz@redhat.com> - -// Copyright (C) 2001, 2003, 2004, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.3.5 string modifiers - -#include <string> -#include <testsuite_hooks.h> - -// assign(const _CharT* __s, size_type __n) -// assign(const _CharT* __s) -void -test03() -{ - bool test __attribute__((unused)) = true; - - using namespace std; - - string one; - string two; - const char * source = "Selling England by the pound"; - - one.assign(source); - VERIFY( one == "Selling England by the pound" ); - - one.assign(source, 28); - VERIFY( one == "Selling England by the pound" ); - - two.assign(source, 7); - VERIFY( two == "Selling" ); - - one.assign(one.c_str() + 8, 20); - VERIFY( one == "England by the pound" ); - - one.assign(one.c_str() + 8, 6); - VERIFY( one == "by the" ); -} - -int main() -{ - test03(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/assign/wchar_t/1.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/assign/wchar_t/1.cc deleted file mode 100644 index ebc02e4b4..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/assign/wchar_t/1.cc +++ /dev/null @@ -1,52 +0,0 @@ -// 2001-10-30 Benjamin Kosnik <bkoz@redhat.com> - -// Copyright (C) 2001, 2003, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.3.5 string modifiers - -#include <string> -#include <cstdio> -#include <testsuite_hooks.h> - -void -test01() -{ - bool test __attribute__((unused)) = true; - - using namespace std; - - const wchar_t* strlit = L"../the long pier/Hanalei Bay/Kauai/Hawaii"; - wstring aux = strlit; - wstring::size_type i = aux.rfind(L"/"); - if (i != wstring::npos) - aux.assign(aux, i + 1, wstring::npos); - VERIFY(aux == L"Hawaii"); - - aux = strlit; - i = aux.rfind(L"r/"); - if (i != wstring::npos) - aux.assign(aux, i + 1, wstring::npos); - VERIFY(aux.c_str()[9] == L'B'); - VERIFY(aux == L"/Hanalei Bay/Kauai/Hawaii"); -} - -int main() -{ - test01(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/assign/wchar_t/2.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/assign/wchar_t/2.cc deleted file mode 100644 index ec5351254..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/assign/wchar_t/2.cc +++ /dev/null @@ -1,58 +0,0 @@ -// 2001-10-30 Benjamin Kosnik <bkoz@redhat.com> - -// Copyright (C) 2001, 2003, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.3.5 string modifiers - -#include <string> -#include <cstdio> -#include <testsuite_hooks.h> - -// assign(const basic_string& __str, size_type __pos, size_type __n) -void -test02() -{ - bool test __attribute__((unused)) = true; - - using namespace std; - - wstring one = L"Selling England by the pound"; - wstring two = one; - wstring three = L"Brilliant trees"; - - one.assign(one, 8, 100); - VERIFY( one == L"England by the pound" ); - - one.assign(one, 8, 0); - VERIFY( one == L"" ); - - one.assign(two, 8, 7); - VERIFY( one == L"England" ); - - one.assign(three, 10, 100); - VERIFY( one == L"trees" ); - - three.assign(one, 0, 3); - VERIFY( three == L"tre" ); -} - -int main() -{ - test02(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/assign/wchar_t/3.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/assign/wchar_t/3.cc deleted file mode 100644 index ef56a795c..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/assign/wchar_t/3.cc +++ /dev/null @@ -1,58 +0,0 @@ -// 2001-10-30 Benjamin Kosnik <bkoz@redhat.com> - -// Copyright (C) 2001, 2003, 2004, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.3.5 string modifiers - -#include <string> -#include <testsuite_hooks.h> - -// assign(const _CharT* __s, size_type __n) -// assign(const _CharT* __s) -void -test03() -{ - bool test __attribute__((unused)) = true; - - using namespace std; - - wstring one; - wstring two; - const wchar_t* source = L"Selling England by the pound"; - - one.assign(source); - VERIFY( one == L"Selling England by the pound" ); - - one.assign(source, 28); - VERIFY( one == L"Selling England by the pound" ); - - two.assign(source, 7); - VERIFY( two == L"Selling" ); - - one.assign(one.c_str() + 8, 20); - VERIFY( one == L"England by the pound" ); - - one.assign(one.c_str() + 8, 6); - VERIFY( one == L"by the" ); -} - -int main() -{ - test03(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/capacity/1.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/capacity/1.cc deleted file mode 100644 index 64c5869b1..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/capacity/1.cc +++ /dev/null @@ -1,200 +0,0 @@ -// 1999-05-11 bkoz - -// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009 -// 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.3.3 string capacity - -#include <string> -#include <cstring> -#include <testsuite_hooks.h> - -template<typename T> - struct A { }; - -template<typename T> - bool - operator==(const A<T>&, const A<T>&) { return true; } - -template<typename T> - bool - operator<(const A<T>&, const A<T>&) { return true; } - -struct B { }; - -// char_traits specialization -namespace std -{ - template<> - struct char_traits<A<B> > - { - typedef A<B> char_type; - // Unsigned as wint_t in unsigned. - typedef unsigned long int_type; - typedef streampos pos_type; - typedef streamoff off_type; - typedef mbstate_t state_type; - - static void - assign(char_type& __c1, const char_type& __c2) - { __c1 = __c2; } - - static bool - eq(const char_type& __c1, const char_type& __c2) - { return __c1 == __c2; } - - static bool - lt(const char_type& __c1, const char_type& __c2) - { return __c1 < __c2; } - - static int - compare(const char_type* __s1, const char_type* __s2, size_t __n) - { - for (size_t __i = 0; __i < __n; ++__i) - if (!eq(__s1[__i], __s2[__i])) - return lt(__s1[__i], __s2[__i]) ? -1 : 1; - return 0; - } - - static size_t - length(const char_type* __s) - { - const char_type* __p = __s; - while (__p) - ++__p; - return (__p - __s); - } - - static const char_type* - find(const char_type* __s, size_t __n, const char_type& __a) - { - for (const char_type* __p = __s; size_t(__p - __s) < __n; ++__p) - if (*__p == __a) return __p; - return 0; - } - - static char_type* - move(char_type* __s1, const char_type* __s2, size_t __n) - { return (char_type*) memmove(__s1, __s2, __n * sizeof(char_type)); } - - static char_type* - copy(char_type* __s1, const char_type* __s2, size_t __n) - { return (char_type*) memcpy(__s1, __s2, __n * sizeof(char_type)); } - - static char_type* - assign(char_type* __s, size_t __n, char_type __a) - { - for (char_type* __p = __s; __p < __s + __n; ++__p) - assign(*__p, __a); - return __s; - } - - static char_type - to_char_type(const int_type&) - { return char_type(); } - - static int_type - to_int_type(const char_type&) { return int_type(); } - - static bool - eq_int_type(const int_type& __c1, const int_type& __c2) - { return __c1 == __c2; } - - static int_type - eof() { return static_cast<int_type>(-1); } - - static int_type - not_eof(const int_type& __c) - { return eq_int_type(__c, eof()) ? int_type(0) : __c; } - }; -} // namespace std - -void test01() -{ - bool test __attribute__((unused)) = true; - - // non POD types : resize, capacity, reserve - std::basic_string< A<B> > str02; - typedef std::basic_string< A<B> >::size_type size_type_o; - size_type_o sz03; - size_type_o sz04; - - sz03 = str02.capacity(); - str02.reserve(100); - sz04 = str02.capacity(); - VERIFY( sz04 >= sz03 ); - VERIFY( sz04 >= 100 ); - str02.reserve(); - sz03 = str02.capacity(); - VERIFY( sz03 == 0 ); - - sz03 = str02.size() + 5; - str02.resize(sz03); - sz04 = str02.size(); - VERIFY( sz03 == sz04 ); - - sz03 = str02.size() - 5; - str02.resize(sz03); - sz04 = str02.size(); - VERIFY( sz03 == sz04 ); - - A<B> inst_obj; - std::basic_string<A<B> > str07(30, inst_obj); - std::basic_string<A<B> > str08 = str07; - str07 = str08 + str07; - VERIFY( str07.capacity() >= str07.size() ); - VERIFY( str08.capacity() >= str08.size() ); - - // non-POD types: size, length, max_size, clear(), empty() - bool b01 = str02.empty(); - VERIFY( b01 == true ); - sz03 = str02.size(); - sz04 = str02.length(); - VERIFY( sz03 == sz04 ); - str02.c_str(); - sz03 = str02.size(); - sz04 = str02.length(); - VERIFY( sz03 == sz04 ); - - sz03 = str02.max_size(); - VERIFY( sz03 >= sz04 ); - - sz03 = str02.size(); - str02.clear(); - b01 = str02.empty(); - VERIFY( b01 == true ); - sz04 = str02.size(); - VERIFY( sz03 >= sz04 ); -} - -#if !__GXX_WEAK__ -// Explicitly instantiate for systems with no COMDAT or weak support. -template - const std::basic_string< A<B> >::size_type - std::basic_string< A<B> >::_Rep::_S_max_size; - -template - const A<B> - std::basic_string< A<B> >::_Rep::_S_terminal; -#endif - -int main() -{ - test01(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/capacity/char/1.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/capacity/char/1.cc deleted file mode 100644 index 2bd36ebf9..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/capacity/char/1.cc +++ /dev/null @@ -1,99 +0,0 @@ -// 1999-05-11 bkoz - -// Copyright (C) 1999, 2002, 2003, 2004, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.3.3 string capacity - -#include <string> -#include <testsuite_hooks.h> - -void test01() -{ - // POD types : resize, capacity, reserve - bool test __attribute__((unused)) = true; - std::string str01; - typedef std::string::size_type size_type_s; - - size_type_s sz01 = str01.capacity(); - str01.reserve(100); - size_type_s sz02 = str01.capacity(); - VERIFY( sz02 >= sz01 ); - VERIFY( sz02 >= 100 ); - str01.reserve(); - sz01 = str01.capacity(); - VERIFY( sz01 == 0 ); - - sz01 = str01.size() + 5; - str01.resize(sz01); - sz02 = str01.size(); - VERIFY( sz01 == sz02 ); - - sz01 = str01.size() - 5; - str01.resize(sz01); - sz02 = str01.size(); - VERIFY( sz01 == sz02 ); - - std::string str05(30, 'q'); - std::string str06 = str05; - str05 = str06 + str05; - VERIFY( str05.capacity() >= str05.size() ); - VERIFY( str06.capacity() >= str06.size() ); - - // POD types: size, length, max_size, clear(), empty() - bool b01; - std::string str011; - b01 = str01.empty(); - VERIFY( b01 == true ); - sz01 = str01.size(); - sz02 = str01.length(); - VERIFY( sz01 == sz02 ); - str01.c_str(); - sz01 = str01.size(); - sz02 = str01.length(); - VERIFY( sz01 == sz02 ); - - sz01 = str01.length(); - str01.c_str(); - str011 = str01 + "_addendum_"; - str01.c_str(); - sz02 = str01.length(); - VERIFY( sz01 == sz02 ); - sz02 = str011.length(); - VERIFY( sz02 > sz01 ); - - // trickster allocator issues involved with these: - std::string str3 = "8-chars_8-chars_"; - std::string str4 = str3 + "7-chars"; - - sz01 = str01.size(); - sz02 = str01.max_size(); - VERIFY( sz02 >= sz01 ); - - sz01 = str01.size(); - str01.clear(); - b01 = str01.empty(); - VERIFY( b01 == true ); - sz02 = str01.size(); - VERIFY( sz01 >= sz02 ); -} - -int main() -{ - test01(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/capacity/char/18654.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/capacity/char/18654.cc deleted file mode 100644 index e9fa200a5..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/capacity/char/18654.cc +++ /dev/null @@ -1,55 +0,0 @@ -// 2004-11-29 Paolo Carlini <pcarlini@suse.de> - -// Copyright (C) 2004, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.3.3 string capacity - -#include <string> -#include <testsuite_hooks.h> - -// libstdc++/18654 -void test01() -{ - using namespace std; - bool test __attribute__((unused)) = true; - - typedef string::size_type size_type; - - // Our current implementation provides exact shrink-to-size - // and shrink-to-fit (in the future, maybe this will change - // for short strings). - const size_type minsize = 2 << 0; - const size_type maxsize = 2 << 20; - for (size_type i = minsize; i <= maxsize; i *= 2) - { - string str(i, 'x'); - str.reserve(3 * i); - - str.reserve(2 * i); - VERIFY( str.capacity() == 2 * i ); - - str.reserve(); - VERIFY( str.capacity() == i ); - } -} - -int main() -{ - test01(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/capacity/char/2.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/capacity/char/2.cc deleted file mode 100644 index dd7574b45..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/capacity/char/2.cc +++ /dev/null @@ -1,42 +0,0 @@ -// 1999-05-11 bkoz - -// Copyright (C) 1999, 2002, 2003, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.3.3 string capacity - -#include <string> -#include <testsuite_hooks.h> - -// libstdc++/4548 -// http://gcc.gnu.org/ml/libstdc++/2001-11/msg00150.html -void test02() -{ - bool test __attribute__((unused)) = true; - - std::string str01 = "twelve chars"; - // str01 becomes shared - std::string str02 = str01; - str01.reserve(1); - VERIFY( str01.capacity() == 12 ); -} - -int main() -{ - test02(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/capacity/wchar_t/1.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/capacity/wchar_t/1.cc deleted file mode 100644 index 427240235..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/capacity/wchar_t/1.cc +++ /dev/null @@ -1,99 +0,0 @@ -// 1999-05-11 bkoz - -// Copyright (C) 1999, 2002, 2003, 2004, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.3.3 string capacity - -#include <string> -#include <testsuite_hooks.h> - -void test01() -{ - // POD types : resize, capacity, reserve - bool test __attribute__((unused)) = true; - std::wstring str01; - typedef std::wstring::size_type size_type_s; - - size_type_s sz01 = str01.capacity(); - str01.reserve(100); - size_type_s sz02 = str01.capacity(); - VERIFY( sz02 >= sz01 ); - VERIFY( sz02 >= 100 ); - str01.reserve(); - sz01 = str01.capacity(); - VERIFY( sz01 == 0 ); - - sz01 = str01.size() + 5; - str01.resize(sz01); - sz02 = str01.size(); - VERIFY( sz01 == sz02 ); - - sz01 = str01.size() - 5; - str01.resize(sz01); - sz02 = str01.size(); - VERIFY( sz01 == sz02 ); - - std::wstring str05(30, L'q'); - std::wstring str06 = str05; - str05 = str06 + str05; - VERIFY( str05.capacity() >= str05.size() ); - VERIFY( str06.capacity() >= str06.size() ); - - // POD types: size, length, max_size, clear(), empty() - bool b01; - std::wstring str011; - b01 = str01.empty(); - VERIFY( b01 == true ); - sz01 = str01.size(); - sz02 = str01.length(); - VERIFY( sz01 == sz02 ); - str01.c_str(); - sz01 = str01.size(); - sz02 = str01.length(); - VERIFY( sz01 == sz02 ); - - sz01 = str01.length(); - str01.c_str(); - str011 = str01 + L"_addendum_"; - str01.c_str(); - sz02 = str01.length(); - VERIFY( sz01 == sz02 ); - sz02 = str011.length(); - VERIFY( sz02 > sz01 ); - - // trickster allocator issues involved with these: - std::wstring str3 = L"8-chars_8-chars_"; - std::wstring str4 = str3 + L"7-chars"; - - sz01 = str01.size(); - sz02 = str01.max_size(); - VERIFY( sz02 >= sz01 ); - - sz01 = str01.size(); - str01.clear(); - b01 = str01.empty(); - VERIFY( b01 == true ); - sz02 = str01.size(); - VERIFY( sz01 >= sz02 ); -} - -int main() -{ - test01(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/capacity/wchar_t/18654.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/capacity/wchar_t/18654.cc deleted file mode 100644 index fd5117576..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/capacity/wchar_t/18654.cc +++ /dev/null @@ -1,55 +0,0 @@ -// 2004-11-29 Paolo Carlini <pcarlini@suse.de> - -// Copyright (C) 2004, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.3.3 string capacity - -#include <string> -#include <testsuite_hooks.h> - -// libstdc++/18654 -void test01() -{ - using namespace std; - bool test __attribute__((unused)) = true; - - typedef wstring::size_type size_type; - - // Our current implementation provides exact shrink-to-size - // and shrink-to-fit (in the future, maybe this will change - // for short strings). - const size_type minsize = 2 << 0; - const size_type maxsize = 2 << 20; - for (size_type i = minsize; i <= maxsize; i *= 2) - { - wstring str(i, L'x'); - str.reserve(3 * i); - - str.reserve(2 * i); - VERIFY( str.capacity() == 2 * i ); - - str.reserve(); - VERIFY( str.capacity() == i ); - } -} - -int main() -{ - test01(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/capacity/wchar_t/2.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/capacity/wchar_t/2.cc deleted file mode 100644 index 564a3219f..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/capacity/wchar_t/2.cc +++ /dev/null @@ -1,42 +0,0 @@ -// 1999-05-11 bkoz - -// Copyright (C) 1999, 2002, 2003, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.3.3 string capacity - -#include <string> -#include <testsuite_hooks.h> - -// libstdc++/4548 -// http://gcc.gnu.org/ml/libstdc++/2001-11/msg00150.html -void test02() -{ - bool test __attribute__((unused)) = true; - - std::wstring str01 = L"twelve chars"; - // str01 becomes shared - std::wstring str02 = str01; - str01.reserve(1); - VERIFY( str01.capacity() == 12 ); -} - -int main() -{ - test02(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/compare/char/1.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/compare/char/1.cc deleted file mode 100644 index d58b02336..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/compare/char/1.cc +++ /dev/null @@ -1,135 +0,0 @@ -// 980930 bkoz work with libstdc++v3 - -// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, -// 2006, 2007, 2009 -// 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.3.6.8 basic_string::compare -// int compare(const basic_string& str) const; -// int compare(size_type pos1, size_type n1, const basic_string& str) const; -// int compare(size_type pos1, size_type n1, const basic_string& str, -// size_type pos2, size_type n2) const; -// int compare(const charT* s) const; -// int compare(size_type pos1, size_type n1, -// const charT* s, size_type n2 = npos) const; - -// NB compare should be thought of as a lexographical compare, ie how -// things would be sorted in a dictionary. - -#include <string> -#include <cstring> -#include <testsuite_hooks.h> - -enum want_value {lt=0, z=1, gt=2}; - -int -test_value(int result, want_value expected); - -int -test_value(int result, want_value expected) -{ - bool test __attribute__((unused)) = true; - bool pass = false; - - switch (expected) { - case lt: - if (result < 0) - pass = true; - break; - case z: - if (!result) - pass = true; - break; - case gt: - if (result > 0) - pass = true; - break; - default: - pass = false; //should not get here - } - VERIFY(pass); - return 0; -} - - -int -test01() -{ - using namespace std; - - string str_0("costa rica"); - string str_1("costa marbella"); - string str_2; - - //sanity check - test_value(strcmp("costa marbella", "costa rica"), lt); - test_value(strcmp("costa rica", "costa rica"), z); - test_value(strcmp(str_1.data(), str_0.data()), lt); - test_value(strcmp(str_0.data(), str_1.data()), gt); - test_value(strncmp(str_1.data(), str_0.data(), 6), z); - test_value(strncmp(str_1.data(), str_0.data(), 14), lt); - test_value(memcmp(str_1.data(), str_0.data(), 6), z); - test_value(memcmp(str_1.data(), str_0.data(), 14), lt); - test_value(memcmp("costa marbella", "costa rica", 14), lt); - - // int compare(const basic_string& str) const; - test_value(str_0.compare(str_1), gt); //because r>m - test_value(str_1.compare(str_0), lt); //because m<r - str_2 = str_0; - test_value(str_2.compare(str_0), z); - str_2 = "cost"; - test_value(str_2.compare(str_0), lt); - str_2 = "costa ricans"; - test_value(str_2.compare(str_0), gt); - - // int compare(size_type pos1, size_type n1, const basic_string& str) const; - test_value(str_1.compare(0, 6, str_0), lt); - str_2 = "cost"; - test_value(str_1.compare(0, 4, str_2), z); - test_value(str_1.compare(0, 5, str_2), gt); - - // int compare(size_type pos1, size_type n1, const basic_string& str, - // size_type pos2, size_type n2) const; - test_value(str_1.compare(0, 6, str_0, 0, 6), z); - test_value(str_1.compare(0, 7, str_0, 0, 7), lt); - test_value(str_0.compare(0, 7, str_1, 0, 7), gt); - - // int compare(const charT* s) const; - test_value(str_0.compare("costa marbella"), gt); - test_value(str_1.compare("costa rica"), lt); - str_2 = str_0; - test_value(str_2.compare("costa rica"), z); - test_value(str_2.compare("cost"), gt); - test_value(str_2.compare("costa ricans"), lt); - - // int compare(size_type pos, size_type n1, const charT* str, - // size_type n2 = npos) const; - test_value(str_1.compare(0, 6, "costa rica", 0, 6), z); - test_value(str_1.compare(0, 7, "costa rica", 0, 7), lt); - test_value(str_0.compare(0, 7, "costa marbella", 0, 7), gt); - - return 0; -} - - -int -main() -{ - test01(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/compare/char/13650.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/compare/char/13650.cc deleted file mode 100644 index e930c2ef2..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/compare/char/13650.cc +++ /dev/null @@ -1,47 +0,0 @@ -// 2004-01-13 Paolo Carlini <pcarlini@suse.de> - -// Copyright (C) 2004, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.3.6.8 basic_string::compare [lib.string::compare] - -#include <string> -#include <testsuite_hooks.h> - -// libstdc++/13650 -void test01() -{ - using namespace std; - bool test __attribute__((unused)) = true; - - const char lit_01[] = { 'w', 'e', '\0', 'r', 'd' }; - const char lit_02[] = { 'w', 'e', 'i', '\0', 'd' }; - - const char lit_ref_a[] = { 'w', 'e', '\0', 'q', 'd' }; - const string str_a(lit_ref_a, 5); - VERIFY( str_a.compare(0, 5, lit_01, 5) < 0 ); - - const char lit_ref_b[] = { 'w', 'e', 'i' }; - const string str_b(lit_ref_b, 3); - VERIFY( str_b.compare(0, 3, lit_02, 5) < 0 ); -} - -int main() -{ - test01(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/compare/wchar_t/1.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/compare/wchar_t/1.cc deleted file mode 100644 index 78cb0db4d..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/compare/wchar_t/1.cc +++ /dev/null @@ -1,133 +0,0 @@ -// 980930 bkoz work with libstdc++v3 - -// Copyright (C) 1998, 1999, 2003, 2004, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.3.6.8 basic_string::compare -// int compare(const basic_string& str) const; -// int compare(size_type pos1, size_type n1, const basic_string& str) const; -// int compare(size_type pos1, size_type n1, const basic_string& str, -// size_type pos2, size_type n2) const; -// int compare(const charT* s) const; -// int compare(size_type pos1, size_type n1, -// const charT* s, size_type n2 = npos) const; - -// NB compare should be thought of as a lexographical compare, ie how -// things would be sorted in a dictionary. - -#include <string> -#include <testsuite_hooks.h> - -enum want_value {lt=0, z=1, gt=2}; - -int -test_value(int result, want_value expected); - -int -test_value(int result, want_value expected) -{ - bool test __attribute__((unused)) = true; - bool pass = false; - - switch (expected) { - case lt: - if (result < 0) - pass = true; - break; - case z: - if (!result) - pass = true; - break; - case gt: - if (result > 0) - pass = true; - break; - default: - pass = false; //should not get here - } - - VERIFY(pass); - return 0; -} - - -int -test01() -{ - using namespace std; - - wstring str_0(L"costa rica"); - wstring str_1(L"costa marbella"); - wstring str_2; - - //sanity check - test_value(wcscmp(L"costa marbella", L"costa rica"), lt); - test_value(wcscmp(L"costa rica", L"costa rica"), z); - test_value(wcscmp(str_1.data(), str_0.data()), lt); - test_value(wcscmp(str_0.data(), str_1.data()), gt); - test_value(wcsncmp(str_1.data(), str_0.data(), 6), z); - test_value(wcsncmp(str_1.data(), str_0.data(), 14), lt); - test_value(wmemcmp(str_1.data(), str_0.data(), 6), z); - test_value(wmemcmp(str_1.data(), str_0.data(), 14), lt); - test_value(wmemcmp(L"costa marbella", L"costa rica", 14), lt); - - // int compare(const basic_string& str) const; - test_value(str_0.compare(str_1), gt); //because r>m - test_value(str_1.compare(str_0), lt); //because m<r - str_2 = str_0; - test_value(str_2.compare(str_0), z); - str_2 = L"cost"; - test_value(str_2.compare(str_0), lt); - str_2 = L"costa ricans"; - test_value(str_2.compare(str_0), gt); - - // int compare(size_type pos1, size_type n1, const basic_string& str) const; - test_value(str_1.compare(0, 6, str_0), lt); - str_2 = L"cost"; - test_value(str_1.compare(0, 4, str_2), z); - test_value(str_1.compare(0, 5, str_2), gt); - - // int compare(size_type pos1, size_type n1, const basic_string& str, - // size_type pos2, size_type n2) const; - test_value(str_1.compare(0, 6, str_0, 0, 6), z); - test_value(str_1.compare(0, 7, str_0, 0, 7), lt); - test_value(str_0.compare(0, 7, str_1, 0, 7), gt); - - // int compare(const charT* s) const; - test_value(str_0.compare(L"costa marbella"), gt); - test_value(str_1.compare(L"costa rica"), lt); - str_2 = str_0; - test_value(str_2.compare(L"costa rica"), z); - test_value(str_2.compare(L"cost"), gt); - test_value(str_2.compare(L"costa ricans"), lt); - - // int compare(size_type pos, size_type n1, const charT* str, - // size_type n2 = npos) const; - test_value(str_1.compare(0, 6, L"costa rica", 0, 6), z); - test_value(str_1.compare(0, 7, L"costa rica", 0, 7), lt); - test_value(str_0.compare(0, 7, L"costa marbella", 0, 7), gt); - - return 0; -} - - -int -main() -{ - test01(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/compare/wchar_t/13650.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/compare/wchar_t/13650.cc deleted file mode 100644 index ea18a8500..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/compare/wchar_t/13650.cc +++ /dev/null @@ -1,47 +0,0 @@ -// 2004-01-13 Paolo Carlini <pcarlini@suse.de> - -// Copyright (C) 2004, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.3.6.8 basic_string::compare [lib.string::compare] - -#include <string> -#include <testsuite_hooks.h> - -// libstdc++/13650 -void test01() -{ - using namespace std; - bool test __attribute__((unused)) = true; - - const wchar_t lit_01[] = { L'w', L'e', L'\0', L'r', L'd' }; - const wchar_t lit_02[] = { L'w', L'e', L'i', L'\0', L'd' }; - - const wchar_t lit_ref_a[] = { L'w', L'e', L'\0', L'q', L'd' }; - const wstring str_a(lit_ref_a, 5); - VERIFY( str_a.compare(0, 5, lit_01, 5) < 0 ); - - const wchar_t lit_ref_b[] = { L'w', L'e', L'i' }; - const wstring str_b(lit_ref_b, 3); - VERIFY( str_b.compare(0, 3, lit_02, 5) < 0 ); -} - -int main() -{ - test01(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/cons/char/1.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/cons/char/1.cc deleted file mode 100644 index 79362e677..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/cons/char/1.cc +++ /dev/null @@ -1,161 +0,0 @@ -// 1999-06-04 bkoz - -// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2009 -// 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.3.1 basic_string constructors. - -#include <new> -#include <string> -#include <stdexcept> -#include <testsuite_hooks.h> - -void test01(void) -{ - bool test __attribute__((unused)) = true; - typedef std::string::size_type csize_type; - typedef std::string::iterator citerator; - csize_type npos = std::string::npos; - csize_type csz01; - - const char str_lit01[] = "rodeo beach, marin"; - const std::string str01(str_lit01); - const std::string str02("baker beach, san francisco"); - - // basic_string(const string&, size_type pos = 0, siz_type n = npos, alloc) - csz01 = str01.size(); - try { - std::string str03(str01, csz01 + 1); - VERIFY( false ); - } - catch(std::out_of_range& fail) { - VERIFY( true ); - } - catch(...) { - VERIFY( false ); - } - - try { - std::string str03(str01, csz01); - VERIFY( str03.size() == 0 ); - VERIFY( str03.size() <= str03.capacity() ); - } - catch(...) { - VERIFY( false ); - } - - // basic_string(const char* s, size_type n, alloc) - csz01 = str01.max_size(); - // NB: As strlen(str_lit01) != csz01, this test is undefined. It - // should not crash, but what gets constructed is a bit arbitrary. - try { - std::string str03(str_lit01, csz01 + 1); - VERIFY( true ); - } - catch(std::length_error& fail) { - VERIFY( true ); - } - catch(...) { - VERIFY( false ); - } - - // NB: As strlen(str_lit01) != csz01, this test is undefined. It - // should not crash, but what gets constructed is a bit arbitrary. - // The "maverick's" of all string objects. - try { - std::string str04(str_lit01, npos); - VERIFY( true ); - } - catch(std::length_error& fail) { - VERIFY( true ); - } - catch(...) { - VERIFY( false ); - } - - // Build a maxsize - 1 lengthed string consisting of all A's - try { - std::string str03(csz01 - 1, 'A'); - VERIFY( str03.size() == csz01 - 1 ); - VERIFY( str03.size() <= str03.capacity() ); - } - // NB: bad_alloc is regrettable but entirely kosher for - // out-of-memory situations. - catch(std::bad_alloc& fail) { - VERIFY( true ); - } - catch(...) { - VERIFY( false ); - } - - // basic_string(const char* s, const allocator& a = allocator()) - std::string str04(str_lit01); - VERIFY( str01 == str04 ); - - - // basic_string(size_type n, char c, const allocator& a = allocator()) - csz01 = str01.max_size(); - try { - std::string str03(csz01 + 1, 'z'); - VERIFY( false ); - } - catch(std::length_error& fail) { - VERIFY( true ); - } - catch(...) { - VERIFY( false ); - } - - try { - std::string str04(npos, 'b'); // the "maverick's" of all string objects. - VERIFY( false ); - } - catch(std::length_error& fail) { - VERIFY( true ); - } - catch(...) { - VERIFY( false ); - } - - try { - std::string str03(csz01 - 1, 'z'); - VERIFY( str03.size() != 0 ); - VERIFY( str03.size() <= str03.capacity() ); - } - // NB: bad_alloc is regrettable but entirely kosher for - // out-of-memory situations. - catch(std::bad_alloc& fail) { - VERIFY( true ); - } - catch(...) { - VERIFY( false ); - } - - - // template<typename _InputIter> - // basic_string(_InputIter begin, _InputIter end, const allocator& a) - std::string str06(str01.begin(), str01.end()); - VERIFY( str06 == str01 ); -} - -int main() -{ - __gnu_test::set_memory_limits(); - test01(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/cons/char/2.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/cons/char/2.cc deleted file mode 100644 index f3d252e3a..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/cons/char/2.cc +++ /dev/null @@ -1,41 +0,0 @@ -// 1999-06-04 bkoz - -// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2009 -// 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.3.1 basic_string constructors. - -#include <string> -#include <testsuite_hooks.h> - -void test02() -{ - bool test __attribute__((unused)) = true; - - // template<typename _InputIter> - // basic_string(_InputIter begin, _InputIter end, const allocator& a) - // where _InputIter is integral [21.3.1 para 15] - std::string s(10,0); - VERIFY( s.size() == 10 ); -} - -int main() -{ - test02(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/cons/char/3.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/cons/char/3.cc deleted file mode 100644 index 5badcacb9..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/cons/char/3.cc +++ /dev/null @@ -1,69 +0,0 @@ -// 1999-06-04 bkoz - -// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2009 -// 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.3.1 basic_string constructors. - -#include <new> -#include <string> -#include <stdexcept> -#include <testsuite_hooks.h> - -void test03() -{ - bool test __attribute__((unused)) = true; - const char* with_nulls = "This contains \0 a zero byte."; - - // These are tests to see how basic_string handles data with NUL - // bytes. Obviously basic_string(char*) will halt at the first one, but - // nothing else should. - std::string s1 (with_nulls, 28); - VERIFY( s1.size() == 28 ); - std::string s2 (s1); - VERIFY( s2.size() == 28 ); - - // Not defined, but libstdc++ throws an exception. - const char* bogus = 0; - try - { - std::string str1(bogus); - VERIFY( false ); - } - catch(std::exception& fail) - { - VERIFY( true ); - } - - // Not defined, but libstdc++ throws an exception. - try - { - std::string str2(bogus, 5); - VERIFY( false ); - } - catch(std::exception& fail) - { - VERIFY( true ); - } -} - -int main() -{ - test03(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/cons/char/4.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/cons/char/4.cc deleted file mode 100644 index 6bc6c19b6..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/cons/char/4.cc +++ /dev/null @@ -1,43 +0,0 @@ -// 1999-06-04 bkoz - -// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2009 -// 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.3.1 basic_string constructors. - -#include <string> -#include <testsuite_hooks.h> - -// http://gcc.gnu.org/ml/libstdc++/2002-06/msg00025.html -void test04() -{ - bool test __attribute__((unused)) = true; - - std::string str01("portofino"); - - std::string::reverse_iterator i1 = str01.rbegin(); - std::string::reverse_iterator i2 = str01.rend(); - std::string str02(i1, i2); - VERIFY( str02 == "onifotrop" ); -} - -int main() -{ - test04(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/cons/char/5.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/cons/char/5.cc deleted file mode 100644 index 73839d26c..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/cons/char/5.cc +++ /dev/null @@ -1,44 +0,0 @@ -// 1999-06-04 bkoz - -// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2009 -// 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.3.1 basic_string constructors. - -#include <string> -#include <vector> -#include <testsuite_hooks.h> - -// libstdc++/8347 -void test05() -{ - bool test __attribute__((unused)) = true; - - std::vector<char> empty; - std::string empty2(empty.begin(), empty.end()); - - // libstdc++/8716 (same underlying situation, same fix) - char const * s = NULL; - std::string zero_length_built_with_NULL(s,0); -} - -int main() -{ - test05(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/cons/char/6.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/cons/char/6.cc deleted file mode 100644 index 3494935f3..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/cons/char/6.cc +++ /dev/null @@ -1,55 +0,0 @@ -// 2004-01-30 Paolo Carlini <pcarlini@suse.de> - -// Copyright (C) 2004, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.3.1 basic_string constructors. - -#include <iterator> -#include <sstream> -#include <cstdlib> -#include <testsuite_hooks.h> - -using namespace std; - -string data(long len) -{ - string ret; - for (long i = 0; i < len; ++i) - ret.push_back('a' + rand() % 26); - return ret; -} - -void test01(int iter) -{ - bool test __attribute__((unused)) = true; - - for (long i = 0, j = 1; i < iter; ++i, j *= 3) - { - istringstream isstr(data(j)); - - string str((istreambuf_iterator<char>(isstr)), - istreambuf_iterator<char>()); - VERIFY( str == isstr.str() ); - } -} - -int main() -{ - test01(13); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/cons/wchar_t/1.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/cons/wchar_t/1.cc deleted file mode 100644 index 81bf2bafc..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/cons/wchar_t/1.cc +++ /dev/null @@ -1,161 +0,0 @@ -// 1999-06-04 bkoz - -// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2009 -// 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.3.1 basic_string constructors. - -#include <new> -#include <string> -#include <stdexcept> -#include <testsuite_hooks.h> - -void test01(void) -{ - bool test __attribute__((unused)) = true; - typedef std::wstring::size_type csize_type; - typedef std::wstring::iterator citerator; - csize_type npos = std::wstring::npos; - csize_type csz01; - - const wchar_t str_lit01[] = L"rodeo beach, marin"; - const std::wstring str01(str_lit01); - const std::wstring str02(L"baker beach, san francisco"); - - // basic_string(const wstring&, size_type pos = 0, siz_type n = npos, alloc) - csz01 = str01.size(); - try { - std::wstring str03(str01, csz01 + 1); - VERIFY( false ); - } - catch(std::out_of_range& fail) { - VERIFY( true ); - } - catch(...) { - VERIFY( false ); - } - - try { - std::wstring str03(str01, csz01); - VERIFY( str03.size() == 0 ); - VERIFY( str03.size() <= str03.capacity() ); - } - catch(...) { - VERIFY( false ); - } - - // basic_string(const wchar_t* s, size_type n, alloc) - csz01 = str01.max_size(); - // NB: As strlen(str_lit01) != csz01, this test is undefined. It - // should not crash, but what gets constructed is a bit arbitrary. - try { - std::wstring str03(str_lit01, csz01 + 1); - VERIFY( true ); - } - catch(std::length_error& fail) { - VERIFY( true ); - } - catch(...) { - VERIFY( false ); - } - - // NB: As strlen(str_lit01) != csz01, this test is undefined. It - // should not crash, but what gets constructed is a bit arbitrary. - // The "maverick's" of all string objects. - try { - std::wstring str04(str_lit01, npos); - VERIFY( true ); - } - catch(std::length_error& fail) { - VERIFY( true ); - } - catch(...) { - VERIFY( false ); - } - - // Build a maxsize - 1 lengthed string consisting of all A's - try { - std::wstring str03(csz01 - 1, 'A'); - VERIFY( str03.size() == csz01 - 1 ); - VERIFY( str03.size() <= str03.capacity() ); - } - // NB: bad_alloc is regrettable but entirely kosher for - // out-of-memory situations. - catch(std::bad_alloc& fail) { - VERIFY( true ); - } - catch(...) { - VERIFY( false ); - } - - // basic_string(const wchar_t* s, const allocator& a = allocator()) - std::wstring str04(str_lit01); - VERIFY( str01 == str04 ); - - - // basic_string(size_type n, char c, const allocator& a = allocator()) - csz01 = str01.max_size(); - try { - std::wstring str03(csz01 + 1, L'z'); - VERIFY( false ); - } - catch(std::length_error& fail) { - VERIFY( true ); - } - catch(...) { - VERIFY( false ); - } - - try { - std::wstring str04(npos, L'b'); // the "maverick's" of all string objects. - VERIFY( false ); - } - catch(std::length_error& fail) { - VERIFY( true ); - } - catch(...) { - VERIFY( false ); - } - - try { - std::wstring str03(csz01 - 1, L'z'); - VERIFY( str03.size() != 0 ); - VERIFY( str03.size() <= str03.capacity() ); - } - // NB: bad_alloc is regrettable but entirely kosher for - // out-of-memory situations. - catch(std::bad_alloc& fail) { - VERIFY( true ); - } - catch(...) { - VERIFY( false ); - } - - - // template<typename _InputIter> - // basic_string(_InputIter begin, _InputIter end, const allocator& a) - std::wstring str06(str01.begin(), str01.end()); - VERIFY( str06 == str01 ); -} - -int main() -{ - __gnu_test::set_memory_limits(); - test01(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/cons/wchar_t/2.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/cons/wchar_t/2.cc deleted file mode 100644 index 57103e1fa..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/cons/wchar_t/2.cc +++ /dev/null @@ -1,41 +0,0 @@ -// 1999-06-04 bkoz - -// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2009 -// 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.3.1 basic_string constructors. - -#include <string> -#include <testsuite_hooks.h> - -void test02() -{ - bool test __attribute__((unused)) = true; - - // template<typename _InputIter> - // basic_string(_InputIter begin, _InputIter end, const allocator& a) - // where _InputIter is integral [21.3.1 para 15] - std::wstring s(10, 0); - VERIFY( s.size() == 10 ); -} - -int main() -{ - test02(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/cons/wchar_t/3.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/cons/wchar_t/3.cc deleted file mode 100644 index f53b9bc17..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/cons/wchar_t/3.cc +++ /dev/null @@ -1,69 +0,0 @@ -// 1999-06-04 bkoz - -// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2009 -// 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.3.1 basic_string constructors. - -#include <new> -#include <string> -#include <stdexcept> -#include <testsuite_hooks.h> - -void test03() -{ - bool test __attribute__((unused)) = true; - const wchar_t* with_nulls = L"This contains \0 a zero byte."; - - // These are tests to see how basic_string handles data with NUL - // bytes. Obviously basic_string(char*) will halt at the first one, but - // nothing else should. - std::wstring s1 (with_nulls, 28); - VERIFY( s1.size() == 28 ); - std::wstring s2 (s1); - VERIFY( s2.size() == 28 ); - - // Not defined, but libstdc++ throws an exception. - const wchar_t* bogus = 0; - try - { - std::wstring str1(bogus); - VERIFY( false ); - } - catch(std::exception& fail) - { - VERIFY( true ); - } - - // Not defined, but libstdc++ throws an exception. - try - { - std::wstring str2(bogus, 5); - VERIFY( false ); - } - catch(std::exception& fail) - { - VERIFY( true ); - } -} - -int main() -{ - test03(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/cons/wchar_t/4.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/cons/wchar_t/4.cc deleted file mode 100644 index ed6eb9a28..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/cons/wchar_t/4.cc +++ /dev/null @@ -1,43 +0,0 @@ -// 1999-06-04 bkoz - -// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2009 -// 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.3.1 basic_string constructors. - -#include <string> -#include <testsuite_hooks.h> - -// http://gcc.gnu.org/ml/libstdc++/2002-06/msg00025.html -void test04() -{ - bool test __attribute__((unused)) = true; - - std::wstring str01(L"portofino"); - - std::wstring::reverse_iterator i1 = str01.rbegin(); - std::wstring::reverse_iterator i2 = str01.rend(); - std::wstring str02(i1, i2); - VERIFY( str02 == L"onifotrop" ); -} - -int main() -{ - test04(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/cons/wchar_t/5.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/cons/wchar_t/5.cc deleted file mode 100644 index 4fe58b6ac..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/cons/wchar_t/5.cc +++ /dev/null @@ -1,44 +0,0 @@ -// 1999-06-04 bkoz - -// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2009 -// 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.3.1 basic_string constructors. - -#include <string> -#include <vector> -#include <testsuite_hooks.h> - -// libstdc++/8347 -void test05() -{ - bool test __attribute__((unused)) = true; - - std::vector<wchar_t> empty; - std::wstring empty2(empty.begin(), empty.end()); - - // libstdc++/8716 (same underlying situation, same fix) - wchar_t const * s = NULL; - std::wstring zero_length_built_with_NULL(s,0); -} - -int main() -{ - test05(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/cons/wchar_t/6.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/cons/wchar_t/6.cc deleted file mode 100644 index 82ed764dd..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/cons/wchar_t/6.cc +++ /dev/null @@ -1,55 +0,0 @@ -// 2004-01-30 Paolo Carlini <pcarlini@suse.de> - -// Copyright (C) 2004, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.3.1 basic_string constructors. - -#include <iterator> -#include <sstream> -#include <cstdlib> -#include <testsuite_hooks.h> - -using namespace std; - -wstring data(long len) -{ - wstring ret; - for (long i = 0; i < len; ++i) - ret.push_back(L'a' + rand() % 26); - return ret; -} - -void test01(int iter) -{ - bool test __attribute__((unused)) = true; - - for (long i = 0, j = 1; i < iter; ++i, j *= 3) - { - wistringstream isstr(data(j)); - - wstring str((istreambuf_iterator<wchar_t>(isstr)), - istreambuf_iterator<wchar_t>()); - VERIFY( str == isstr.str() ); - } -} - -int main() -{ - test01(13); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/element_access/char/1.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/element_access/char/1.cc deleted file mode 100644 index b45db4ccb..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/element_access/char/1.cc +++ /dev/null @@ -1,88 +0,0 @@ -// 1999-06-08 bkoz - -// Copyright (C) 1999, 2003, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.3.4 basic_string element access - -#include <string> -#include <stdexcept> -#include <testsuite_hooks.h> - -bool test01(void) -{ - bool test __attribute__((unused)) = true; - typedef std::string::size_type csize_type; - typedef std::string::const_reference cref; - typedef std::string::reference ref; - csize_type csz01, csz02; - - const std::string str01("tamarindo, costa rica"); - std::string str02("41st street beach, capitola, california"); - std::string str03; - - // const_reference operator[] (size_type pos) const; - csz01 = str01.size(); - cref cref1 = str01[csz01 - 1]; - VERIFY( cref1 == 'a' ); - cref cref2 = str01[csz01]; - VERIFY( cref2 == char() ); - - // reference operator[] (size_type pos); - csz02 = str02.size(); - ref ref1 = str02[csz02 - 1]; - VERIFY( ref1 == 'a' ); - ref ref2 = str02[1]; - VERIFY( ref2 == '1' ); - - // const_reference at(size_type pos) const; - csz01 = str01.size(); - cref cref3 = str01.at(csz01 - 1); - VERIFY( cref3 == 'a' ); - try { - str01.at(csz01); - VERIFY( false ); // Should not get here, as exception thrown. - } - catch(std::out_of_range& fail) { - VERIFY( true ); - } - catch(...) { - VERIFY( false ); - } - - // reference at(size_type pos); - csz01 = str02.size(); - ref ref3 = str02.at(csz02 - 1); - VERIFY( ref3 == 'a' ); - try { - str02.at(csz02); - VERIFY( false ); // Should not get here, as exception thrown. - } - catch(std::out_of_range& fail) { - VERIFY( true ); - } - catch(...) { - VERIFY( false ); - } - return test; -} - -int main() -{ - test01(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/element_access/char/2.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/element_access/char/2.cc deleted file mode 100644 index 9626b535f..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/element_access/char/2.cc +++ /dev/null @@ -1,110 +0,0 @@ -// 1999-06-08 bkoz - -// Copyright (C) 1999, 2003, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.3 template class basic_string - -#include <string> -#include <stdexcept> -#include <testsuite_hooks.h> - -// Do a quick sanity check on known problems with element access and -// ref-counted strings. These should all pass, regardless of the -// underlying string implementation, of course. -bool test01(void) -{ - bool test __attribute__((unused)) = true; - typedef std::string::size_type csize_type; - typedef std::string::iterator siterator; - typedef std::string::reverse_iterator sriterator; - csize_type csz01, csz02; - siterator it1; - sriterator rit1; - - std::string str01("montara beach, half moon bay"); - const std::string str02("ocean beach, san francisco"); - std::string str03; - - // 21.3 p 5 - - // References, pointers, and iterators referring to the elements of - // a basic_string may be invalidated by the following uses of that - // basic_string object: - - // ... - - // Susequent to any of the above uses except the forms of insert() - // and erase() which return iterators, the first call to non-const - // member functions operator[](), at(), begin(), rbegin(), end(), or - // rend() - - str03 = str01; - it1 = str01.begin(); - *it1 = 'x'; - VERIFY( str01[0] == 'x' ); - VERIFY( str03[0] == 'm' ); - - str03 = str01; - csz01 = str01.size(); - rit1 = str01.rbegin(); // NB: Pointing at one-past the end, so ... - *rit1 = 'z'; // ... but it's taken care of here - VERIFY( str01[csz01 - 1] == 'z' ); - VERIFY( str03[csz01 - 1] == 'y' ); - - str03 = str01; - csz01 = str01.size(); - std::string::reference r1 = str01.at(csz01 - 2); - VERIFY( str03 == str01 ); - r1 = 'd'; - VERIFY( str01[csz01 - 2] == 'd' ); - VERIFY( str03[csz01 - 2] == 'a' ); - - str03 = str01; - csz01 = str01.size(); - std::string::reference r2 = str01[csz01 - 3]; - VERIFY( str03 == str01 ); - r2 = 'w'; - VERIFY( str01[csz01 - 3] == 'w' ); - VERIFY( str03[csz01 - 3] == 'b' ); - - str03 = str01; - csz02 = str01.size(); - it1 = str01.end(); - VERIFY( str03 == str01 ); - --it1; - *it1 = 'q'; - VERIFY( str01[csz02 - 1] == 'q' ); - VERIFY( str03[csz02 - 1] == 'z' ); - - str03 = str01; - rit1 = str01.rend(); - VERIFY( str03 == str01 ); - --rit1; - *rit1 = 'p'; - VERIFY( str01[0] == 'p' ); - VERIFY( str03[0] == 'x' ); - - // need to also test for const begin/const end - return test; -} - -int main() -{ - test01(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/element_access/char/21674.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/element_access/char/21674.cc deleted file mode 100644 index 0c318bcf7..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/element_access/char/21674.cc +++ /dev/null @@ -1,32 +0,0 @@ -// { dg-do run { xfail { ! { *-*-darwin* } } } } -// { dg-require-debug-mode "" } -// { dg-options "-O0 -D_GLIBCXX_DEBUG" } - -// Copyright (C) 2005, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - - -#include <string> - -// libstdc++/21674 -// NB: Should work without any inlining or optimizations (ie. -O0). -int main() -{ - typedef std::string string_type; - string_type s; - s[1]; // abort -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/element_access/char/3.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/element_access/char/3.cc deleted file mode 100644 index 385ef28ba..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/element_access/char/3.cc +++ /dev/null @@ -1,83 +0,0 @@ -// 1999-06-08 bkoz - -// Copyright (C) 1999, 2003, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.3 template class basic_string - -#include <string> -#include <stdexcept> -#include <testsuite_hooks.h> - -// Do another sanity check, this time for member functions that return -// iterators, namely insert and erase. -bool test02(void) -{ - bool test __attribute__((unused)) = true; - typedef std::string::size_type csize_type; - typedef std::string::iterator siterator; - typedef std::string::reverse_iterator sriterator; - siterator it1; - sriterator rit1; - - const std::string str01("its beach, santa cruz"); - - std::string str02 = str01; - std::string str05 = str02; // optional, so that begin below causes a mutate - std::string::iterator p = str02.insert(str02.begin(), ' '); - std::string str03 = str02; - VERIFY( str03 == str02 ); - *p = '!'; - VERIFY( *str03.c_str() == ' ' ); - str03[0] = '@'; - VERIFY( str02[0] == '!' ); - VERIFY( *p == '!' ); - VERIFY( str02 != str05 ); - VERIFY( str02 != str03 ); - - std::string str10 = str01; - std::string::iterator p2 = str10.insert(str10.begin(), 'a'); - std::string str11 = str10; - *p2 = 'e'; - VERIFY( str11 != str10 ); - - std::string str06 = str01; - std::string str07 = str06; // optional, so that begin below causes a mutate - p = str06.erase(str06.begin()); - std::string str08 = str06; - VERIFY( str08 == str06 ); - *p = '!'; - VERIFY( *str08.c_str() == 't' ); - str08[0] = '@'; - VERIFY( str06[0] == '!' ); - VERIFY( *p == '!' ); - VERIFY( str06 != str07 ); - VERIFY( str06 != str08 ); - - std::string str12 = str01; - p2 = str12.erase(str12.begin(), str12.begin() + str12.size() - 1); - std::string str13 = str12; - *p2 = 'e'; - VERIFY( str12 != str13 ); - return test; -} - -int main() -{ - test02(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/element_access/char/4.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/element_access/char/4.cc deleted file mode 100644 index 5adb1583a..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/element_access/char/4.cc +++ /dev/null @@ -1,49 +0,0 @@ -// 2004-01-18 Paolo Carlini <pcarlini@suse.de> - -// Copyright (C) 2004, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.3.4 basic_string element access - -#include <string> -#include <testsuite_hooks.h> - -// http://gcc.gnu.org/ml/libstdc++/2004-01/msg00184.html -void test01() -{ - bool test __attribute__((unused)) = true; - using namespace std; - - for (int i = 0; i < 2000; ++i) - { - string str_01; - - for (int j = 0; j < i; ++j) - str_01 += 'a'; - - str_01.reserve(i + 10); - - const string str_02(str_01); - VERIFY( str_02[i] == '\0' ); - } -} - -int main() -{ - test01(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/element_access/char/empty.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/element_access/char/empty.cc deleted file mode 100644 index af0c7ff41..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/element_access/char/empty.cc +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (C) 2004, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. -// - -#include <string> -#include <testsuite_hooks.h> - -// as per 21.3.4 -int main() -{ - bool test __attribute__((unused)) = true; - - { - std::string empty; - char c = empty[0]; - VERIFY( c == char() ); - } - - { - const std::string empty; - char c = empty[0]; - VERIFY( c == char() ); - } - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/element_access/wchar_t/1.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/element_access/wchar_t/1.cc deleted file mode 100644 index 13dac274b..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/element_access/wchar_t/1.cc +++ /dev/null @@ -1,88 +0,0 @@ -// 1999-06-08 bkoz - -// Copyright (C) 1999, 2003, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.3.4 basic_string element access - -#include <string> -#include <stdexcept> -#include <testsuite_hooks.h> - -bool test01(void) -{ - bool test __attribute__((unused)) = true; - typedef std::wstring::size_type csize_type; - typedef std::wstring::const_reference cref; - typedef std::wstring::reference ref; - csize_type csz01, csz02; - - const std::wstring str01(L"tamarindo, costa rica"); - std::wstring str02(L"41st street beach, capitola, california"); - std::wstring str03; - - // const_reference operator[] (size_type pos) const; - csz01 = str01.size(); - cref cref1 = str01[csz01 - 1]; - VERIFY( cref1 == L'a' ); - cref cref2 = str01[csz01]; - VERIFY( cref2 == wchar_t() ); - - // reference operator[] (size_type pos); - csz02 = str02.size(); - ref ref1 = str02[csz02 - 1]; - VERIFY( ref1 == L'a' ); - ref ref2 = str02[1]; - VERIFY( ref2 == L'1' ); - - // const_reference at(size_type pos) const; - csz01 = str01.size(); - cref cref3 = str01.at(csz01 - 1); - VERIFY( cref3 == L'a' ); - try { - str01.at(csz01); - VERIFY( false ); // Should not get here, as exception thrown. - } - catch(std::out_of_range& fail) { - VERIFY( true ); - } - catch(...) { - VERIFY( false ); - } - - // reference at(size_type pos); - csz01 = str02.size(); - ref ref3 = str02.at(csz02 - 1); - VERIFY( ref3 == L'a' ); - try { - str02.at(csz02); - VERIFY( false ); // Should not get here, as exception thrown. - } - catch(std::out_of_range& fail) { - VERIFY( true ); - } - catch(...) { - VERIFY( false ); - } - return test; -} - -int main() -{ - test01(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/element_access/wchar_t/2.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/element_access/wchar_t/2.cc deleted file mode 100644 index 6ffece7da..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/element_access/wchar_t/2.cc +++ /dev/null @@ -1,111 +0,0 @@ -// 1999-06-08 bkoz - -// Copyright (C) 1999, 2003, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.3 template class basic_string - -#include <string> -#include <stdexcept> -#include <testsuite_hooks.h> - -// Do a quick sanity check on known problems with element access and -// ref-counted strings. These should all pass, regardless of the -// underlying string implementation, of course. -bool test01(void) -{ - bool test __attribute__((unused)) = true; - typedef std::wstring::size_type csize_type; - typedef std::wstring::iterator siterator; - typedef std::wstring::reverse_iterator sriterator; - csize_type csz01, csz02; - siterator it1; - sriterator rit1; - - std::wstring str01(L"montara beach, half moon bay"); - const std::wstring str02(L"ocean beach, san francisco"); - std::wstring str03; - - // 21.3 p 5 - - // References, pointers, and iterators referring to the elements of - // a basic_string may be invalidated by the following uses of that - // basic_string object: - - // ... - - // Susequent to any of the above uses except the forms of insert() - // and erase() which return iterators, the first call to non-const - // member functions operator[](), at(), begin(), rbegin(), end(), or - // rend() - - str03 = str01; - it1 = str01.begin(); - *it1 = L'x'; - VERIFY( str01[0] == L'x' ); - VERIFY( str03[0] == L'm' ); - - str03 = str01; - csz01 = str01.size(); - rit1 = str01.rbegin(); // NB: Pointing at one-past the end, so ... - *rit1 = L'z'; // ... but it's taken care of here - VERIFY( str01[csz01 - 1] == L'z' ); - VERIFY( str03[csz01 - 1] == L'y' ); - - str03 = str01; - csz01 = str01.size(); - std::wstring::reference r1 = str01.at(csz01 - 2); - VERIFY( str03 == str01 ); - r1 = L'd'; - VERIFY( str01[csz01 - 2] == L'd' ); - VERIFY( str03[csz01 - 2] == L'a' ); - - str03 = str01; - csz01 = str01.size(); - std::wstring::reference r2 = str01[csz01 - 3]; - VERIFY( str03 == str01 ); - r2 = L'w'; - VERIFY( str01[csz01 - 3] == L'w' ); - VERIFY( str03[csz01 - 3] == L'b' ); - - str03 = str01; - csz02 = str01.size(); - it1 = str01.end(); - VERIFY( str03 == str01 ); - --it1; - *it1 = L'q'; - VERIFY( str01[csz02 - 1] == L'q' ); - VERIFY( str03[csz02 - 1] == L'z' ); - - str03 = str01; - rit1 = str01.rend(); - VERIFY( str03 == str01 ); - --rit1; - *rit1 = L'p'; - VERIFY( str01[0] == L'p' ); - VERIFY( str03[0] == L'x' ); - - // need to also test for const begin/const end - VERIFY(test); - return test; -} - -int main() -{ - test01(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/element_access/wchar_t/21674.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/element_access/wchar_t/21674.cc deleted file mode 100644 index ea0cfd7a0..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/element_access/wchar_t/21674.cc +++ /dev/null @@ -1,32 +0,0 @@ -// { dg-do run { xfail { ! { *-*-darwin* } } } } -// { dg-require-debug-mode "" } -// { dg-options "-O0 -D_GLIBCXX_DEBUG" } - -// Copyright (C) 2005, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - - -#include <string> - -// libstdc++/21674 -// NB: Should work without any inlining or optimizations (ie. -O0). -int main() -{ - typedef std::wstring string_type; - string_type s; - s[1]; // abort -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/element_access/wchar_t/3.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/element_access/wchar_t/3.cc deleted file mode 100644 index 266f03736..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/element_access/wchar_t/3.cc +++ /dev/null @@ -1,83 +0,0 @@ -// 1999-06-08 bkoz - -// Copyright (C) 1999, 2003, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.3 template class basic_string - -#include <string> -#include <stdexcept> -#include <testsuite_hooks.h> - -// Do another sanity check, this time for member functions that return -// iterators, namely insert and erase. -bool test02(void) -{ - bool test __attribute__((unused)) = true; - typedef std::wstring::size_type csize_type; - typedef std::wstring::iterator siterator; - typedef std::wstring::reverse_iterator sriterator; - siterator it1; - sriterator rit1; - - const std::wstring str01(L"its beach, santa cruz"); - - std::wstring str02 = str01; - std::wstring str05 = str02; // optional, so that begin below causes a mutate - std::wstring::iterator p = str02.insert(str02.begin(), L' '); - std::wstring str03 = str02; - VERIFY( str03 == str02 ); - *p = L'!'; - VERIFY( *str03.c_str() == L' ' ); - str03[0] = L'@'; - VERIFY( str02[0] == L'!' ); - VERIFY( *p == L'!' ); - VERIFY( str02 != str05 ); - VERIFY( str02 != str03 ); - - std::wstring str10 = str01; - std::wstring::iterator p2 = str10.insert(str10.begin(), L'a'); - std::wstring str11 = str10; - *p2 = L'e'; - VERIFY( str11 != str10 ); - - std::wstring str06 = str01; - std::wstring str07 = str06; // optional, so that begin below causes a mutate - p = str06.erase(str06.begin()); - std::wstring str08 = str06; - VERIFY( str08 == str06 ); - *p = L'!'; - VERIFY( *str08.c_str() == L't' ); - str08[0] = L'@'; - VERIFY( str06[0] == L'!' ); - VERIFY( *p == L'!' ); - VERIFY( str06 != str07 ); - VERIFY( str06 != str08 ); - - std::wstring str12 = str01; - p2 = str12.erase(str12.begin(), str12.begin() + str12.size() - 1); - std::wstring str13 = str12; - *p2 = L'e'; - VERIFY( str12 != str13 ); - return test; -} - -int main() -{ - test02(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/element_access/wchar_t/4.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/element_access/wchar_t/4.cc deleted file mode 100644 index d05ab4169..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/element_access/wchar_t/4.cc +++ /dev/null @@ -1,49 +0,0 @@ -// 2004-01-18 Paolo Carlini <pcarlini@suse.de> - -// Copyright (C) 2004, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.3.4 basic_string element access - -#include <string> -#include <testsuite_hooks.h> - -// http://gcc.gnu.org/ml/libstdc++/2004-01/msg00184.html -void test01() -{ - bool test __attribute__((unused)) = true; - using namespace std; - - for (int i = 0; i < 2000; ++i) - { - wstring str_01; - - for (int j = 0; j < i; ++j) - str_01 += L'a'; - - str_01.reserve(i + 10); - - const wstring str_02(str_01); - VERIFY( str_02[i] == L'\0' ); - } -} - -int main() -{ - test01(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/element_access/wchar_t/empty.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/element_access/wchar_t/empty.cc deleted file mode 100644 index 9a70ace0e..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/element_access/wchar_t/empty.cc +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (C) 2004, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. -// - -#include <string> -#include <testsuite_hooks.h> - -// as per 21.3.4 -int main() -{ - bool test __attribute__((unused)) = true; - - { - std::wstring empty; - wchar_t c = empty[0]; - VERIFY( c == wchar_t() ); - } - - { - const std::wstring empty; - wchar_t c = empty[0]; - VERIFY( c == wchar_t() ); - } - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/find/char/1.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/find/char/1.cc deleted file mode 100644 index 695b05824..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/find/char/1.cc +++ /dev/null @@ -1,93 +0,0 @@ -// 1999-06-09 bkoz - -// Copyright (C) 1994, 1999, 2000, 2003, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.3.6.1 basic_string find - -#include <string> -#include <testsuite_hooks.h> - -bool test01(void) -{ - bool test __attribute__((unused)) = true; - typedef std::string::size_type csize_type; - typedef std::string::const_reference cref; - typedef std::string::reference ref; - csize_type npos = std::string::npos; - csize_type csz01, csz02; - - const char str_lit01[] = "mave"; - const std::string str01("mavericks, santa cruz"); - std::string str02(str_lit01); - std::string str03("s, s"); - std::string str04; - - // size_type find(const string&, size_type pos = 0) const; - csz01 = str01.find(str01); - VERIFY( csz01 == 0 ); - csz01 = str01.find(str01, 4); - VERIFY( csz01 == npos ); - csz01 = str01.find(str02, 0); - VERIFY( csz01 == 0 ); - csz01 = str01.find(str02, 3); - VERIFY( csz01 == npos ); - csz01 = str01.find(str03, 0); - VERIFY( csz01 == 8 ); - csz01 = str01.find(str03, 3); - VERIFY( csz01 == 8 ); - csz01 = str01.find(str03, 12); - VERIFY( csz01 == npos ); - - // An empty string consists of no characters - // therefore it should be found at every point in a string, - // except beyond the end - csz01 = str01.find(str04, 0); - VERIFY( csz01 == 0 ); - csz01 = str01.find(str04, 5); - VERIFY( csz01 == 5 ); - csz01 = str01.find(str04, str01.size()); - VERIFY( csz01 == str01.size() ); - csz01 = str01.find(str04, str01.size()+1); - VERIFY( csz01 == npos ); - - // size_type find(const char* s, size_type pos, size_type n) const; - csz01 = str01.find(str_lit01, 0, 3); - VERIFY( csz01 == 0 ); - csz01 = str01.find(str_lit01, 3, 0); - VERIFY( csz01 == 3 ); - - // size_type find(const char* s, size_type pos = 0) const; - csz01 = str01.find(str_lit01); - VERIFY( csz01 == 0 ); - csz01 = str01.find(str_lit01, 3); - VERIFY( csz01 == npos ); - - // size_type find(char c, size_type pos = 0) const; - csz01 = str01.find('z'); - csz02 = str01.size() - 1; - VERIFY( csz01 == csz02 ); - csz01 = str01.find('/'); - VERIFY( csz01 == npos ); - return test; -} - -int main() -{ - test01(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/find/char/2.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/find/char/2.cc deleted file mode 100644 index dac20145a..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/find/char/2.cc +++ /dev/null @@ -1,92 +0,0 @@ -// 1999-06-09 bkoz - -// Copyright (C) 1994, 1999, 2000, 2003, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.3.6.3 basic_string find_first_of - -#include <string> -#include <testsuite_hooks.h> - -bool test02(void) -{ - bool test __attribute__((unused)) = true; - typedef std::string::size_type csize_type; - csize_type npos = std::string::npos; - csize_type csz01, csz02; - - const char str_lit01[] = "mave"; - const std::string str01("mavericks, santa cruz"); - std::string str02(str_lit01); - std::string str03("s, s"); - std::string str04; - - // size_type find_first_of(const string&, size_type pos = 0) const; - std::string str05("xena rulez"); - csz01 = str01.find_first_of(str01); - VERIFY( csz01 == 0 ); - csz01 = str01.find_first_of(str01, 4); - VERIFY( csz01 == 4 ); - csz01 = str01.find_first_of(str02, 0); - VERIFY( csz01 == 0 ); - csz01 = str01.find_first_of(str02, 3); - VERIFY( csz01 == 3 ); - csz01 = str01.find_first_of(str03, 0); - VERIFY( csz01 == 8 ); - csz01 = str01.find_first_of(str03, 3); - VERIFY( csz01 == 8 ); - csz01 = str01.find_first_of(str03, 12); - VERIFY( csz01 == 16 ); - csz01 = str01.find_first_of(str05, 0); - VERIFY( csz01 == 1 ); - csz01 = str01.find_first_of(str05, 4); - VERIFY( csz01 == 4 ); - - // An empty string consists of no characters - // therefore it should be found at every point in a string, - // except beyond the end - // However, str1.find_first_of(str2,pos) finds the first character in - // str1 (starting at pos) that exists in str2, which is none for empty str2 - csz01 = str01.find_first_of(str04, 0); - VERIFY( csz01 == npos ); - csz01 = str01.find_first_of(str04, 5); - VERIFY( csz01 == npos ); - - // size_type find_first_of(const char* s, size_type pos, size_type n) const; - csz01 = str01.find_first_of(str_lit01, 0, 3); - VERIFY( csz01 == 0 ); - csz01 = str01.find_first_of(str_lit01, 3, 0); - VERIFY( csz01 == npos ); - - // size_type find_first_of(const char* s, size_type pos = 0) const; - csz01 = str01.find_first_of(str_lit01); - VERIFY( csz01 == 0 ); - csz01 = str01.find_first_of(str_lit01, 3); - VERIFY( csz01 == 3 ); - - // size_type find_first_of(char c, size_type pos = 0) const; - csz01 = str01.find_first_of('z'); - csz02 = str01.size() - 1; - VERIFY( csz01 == csz02 ); - return test; -} - -int main() -{ - test02(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/find/char/3.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/find/char/3.cc deleted file mode 100644 index d06f5a32a..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/find/char/3.cc +++ /dev/null @@ -1,92 +0,0 @@ -// 2003-05-04 Paolo Carlini <pcarlini@unitus.it> - -// Copyright (C) 2003, 2005, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.3.6.5 basic_string find_first_not_of - -#include <string> -#include <testsuite_hooks.h> - -bool test03(void) -{ - bool test __attribute__((unused)) = true; - typedef std::string::size_type csize_type; - csize_type npos = std::string::npos; - csize_type csz01; - - const std::string str01("Bob Rock, per me"); - const char str_lit01[] = "Bob Rock"; - std::string str02("ovvero Trivi"); - std::string str03(str_lit01); - std::string str04; - - // size_type find_first_not_of(const string&, size_type pos = 0) const; - csz01 = str01.find_first_not_of(str01); - VERIFY( csz01 == npos ); - csz01 = str01.find_first_not_of(str02, 0); - VERIFY( csz01 == 0 ); - csz01 = str01.find_first_not_of(str02, 10); - VERIFY( csz01 == 10 ); - csz01 = str01.find_first_not_of(str02, 12); - VERIFY( csz01 == 14 ); - csz01 = str01.find_first_not_of(str03, 0); - VERIFY( csz01 == 8 ); - csz01 = str01.find_first_not_of(str03, 15); - VERIFY( csz01 == 15 ); - csz01 = str01.find_first_not_of(str03, 16); - VERIFY( csz01 == npos ); - csz01 = str01.find_first_not_of(str04, 0); - VERIFY( csz01 == 0 ); - csz01 = str01.find_first_not_of(str04, 12); - VERIFY( csz01 == 12 ); - csz01 = str03.find_first_not_of(str01, 0); - VERIFY( csz01 == npos ); - csz01 = str04.find_first_not_of(str02, 0); - VERIFY( csz01 == npos ); - - // size_type find_first_not_of(const char* s, size_type pos, size_type n) const; - csz01 = str01.find_first_not_of(str_lit01, 0, 0); - VERIFY( csz01 == 0 ); - csz01 = str01.find_first_not_of(str_lit01, 0, 8); - VERIFY( csz01 == 8 ); - csz01 = str01.find_first_not_of(str_lit01, 10, 0); - VERIFY( csz01 == 10 ); - - // size_type find_first_not_of(const char* s, size_type pos = 0) const; - csz01 = str01.find_first_not_of(str_lit01); - VERIFY( csz01 == 8 ); - csz01 = str02.find_first_not_of(str_lit01, 2); - VERIFY( csz01 == 2 ); - - // size_type find_first_not_of(char c, size_type pos = 0) const; - csz01 = str01.find_first_not_of('B'); - VERIFY( csz01 == 1 ); - csz01 = str01.find_first_not_of('o', 1); - VERIFY( csz01 == 2 ); - csz01 = str02.find_first_not_of('z'); - VERIFY( csz01 == 0 ); - csz01 = str04.find_first_not_of('S'); - VERIFY( csz01 == npos ); - return test; -} - -int main() -{ - test03(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/find/char/4.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/find/char/4.cc deleted file mode 100644 index 2d58988c7..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/find/char/4.cc +++ /dev/null @@ -1,42 +0,0 @@ -// 2007-03-30 Paolo Carlini <pcarlini@suse.de> - -// Copyright (C) 2007, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.3.6.1 basic_string find - -#include <string> -#include <testsuite_hooks.h> - -// libstdc++/31401 -void test01() -{ - bool test __attribute__((unused)) = true; - typedef std::string::size_type csize_type; - csize_type npos = std::string::npos; - - std::string use = "anu"; - csize_type pos1 = use.find("a", npos); - - VERIFY( pos1 == npos ); -} - -int main() -{ - test01(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/find/wchar_t/1.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/find/wchar_t/1.cc deleted file mode 100644 index 8fd5149e5..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/find/wchar_t/1.cc +++ /dev/null @@ -1,93 +0,0 @@ -// 1999-06-09 bkoz - -// Copyright (C) 1994, 1999, 2000, 2003, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.3.6.1 basic_string find - -#include <string> -#include <testsuite_hooks.h> - -bool test01(void) -{ - bool test __attribute__((unused)) = true; - typedef std::wstring::size_type csize_type; - typedef std::wstring::const_reference cref; - typedef std::wstring::reference ref; - csize_type npos = std::wstring::npos; - csize_type csz01, csz02; - - const wchar_t str_lit01[] = L"mave"; - const std::wstring str01(L"mavericks, santa cruz"); - std::wstring str02(str_lit01); - std::wstring str03(L"s, s"); - std::wstring str04; - - // size_type find(const wstring&, size_type pos = 0) const; - csz01 = str01.find(str01); - VERIFY( csz01 == 0 ); - csz01 = str01.find(str01, 4); - VERIFY( csz01 == npos ); - csz01 = str01.find(str02, 0); - VERIFY( csz01 == 0 ); - csz01 = str01.find(str02, 3); - VERIFY( csz01 == npos ); - csz01 = str01.find(str03, 0); - VERIFY( csz01 == 8 ); - csz01 = str01.find(str03, 3); - VERIFY( csz01 == 8 ); - csz01 = str01.find(str03, 12); - VERIFY( csz01 == npos ); - - // An empty string consists of no characters - // therefore it should be found at every point in a string, - // except beyond the end - csz01 = str01.find(str04, 0); - VERIFY( csz01 == 0 ); - csz01 = str01.find(str04, 5); - VERIFY( csz01 == 5 ); - csz01 = str01.find(str04, str01.size()); - VERIFY( csz01 == str01.size() ); - csz01 = str01.find(str04, str01.size()+1); - VERIFY( csz01 == npos ); - - // size_type find(const wchar_t* s, size_type pos, size_type n) const; - csz01 = str01.find(str_lit01, 0, 3); - VERIFY( csz01 == 0 ); - csz01 = str01.find(str_lit01, 3, 0); - VERIFY( csz01 == 3 ); - - // size_type find(const wchar_t* s, size_type pos = 0) const; - csz01 = str01.find(str_lit01); - VERIFY( csz01 == 0 ); - csz01 = str01.find(str_lit01, 3); - VERIFY( csz01 == npos ); - - // size_type find(wchar_t c, size_type pos = 0) const; - csz01 = str01.find(L'z'); - csz02 = str01.size() - 1; - VERIFY( csz01 == csz02 ); - csz01 = str01.find(L'/'); - VERIFY( csz01 == npos ); - return test; -} - -int main() -{ - test01(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/find/wchar_t/2.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/find/wchar_t/2.cc deleted file mode 100644 index ff799163b..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/find/wchar_t/2.cc +++ /dev/null @@ -1,92 +0,0 @@ -// 1999-06-09 bkoz - -// Copyright (C) 1994, 1999, 2000, 2003, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.3.6.3 basic_string find_first_of - -#include <string> -#include <testsuite_hooks.h> - -bool test02(void) -{ - bool test __attribute__((unused)) = true; - typedef std::wstring::size_type csize_type; - csize_type npos = std::wstring::npos; - csize_type csz01, csz02; - - const wchar_t str_lit01[] = L"mave"; - const std::wstring str01(L"mavericks, santa cruz"); - std::wstring str02(str_lit01); - std::wstring str03(L"s, s"); - std::wstring str04; - - // size_type find_first_of(const wstring&, size_type pos = 0) const; - std::wstring str05(L"xena rulez"); - csz01 = str01.find_first_of(str01); - VERIFY( csz01 == 0 ); - csz01 = str01.find_first_of(str01, 4); - VERIFY( csz01 == 4 ); - csz01 = str01.find_first_of(str02, 0); - VERIFY( csz01 == 0 ); - csz01 = str01.find_first_of(str02, 3); - VERIFY( csz01 == 3 ); - csz01 = str01.find_first_of(str03, 0); - VERIFY( csz01 == 8 ); - csz01 = str01.find_first_of(str03, 3); - VERIFY( csz01 == 8 ); - csz01 = str01.find_first_of(str03, 12); - VERIFY( csz01 == 16 ); - csz01 = str01.find_first_of(str05, 0); - VERIFY( csz01 == 1 ); - csz01 = str01.find_first_of(str05, 4); - VERIFY( csz01 == 4 ); - - // An empty string consists of no characters - // therefore it should be found at every point in a string, - // except beyond the end - // However, str1.find_first_of(str2,pos) finds the first character in - // str1 (starting at pos) that exists in str2, which is none for empty str2 - csz01 = str01.find_first_of(str04, 0); - VERIFY( csz01 == npos ); - csz01 = str01.find_first_of(str04, 5); - VERIFY( csz01 == npos ); - - // size_type find_first_of(const wchar_t* s, size_type pos, size_type n) const; - csz01 = str01.find_first_of(str_lit01, 0, 3); - VERIFY( csz01 == 0 ); - csz01 = str01.find_first_of(str_lit01, 3, 0); - VERIFY( csz01 == npos ); - - // size_type find_first_of(const wchar_t* s, size_type pos = 0) const; - csz01 = str01.find_first_of(str_lit01); - VERIFY( csz01 == 0 ); - csz01 = str01.find_first_of(str_lit01, 3); - VERIFY( csz01 == 3 ); - - // size_type find_first_of(wchar_t c, size_type pos = 0) const; - csz01 = str01.find_first_of(L'z'); - csz02 = str01.size() - 1; - VERIFY( csz01 == csz02 ); - return test; -} - -int main() -{ - test02(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/find/wchar_t/3.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/find/wchar_t/3.cc deleted file mode 100644 index 4017f7383..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/find/wchar_t/3.cc +++ /dev/null @@ -1,92 +0,0 @@ -// 2003-05-04 Paolo Carlini <pcarlini@unitus.it> - -// Copyright (C) 2003, 2005, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.3.6.5 basic_string find_first_not_of - -#include <string> -#include <testsuite_hooks.h> - -bool test03(void) -{ - bool test __attribute__((unused)) = true; - typedef std::wstring::size_type csize_type; - csize_type npos = std::wstring::npos; - csize_type csz01; - - const std::wstring str01(L"Bob Rock, per me"); - const wchar_t str_lit01[] = L"Bob Rock"; - std::wstring str02(L"ovvero Trivi"); - std::wstring str03(str_lit01); - std::wstring str04; - - // size_type find_first_not_of(const string&, size_type pos = 0) const; - csz01 = str01.find_first_not_of(str01); - VERIFY( csz01 == npos ); - csz01 = str01.find_first_not_of(str02, 0); - VERIFY( csz01 == 0 ); - csz01 = str01.find_first_not_of(str02, 10); - VERIFY( csz01 == 10 ); - csz01 = str01.find_first_not_of(str02, 12); - VERIFY( csz01 == 14 ); - csz01 = str01.find_first_not_of(str03, 0); - VERIFY( csz01 == 8 ); - csz01 = str01.find_first_not_of(str03, 15); - VERIFY( csz01 == 15 ); - csz01 = str01.find_first_not_of(str03, 16); - VERIFY( csz01 == npos ); - csz01 = str01.find_first_not_of(str04, 0); - VERIFY( csz01 == 0 ); - csz01 = str01.find_first_not_of(str04, 12); - VERIFY( csz01 == 12 ); - csz01 = str03.find_first_not_of(str01, 0); - VERIFY( csz01 == npos ); - csz01 = str04.find_first_not_of(str02, 0); - VERIFY( csz01 == npos ); - - // size_type find_first_not_of(const char* s, size_type pos, size_type n) const; - csz01 = str01.find_first_not_of(str_lit01, 0, 0); - VERIFY( csz01 == 0 ); - csz01 = str01.find_first_not_of(str_lit01, 0, 8); - VERIFY( csz01 == 8 ); - csz01 = str01.find_first_not_of(str_lit01, 10, 0); - VERIFY( csz01 == 10 ); - - // size_type find_first_not_of(const char* s, size_type pos = 0) const; - csz01 = str01.find_first_not_of(str_lit01); - VERIFY( csz01 == 8 ); - csz01 = str02.find_first_not_of(str_lit01, 2); - VERIFY( csz01 == 2 ); - - // size_type find_first_not_of(char c, size_type pos = 0) const; - csz01 = str01.find_first_not_of(L'B'); - VERIFY( csz01 == 1 ); - csz01 = str01.find_first_not_of(L'o', 1); - VERIFY( csz01 == 2 ); - csz01 = str02.find_first_not_of(L'z'); - VERIFY( csz01 == 0 ); - csz01 = str04.find_first_not_of(L'S'); - VERIFY( csz01 == npos ); - return test; -} - -int main() -{ - test03(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/find/wchar_t/4.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/find/wchar_t/4.cc deleted file mode 100644 index 973ee92f7..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/find/wchar_t/4.cc +++ /dev/null @@ -1,42 +0,0 @@ -// 2007-03-30 Paolo Carlini <pcarlini@suse.de> - -// Copyright (C) 2007, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.3.6.1 basic_string find - -#include <string> -#include <testsuite_hooks.h> - -// libstdc++/31401 -void test01() -{ - bool test __attribute__((unused)) = true; - typedef std::wstring::size_type csize_type; - csize_type npos = std::wstring::npos; - - std::wstring use = L"anu"; - csize_type pos1 = use.find(L"a", npos); - - VERIFY( pos1 == npos ); -} - -int main() -{ - test01(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/init-list.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/init-list.cc deleted file mode 100644 index c039a4115..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/init-list.cc +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (C) 2008, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. -// - -// { dg-options "-std=gnu++0x" } - -#include <string> -#include <testsuite_hooks.h> - -using namespace std; - -int test01(void) -{ - bool test = true; - - string s1 = { 'a', 'b', 'c' }; - VERIFY(s1 == "abc"); - - s1 = { 'd', 'e', 'f' }; - VERIFY(s1 == "def"); - - s1 += { 'g', 'h', 'i' }; - VERIFY(s1 == "defghi"); - - s1.append({ 'j', 'k', 'l' }); - VERIFY(s1 == "defghijkl"); - - s1.assign({ 'm', 'n', 'o' }); - VERIFY(s1 == "mno"); - - // There aren't actually overloads of insert and replace taking size_type - // and initializer_list, but test the usage anyway. - s1.insert(2, { 'p', 'q', 'r' }); - VERIFY(s1 == "mnpqro"); - - s1.replace(2, 3, { 's', 't', 'u' }); - VERIFY(s1 == "mnstuo"); - - string::iterator i1, i2; - - i1 = s1.begin()+2; - s1.insert(i1, { 'v', 'w', 'x' }); - VERIFY(s1 == "mnvwxstuo"); - - i1 = s1.begin()+2; - i2 = i1+6; - s1.replace(i1, i2, { 'y', 'z' }); - VERIFY(s1 == "mnyzo"); - - return test; -} - -int main() -{ - __gnu_test::set_memory_limits(); - test01(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/insert/char/1.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/insert/char/1.cc deleted file mode 100644 index de4336d8c..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/insert/char/1.cc +++ /dev/null @@ -1,189 +0,0 @@ -// 1999-06-03 bkoz - -// Copyright (C) 1999, 2003, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.3.5.4 basic_string::insert - -#include <string> -#include <stdexcept> -#include <testsuite_hooks.h> - -int test01(void) -{ - bool test __attribute__((unused)) = true; - typedef std::string::size_type csize_type; - typedef std::string::iterator citerator; - csize_type csz01, csz02; - - const std::string str01("rodeo beach, marin"); - const std::string str02("baker beach, san francisco"); - std::string str03; - - // string& insert(size_type p1, const string& str, size_type p2, size_type n) - // requires: - // 1) p1 <= size() - // 2) p2 <= str.size() - // 3) rlen = min(n, str.size() - p2) - // throws: - // 1) out_of_range if p1 > size() || p2 > str.size() - // 2) length_error if size() >= npos - rlen - // effects: - // replaces *this with new string of length size() + rlen such that - // nstr[0] to nstr[p1] == thisstr[0] to thisstr[p1] - // nstr[p1 + 1] to nstr[p1 + rlen] == str[p2] to str[p2 + rlen] - // nstr[p1 + 1 + rlen] to nstr[...] == thisstr[p1 + 1] to thisstr[...] - str03 = str01; - csz01 = str03.size(); - csz02 = str02.size(); - try { - str03.insert(csz01 + 1, str02, 0, 5); - VERIFY( false ); - } - catch(std::out_of_range& fail) { - VERIFY( true ); - } - catch(...) { - VERIFY( false ); - } - - str03 = str01; - csz01 = str03.size(); - csz02 = str02.size(); - try { - str03.insert(0, str02, csz02 + 1, 5); - VERIFY( false ); - } - catch(std::out_of_range& fail) { - VERIFY( true ); - } - catch(...) { - VERIFY( false ); - } - - csz01 = str01.max_size(); - try { - std::string str04(csz01, 'b'); - str03 = str04; - csz02 = str02.size(); - try { - str03.insert(0, str02, 0, 5); - VERIFY( false ); - } - catch(std::length_error& fail) { - VERIFY( true ); - } - catch(...) { - VERIFY( false ); - } - } - catch(std::bad_alloc& failure){ - VERIFY( true ); - } - catch(std::exception& failure){ - VERIFY( false ); - } - - str03 = str01; - csz01 = str03.size(); - csz02 = str02.size(); - str03.insert(13, str02, 0, 12); - VERIFY( str03 == "rodeo beach, baker beach,marin" ); - - str03 = str01; - csz01 = str03.size(); - csz02 = str02.size(); - str03.insert(0, str02, 0, 12); - VERIFY( str03 == "baker beach,rodeo beach, marin" ); - - str03 = str01; - csz01 = str03.size(); - csz02 = str02.size(); - str03.insert(csz01, str02, 0, csz02); - VERIFY( str03 == "rodeo beach, marinbaker beach, san francisco" ); - - // string& insert(size_type __p, const string& string); - // insert(p1, str, 0, npos) - str03 = str01; - csz01 = str03.size(); - csz02 = str02.size(); - str03.insert(csz01, str02); - VERIFY( str03 == "rodeo beach, marinbaker beach, san francisco" ); - - str03 = str01; - csz01 = str03.size(); - csz02 = str02.size(); - str03.insert(0, str02); - VERIFY( str03 == "baker beach, san franciscorodeo beach, marin" ); - - // string& insert(size_type __p, const char* s, size_type n); - // insert(p1, string(s,n)) - str03 = str02; - csz01 = str03.size(); - str03.insert(0, "-break at the bridge", 20); - VERIFY( str03 == "-break at the bridgebaker beach, san francisco" ); - - // string& insert(size_type __p, const char* s); - // insert(p1, string(s)) - str03 = str02; - str03.insert(0, "-break at the bridge"); - VERIFY( str03 == "-break at the bridgebaker beach, san francisco" ); - - // string& insert(size_type __p, size_type n, char c) - // insert(p1, string(n,c)) - str03 = str02; - csz01 = str03.size(); - str03.insert(csz01, 5, 'z'); - VERIFY( str03 == "baker beach, san franciscozzzzz" ); - - // iterator insert(iterator p, char c) - // inserts a copy of c before the character referred to by p - str03 = str02; - citerator cit01 = str03.begin(); - str03.insert(cit01, 'u'); - VERIFY( str03 == "ubaker beach, san francisco" ); - - // iterator insert(iterator p, size_type n, char c) - // inserts n copies of c before the character referred to by p - str03 = str02; - cit01 = str03.begin(); - str03.insert(cit01, 5, 'u'); - VERIFY( str03 == "uuuuubaker beach, san francisco" ); - - // template<inputit> - // void - // insert(iterator p, inputit first, inputit, last) - // ISO-14882: defect #7 part 1 clarifies this member function to be: - // insert(p - begin(), string(first,last)) - str03 = str02; - csz01 = str03.size(); - str03.insert(str03.begin(), str01.begin(), str01.end()); - VERIFY( str03 == "rodeo beach, marinbaker beach, san francisco" ); - - str03 = str02; - csz01 = str03.size(); - str03.insert(str03.end(), str01.begin(), str01.end()); - VERIFY( str03 == "baker beach, san franciscorodeo beach, marin" ); - return test; -} - -int main() -{ - __gnu_test::set_memory_limits(); - test01(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/insert/char/2.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/insert/char/2.cc deleted file mode 100644 index 4cebac110..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/insert/char/2.cc +++ /dev/null @@ -1,82 +0,0 @@ -// 1999-06-03 bkoz - -// Copyright (C) 1999, 2003, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.3.5.4 basic_string::insert - -#include <string> -#include <testsuite_hooks.h> - -// More -// string& insert(size_type __p, const char* s, size_type n); -// string& insert(size_type __p, const char* s); -// but now s points inside the _Rep -int test02(void) -{ - bool test __attribute__((unused)) = true; - - std::string str01; - const char* title = "Everything was beautiful, and nothing hurt"; - // Increasing size: str01 is reallocated every time. - str01 = title; - str01.insert(0, str01.c_str() + str01.size() - 4, 4); - VERIFY( str01 == "hurtEverything was beautiful, and nothing hurt" ); - str01 = title; - str01.insert(0, str01.c_str(), 5); - VERIFY( str01 == "EveryEverything was beautiful, and nothing hurt" ); - str01 = title; - str01.insert(10, str01.c_str() + 4, 6); - VERIFY( str01 == "Everythingything was beautiful, and nothing hurt" ); - str01 = title; - str01.insert(15, str01.c_str(), 10); - VERIFY( str01 == "Everything was Everythingbeautiful, and nothing hurt" ); - str01 = title; - str01.insert(15, str01.c_str() + 11, 13); - VERIFY( str01 == "Everything was was beautifulbeautiful, and nothing hurt" ); - str01 = title; - str01.insert(0, str01.c_str()); - VERIFY( str01 == "Everything was beautiful, and nothing hurt" - "Everything was beautiful, and nothing hurt"); - // Again: no reallocations. - str01 = title; - str01.insert(0, str01.c_str() + str01.size() - 4, 4); - VERIFY( str01 == "hurtEverything was beautiful, and nothing hurt" ); - str01 = title; - str01.insert(0, str01.c_str(), 5); - VERIFY( str01 == "EveryEverything was beautiful, and nothing hurt" ); - str01 = title; - str01.insert(10, str01.c_str() + 4, 6); - VERIFY( str01 == "Everythingything was beautiful, and nothing hurt" ); - str01 = title; - str01.insert(15, str01.c_str(), 10); - VERIFY( str01 == "Everything was Everythingbeautiful, and nothing hurt" ); - str01 = title; - str01.insert(15, str01.c_str() + 11, 13); - VERIFY( str01 == "Everything was was beautifulbeautiful, and nothing hurt" ); - str01 = title; - str01.insert(0, str01.c_str()); - VERIFY( str01 == "Everything was beautiful, and nothing hurt" - "Everything was beautiful, and nothing hurt"); - return test; -} - -int main() -{ - test02(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/insert/wchar_t/1.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/insert/wchar_t/1.cc deleted file mode 100644 index 33c044c9e..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/insert/wchar_t/1.cc +++ /dev/null @@ -1,189 +0,0 @@ -// 1999-06-03 bkoz - -// Copyright (C) 1999, 2003, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.3.5.4 basic_string::insert - -#include <string> -#include <stdexcept> -#include <testsuite_hooks.h> - -int test01(void) -{ - bool test __attribute__((unused)) = true; - typedef std::wstring::size_type csize_type; - typedef std::wstring::iterator citerator; - csize_type csz01, csz02; - - const std::wstring str01(L"rodeo beach, marin"); - const std::wstring str02(L"baker beach, san francisco"); - std::wstring str03; - - // wstring& insert(size_type p1, const wstring& str, size_type p2, size_type n) - // requires: - // 1) p1 <= size() - // 2) p2 <= str.size() - // 3) rlen = min(n, str.size() - p2) - // throws: - // 1) out_of_range if p1 > size() || p2 > str.size() - // 2) length_error if size() >= npos - rlen - // effects: - // replaces *this with new wstring of length size() + rlen such that - // nstr[0] to nstr[p1] == thisstr[0] to thisstr[p1] - // nstr[p1 + 1] to nstr[p1 + rlen] == str[p2] to str[p2 + rlen] - // nstr[p1 + 1 + rlen] to nstr[...] == thisstr[p1 + 1] to thisstr[...] - str03 = str01; - csz01 = str03.size(); - csz02 = str02.size(); - try { - str03.insert(csz01 + 1, str02, 0, 5); - VERIFY( false ); - } - catch(std::out_of_range& fail) { - VERIFY( true ); - } - catch(...) { - VERIFY( false ); - } - - str03 = str01; - csz01 = str03.size(); - csz02 = str02.size(); - try { - str03.insert(0, str02, csz02 + 1, 5); - VERIFY( false ); - } - catch(std::out_of_range& fail) { - VERIFY( true ); - } - catch(...) { - VERIFY( false ); - } - - csz01 = str01.max_size(); - try { - std::wstring str04(csz01, L'b'); - str03 = str04; - csz02 = str02.size(); - try { - str03.insert(0, str02, 0, 5); - VERIFY( false ); - } - catch(std::length_error& fail) { - VERIFY( true ); - } - catch(...) { - VERIFY( false ); - } - } - catch(std::bad_alloc& failure){ - VERIFY( true ); - } - catch(std::exception& failure){ - VERIFY( false ); - } - - str03 = str01; - csz01 = str03.size(); - csz02 = str02.size(); - str03.insert(13, str02, 0, 12); - VERIFY( str03 == L"rodeo beach, baker beach,marin" ); - - str03 = str01; - csz01 = str03.size(); - csz02 = str02.size(); - str03.insert(0, str02, 0, 12); - VERIFY( str03 == L"baker beach,rodeo beach, marin" ); - - str03 = str01; - csz01 = str03.size(); - csz02 = str02.size(); - str03.insert(csz01, str02, 0, csz02); - VERIFY( str03 == L"rodeo beach, marinbaker beach, san francisco" ); - - // wstring& insert(size_type __p, const wstring& wstr); - // insert(p1, str, 0, npos) - str03 = str01; - csz01 = str03.size(); - csz02 = str02.size(); - str03.insert(csz01, str02); - VERIFY( str03 == L"rodeo beach, marinbaker beach, san francisco" ); - - str03 = str01; - csz01 = str03.size(); - csz02 = str02.size(); - str03.insert(0, str02); - VERIFY( str03 == L"baker beach, san franciscorodeo beach, marin" ); - - // wstring& insert(size_type __p, const wchar_t* s, size_type n); - // insert(p1, wstring(s,n)) - str03 = str02; - csz01 = str03.size(); - str03.insert(0, L"-break at the bridge", 20); - VERIFY( str03 == L"-break at the bridgebaker beach, san francisco" ); - - // wstring& insert(size_type __p, const wchar_t* s); - // insert(p1, wstring(s)) - str03 = str02; - str03.insert(0, L"-break at the bridge"); - VERIFY( str03 == L"-break at the bridgebaker beach, san francisco" ); - - // wstring& insert(size_type __p, size_type n, wchar_t c) - // insert(p1, wstring(n,c)) - str03 = str02; - csz01 = str03.size(); - str03.insert(csz01, 5, L'z'); - VERIFY( str03 == L"baker beach, san franciscozzzzz" ); - - // iterator insert(iterator p, wchar_t c) - // inserts a copy of c before the character referred to by p - str03 = str02; - citerator cit01 = str03.begin(); - str03.insert(cit01, L'u'); - VERIFY( str03 == L"ubaker beach, san francisco" ); - - // iterator insert(iterator p, size_type n, wchar_t c) - // inserts n copies of c before the character referred to by p - str03 = str02; - cit01 = str03.begin(); - str03.insert(cit01, 5, L'u'); - VERIFY( str03 == L"uuuuubaker beach, san francisco" ); - - // template<inputit> - // void - // insert(iterator p, inputit first, inputit, last) - // ISO-14882: defect #7 part 1 clarifies this member function to be: - // insert(p - begin(), wstring(first,last)) - str03 = str02; - csz01 = str03.size(); - str03.insert(str03.begin(), str01.begin(), str01.end()); - VERIFY( str03 == L"rodeo beach, marinbaker beach, san francisco" ); - - str03 = str02; - csz01 = str03.size(); - str03.insert(str03.end(), str01.begin(), str01.end()); - VERIFY( str03 == L"baker beach, san franciscorodeo beach, marin" ); - return test; -} - -int main() -{ - __gnu_test::set_memory_limits(); - test01(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/insert/wchar_t/2.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/insert/wchar_t/2.cc deleted file mode 100644 index 17c03cdae..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/insert/wchar_t/2.cc +++ /dev/null @@ -1,82 +0,0 @@ -// 1999-06-03 bkoz - -// Copyright (C) 1999, 2003, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.3.5.4 basic_string::insert - -#include <string> -#include <testsuite_hooks.h> - -// More -// wstring& insert(size_type __p, const wchar_t* s, size_type n); -// wstring& insert(size_type __p, const wchar_t* s); -// but now s points inside the _Rep -int test02(void) -{ - bool test __attribute__((unused)) = true; - - std::wstring str01; - const wchar_t* title = L"Everything was beautiful, and nothing hurt"; - // Increasing size: str01 is reallocated every time. - str01 = title; - str01.insert(0, str01.c_str() + str01.size() - 4, 4); - VERIFY( str01 == L"hurtEverything was beautiful, and nothing hurt" ); - str01 = title; - str01.insert(0, str01.c_str(), 5); - VERIFY( str01 == L"EveryEverything was beautiful, and nothing hurt" ); - str01 = title; - str01.insert(10, str01.c_str() + 4, 6); - VERIFY( str01 == L"Everythingything was beautiful, and nothing hurt" ); - str01 = title; - str01.insert(15, str01.c_str(), 10); - VERIFY( str01 == L"Everything was Everythingbeautiful, and nothing hurt" ); - str01 = title; - str01.insert(15, str01.c_str() + 11, 13); - VERIFY( str01 == L"Everything was was beautifulbeautiful, and nothing hurt" ); - str01 = title; - str01.insert(0, str01.c_str()); - VERIFY( str01 == L"Everything was beautiful, and nothing hurt" - L"Everything was beautiful, and nothing hurt"); - // Again: no reallocations. - str01 = title; - str01.insert(0, str01.c_str() + str01.size() - 4, 4); - VERIFY( str01 == L"hurtEverything was beautiful, and nothing hurt" ); - str01 = title; - str01.insert(0, str01.c_str(), 5); - VERIFY( str01 == L"EveryEverything was beautiful, and nothing hurt" ); - str01 = title; - str01.insert(10, str01.c_str() + 4, 6); - VERIFY( str01 == L"Everythingything was beautiful, and nothing hurt" ); - str01 = title; - str01.insert(15, str01.c_str(), 10); - VERIFY( str01 == L"Everything was Everythingbeautiful, and nothing hurt" ); - str01 = title; - str01.insert(15, str01.c_str() + 11, 13); - VERIFY( str01 == L"Everything was was beautifulbeautiful, and nothing hurt" ); - str01 = title; - str01.insert(0, str01.c_str()); - VERIFY( str01 == L"Everything was beautiful, and nothing hurt" - L"Everything was beautiful, and nothing hurt"); - return test; -} - -int main() -{ - test02(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/char/1.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/char/1.cc deleted file mode 100644 index 9b3ed4c3c..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/char/1.cc +++ /dev/null @@ -1,165 +0,0 @@ -// 1999-07-01 bkoz - -// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2009 -// 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.3.7.9 inserters and extractors - -// NB: This file is predicated on sstreams, istreams, and ostreams -// working, not to mention other major details like char_traits, and -// all of the string class. - -#include <string> -#include <stdexcept> -#include <sstream> -#include <fstream> -#include <iostream> -#include <testsuite_hooks.h> - -bool test01(void) -{ - bool test __attribute__((unused)) = true; - typedef std::string::size_type csize_type; - typedef std::string::const_reference cref; - typedef std::string::reference ref; - - const std::string str01("sailing grand traverse bay\n" - "\t\t\t from Elk Rapids to the point reminds me of miles"); - const std::string str02("sailing"); - const std::string str03("grand"); - const std::string str04("traverse"); - const std::string str05; - std::string str10; - - // istream& operator>>(istream&, string&) - std::istringstream istrs01(str01); - istrs01 >> str10; - VERIFY( str10 == str02 ); - try - { - std::istringstream::int_type i01 = istrs01.peek(); //a-boo - VERIFY( std::istringstream::traits_type::to_char_type(i01) == ' ' ); - } - catch(std::exception& fail) - { - VERIFY( false ); // shouldn't throw - } - - istrs01.clear(); - istrs01 >> str10; - VERIFY( str10 == str03 ); - istrs01.clear(); - istrs01 >> str10; - VERIFY( str10 == str04 ); // sentry picks out the white spaces. . - - std::istringstream istrs02(str05); // empty - istrs02 >> str10; - VERIFY( str10 == str04 ); - - // istream& getline(istream&, string&, char) - // istream& getline(istream&, string&) - try - { - istrs01.clear(); - getline(istrs01, str10); - VERIFY( !istrs01.fail() ); - VERIFY( !istrs01.eof() ); - VERIFY( istrs01.good() ); - VERIFY( str10 == " bay" ); - } - catch(std::exception& fail) - { - VERIFY( false ); // shouldn't throw - } - - try - { - istrs01.clear(); - getline(istrs01, str10,'\t'); - VERIFY( !istrs01.fail() ); - VERIFY( !istrs01.eof() ); - VERIFY( istrs01.good() ); - VERIFY( str10 == str05 ); - } - catch(std::exception& fail) - { - VERIFY( false ); // shouldn't throw - } - - try - { - istrs01.clear(); - getline(istrs01, str10,'\t'); - VERIFY( !istrs01.fail() ); - VERIFY( !istrs01.eof() ); - VERIFY( istrs01.good() ); - VERIFY( str10 == str05 ); - } - catch(std::exception& fail) - { - VERIFY( false ); // shouldn't throw - } - - try - { - istrs01.clear(); - getline(istrs01, str10, '.'); - VERIFY( !istrs01.fail() ); - VERIFY( istrs01.eof() ); - VERIFY( !istrs01.good() ); - VERIFY( str10 == "\t from Elk Rapids to the point reminds me of miles" ); - } - catch(std::exception& fail) - { - VERIFY( false ); // shouldn't throw - } - - try - { - getline(istrs02, str10); - VERIFY( istrs02.fail() ); - VERIFY( istrs02.eof() ); - VERIFY( str10 =="\t from Elk Rapids to the point reminds me of miles" ); - } - catch(std::exception& fail) - { - VERIFY( false ); // shouldn't throw - } - - // ostream& operator<<(ostream&, const basic_string&) - std::ostringstream ostrs01; - try - { - ostrs01 << str01; - VERIFY( ostrs01.str() == str01 ); - } - catch(std::exception& fail) - { - VERIFY( false ); - } - - std::string hello_world; - std::cout << hello_world; - return test; -} - -int main() -{ - test01(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/char/10.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/char/10.cc deleted file mode 100644 index f2722fe96..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/char/10.cc +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (C) 2004, 2005, 2006, 2007, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.3.7.9 inserters and extractors - -// { dg-require-fileio "" } - -#include <istream> -#include <string> -#include <fstream> -#include <cstdlib> -#include <testsuite_hooks.h> - -using namespace std; - -string prepare(string::size_type len, unsigned nchunks, char delim) -{ - string ret; - for (unsigned i = 0; i < nchunks; ++i) - { - for (string::size_type j = 0; j < len; ++j) - ret.push_back('a' + rand() % 26); - len *= 2; - ret.push_back(delim); - } - return ret; -} - -void check(istream& stream, const string& str, unsigned nchunks, char delim) -{ - bool test __attribute__((unused)) = true; - - string chunk; - string::size_type index = 0, index_new = 0; - unsigned n = 0; - - while (getline(stream, chunk, delim)) - { - index_new = str.find(delim, index); - VERIFY( !str.compare(index, index_new - index, chunk) ); - index = index_new + 1; - ++n; - } - VERIFY( stream.eof() ); - VERIFY( n == nchunks ); -} - -// istream& getline(istream&, string&, char) -void test01() -{ - const char filename[] = "inserters_extractors-2.txt"; - - const char delim = '|'; - const unsigned nchunks = 10; - const string data = prepare(777, nchunks, delim); - - ofstream ofstrm; - ofstrm.open(filename); - ofstrm.write(data.data(), data.size()); - ofstrm.close(); - - ifstream ifstrm; - ifstrm.open(filename); - check(ifstrm, data, nchunks, delim); - ifstrm.close(); -} - -int main() -{ - test01(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/char/11.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/char/11.cc deleted file mode 100644 index 662311a88..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/char/11.cc +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (C) 2004, 2005, 2006, 2007, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.3.7.9 inserters and extractors - -// { dg-require-fileio "" } - -#include <istream> -#include <string> -#include <fstream> -#include <cstdlib> -#include <testsuite_hooks.h> - -using namespace std; - -string prepare(string::size_type len, unsigned nchunks) -{ - string ret; - for (unsigned i = 0; i < nchunks; ++i) - { - for (string::size_type j = 0; j < len; ++j) - ret.push_back('a' + rand() % 26); - len *= 2; - ret.push_back(' '); - } - return ret; -} - -void check(istream& stream, const string& str, unsigned nchunks) -{ - bool test __attribute__((unused)) = true; - - string chunk; - string::size_type index = 0, index_new = 0; - unsigned n = 0; - - while (stream >> chunk) - { - index_new = str.find(' ', index); - VERIFY( !str.compare(index, index_new - index, chunk) ); - index = index_new + 1; - ++n; - } - VERIFY( stream.eof() ); - VERIFY( n == nchunks ); -} - -// istream& operator>>(istream&, string&) -void test01() -{ - const char filename[] = "inserters_extractors-3.txt"; - - const unsigned nchunks = 10; - const string data = prepare(666, nchunks); - - ofstream ofstrm; - ofstrm.open(filename); - ofstrm.write(data.data(), data.size()); - ofstrm.close(); - - ifstream ifstrm; - ifstrm.open(filename); - check(ifstrm, data, nchunks); - ifstrm.close(); -} - -int main() -{ - test01(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/char/28277.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/char/28277.cc deleted file mode 100644 index dfcacc089..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/char/28277.cc +++ /dev/null @@ -1,54 +0,0 @@ -// 2006-10-12 Paolo Carlini <pcarlini@suse.de> - -// Copyright (C) 2006, 2007, 2008, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// { dg-options "-DWIDTH=200000" { target simulator } } - -// 21.3.7.9 inserters and extractors - -#include <ostream> -#include <sstream> -#include <testsuite_hooks.h> - -#ifndef WIDTH -#define WIDTH 20000000 -#endif - -// libstdc++/28277 -void test01() -{ - using namespace std; - bool test __attribute__((unused)) = true; - - ostringstream oss_01; - const string str_01(50, 'a'); - - oss_01.width(WIDTH); - const streamsize width = oss_01.width(); - - oss_01 << str_01; - - VERIFY( oss_01.good() ); - VERIFY( oss_01.str().size() == string::size_type(width) ); -} - -int main() -{ - test01(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/char/4.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/char/4.cc deleted file mode 100644 index cb1713bc8..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/char/4.cc +++ /dev/null @@ -1,65 +0,0 @@ -// 1999-07-01 bkoz - -// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2009 -// 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.3.7.9 inserters and extractors - -// NB: This file is predicated on sstreams, istreams, and ostreams -// working, not to mention other major details like char_traits, and -// all of the string class. - -#include <string> -#include <sstream> -#include <testsuite_hooks.h> - -// testing basic_stringbuf::xsputn via stress testing with large strings -// based on a bug report libstdc++ 9 -void test04(std::size_t size) -{ - bool test __attribute__((unused)) = true; - std::string str(size, 's'); - std::size_t expected_size = 2 * (size + 1); - std::ostringstream oss(str); - - // sanity checks - VERIFY( str.size() == size ); - VERIFY( oss.good() ); - - // stress test - oss << str << std::endl; - if (!oss.good()) - test = false; - - oss << str << std::endl; - if (!oss.good()) - test = false; - - VERIFY( str.size() == size ); - VERIFY( oss.good() ); - std::string str_tmp = oss.str(); - VERIFY( str_tmp.size() == expected_size ); -} - -int main() -{ - test04(1); // expected_size == 4 - test04(1000); // expected_size == 2002 - test04(10000); // expected_size == 20002 - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/char/5.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/char/5.cc deleted file mode 100644 index 109627325..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/char/5.cc +++ /dev/null @@ -1,88 +0,0 @@ -// 1999-07-01 bkoz - -// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2009 -// 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.3.7.9 inserters and extractors - -// NB: This file is predicated on sstreams, istreams, and ostreams -// working, not to mention other major details like char_traits, and -// all of the string class. - -// { dg-require-fileio "" } - -#include <string> -#include <fstream> -#include <iostream> -#include <testsuite_hooks.h> - -// testing basic_filebuf::xsputn via stress testing with large strings -// based on a bug report libstdc++ 9 -// mode == out -void test05(std::size_t size) -{ - bool test __attribute__((unused)) = true; - const char filename[] = "inserters_extractors-1.txt"; - const char fillc = 'f'; - std::ofstream ofs(filename); - std::string str(size, fillc); - - // sanity checks - VERIFY( str.size() == size ); - VERIFY( ofs.good() ); - - // stress test - ofs << str << std::endl; - if (!ofs.good()) - test = false; - - ofs << str << std::endl; - if (!ofs.good()) - test = false; - - VERIFY( str.size() == size ); - VERIFY( ofs.good() ); - - ofs.close(); - - // sanity check on the written file - std::ifstream ifs(filename); - std::size_t count = 0; - char c; - while (count <= (2 * size) + 4) - { - ifs >> c; - if (ifs.good() && c == fillc) - { - ++count; - c = '0'; - } - else - break; - } - - VERIFY( count == 2 * size ); -} - -int main() -{ - test05(1); - test05(1000); - test05(10000); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/char/6.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/char/6.cc deleted file mode 100644 index cc0e5d673..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/char/6.cc +++ /dev/null @@ -1,61 +0,0 @@ -// 1999-07-01 bkoz - -// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2009 -// 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.3.7.9 inserters and extractors - -// NB: This file is predicated on sstreams, istreams, and ostreams -// working, not to mention other major details like char_traits, and -// all of the string class. - -#include <string> -#include <sstream> -#include <testsuite_hooks.h> - -// istringstream/stringbuf extractor properly size buffer based on -// actual, not allocated contents (string.size() vs. string.capacity()). -// http://gcc.gnu.org/ml/libstdc++/1999-q4/msg00049.html -void test06(void) -{ - bool test __attribute__((unused)) = true; - - typedef std::string::size_type size_type; - std::string str01("@silent"); - size_type i01 = str01.size(); - size_type i02 = str01.capacity(); - str01.erase(0, 1); - size_type i03 = str01.size(); - size_type i04 = str01.capacity(); - VERIFY( i01 - 1 == i03 ); - VERIFY( i02 >= i04 ); - - std::istringstream is(str01); - std::string str02; - is >> str02 >> std::ws; - size_type i05 = str02.size(); - size_type i06 = str02.capacity(); - VERIFY( i05 == i03 ); - VERIFY( i06 <= i04 ); -} - -int main() -{ - test06(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/char/7.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/char/7.cc deleted file mode 100644 index c8ae3c580..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/char/7.cc +++ /dev/null @@ -1,53 +0,0 @@ -// 1999-07-01 bkoz - -// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2009 -// 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.3.7.9 inserters and extractors - -// NB: This file is predicated on sstreams, istreams, and ostreams -// working, not to mention other major details like char_traits, and -// all of the string class. - -#include <string> -#include <sstream> -#include <testsuite_hooks.h> - -// http://gcc.gnu.org/ml/libstdc++/2000-q1/msg00085.html -// istream::operator>>(string) -// sets failbit -// NB: this is a defect in the standard. -void test07(void) -{ - bool test __attribute__((unused)) = true; - const std::string name("z6.cc"); - std::istringstream iss (name); - int i = 0; - std::string s; - while (iss >> s) - ++i; - - VERIFY( i < 3 ); - VERIFY( static_cast<bool>(iss.rdstate() & std::ios_base::failbit) ); -} - -int main() -{ - test07(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/char/8.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/char/8.cc deleted file mode 100644 index 4e008a369..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/char/8.cc +++ /dev/null @@ -1,53 +0,0 @@ -// 1999-07-01 bkoz - -// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2009 -// 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.3.7.9 inserters and extractors - -// NB: This file is predicated on sstreams, istreams, and ostreams -// working, not to mention other major details like char_traits, and -// all of the string class. - -#include <string> -#include <sstream> -#include <iomanip> -#include <testsuite_hooks.h> - -// libstdc++/1019 -void test08() -{ - using namespace std; - - bool test __attribute__((unused)) = true; - istringstream istrm("enero:2001"); - int year; - char sep; - string month; - - istrm >> setw(5) >> month >> sep >> year; - VERIFY( month.size() == 5 ); - VERIFY( sep == ':' ); - VERIFY( year == 2001 ); -} - -int main() -{ - test08(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/char/9.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/char/9.cc deleted file mode 100644 index 29d3e7704..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/char/9.cc +++ /dev/null @@ -1,56 +0,0 @@ -// 1999-07-01 bkoz - -// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2009 -// 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.3.7.9 inserters and extractors - -// NB: This file is predicated on sstreams, istreams, and ostreams -// working, not to mention other major details like char_traits, and -// all of the string class. - -#include <string> -#include <sstream> -#include <iomanip> -#include <testsuite_hooks.h> - -// libstdc++/2830 -void test09() -{ - bool test __attribute__((unused)) = true; - std::string blanks( 3, '\0'); - std::string foo = "peace"; - foo += blanks; - foo += "& love"; - - std::ostringstream oss1; - oss1 << foo; - VERIFY( oss1.str() == foo ); - - std::ostringstream oss2; - oss2.width(20); - oss2 << foo; - VERIFY( oss2.str() != foo ); - VERIFY( oss2.str().size() == 20 ); -} - -int main() -{ - test09(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/pod/10081-in.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/pod/10081-in.cc deleted file mode 100644 index 142977c0c..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/pod/10081-in.cc +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2009 -// 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - - -// 27.6.1.1.2 class basic_istream::sentry - -#include <string> -#include <istream> -#include <sstream> -#include <locale> -#include <typeinfo> -#include <testsuite_hooks.h> -#include <testsuite_character.h> - -void test01() -{ - using namespace std; - using __gnu_test::pod_ushort; - typedef basic_string<pod_ushort> string_type; - typedef basic_stringbuf<pod_ushort> stringbuf_type; - typedef basic_istream<pod_ushort> istream_type; - - bool test __attribute__((unused)) = true; - - string_type str; - stringbuf_type strbuf01; - istream_type stream(&strbuf01); - - try - { - stream >> str; - } - catch (std::bad_cast& obj) - { - // Ok, throws bad_cast because locale has no ctype facet. - } - catch (...) - { - VERIFY( false ); - } - - const std::locale loc(std::locale::classic(), new std::ctype<pod_ushort>); - stream.imbue(loc); - try - { - stream >> str; - } - catch (...) - { - VERIFY( false ); - } -} - -#if !__GXX_WEAK__ -// Explicitly instantiate for systems with no COMDAT or weak support. -template - const std::basic_string<__gnu_test::pod_ushort>::size_type - std::basic_string<__gnu_test::pod_ushort>::_Rep::_S_max_size; - -template - const __gnu_test::pod_ushort - std::basic_string<__gnu_test::pod_ushort>::_Rep::_S_terminal; -#endif - -int main() -{ - test01(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/pod/10081-out.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/pod/10081-out.cc deleted file mode 100644 index 50c9ec738..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/pod/10081-out.cc +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2009 -// 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - - -// 27.6.1.1.2 class basic_istream::sentry - -#include <string> -#include <ostream> -#include <sstream> -#include <locale> -#include <typeinfo> -#include <testsuite_hooks.h> -#include <testsuite_character.h> - -void test01() -{ - using namespace std; - using __gnu_test::pod_ushort; - typedef basic_string<pod_ushort> string_type; - typedef basic_stringbuf<pod_ushort> stringbuf_type; - typedef basic_ostream<pod_ushort> ostream_type; - - bool test __attribute__((unused)) = true; - - string_type str; - stringbuf_type strbuf01; - ostream_type stream(&strbuf01); - - try - { - stream << str; - } - catch (std::bad_cast& obj) - { - // Ok, throws bad_cast because locale has no ctype facet. - } - catch (...) - { - VERIFY( false ); - } - - const std::locale loc(std::locale::classic(), new std::ctype<pod_ushort>); - stream.imbue(loc); - try - { - stream << str; - } - catch (...) - { - VERIFY( false ); - } -} - -#if !__GXX_WEAK__ -// Explicitly instantiate for systems with no COMDAT or weak support. -template - const std::basic_string<__gnu_test::pod_ushort>::size_type - std::basic_string<__gnu_test::pod_ushort>::_Rep::_S_max_size; - -template - const __gnu_test::pod_ushort - std::basic_string<__gnu_test::pod_ushort>::_Rep::_S_terminal; -#endif - -int main() -{ - test01(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/wchar_t/1.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/wchar_t/1.cc deleted file mode 100644 index a98201f67..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/wchar_t/1.cc +++ /dev/null @@ -1,165 +0,0 @@ -// 1999-07-01 bkoz - -// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2009 -// 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.3.7.9 inserters and extractors - -// NB: This file is predicated on sstreams, istreams, and ostreams -// working, not to mention other major details like char_traits, and -// all of the string class. - -#include <string> -#include <stdexcept> -#include <sstream> -#include <fstream> -#include <iostream> -#include <testsuite_hooks.h> - -bool test01(void) -{ - bool test __attribute__((unused)) = true; - typedef std::wstring::size_type csize_type; - typedef std::wstring::const_reference cref; - typedef std::wstring::reference ref; - - const std::wstring str01(L"sailing grand traverse bay\n" - L"\t\t\t from Elk Rapids to the point reminds me of miles"); - const std::wstring str02(L"sailing"); - const std::wstring str03(L"grand"); - const std::wstring str04(L"traverse"); - const std::wstring str05; - std::wstring str10; - - // istream& operator>>(istream&, string&) - std::wistringstream istrs01(str01); - istrs01 >> str10; - VERIFY( str10 == str02 ); - try - { - std::wistringstream::int_type i01 = istrs01.peek(); //a-boo - VERIFY( std::wistringstream::traits_type::to_char_type(i01) == L' ' ); - } - catch(std::exception& fail) - { - VERIFY( false ); // shouldn't throw - } - - istrs01.clear(); - istrs01 >> str10; - VERIFY( str10 == str03 ); - istrs01.clear(); - istrs01 >> str10; - VERIFY( str10 == str04 ); // sentry picks out the white spaces. . - - std::wistringstream istrs02(str05); // empty - istrs02 >> str10; - VERIFY( str10 == str04 ); - - // istream& getline(istream&, string&, char) - // istream& getline(istream&, string&) - try - { - istrs01.clear(); - getline(istrs01, str10); - VERIFY( !istrs01.fail() ); - VERIFY( !istrs01.eof() ); - VERIFY( istrs01.good() ); - VERIFY( str10 == L" bay" ); - } - catch(std::exception& fail) - { - VERIFY( false ); // shouldn't throw - } - - try - { - istrs01.clear(); - getline(istrs01, str10, L'\t'); - VERIFY( !istrs01.fail() ); - VERIFY( !istrs01.eof() ); - VERIFY( istrs01.good() ); - VERIFY( str10 == str05 ); - } - catch(std::exception& fail) - { - VERIFY( false ); // shouldn't throw - } - - try - { - istrs01.clear(); - getline(istrs01, str10, L'\t'); - VERIFY( !istrs01.fail() ); - VERIFY( !istrs01.eof() ); - VERIFY( istrs01.good() ); - VERIFY( str10 == str05 ); - } - catch(std::exception& fail) - { - VERIFY( false ); // shouldn't throw - } - - try - { - istrs01.clear(); - getline(istrs01, str10, L'.'); - VERIFY( !istrs01.fail() ); - VERIFY( istrs01.eof() ); - VERIFY( !istrs01.good() ); - VERIFY( str10 == L"\t from Elk Rapids to the point reminds me of miles" ); - } - catch(std::exception& fail) - { - VERIFY( false ); // shouldn't throw - } - - try - { - getline(istrs02, str10); - VERIFY( istrs02.fail() ); - VERIFY( istrs02.eof() ); - VERIFY( str10 == L"\t from Elk Rapids to the point reminds me of miles" ); - } - catch(std::exception& fail) - { - VERIFY( false ); // shouldn't throw - } - - // ostream& operator<<(ostream&, const basic_string&) - std::wostringstream ostrs01; - try - { - ostrs01 << str01; - VERIFY( ostrs01.str() == str01 ); - } - catch(std::exception& fail) - { - VERIFY( false ); - } - - std::wstring hello_world; - std::wcout << hello_world; - return test; -} - -int main() -{ - test01(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/wchar_t/10.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/wchar_t/10.cc deleted file mode 100644 index 0883e13c3..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/wchar_t/10.cc +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (C) 2004, 2005, 2006, 2007, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.3.7.9 inserters and extractors - -#include <istream> -#include <string> -#include <fstream> -#include <cstdlib> -#include <testsuite_hooks.h> - -using namespace std; - -wstring prepare(wstring::size_type len, unsigned nchunks, wchar_t delim) -{ - wstring ret; - for (unsigned i = 0; i < nchunks; ++i) - { - for (wstring::size_type j = 0; j < len; ++j) - ret.push_back(L'a' + rand() % 26); - len *= 2; - ret.push_back(delim); - } - return ret; -} - -void check(wistream& stream, const wstring& str, unsigned nchunks, wchar_t delim) -{ - bool test __attribute__((unused)) = true; - - wstring chunk; - wstring::size_type index = 0, index_new = 0; - unsigned n = 0; - - while (getline(stream, chunk, delim)) - { - index_new = str.find(delim, index); - VERIFY( !str.compare(index, index_new - index, chunk) ); - index = index_new + 1; - ++n; - } - VERIFY( stream.eof() ); - VERIFY( n == nchunks ); -} - -// istream& getline(istream&, string&, char) -void test01() -{ - const char filename[] = "inserters_extractors-2.txt"; - - const wchar_t delim = L'|'; - const unsigned nchunks = 10; - const wstring data = prepare(777, nchunks, delim); - - wofstream ofstrm; - ofstrm.open(filename); - ofstrm.write(data.data(), data.size()); - ofstrm.close(); - - wifstream ifstrm; - ifstrm.open(filename); - check(ifstrm, data, nchunks, delim); - ifstrm.close(); -} - -int main() -{ - test01(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/wchar_t/11.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/wchar_t/11.cc deleted file mode 100644 index 2f174cad4..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/wchar_t/11.cc +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (C) 2004, 2005, 2006, 2007, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.3.7.9 inserters and extractors - -#include <istream> -#include <string> -#include <fstream> -#include <cstdlib> -#include <testsuite_hooks.h> - -using namespace std; - -wstring prepare(wstring::size_type len, unsigned nchunks) -{ - wstring ret; - for (unsigned i = 0; i < nchunks; ++i) - { - for (wstring::size_type j = 0; j < len; ++j) - ret.push_back(L'a' + rand() % 26); - len *= 2; - ret.push_back(L' '); - } - return ret; -} - -void check(wistream& stream, const wstring& str, unsigned nchunks) -{ - bool test __attribute__((unused)) = true; - - wstring chunk; - wstring::size_type index = 0, index_new = 0; - unsigned n = 0; - - while (stream >> chunk) - { - index_new = str.find(L' ', index); - VERIFY( !str.compare(index, index_new - index, chunk) ); - index = index_new + 1; - ++n; - } - VERIFY( stream.eof() ); - VERIFY( n == nchunks ); -} - -// istream& operator>>(istream&, string&) -void test01() -{ - const char filename[] = "inserters_extractors-3.txt"; - - const unsigned nchunks = 10; - const wstring data = prepare(666, nchunks); - - wofstream ofstrm; - ofstrm.open(filename); - ofstrm.write(data.data(), data.size()); - ofstrm.close(); - - wifstream ifstrm; - ifstrm.open(filename); - check(ifstrm, data, nchunks); - ifstrm.close(); -} - -int main() -{ - test01(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/wchar_t/28277.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/wchar_t/28277.cc deleted file mode 100644 index 51c26fd80..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/wchar_t/28277.cc +++ /dev/null @@ -1,54 +0,0 @@ -// 2006-10-12 Paolo Carlini <pcarlini@suse.de> - -// Copyright (C) 2006, 2007, 2008, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// { dg-options "-DWIDTH=500000" { target simulator } } - -// 21.3.7.9 inserters and extractors - -#include <ostream> -#include <sstream> -#include <testsuite_hooks.h> - -#ifndef WIDTH -#define WIDTH 50000000 -#endif - -// libstdc++/28277 -void test01() -{ - using namespace std; - bool test __attribute__((unused)) = true; - - wostringstream oss_01; - const wstring str_01(50, L'a'); - - oss_01.width(WIDTH); - const streamsize width = oss_01.width(); - - oss_01 << str_01; - - VERIFY( oss_01.good() ); - VERIFY( oss_01.str().size() == wstring::size_type(width) ); -} - -int main() -{ - test01(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/wchar_t/4.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/wchar_t/4.cc deleted file mode 100644 index 78bdf5132..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/wchar_t/4.cc +++ /dev/null @@ -1,65 +0,0 @@ -// 1999-07-01 bkoz - -// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2009 -// 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.3.7.9 inserters and extractors - -// NB: This file is predicated on sstreams, istreams, and ostreams -// working, not to mention other major details like char_traits, and -// all of the string class. - -#include <string> -#include <sstream> -#include <testsuite_hooks.h> - -// testing basic_stringbuf::xsputn via stress testing with large strings -// based on a bug report libstdc++ 9 -void test04(std::size_t size) -{ - bool test __attribute__((unused)) = true; - std::wstring str(size, L's'); - std::size_t expected_size = 2 * (size + 1); - std::wostringstream oss(str); - - // sanity checks - VERIFY( str.size() == size ); - VERIFY( oss.good() ); - - // stress test - oss << str << std::endl; - if (!oss.good()) - test = false; - - oss << str << std::endl; - if (!oss.good()) - test = false; - - VERIFY( str.size() == size ); - VERIFY( oss.good() ); - std::wstring str_tmp = oss.str(); - VERIFY( str_tmp.size() == expected_size ); -} - -int main() -{ - test04(1); // expected_size == 4 - test04(1000); // expected_size == 2002 - test04(10000); // expected_size == 20002 - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/wchar_t/5.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/wchar_t/5.cc deleted file mode 100644 index d9657a4c7..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/wchar_t/5.cc +++ /dev/null @@ -1,86 +0,0 @@ -// 1999-07-01 bkoz - -// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2009 -// 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.3.7.9 inserters and extractors - -// NB: This file is predicated on sstreams, istreams, and ostreams -// working, not to mention other major details like char_traits, and -// all of the string class. - -#include <string> -#include <fstream> -#include <iostream> -#include <testsuite_hooks.h> - -// testing basic_filebuf::xsputn via stress testing with large strings -// based on a bug report libstdc++ 9 -// mode == out -void test05(std::size_t size) -{ - bool test __attribute__((unused)) = true; - const char filename[] = "inserters_extractors-1.txt"; - const wchar_t fillc = L'f'; - std::wofstream ofs(filename); - std::wstring str(size, fillc); - - // sanity checks - VERIFY( str.size() == size ); - VERIFY( ofs.good() ); - - // stress test - ofs << str << std::endl; - if (!ofs.good()) - test = false; - - ofs << str << std::endl; - if (!ofs.good()) - test = false; - - VERIFY( str.size() == size ); - VERIFY( ofs.good() ); - - ofs.close(); - - // sanity check on the written file - std::wifstream ifs(filename); - std::size_t count = 0; - wchar_t c; - while (count <= (2 * size) + 4) - { - ifs >> c; - if (ifs.good() && c == fillc) - { - ++count; - c = '0'; - } - else - break; - } - - VERIFY( count == 2 * size ); -} - -int main() -{ - test05(1); - test05(1000); - test05(10000); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/wchar_t/6.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/wchar_t/6.cc deleted file mode 100644 index e49f61fb0..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/wchar_t/6.cc +++ /dev/null @@ -1,61 +0,0 @@ -// 1999-07-01 bkoz - -// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2009 -// 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.3.7.9 inserters and extractors - -// NB: This file is predicated on sstreams, istreams, and ostreams -// working, not to mention other major details like char_traits, and -// all of the string class. - -#include <string> -#include <sstream> -#include <testsuite_hooks.h> - -// istringstream/stringbuf extractor properly size buffer based on -// actual, not allocated contents (string.size() vs. string.capacity()). -// http://gcc.gnu.org/ml/libstdc++/1999-q4/msg00049.html -void test06(void) -{ - bool test __attribute__((unused)) = true; - - typedef std::wstring::size_type size_type; - std::wstring str01(L"@silent"); - size_type i01 = str01.size(); - size_type i02 = str01.capacity(); - str01.erase(0, 1); - size_type i03 = str01.size(); - size_type i04 = str01.capacity(); - VERIFY( i01 - 1 == i03 ); - VERIFY( i02 >= i04 ); - - std::wistringstream is(str01); - std::wstring str02; - is >> str02 >> std::ws; - size_type i05 = str02.size(); - size_type i06 = str02.capacity(); - VERIFY( i05 == i03 ); - VERIFY( i06 <= i04 ); -} - -int main() -{ - test06(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/wchar_t/7.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/wchar_t/7.cc deleted file mode 100644 index 4032e389d..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/wchar_t/7.cc +++ /dev/null @@ -1,53 +0,0 @@ -// 1999-07-01 bkoz - -// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2009 -// 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.3.7.9 inserters and extractors - -// NB: This file is predicated on sstreams, istreams, and ostreams -// working, not to mention other major details like char_traits, and -// all of the string class. - -#include <string> -#include <sstream> -#include <testsuite_hooks.h> - -// http://gcc.gnu.org/ml/libstdc++/2000-q1/msg00085.html -// istream::operator>>(string) -// sets failbit -// NB: this is a defect in the standard. -void test07(void) -{ - bool test __attribute__((unused)) = true; - const std::wstring name(L"z6.cc"); - std::wistringstream iss(name); - int i = 0; - std::wstring s; - while (iss >> s) - ++i; - - VERIFY( i < 3 ); - VERIFY( static_cast<bool>(iss.rdstate() & std::ios_base::failbit) ); -} - -int main() -{ - test07(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/wchar_t/8.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/wchar_t/8.cc deleted file mode 100644 index 58dc00eca..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/wchar_t/8.cc +++ /dev/null @@ -1,53 +0,0 @@ -// 1999-07-01 bkoz - -// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2009 -// 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.3.7.9 inserters and extractors - -// NB: This file is predicated on sstreams, istreams, and ostreams -// working, not to mention other major details like char_traits, and -// all of the string class. - -#include <string> -#include <sstream> -#include <iomanip> -#include <testsuite_hooks.h> - -// libstdc++/1019 -void test08() -{ - using namespace std; - - bool test __attribute__((unused)) = true; - wistringstream istrm(L"enero:2001"); - int year; - wchar_t sep; - wstring month; - - istrm >> setw(5) >> month >> sep >> year; - VERIFY( month.size() == 5 ); - VERIFY( sep == ':' ); - VERIFY( year == 2001 ); -} - -int main() -{ - test08(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/wchar_t/9.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/wchar_t/9.cc deleted file mode 100644 index d7fa9467d..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/wchar_t/9.cc +++ /dev/null @@ -1,56 +0,0 @@ -// 1999-07-01 bkoz - -// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2009 -// 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.3.7.9 inserters and extractors - -// NB: This file is predicated on sstreams, istreams, and ostreams -// working, not to mention other major details like char_traits, and -// all of the string class. - -#include <string> -#include <sstream> -#include <iomanip> -#include <testsuite_hooks.h> - -// libstdc++/2830 -void test09() -{ - bool test __attribute__((unused)) = true; - std::wstring blanks(3, L'\0'); - std::wstring foo = L"peace"; - foo += blanks; - foo += L"& love"; - - std::wostringstream oss1; - oss1 << foo; - VERIFY( oss1.str() == foo ); - - std::wostringstream oss2; - oss2.width(20); - oss2 << foo; - VERIFY( oss2.str() != foo ); - VERIFY( oss2.str().size() == 20 ); -} - -int main() -{ - test09(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/char/stod.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/char/stod.cc deleted file mode 100644 index e4608d106..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/char/stod.cc +++ /dev/null @@ -1,137 +0,0 @@ -// { dg-options "-std=gnu++0x" } -// { dg-require-string-conversions "" } - -// 2008-06-15 Paolo Carlini <paolo.carlini@oracle.com> - -// Copyright (C) 2008, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.4 Numeric Conversions [string.conversions] - -#include <string> -#include <limits> -#include <stdexcept> -#include <testsuite_hooks.h> - -void -test01() -{ - bool test __attribute__((unused)) = false; - using namespace std; - - try - { - string one; - stod(one); - } - catch(std::invalid_argument) - { - test = true; - } - catch(...) - { - } - VERIFY( test ); - - test = false; - try - { - string one("a"); - stod(one); - } - catch(std::invalid_argument) - { - test = true; - } - catch(...) - { - } - VERIFY( test ); - - double d1 = 0.0; - size_t idx1 = 0; - try - { - string one("2.0a"); - d1 = stod(one, &idx1); - } - catch(...) - { - test = false; - } - VERIFY( test ); - VERIFY( d1 == 2.0 ); - VERIFY( idx1 == 3 ); - - test = false; - try - { - string one("1e"); - one.append(2 * numeric_limits<double>::max_exponent10, '9'); - d1 = stod(one); - } - catch(std::out_of_range) - { - test = true; - } - catch(...) - { - } - VERIFY( test ); - VERIFY( d1 == 2.0 ); - - try - { - long double ld0 = numeric_limits<double>::max() / 100.0; - string one(to_string(ld0)); - stod(one); - } - catch(...) - { - test = false; - } - VERIFY( test ); - - if ((numeric_limits<long double>::max() / 10000.0L) - > numeric_limits<double>::max()) - { - test = false; - d1 = -1.0; - try - { - long double ld1 = numeric_limits<double>::max(); - ld1 *= 100.0; - string one(to_string(ld1)); - d1 = stod(one); - } - catch(std::out_of_range) - { - test = true; - } - catch(...) - { - } - VERIFY( test ); - VERIFY( d1 == -1.0 ); - } -} - -int main() -{ - test01(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/char/stof.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/char/stof.cc deleted file mode 100644 index 6f14bd3ad..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/char/stof.cc +++ /dev/null @@ -1,137 +0,0 @@ -// { dg-options "-std=gnu++0x" } -// { dg-require-string-conversions "" } - -// 2008-06-15 Paolo Carlini <paolo.carlini@oracle.com> - -// Copyright (C) 2008, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.4 Numeric Conversions [string.conversions] - -#include <string> -#include <limits> -#include <stdexcept> -#include <testsuite_hooks.h> - -void -test01() -{ - bool test __attribute__((unused)) = false; - using namespace std; - - try - { - string one; - stof(one); - } - catch(std::invalid_argument) - { - test = true; - } - catch(...) - { - } - VERIFY( test ); - - test = false; - try - { - string one("a"); - stof(one); - } - catch(std::invalid_argument) - { - test = true; - } - catch(...) - { - } - VERIFY( test ); - - float f1 = 0.0f; - size_t idx1 = 0; - try - { - string one("2.0a"); - f1 = stof(one, &idx1); - } - catch(...) - { - test = false; - } - VERIFY( test ); - VERIFY( f1 == 2.0f ); - VERIFY( idx1 == 3 ); - - test = false; - try - { - string one("1e"); - one.append(2 * numeric_limits<float>::max_exponent10, '9'); - f1 = stof(one); - } - catch(std::out_of_range) - { - test = true; - } - catch(...) - { - } - VERIFY( test ); - VERIFY( f1 == 2.0f ); - - try - { - long double ld0 = numeric_limits<float>::max() / 100.0; - string one(to_string(ld0)); - stof(one); - } - catch(...) - { - test = false; - } - VERIFY( test ); - - if ((numeric_limits<long double>::max() / 10000.0L) - > numeric_limits<float>::max()) - { - test = false; - f1 = -1.0f; - try - { - long double ld1 = numeric_limits<float>::max(); - ld1 *= 100.0; - string one(to_string(ld1)); - f1 = stof(one); - } - catch(std::out_of_range) - { - test = true; - } - catch(...) - { - } - VERIFY( test ); - VERIFY( f1 == -1.0f ); - } -} - -int main() -{ - test01(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/char/stoi.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/char/stoi.cc deleted file mode 100644 index 7bcd123cb..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/char/stoi.cc +++ /dev/null @@ -1,202 +0,0 @@ -// { dg-options "-std=gnu++0x" } -// { dg-require-string-conversions "" } - -// 2008-06-15 Paolo Carlini <paolo.carlini@oracle.com> - -// Copyright (C) 2008, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.4 Numeric Conversions [string.conversions] - -#include <string> -#include <limits> -#include <stdexcept> -#include <testsuite_hooks.h> - -void -test01() -{ - bool test __attribute__((unused)) = false; - using namespace std; - - try - { - string one; - stoi(one); - } - catch(std::invalid_argument) - { - test = true; - } - catch(...) - { - } - VERIFY( test ); - - test = false; - try - { - string one("a"); - stoi(one); - } - catch(std::invalid_argument) - { - test = true; - } - catch(...) - { - } - VERIFY( test ); - - int i1 = 0; - try - { - string one("a"); - i1 = stoi(one, 0, 16); - } - catch(...) - { - test = false; - } - VERIFY( test ); - VERIFY( i1 == 10 ); - - size_t idx1 = 0; - try - { - string one("78"); - i1 = stoi(one, &idx1, 8); - } - catch(...) - { - test = false; - } - VERIFY( test ); - VERIFY( i1 == 7 ); - VERIFY( idx1 = 1 ); - - try - { - string one("10112"); - i1 = stoi(one, &idx1, 2); - } - catch(...) - { - test = false; - } - VERIFY( test ); - VERIFY( i1 == 11 ); - VERIFY( idx1 == 4 ); - - try - { - string one("0XE"); - i1 = stoi(one, &idx1, 0); - } - catch(...) - { - test = false; - } - VERIFY( test ); - VERIFY( i1 == 14 ); - VERIFY( idx1 == 3 ); - - test = false; - try - { - string one(1000, '9'); - i1 = stoi(one); - } - catch(std::out_of_range) - { - test = true; - } - catch(...) - { - } - VERIFY( test ); - VERIFY( i1 == 14 ); - - try - { - i1 = numeric_limits<int>::max(); - string one(to_string((long long)i1)); - i1 = stoi(one); - } - catch(...) - { - test = false; - } - VERIFY( test ); - VERIFY( i1 == numeric_limits<int>::max() ); - - try - { - i1 = numeric_limits<int>::min(); - string one(to_string((long long)i1)); - i1 = stoi(one); - } - catch(...) - { - test = false; - } - VERIFY( test ); - VERIFY( i1 == numeric_limits<int>::min() ); - - test = false; - i1 = 1; - try - { - long long ll0 = numeric_limits<int>::max(); - ++ll0; - string one(to_string(ll0)); - i1 = stoi(one); - } - catch(std::out_of_range) - { - test = true; - } - catch(...) - { - } - VERIFY( test ); - VERIFY( i1 == 1 ); - - test = false; - try - { - long long ll1 = numeric_limits<int>::min(); - --ll1; - string one(to_string(ll1)); - i1 = stoi(one); - } - catch(std::out_of_range) - { - test = true; - } - catch(...) - { - } - VERIFY( test ); - VERIFY( i1 == 1 ); -} - -int main() -{ - test01(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/char/stol.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/char/stol.cc deleted file mode 100644 index 7b61db6fb..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/char/stol.cc +++ /dev/null @@ -1,165 +0,0 @@ -// { dg-options "-std=gnu++0x" } -// { dg-require-string-conversions "" } - -// 2008-06-15 Paolo Carlini <paolo.carlini@oracle.com> - -// Copyright (C) 2008, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.4 Numeric Conversions [string.conversions] - -#include <string> -#include <limits> -#include <stdexcept> -#include <testsuite_hooks.h> - -void -test01() -{ - bool test __attribute__((unused)) = false; - using namespace std; - - try - { - string one; - stol(one); - } - catch(std::invalid_argument) - { - test = true; - } - catch(...) - { - } - VERIFY( test ); - - test = false; - try - { - string one("a"); - stol(one); - } - catch(std::invalid_argument) - { - test = true; - } - catch(...) - { - } - VERIFY( test ); - - long l1 = 0; - try - { - string one("a"); - l1 = stol(one, 0, 16); - } - catch(...) - { - test = false; - } - VERIFY( test ); - VERIFY( l1 == 10 ); - - size_t idx1 = 0; - try - { - string one("78"); - l1 = stol(one, &idx1, 8); - } - catch(...) - { - test = false; - } - VERIFY( test ); - VERIFY( l1 == 7 ); - VERIFY( idx1 = 1 ); - - try - { - string one("10112"); - l1 = stol(one, &idx1, 2); - } - catch(...) - { - test = false; - } - VERIFY( test ); - VERIFY( l1 == 11 ); - VERIFY( idx1 == 4 ); - - try - { - string one("0XE"); - l1 = stol(one, &idx1, 0); - } - catch(...) - { - test = false; - } - VERIFY( test ); - VERIFY( l1 == 14 ); - VERIFY( idx1 == 3 ); - - test = false; - try - { - string one(1000, '9'); - l1 = stol(one); - } - catch(std::out_of_range) - { - test = true; - } - catch(...) - { - } - VERIFY( test ); - VERIFY( l1 == 14 ); - - try - { - l1 = numeric_limits<long>::max(); - string one(to_string((long long)l1)); - l1 = stol(one); - } - catch(...) - { - test = false; - } - VERIFY( test ); - VERIFY( l1 == numeric_limits<long>::max() ); - - try - { - l1 = numeric_limits<long>::min(); - string one(to_string((long long)l1)); - l1 = stol(one); - } - catch(...) - { - test = false; - } - VERIFY( test ); - VERIFY( l1 == numeric_limits<long>::min() ); -} - -int main() -{ - test01(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/char/stold.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/char/stold.cc deleted file mode 100644 index c8123bcd2..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/char/stold.cc +++ /dev/null @@ -1,114 +0,0 @@ -// { dg-options "-std=gnu++0x" } -// { dg-require-string-conversions "" } - -// 2008-06-15 Paolo Carlini <paolo.carlini@oracle.com> - -// Copyright (C) 2008, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.4 Numeric Conversions [string.conversions] - -#include <string> -#include <limits> -#include <stdexcept> -#include <testsuite_hooks.h> - -void -test01() -{ - bool test __attribute__((unused)) = false; - using namespace std; - - try - { - string one; - stold(one); - } - catch(std::invalid_argument) - { - test = true; - } - catch(...) - { - } - VERIFY( test ); - - test = false; - try - { - string one("a"); - stold(one); - } - catch(std::invalid_argument) - { - test = true; - } - catch(...) - { - } - VERIFY( test ); - - long double ld1 = 0.0L; - size_t idx1 = 0; - try - { - string one("2.0a"); - ld1 = stold(one, &idx1); - } - catch(...) - { - test = false; - } - VERIFY( test ); - VERIFY( ld1 == 2.0L ); - VERIFY( idx1 == 3 ); - - test = false; - try - { - string one("1e"); - one.append(2 * numeric_limits<long double>::max_exponent10, '9'); - ld1 = stold(one); - } - catch(std::out_of_range) - { - test = true; - } - catch(...) - { - } - VERIFY( test ); - VERIFY( ld1 == 2.0L ); - - try - { - long double ld0 = numeric_limits<long double>::max() / 100.0L; - string one(to_string(ld0)); - stold(one); - } - catch(...) - { - test = false; - } - VERIFY( test ); -} - -int main() -{ - test01(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/char/stoll.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/char/stoll.cc deleted file mode 100644 index 161c94a09..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/char/stoll.cc +++ /dev/null @@ -1,165 +0,0 @@ -// { dg-options "-std=gnu++0x" } -// { dg-require-string-conversions "" } - -// 2008-06-15 Paolo Carlini <paolo.carlini@oracle.com> - -// Copyright (C) 2008, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.4 Numeric Conversions [string.conversions] - -#include <string> -#include <limits> -#include <stdexcept> -#include <testsuite_hooks.h> - -void -test01() -{ - bool test __attribute__((unused)) = false; - using namespace std; - - try - { - string one; - stoll(one); - } - catch(std::invalid_argument) - { - test = true; - } - catch(...) - { - } - VERIFY( test ); - - test = false; - try - { - string one("a"); - stoll(one); - } - catch(std::invalid_argument) - { - test = true; - } - catch(...) - { - } - VERIFY( test ); - - long long ll1 = 0; - try - { - string one("a"); - ll1 = stoll(one, 0, 16); - } - catch(...) - { - test = false; - } - VERIFY( test ); - VERIFY( ll1 == 10 ); - - size_t idx1 = 0; - try - { - string one("78"); - ll1 = stoll(one, &idx1, 8); - } - catch(...) - { - test = false; - } - VERIFY( test ); - VERIFY( ll1 == 7 ); - VERIFY( idx1 = 1 ); - - try - { - string one("10112"); - ll1 = stoll(one, &idx1, 2); - } - catch(...) - { - test = false; - } - VERIFY( test ); - VERIFY( ll1 == 11 ); - VERIFY( idx1 == 4 ); - - try - { - string one("0XE"); - ll1 = stoll(one, &idx1, 0); - } - catch(...) - { - test = false; - } - VERIFY( test ); - VERIFY( ll1 == 14 ); - VERIFY( idx1 == 3 ); - - test = false; - try - { - string one(1000, '9'); - ll1 = stoll(one); - } - catch(std::out_of_range) - { - test = true; - } - catch(...) - { - } - VERIFY( test ); - VERIFY( ll1 == 14 ); - - try - { - ll1 = numeric_limits<long long>::max(); - string one(to_string(ll1)); - ll1 = stoll(one); - } - catch(...) - { - test = false; - } - VERIFY( test ); - VERIFY( ll1 == numeric_limits<long long>::max() ); - - try - { - ll1 = numeric_limits<long long>::min(); - string one(to_string(ll1)); - ll1 = stoll(one); - } - catch(...) - { - test = false; - } - VERIFY( test ); - VERIFY( ll1 == numeric_limits<long long>::min() ); -} - -int main() -{ - test01(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/char/stoul.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/char/stoul.cc deleted file mode 100644 index b6f42f15b..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/char/stoul.cc +++ /dev/null @@ -1,152 +0,0 @@ -// { dg-options "-std=gnu++0x" } -// { dg-require-string-conversions "" } - -// 2008-06-15 Paolo Carlini <paolo.carlini@oracle.com> - -// Copyright (C) 2008, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.4 Numeric Conversions [string.conversions] - -#include <string> -#include <limits> -#include <stdexcept> -#include <testsuite_hooks.h> - -void -test01() -{ - bool test __attribute__((unused)) = false; - using namespace std; - - try - { - string one; - stoul(one); - } - catch(std::invalid_argument) - { - test = true; - } - catch(...) - { - } - VERIFY( test ); - - test = false; - try - { - string one("a"); - stoul(one); - } - catch(std::invalid_argument) - { - test = true; - } - catch(...) - { - } - VERIFY( test ); - - unsigned long ul1 = 0; - try - { - string one("a"); - ul1 = stoul(one, 0, 16); - } - catch(...) - { - test = false; - } - VERIFY( test ); - VERIFY( ul1 == 10 ); - - size_t idx1 = 0; - try - { - string one("78"); - ul1 = stoul(one, &idx1, 8); - } - catch(...) - { - test = false; - } - VERIFY( test ); - VERIFY( ul1 == 7 ); - VERIFY( idx1 = 1 ); - - try - { - string one("10112"); - ul1 = stoul(one, &idx1, 2); - } - catch(...) - { - test = false; - } - VERIFY( test ); - VERIFY( ul1 == 11 ); - VERIFY( idx1 == 4 ); - - try - { - string one("0XE"); - ul1 = stoul(one, &idx1, 0); - } - catch(...) - { - test = false; - } - VERIFY( test ); - VERIFY( ul1 == 14 ); - VERIFY( idx1 == 3 ); - - test = false; - try - { - string one(1000, '9'); - ul1 = stoul(one); - } - catch(std::out_of_range) - { - test = true; - } - catch(...) - { - } - VERIFY( test ); - VERIFY( ul1 == 14 ); - - try - { - ul1 = numeric_limits<unsigned long>::max(); - string one(to_string((unsigned long long)ul1)); - ul1 = stoul(one); - } - catch(...) - { - test = false; - } - VERIFY( test ); - VERIFY( ul1 == numeric_limits<unsigned long>::max() ); -} - -int main() -{ - test01(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/char/stoull.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/char/stoull.cc deleted file mode 100644 index 15e3e85e5..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/char/stoull.cc +++ /dev/null @@ -1,152 +0,0 @@ -// { dg-options "-std=gnu++0x" } -// { dg-require-string-conversions "" } - -// 2008-06-15 Paolo Carlini <paolo.carlini@oracle.com> - -// Copyright (C) 2008, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.4 Numeric Conversions [string.conversions] - -#include <string> -#include <limits> -#include <stdexcept> -#include <testsuite_hooks.h> - -void -test01() -{ - bool test __attribute__((unused)) = false; - using namespace std; - - try - { - string one; - stoull(one); - } - catch(std::invalid_argument) - { - test = true; - } - catch(...) - { - } - VERIFY( test ); - - test = false; - try - { - string one("a"); - stoull(one); - } - catch(std::invalid_argument) - { - test = true; - } - catch(...) - { - } - VERIFY( test ); - - unsigned long long ull1 = 0; - try - { - string one("a"); - ull1 = stoull(one, 0, 16); - } - catch(...) - { - test = false; - } - VERIFY( test ); - VERIFY( ull1 == 10 ); - - size_t idx1 = 0; - try - { - string one("78"); - ull1 = stoull(one, &idx1, 8); - } - catch(...) - { - test = false; - } - VERIFY( test ); - VERIFY( ull1 == 7 ); - VERIFY( idx1 = 1 ); - - try - { - string one("10112"); - ull1 = stoull(one, &idx1, 2); - } - catch(...) - { - test = false; - } - VERIFY( test ); - VERIFY( ull1 == 11 ); - VERIFY( idx1 == 4 ); - - try - { - string one("0XE"); - ull1 = stoull(one, &idx1, 0); - } - catch(...) - { - test = false; - } - VERIFY( test ); - VERIFY( ull1 == 14 ); - VERIFY( idx1 == 3 ); - - test = false; - try - { - string one(1000, '9'); - ull1 = stoull(one); - } - catch(std::out_of_range) - { - test = true; - } - catch(...) - { - } - VERIFY( test ); - VERIFY( ull1 == 14 ); - - try - { - ull1 = numeric_limits<unsigned long long>::max(); - string one(to_string(ull1)); - ull1 = stoull(one); - } - catch(...) - { - test = false; - } - VERIFY( test ); - VERIFY( ull1 == numeric_limits<unsigned long long>::max() ); -} - -int main() -{ - test01(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/char/to_string.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/char/to_string.cc deleted file mode 100644 index ede975271..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/char/to_string.cc +++ /dev/null @@ -1,63 +0,0 @@ -// { dg-options "-std=gnu++0x" } -// { dg-require-string-conversions "" } - -// 2008-06-15 Paolo Carlini <paolo.carlini@oracle.com> - -// Copyright (C) 2008, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.4 Numeric Conversions [string.conversions] - -#include <string> -#include <testsuite_hooks.h> - -void -test01() -{ - bool test __attribute__((unused)) = true; - using namespace std; - - long long ll1 = -2; - string one(to_string(ll1)); - VERIFY( one == "-2" ); - - long long ll2 = 10; - string two(to_string(ll2)); - VERIFY( two == "10" ); - - unsigned long long ull1 = 2; - string three(to_string(ull1)); - VERIFY( three == "2" ); - - unsigned long long ull2 = 3000; - string four(to_string(ull2)); - VERIFY( four == "3000" ); - - long double ld1 = 2.0L; - string five(to_string(ld1)); - VERIFY( five == "2.000000" ); - - long double ld2 = -4.0L; - string six(to_string(ld2)); - VERIFY( six == "-4.000000" ); -} - -int main() -{ - test01(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/wchar_t/stod.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/wchar_t/stod.cc deleted file mode 100644 index c5c7bdd44..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/wchar_t/stod.cc +++ /dev/null @@ -1,139 +0,0 @@ -// { dg-options "-std=gnu++0x" } -// 2008-06-15 Paolo Carlini <paolo.carlini@oracle.com> - -// Copyright (C) 2008, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.4 Numeric Conversions [string.conversions] - -#include <string> -#include <limits> -#include <stdexcept> -#include <testsuite_hooks.h> - -void -test01() -{ -#ifdef _GLIBCXX_USE_C99 - - bool test __attribute__((unused)) = false; - using namespace std; - - try - { - wstring one; - stod(one); - } - catch(std::invalid_argument) - { - test = true; - } - catch(...) - { - } - VERIFY( test ); - - test = false; - try - { - wstring one(L"a"); - stod(one); - } - catch(std::invalid_argument) - { - test = true; - } - catch(...) - { - } - VERIFY( test ); - - double d1 = 0.0; - size_t idx1 = 0; - try - { - wstring one(L"2.0a"); - d1 = stod(one, &idx1); - } - catch(...) - { - test = false; - } - VERIFY( test ); - VERIFY( d1 == 2.0 ); - VERIFY( idx1 == 3 ); - - test = false; - try - { - wstring one(L"1e"); - one.append(2 * numeric_limits<double>::max_exponent10, L'9'); - d1 = stod(one); - } - catch(std::out_of_range) - { - test = true; - } - catch(...) - { - } - VERIFY( test ); - VERIFY( d1 == 2.0 ); - - try - { - long double ld0 = numeric_limits<double>::max() / 100.0; - wstring one(to_wstring(ld0)); - stod(one); - } - catch(...) - { - test = false; - } - VERIFY( test ); - - if ((numeric_limits<long double>::max() / 10000.0L) - > numeric_limits<double>::max()) - { - test = false; - d1 = -1.0; - try - { - long double ld1 = numeric_limits<double>::max(); - ld1 *= 100.0; - wstring one(to_wstring(ld1)); - d1 = stod(one); - } - catch(std::out_of_range) - { - test = true; - } - catch(...) - { - } - VERIFY( test ); - VERIFY( d1 == -1.0 ); - } - -#endif -} - -int main() -{ - test01(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/wchar_t/stof.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/wchar_t/stof.cc deleted file mode 100644 index ffc0867b5..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/wchar_t/stof.cc +++ /dev/null @@ -1,139 +0,0 @@ -// { dg-options "-std=gnu++0x" } -// 2008-06-15 Paolo Carlini <paolo.carlini@oracle.com> - -// Copyright (C) 2008, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.4 Numeric Conversions [string.conversions] - -#include <string> -#include <limits> -#include <stdexcept> -#include <testsuite_hooks.h> - -void -test01() -{ -#ifdef _GLIBCXX_USE_C99 - - bool test __attribute__((unused)) = false; - using namespace std; - - try - { - wstring one; - stof(one); - } - catch(std::invalid_argument) - { - test = true; - } - catch(...) - { - } - VERIFY( test ); - - test = false; - try - { - wstring one(L"a"); - stof(one); - } - catch(std::invalid_argument) - { - test = true; - } - catch(...) - { - } - VERIFY( test ); - - float f1 = 0.0f; - size_t idx1 = 0; - try - { - wstring one(L"2.0a"); - f1 = stof(one, &idx1); - } - catch(...) - { - test = false; - } - VERIFY( test ); - VERIFY( f1 == 2.0f ); - VERIFY( idx1 == 3 ); - - test = false; - try - { - wstring one(L"1e"); - one.append(2 * numeric_limits<float>::max_exponent10, L'9'); - f1 = stof(one); - } - catch(std::out_of_range) - { - test = true; - } - catch(...) - { - } - VERIFY( test ); - VERIFY( f1 == 2.0f ); - - try - { - long double ld0 = numeric_limits<float>::max() / 100.0; - wstring one(to_wstring(ld0)); - stof(one); - } - catch(...) - { - test = false; - } - VERIFY( test ); - - if ((numeric_limits<long double>::max() / 10000.0L) - > numeric_limits<float>::max()) - { - test = false; - f1 = -1.0f; - try - { - long double ld1 = numeric_limits<float>::max(); - ld1 *= 100.0; - wstring one(to_wstring(ld1)); - f1 = stof(one); - } - catch(std::out_of_range) - { - test = true; - } - catch(...) - { - } - VERIFY( test ); - VERIFY( f1 == -1.0f ); - } - -#endif -} - -int main() -{ - test01(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/wchar_t/stoi.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/wchar_t/stoi.cc deleted file mode 100644 index b37cc757b..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/wchar_t/stoi.cc +++ /dev/null @@ -1,204 +0,0 @@ -// { dg-options "-std=gnu++0x" } -// 2008-06-15 Paolo Carlini <paolo.carlini@oracle.com> - -// Copyright (C) 2008, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.4 Numeric Conversions [string.conversions] - -#include <string> -#include <limits> -#include <stdexcept> -#include <testsuite_hooks.h> - -void -test01() -{ -#ifdef _GLIBCXX_USE_C99 - - bool test __attribute__((unused)) = false; - using namespace std; - - try - { - wstring one; - stoi(one); - } - catch(std::invalid_argument) - { - test = true; - } - catch(...) - { - } - VERIFY( test ); - - test = false; - try - { - wstring one(L"a"); - stoi(one); - } - catch(std::invalid_argument) - { - test = true; - } - catch(...) - { - } - VERIFY( test ); - - int i1 = 0; - try - { - wstring one(L"a"); - i1 = stoi(one, 0, 16); - } - catch(...) - { - test = false; - } - VERIFY( test ); - VERIFY( i1 == 10 ); - - size_t idx1 = 0; - try - { - wstring one(L"78"); - i1 = stoi(one, &idx1, 8); - } - catch(...) - { - test = false; - } - VERIFY( test ); - VERIFY( i1 == 7 ); - VERIFY( idx1 = 1 ); - - try - { - wstring one(L"10112"); - i1 = stoi(one, &idx1, 2); - } - catch(...) - { - test = false; - } - VERIFY( test ); - VERIFY( i1 == 11 ); - VERIFY( idx1 == 4 ); - - try - { - wstring one(L"0XE"); - i1 = stoi(one, &idx1, 0); - } - catch(...) - { - test = false; - } - VERIFY( test ); - VERIFY( i1 == 14 ); - VERIFY( idx1 == 3 ); - - test = false; - try - { - wstring one(1000, L'9'); - i1 = stoi(one); - } - catch(std::out_of_range) - { - test = true; - } - catch(...) - { - } - VERIFY( test ); - VERIFY( i1 == 14 ); - - try - { - i1 = numeric_limits<int>::max(); - wstring one(to_wstring((long long)i1)); - i1 = stoi(one); - } - catch(...) - { - test = false; - } - VERIFY( test ); - VERIFY( i1 == numeric_limits<int>::max() ); - - try - { - i1 = numeric_limits<int>::min(); - wstring one(to_wstring((long long)i1)); - i1 = stoi(one); - } - catch(...) - { - test = false; - } - VERIFY( test ); - VERIFY( i1 == numeric_limits<int>::min() ); - - test = false; - i1 = 1; - try - { - long long ll0 = numeric_limits<int>::max(); - ++ll0; - wstring one(to_wstring(ll0)); - i1 = stoi(one); - } - catch(std::out_of_range) - { - test = true; - } - catch(...) - { - } - VERIFY( test ); - VERIFY( i1 == 1 ); - - test = false; - try - { - long long ll1 = numeric_limits<int>::min(); - --ll1; - wstring one(to_wstring(ll1)); - i1 = stoi(one); - } - catch(std::out_of_range) - { - test = true; - } - catch(...) - { - } - VERIFY( test ); - VERIFY( i1 == 1 ); - -#endif -} - -int main() -{ - test01(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/wchar_t/stol.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/wchar_t/stol.cc deleted file mode 100644 index 3cd3df677..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/wchar_t/stol.cc +++ /dev/null @@ -1,167 +0,0 @@ -// { dg-options "-std=gnu++0x" } -// 2008-06-15 Paolo Carlini <paolo.carlini@oracle.com> - -// Copyright (C) 2008, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.4 Numeric Conversions [string.conversions] - -#include <string> -#include <limits> -#include <stdexcept> -#include <testsuite_hooks.h> - -void -test01() -{ -#ifdef _GLIBCXX_USE_C99 - - bool test __attribute__((unused)) = false; - using namespace std; - - try - { - wstring one; - stol(one); - } - catch(std::invalid_argument) - { - test = true; - } - catch(...) - { - } - VERIFY( test ); - - test = false; - try - { - wstring one(L"a"); - stol(one); - } - catch(std::invalid_argument) - { - test = true; - } - catch(...) - { - } - VERIFY( test ); - - long l1 = 0; - try - { - wstring one(L"a"); - l1 = stol(one, 0, 16); - } - catch(...) - { - test = false; - } - VERIFY( test ); - VERIFY( l1 == 10 ); - - size_t idx1 = 0; - try - { - wstring one(L"78"); - l1 = stol(one, &idx1, 8); - } - catch(...) - { - test = false; - } - VERIFY( test ); - VERIFY( l1 == 7 ); - VERIFY( idx1 = 1 ); - - try - { - wstring one(L"10112"); - l1 = stol(one, &idx1, 2); - } - catch(...) - { - test = false; - } - VERIFY( test ); - VERIFY( l1 == 11 ); - VERIFY( idx1 == 4 ); - - try - { - wstring one(L"0XE"); - l1 = stol(one, &idx1, 0); - } - catch(...) - { - test = false; - } - VERIFY( test ); - VERIFY( l1 == 14 ); - VERIFY( idx1 == 3 ); - - test = false; - try - { - wstring one(1000, L'9'); - l1 = stol(one); - } - catch(std::out_of_range) - { - test = true; - } - catch(...) - { - } - VERIFY( test ); - VERIFY( l1 == 14 ); - - try - { - l1 = numeric_limits<long>::max(); - wstring one(to_wstring((long long)l1)); - l1 = stol(one); - } - catch(...) - { - test = false; - } - VERIFY( test ); - VERIFY( l1 == numeric_limits<long>::max() ); - - try - { - l1 = numeric_limits<long>::min(); - wstring one(to_wstring((long long)l1)); - l1 = stol(one); - } - catch(...) - { - test = false; - } - VERIFY( test ); - VERIFY( l1 == numeric_limits<long>::min() ); - -#endif -} - -int main() -{ - test01(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/wchar_t/stold.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/wchar_t/stold.cc deleted file mode 100644 index 4757f0c08..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/wchar_t/stold.cc +++ /dev/null @@ -1,116 +0,0 @@ -// { dg-options "-std=gnu++0x" } -// 2008-06-15 Paolo Carlini <paolo.carlini@oracle.com> - -// Copyright (C) 2008, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.4 Numeric Conversions [string.conversions] - -#include <string> -#include <limits> -#include <stdexcept> -#include <testsuite_hooks.h> - -void -test01() -{ -#ifdef _GLIBCXX_USE_C99 - - bool test __attribute__((unused)) = false; - using namespace std; - - try - { - wstring one; - stold(one); - } - catch(std::invalid_argument) - { - test = true; - } - catch(...) - { - } - VERIFY( test ); - - test = false; - try - { - wstring one(L"a"); - stold(one); - } - catch(std::invalid_argument) - { - test = true; - } - catch(...) - { - } - VERIFY( test ); - - long double ld1 = 0.0L; - size_t idx1 = 0; - try - { - wstring one(L"2.0a"); - ld1 = stold(one, &idx1); - } - catch(...) - { - test = false; - } - VERIFY( test ); - VERIFY( ld1 == 2.0L ); - VERIFY( idx1 == 3 ); - - test = false; - try - { - wstring one(L"1e"); - one.append(2 * numeric_limits<long double>::max_exponent10, L'9'); - ld1 = stold(one); - } - catch(std::out_of_range) - { - test = true; - } - catch(...) - { - } - VERIFY( test ); - VERIFY( ld1 == 2.0L ); - - try - { - long double ld0 = numeric_limits<long double>::max() / 100.0L; - wstring one(to_wstring(ld0)); - stold(one); - } - catch(...) - { - test = false; - } - VERIFY( test ); - -#endif -} - -int main() -{ - test01(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/wchar_t/stoll.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/wchar_t/stoll.cc deleted file mode 100644 index 55f484a57..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/wchar_t/stoll.cc +++ /dev/null @@ -1,167 +0,0 @@ -// { dg-options "-std=gnu++0x" } -// 2008-06-15 Paolo Carlini <paolo.carlini@oracle.com> - -// Copyright (C) 2008, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.4 Numeric Conversions [string.conversions] - -#include <string> -#include <limits> -#include <stdexcept> -#include <testsuite_hooks.h> - -void -test01() -{ -#ifdef _GLIBCXX_USE_C99 - - bool test __attribute__((unused)) = false; - using namespace std; - - try - { - wstring one; - stoll(one); - } - catch(std::invalid_argument) - { - test = true; - } - catch(...) - { - } - VERIFY( test ); - - test = false; - try - { - wstring one(L"a"); - stoll(one); - } - catch(std::invalid_argument) - { - test = true; - } - catch(...) - { - } - VERIFY( test ); - - long long ll1 = 0; - try - { - wstring one(L"a"); - ll1 = stoll(one, 0, 16); - } - catch(...) - { - test = false; - } - VERIFY( test ); - VERIFY( ll1 == 10 ); - - size_t idx1 = 0; - try - { - wstring one(L"78"); - ll1 = stoll(one, &idx1, 8); - } - catch(...) - { - test = false; - } - VERIFY( test ); - VERIFY( ll1 == 7 ); - VERIFY( idx1 = 1 ); - - try - { - wstring one(L"10112"); - ll1 = stoll(one, &idx1, 2); - } - catch(...) - { - test = false; - } - VERIFY( test ); - VERIFY( ll1 == 11 ); - VERIFY( idx1 == 4 ); - - try - { - wstring one(L"0XE"); - ll1 = stoll(one, &idx1, 0); - } - catch(...) - { - test = false; - } - VERIFY( test ); - VERIFY( ll1 == 14 ); - VERIFY( idx1 == 3 ); - - test = false; - try - { - wstring one(1000, L'9'); - ll1 = stoll(one); - } - catch(std::out_of_range) - { - test = true; - } - catch(...) - { - } - VERIFY( test ); - VERIFY( ll1 == 14 ); - - try - { - ll1 = numeric_limits<long long>::max(); - wstring one(to_wstring(ll1)); - ll1 = stoll(one); - } - catch(...) - { - test = false; - } - VERIFY( test ); - VERIFY( ll1 == numeric_limits<long long>::max() ); - - try - { - ll1 = numeric_limits<long long>::min(); - wstring one(to_wstring(ll1)); - ll1 = stoll(one); - } - catch(...) - { - test = false; - } - VERIFY( test ); - VERIFY( ll1 == numeric_limits<long long>::min() ); - -#endif -} - -int main() -{ - test01(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/wchar_t/stoul.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/wchar_t/stoul.cc deleted file mode 100644 index 5498a9620..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/wchar_t/stoul.cc +++ /dev/null @@ -1,154 +0,0 @@ -// { dg-options "-std=gnu++0x" } -// 2008-06-15 Paolo Carlini <paolo.carlini@oracle.com> - -// Copyright (C) 2008, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.4 Numeric Conversions [string.conversions] - -#include <string> -#include <limits> -#include <stdexcept> -#include <testsuite_hooks.h> - -void -test01() -{ -#ifdef _GLIBCXX_USE_C99 - - bool test __attribute__((unused)) = false; - using namespace std; - - try - { - wstring one; - stoul(one); - } - catch(std::invalid_argument) - { - test = true; - } - catch(...) - { - } - VERIFY( test ); - - test = false; - try - { - wstring one(L"a"); - stoul(one); - } - catch(std::invalid_argument) - { - test = true; - } - catch(...) - { - } - VERIFY( test ); - - unsigned long ul1 = 0; - try - { - wstring one(L"a"); - ul1 = stoul(one, 0, 16); - } - catch(...) - { - test = false; - } - VERIFY( test ); - VERIFY( ul1 == 10 ); - - size_t idx1 = 0; - try - { - wstring one(L"78"); - ul1 = stoul(one, &idx1, 8); - } - catch(...) - { - test = false; - } - VERIFY( test ); - VERIFY( ul1 == 7 ); - VERIFY( idx1 = 1 ); - - try - { - wstring one(L"10112"); - ul1 = stoul(one, &idx1, 2); - } - catch(...) - { - test = false; - } - VERIFY( test ); - VERIFY( ul1 == 11 ); - VERIFY( idx1 == 4 ); - - try - { - wstring one(L"0XE"); - ul1 = stoul(one, &idx1, 0); - } - catch(...) - { - test = false; - } - VERIFY( test ); - VERIFY( ul1 == 14 ); - VERIFY( idx1 == 3 ); - - test = false; - try - { - wstring one(1000, L'9'); - ul1 = stoul(one); - } - catch(std::out_of_range) - { - test = true; - } - catch(...) - { - } - VERIFY( test ); - VERIFY( ul1 == 14 ); - - try - { - ul1 = numeric_limits<unsigned long>::max(); - wstring one(to_wstring((unsigned long long)ul1)); - ul1 = stoul(one); - } - catch(...) - { - test = false; - } - VERIFY( test ); - VERIFY( ul1 == numeric_limits<unsigned long>::max() ); - -#endif -} - -int main() -{ - test01(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/wchar_t/stoull.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/wchar_t/stoull.cc deleted file mode 100644 index f2d8fb172..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/wchar_t/stoull.cc +++ /dev/null @@ -1,154 +0,0 @@ -// { dg-options "-std=gnu++0x" } -// 2008-06-15 Paolo Carlini <paolo.carlini@oracle.com> - -// Copyright (C) 2008, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.4 Numeric Conversions [string.conversions] - -#include <string> -#include <limits> -#include <stdexcept> -#include <testsuite_hooks.h> - -void -test01() -{ -#ifdef _GLIBCXX_USE_C99 - - bool test __attribute__((unused)) = false; - using namespace std; - - try - { - wstring one; - stoull(one); - } - catch(std::invalid_argument) - { - test = true; - } - catch(...) - { - } - VERIFY( test ); - - test = false; - try - { - wstring one(L"a"); - stoull(one); - } - catch(std::invalid_argument) - { - test = true; - } - catch(...) - { - } - VERIFY( test ); - - unsigned long long ull1 = 0; - try - { - wstring one(L"a"); - ull1 = stoull(one, 0, 16); - } - catch(...) - { - test = false; - } - VERIFY( test ); - VERIFY( ull1 == 10 ); - - size_t idx1 = 0; - try - { - wstring one(L"78"); - ull1 = stoull(one, &idx1, 8); - } - catch(...) - { - test = false; - } - VERIFY( test ); - VERIFY( ull1 == 7 ); - VERIFY( idx1 = 1 ); - - try - { - wstring one(L"10112"); - ull1 = stoull(one, &idx1, 2); - } - catch(...) - { - test = false; - } - VERIFY( test ); - VERIFY( ull1 == 11 ); - VERIFY( idx1 == 4 ); - - try - { - wstring one(L"0XE"); - ull1 = stoull(one, &idx1, 0); - } - catch(...) - { - test = false; - } - VERIFY( test ); - VERIFY( ull1 == 14 ); - VERIFY( idx1 == 3 ); - - test = false; - try - { - wstring one(1000, L'9'); - ull1 = stoull(one); - } - catch(std::out_of_range) - { - test = true; - } - catch(...) - { - } - VERIFY( test ); - VERIFY( ull1 == 14 ); - - try - { - ull1 = numeric_limits<unsigned long long>::max(); - wstring one(to_wstring(ull1)); - ull1 = stoull(one); - } - catch(...) - { - test = false; - } - VERIFY( test ); - VERIFY( ull1 == numeric_limits<unsigned long long>::max() ); - -#endif -} - -int main() -{ - test01(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/wchar_t/to_wstring.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/wchar_t/to_wstring.cc deleted file mode 100644 index dd46736ea..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/wchar_t/to_wstring.cc +++ /dev/null @@ -1,65 +0,0 @@ -// { dg-options "-std=gnu++0x" } -// 2008-06-15 Paolo Carlini <paolo.carlini@oracle.com> - -// Copyright (C) 2008, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.4 Numeric Conversions [string.conversions] - -#include <string> -#include <testsuite_hooks.h> - -void -test01() -{ -#ifdef _GLIBCXX_USE_C99 - - bool test __attribute__((unused)) = true; - using namespace std; - - long long ll1 = -2; - wstring one(to_wstring(ll1)); - VERIFY( one == L"-2" ); - - long long ll2 = 10; - wstring two(to_wstring(ll2)); - VERIFY( two == L"10" ); - - unsigned long long ull1 = 2; - wstring three(to_wstring(ull1)); - VERIFY( three == L"2" ); - - unsigned long long ull2 = 3000; - wstring four(to_wstring(ull2)); - VERIFY( four == L"3000" ); - - long double ld1 = 2.0L; - wstring five(to_wstring(ld1)); - VERIFY( five == L"2.000000" ); - - long double ld2 = -4.0L; - wstring six(to_wstring(ld2)); - VERIFY( six == L"-4.000000" ); - -#endif -} - -int main() -{ - test01(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/operations/char/1.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/operations/char/1.cc deleted file mode 100644 index c39f6b416..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/operations/char/1.cc +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (C) 2004, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.3.6 string operations - -#include <string> -#include <testsuite_hooks.h> - -int test01(void) -{ - bool test __attribute__((unused)) = true; - - std::string empty; - - // data() for size == 0 is non-NULL. - VERIFY( empty.size() == 0 ); - const std::string::value_type* p = empty.data(); - VERIFY( p != NULL ); - - return 0; -} - -int main() -{ - test01(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/operations/wchar_t/1.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/operations/wchar_t/1.cc deleted file mode 100644 index 1ddde9272..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/operations/wchar_t/1.cc +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (C) 2004, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.3.6 string operations - -#include <string> -#include <testsuite_hooks.h> - -int test01(void) -{ - bool test __attribute__((unused)) = true; - - std::wstring empty; - - // data() for size == 0 is non-NULL. - VERIFY( empty.size() == 0 ); - const std::wstring::value_type* p = empty.data(); - VERIFY( p != NULL ); - - return 0; -} - -int main() -{ - test01(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/operators/char/1.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/operators/char/1.cc deleted file mode 100644 index e9b030e59..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/operators/char/1.cc +++ /dev/null @@ -1,49 +0,0 @@ -// 1999-05-07 bkoz - -// Copyright (C) 1999, 2003, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.3.6 string operations - -#include <string> -#include <cstdio> -#include <testsuite_hooks.h> - -int test01(void) -{ - bool test __attribute__((unused)) = true; - - std::string str1; - std::string str2; - - // Should get this: - // 1:8-chars_8-chars_ - // 2:8-chars_8-chars_ - str1 = std::string("8-chars_") + "8-chars_"; - str1.c_str(); - // printf("1:%s\n", str1.c_str()); - str2 = str1 + "7-chars"; - // printf("2:%s\n", str1.c_str()); //str1 is gone - str1.c_str(); - return 0; -} - -int main() -{ - test01(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/operators/char/2.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/operators/char/2.cc deleted file mode 100644 index 7be6ae5cc..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/operators/char/2.cc +++ /dev/null @@ -1,294 +0,0 @@ -// 1998-10-01, 1999-06-25 bkoz - -// Copyright (C) 1998, 1999, 2003, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.3.7.1 basic_string non-member functions - -// 21.3.7.2 operator== -/* -template<class charT, class traits, class Allocator> - bool operator==(const basic_string<charT,traits,Allocator>& lhs, - const basic_string<charT,traits,Allocator>& rhs); - -template<class charT, class traits, class Allocator> - bool operator==(const charT* lhs, - const basic_string<charT,traits,Allocator>& rhs); - -template<class charT, class traits, class Allocator> - bool operator==(const basic_string<charT,traits,Allocator>& lhs, - const charT* rhs); -*/ - -// 21.3.7.3 operator!= -/* -template<class charT, class traits, class Allocator> - bool operator!=(const basic_string<charT,traits,Allocator>& lhs, - const basic_string<charT,traits,Allocator>& rhs); - -template<class charT, class traits, class Allocator> - bool operator!=(const charT* lhs, - const basic_string<charT,traits,Allocator>& rhs); - -template<class charT, class traits, class Allocator> - bool operator!=(const basic_string<charT,traits,Allocator>& lhs, - const charT* rhs); -*/ - -// 21.3.7.4 operator< -/* -template<class charT, class traits, class Allocator> - bool operator< (const basic_string<charT,traits,Allocator>& lhs, - const basic_string<charT,traits,Allocator>& rhs); - -template<class charT, class traits, class Allocator> - bool operator< (const basic_string<charT,traits,Allocator>& lhs, - const charT* rhs); - -template<class charT, class traits, class Allocator> - bool operator< (const charT* lhs, - const basic_string<charT,traits,Allocator>& rhs); -*/ - -// 21.3.7.5 operator> -/* -template<class charT, class traits, class Allocator> - bool operator> (const basic_string<charT,traits,Allocator>& lhs, - const basic_string<charT,traits,Allocator>& rhs); - -template<class charT, class traits, class Allocator> - bool operator> (const basic_string<charT,traits,Allocator>& lhs, - const charT* rhs); - -template<class charT, class traits, class Allocator> - bool operator> (const charT* lhs, - const basic_string<charT,traits,Allocator>& rhs); -*/ - -//21.3.7.6 operator<= -/* -template<class charT, class traits, class Allocator> - bool operator<=(const basic_string<charT,traits,Allocator>& lhs, - const basic_string<charT,traits,Allocator>& rhs); - -template<class charT, class traits, class Allocator> - bool operator<=(const basic_string<charT,traits,Allocator>& lhs, - const charT* rhs); - -template<class charT, class traits, class Allocator> - bool operator<=(const charT* lhs, - const basic_string<charT,traits,Allocator>& rhs); -*/ - -// 21.3.7.7 operator>= -/* -template<class charT, class traits, class Allocator> - bool operator>=(const basic_string<charT,traits,Allocator>& lhs, - const basic_string<charT,traits,Allocator>& rhs); - -template<class charT, class traits, class Allocator> - bool operator>=(const basic_string<charT,traits,Allocator>& lhs, - const charT* rhs); - -template<class charT, class traits, class Allocator> - bool operator>=(const charT* lhs, - const basic_string<charT,traits,Allocator>& rhs); -*/ - -#include <string> -#include <testsuite_hooks.h> - -int test01(void) -{ - bool test __attribute__((unused)) = true; - std::string str_0("costa rica"); - std::string str_1("costa marbella"); - std::string str_2("cost"); - std::string str_3("costa ricans"); - std::string str_4; - - str_4 = str_0; - //comparisons between string objects - VERIFY( !(str_0 == str_1) ); - VERIFY( !(str_0 == str_2) ); - VERIFY( !(str_0 == str_3) ); - VERIFY( !(str_1 == str_0) ); - VERIFY( !(str_2 == str_0) ); - VERIFY( !(str_3 == str_0) ); - VERIFY( str_4 == str_0 ); - VERIFY( str_0 == str_4 ); - - VERIFY( str_0 != str_1 ); - VERIFY( str_0 != str_2 ); - VERIFY( str_0 != str_3 ); - VERIFY( str_1 != str_0 ); - VERIFY( str_2 != str_0 ); - VERIFY( str_3 != str_0 ); - VERIFY( !(str_0 != str_4) ); - VERIFY( !(str_4 != str_0) ); - - VERIFY( str_0 > str_1 ); //true cuz r>m - VERIFY( str_0 > str_2 ); - VERIFY( !(str_0 > str_3) ); - VERIFY( !(str_1 > str_0) ); //false cuz m<r - VERIFY( !(str_2 > str_0) ); - VERIFY( str_3 > str_0 ); - VERIFY( !(str_0 > str_4) ); - VERIFY( !(str_4 > str_0) ); - - VERIFY( !(str_0 < str_1) ); //false cuz r>m - VERIFY( !(str_0 < str_2) ); - VERIFY( str_0 < str_3 ); - VERIFY( str_1 < str_0 ); //true cuz m<r - VERIFY( str_2 < str_0 ); - VERIFY( !(str_3 < str_0) ); - VERIFY( !(str_0 < str_4) ); - VERIFY( !(str_4 < str_0) ); - - VERIFY( str_0 >= str_1 ); //true cuz r>m - VERIFY( str_0 >= str_2 ); - VERIFY( !(str_0 >= str_3) ); - VERIFY( !(str_1 >= str_0) );//false cuz m<r - VERIFY( !(str_2 >= str_0) ); - VERIFY( str_3 >= str_0 ); - VERIFY( str_0 >= str_4 ); - VERIFY( str_4 >= str_0 ); - - VERIFY( !(str_0 <= str_1) );//false cuz r>m - VERIFY( !(str_0 <= str_2) ); - VERIFY( str_0 <= str_3 ); - VERIFY( str_1 <= str_0 );//true cuz m<r - VERIFY( str_2 <= str_0 ); - VERIFY( !(str_3 <= str_0) ); - VERIFY( str_0 <= str_4 ); - VERIFY( str_4 <= str_0 ); - - //comparisons between string object and string literal - VERIFY( !(str_0 == "costa marbella") ); - VERIFY( !(str_0 == "cost") ); - VERIFY( !(str_0 == "costa ricans") ); - VERIFY( !("costa marbella" == str_0) ); - VERIFY( !("cost" == str_0) ); - VERIFY( !("costa ricans" == str_0) ); - VERIFY( "costa rica" == str_0 ); - VERIFY( str_0 == "costa rica" ); - - VERIFY( str_0 != "costa marbella" ); - VERIFY( str_0 != "cost" ); - VERIFY( str_0 != "costa ricans" ); - VERIFY( "costa marbella" != str_0 ); - VERIFY( "cost" != str_0 ); - VERIFY( "costa ricans" != str_0 ); - VERIFY( !("costa rica" != str_0) ); - VERIFY( !(str_0 != "costa rica") ); - - VERIFY( str_0 > "costa marbella" ); //true cuz r>m - VERIFY( str_0 > "cost" ); - VERIFY( !(str_0 > "costa ricans") ); - VERIFY( !("costa marbella" > str_0) );//false cuz m<r - VERIFY( !("cost" > str_0) ); - VERIFY( "costa ricans" > str_0 ); - VERIFY( !("costa rica" > str_0) ); - VERIFY( !(str_0 > "costa rica") ); - - VERIFY( !(str_0 < "costa marbella") );//false cuz r>m - VERIFY( !(str_0 < "cost") ); - VERIFY( str_0 < "costa ricans" ); - VERIFY( "costa marbella" < str_0 );//true cuz m<r - VERIFY( "cost" < str_0 ); - VERIFY( !("costa ricans" < str_0) ); - VERIFY( !("costa rica" < str_0) ); - VERIFY( !(str_0 < "costa rica") ); - - VERIFY( str_0 >= "costa marbella" );//true cuz r>m - VERIFY( str_0 >= "cost" ); - VERIFY( !(str_0 >= "costa ricans") ); - VERIFY( !("costa marbella" >= str_0) );//false cuz m<r - VERIFY( !("cost" >= str_0) ); - VERIFY( "costa ricans" >= str_0 ); - VERIFY( "costa rica" >= str_0 ); - VERIFY( str_0 >= "costa rica" ); - - VERIFY( !(str_0 <= "costa marbella") );//false cuz r>m - VERIFY( !(str_0 <= "cost") ); - VERIFY( str_0 <= "costa ricans" ); - VERIFY( "costa marbella" <= str_0 );//true cuz m<r - VERIFY( "cost" <= str_0 ); - VERIFY( !("costa ricans" <= str_0) ); - VERIFY( "costa rica" <= str_0 ); - VERIFY( str_0 <= "costa rica" ); - - // 21.3.7.1 operator+ -/* -template<class charT, class traits, class Allocator> - basic_string<charT,traits,Allocator> - operator+(const basic_string<charT,traits,Allocator>& lhs, - const basic_string<charT,traits,Allocator>& rhs); - -template<class charT, class traits, class Allocator> - basic_string<charT,traits,Allocator> - operator+(const charT* lhs, - const basic_string<charT,traits,Allocator>& rhs); - -template<class charT, class traits, class Allocator> - basic_string<charT,traits,Allocator> - operator+(const basic_string<charT,traits,Allocator>& lhs, - const charT* rhs); - -template<class charT, class traits, class Allocator> - basic_string<charT,traits,Allocator> - operator+(charT lhs, const basic_string<charT,traits,Allocator>& rhs); - -template<class charT, class traits, class Allocator> - basic_string<charT,traits,Allocator> - operator+(const basic_string<charT,traits,Allocator>& lhs, charT rhs); -*/ - - str_4 = str_0 + "ns"; - VERIFY( str_4 == str_3 ); - - const std::string str_5(" marbella"); - str_4 = "costa" + str_5; - VERIFY( str_4 == str_1 ); - - std::string str_6("ns"); - str_4 = str_0 + str_6; - VERIFY( str_4 == str_3 ); - - str_4 = str_0 + 'n'; - str_4 = str_4 + 's'; - VERIFY( str_4 == str_3 ); - - str_4 = 'a' + str_6; - str_4 = 'c' + str_4; - str_4 = 'i' + str_4; - str_4 = 'r' + str_4; - str_4 = ' ' + str_4; - str_4 = 'a' + str_4; - str_4 = 't' + str_4; - str_4 = 's' + str_4; - str_4 = 'o' + str_4; - str_4 = 'c' + str_4; - VERIFY( str_4 == str_3 ); - return 0; -} - -int main() -{ - test01(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/operators/wchar_t/1.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/operators/wchar_t/1.cc deleted file mode 100644 index 3bdc0d25b..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/operators/wchar_t/1.cc +++ /dev/null @@ -1,49 +0,0 @@ -// 1999-05-07 bkoz - -// Copyright (C) 1999, 2003, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.3.6 string operations - -#include <string> -#include <cstdio> -#include <testsuite_hooks.h> - -int test01(void) -{ - bool test __attribute__((unused)) = true; - - std::wstring str1; - std::wstring str2; - - // Should get this: - // 1:8-chars_8-chars_ - // 2:8-chars_8-chars_ - str1 = std::wstring(L"8-chars_") + L"8-chars_"; - str1.c_str(); - // wprintf("1:%s\n", str1.c_str()); - str2 = str1 + L"7-chars"; - // wprintf("2:%s\n", str1.c_str()); //str1 is gone - str1.c_str(); - return 0; -} - -int main() -{ - test01(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/operators/wchar_t/2.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/operators/wchar_t/2.cc deleted file mode 100644 index a563f5377..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/operators/wchar_t/2.cc +++ /dev/null @@ -1,294 +0,0 @@ -// 1998-10-01, 1999-06-25 bkoz - -// Copyright (C) 1998, 1999, 2003, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.3.7.1 basic_string non-member functions - -// 21.3.7.2 operator== -/* -template<class charT, class traits, class Allocator> - bool operator==(const basic_string<charT,traits,Allocator>& lhs, - const basic_string<charT,traits,Allocator>& rhs); - -template<class charT, class traits, class Allocator> - bool operator==(const charT* lhs, - const basic_string<charT,traits,Allocator>& rhs); - -template<class charT, class traits, class Allocator> - bool operator==(const basic_string<charT,traits,Allocator>& lhs, - const charT* rhs); -*/ - -// 21.3.7.3 operator!= -/* -template<class charT, class traits, class Allocator> - bool operator!=(const basic_string<charT,traits,Allocator>& lhs, - const basic_string<charT,traits,Allocator>& rhs); - -template<class charT, class traits, class Allocator> - bool operator!=(const charT* lhs, - const basic_string<charT,traits,Allocator>& rhs); - -template<class charT, class traits, class Allocator> - bool operator!=(const basic_string<charT,traits,Allocator>& lhs, - const charT* rhs); -*/ - -// 21.3.7.4 operator< -/* -template<class charT, class traits, class Allocator> - bool operator< (const basic_string<charT,traits,Allocator>& lhs, - const basic_string<charT,traits,Allocator>& rhs); - -template<class charT, class traits, class Allocator> - bool operator< (const basic_string<charT,traits,Allocator>& lhs, - const charT* rhs); - -template<class charT, class traits, class Allocator> - bool operator< (const charT* lhs, - const basic_string<charT,traits,Allocator>& rhs); -*/ - -// 21.3.7.5 operator> -/* -template<class charT, class traits, class Allocator> - bool operator> (const basic_string<charT,traits,Allocator>& lhs, - const basic_string<charT,traits,Allocator>& rhs); - -template<class charT, class traits, class Allocator> - bool operator> (const basic_string<charT,traits,Allocator>& lhs, - const charT* rhs); - -template<class charT, class traits, class Allocator> - bool operator> (const charT* lhs, - const basic_string<charT,traits,Allocator>& rhs); -*/ - -//21.3.7.6 operator<= -/* -template<class charT, class traits, class Allocator> - bool operator<=(const basic_string<charT,traits,Allocator>& lhs, - const basic_string<charT,traits,Allocator>& rhs); - -template<class charT, class traits, class Allocator> - bool operator<=(const basic_string<charT,traits,Allocator>& lhs, - const charT* rhs); - -template<class charT, class traits, class Allocator> - bool operator<=(const charT* lhs, - const basic_string<charT,traits,Allocator>& rhs); -*/ - -// 21.3.7.7 operator>= -/* -template<class charT, class traits, class Allocator> - bool operator>=(const basic_string<charT,traits,Allocator>& lhs, - const basic_string<charT,traits,Allocator>& rhs); - -template<class charT, class traits, class Allocator> - bool operator>=(const basic_string<charT,traits,Allocator>& lhs, - const charT* rhs); - -template<class charT, class traits, class Allocator> - bool operator>=(const charT* lhs, - const basic_string<charT,traits,Allocator>& rhs); -*/ - -#include <string> -#include <testsuite_hooks.h> - -int test01(void) -{ - bool test __attribute__((unused)) = true; - std::wstring str_0(L"costa rica"); - std::wstring str_1(L"costa marbella"); - std::wstring str_2(L"cost"); - std::wstring str_3(L"costa ricans"); - std::wstring str_4; - - str_4 = str_0; - //comparisons between string objects - VERIFY( !(str_0 == str_1) ); - VERIFY( !(str_0 == str_2) ); - VERIFY( !(str_0 == str_3) ); - VERIFY( !(str_1 == str_0) ); - VERIFY( !(str_2 == str_0) ); - VERIFY( !(str_3 == str_0) ); - VERIFY( str_4 == str_0 ); - VERIFY( str_0 == str_4 ); - - VERIFY( str_0 != str_1 ); - VERIFY( str_0 != str_2 ); - VERIFY( str_0 != str_3 ); - VERIFY( str_1 != str_0 ); - VERIFY( str_2 != str_0 ); - VERIFY( str_3 != str_0 ); - VERIFY( !(str_0 != str_4) ); - VERIFY( !(str_4 != str_0) ); - - VERIFY( str_0 > str_1 ); //true cuz r>m - VERIFY( str_0 > str_2 ); - VERIFY( !(str_0 > str_3) ); - VERIFY( !(str_1 > str_0) ); //false cuz m<r - VERIFY( !(str_2 > str_0) ); - VERIFY( str_3 > str_0 ); - VERIFY( !(str_0 > str_4) ); - VERIFY( !(str_4 > str_0) ); - - VERIFY( !(str_0 < str_1) ); //false cuz r>m - VERIFY( !(str_0 < str_2) ); - VERIFY( str_0 < str_3 ); - VERIFY( str_1 < str_0 ); //true cuz m<r - VERIFY( str_2 < str_0 ); - VERIFY( !(str_3 < str_0) ); - VERIFY( !(str_0 < str_4) ); - VERIFY( !(str_4 < str_0) ); - - VERIFY( str_0 >= str_1 ); //true cuz r>m - VERIFY( str_0 >= str_2 ); - VERIFY( !(str_0 >= str_3) ); - VERIFY( !(str_1 >= str_0) );//false cuz m<r - VERIFY( !(str_2 >= str_0) ); - VERIFY( str_3 >= str_0 ); - VERIFY( str_0 >= str_4 ); - VERIFY( str_4 >= str_0 ); - - VERIFY( !(str_0 <= str_1) );//false cuz r>m - VERIFY( !(str_0 <= str_2) ); - VERIFY( str_0 <= str_3 ); - VERIFY( str_1 <= str_0 );//true cuz m<r - VERIFY( str_2 <= str_0 ); - VERIFY( !(str_3 <= str_0) ); - VERIFY( str_0 <= str_4 ); - VERIFY( str_4 <= str_0 ); - - //comparisons between string object and string literal - VERIFY( !(str_0 == L"costa marbella") ); - VERIFY( !(str_0 == L"cost") ); - VERIFY( !(str_0 == L"costa ricans") ); - VERIFY( !(L"costa marbella" == str_0) ); - VERIFY( !(L"cost" == str_0) ); - VERIFY( !(L"costa ricans" == str_0) ); - VERIFY( L"costa rica" == str_0 ); - VERIFY( str_0 == L"costa rica" ); - - VERIFY( str_0 != L"costa marbella" ); - VERIFY( str_0 != L"cost" ); - VERIFY( str_0 != L"costa ricans" ); - VERIFY( L"costa marbella" != str_0 ); - VERIFY( L"cost" != str_0 ); - VERIFY( L"costa ricans" != str_0 ); - VERIFY( !(L"costa rica" != str_0) ); - VERIFY( !(str_0 != L"costa rica") ); - - VERIFY( str_0 > L"costa marbella" ); //true cuz r>m - VERIFY( str_0 > L"cost" ); - VERIFY( !(str_0 > L"costa ricans") ); - VERIFY( !(L"costa marbella" > str_0) );//false cuz m<r - VERIFY( !(L"cost" > str_0) ); - VERIFY( L"costa ricans" > str_0 ); - VERIFY( !(L"costa rica" > str_0) ); - VERIFY( !(str_0 > L"costa rica") ); - - VERIFY( !(str_0 < L"costa marbella") );//false cuz r>m - VERIFY( !(str_0 < L"cost") ); - VERIFY( str_0 < L"costa ricans" ); - VERIFY( L"costa marbella" < str_0 );//true cuz m<r - VERIFY( L"cost" < str_0 ); - VERIFY( !(L"costa ricans" < str_0) ); - VERIFY( !(L"costa rica" < str_0) ); - VERIFY( !(str_0 < L"costa rica") ); - - VERIFY( str_0 >= L"costa marbella" );//true cuz r>m - VERIFY( str_0 >= L"cost" ); - VERIFY( !(str_0 >= L"costa ricans") ); - VERIFY( !(L"costa marbella" >= str_0) );//false cuz m<r - VERIFY( !(L"cost" >= str_0) ); - VERIFY( L"costa ricans" >= str_0 ); - VERIFY( L"costa rica" >= str_0 ); - VERIFY( str_0 >= L"costa rica" ); - - VERIFY( !(str_0 <= L"costa marbella") );//false cuz r>m - VERIFY( !(str_0 <= L"cost") ); - VERIFY( str_0 <= L"costa ricans" ); - VERIFY( L"costa marbella" <= str_0 );//true cuz m<r - VERIFY( L"cost" <= str_0 ); - VERIFY( !(L"costa ricans" <= str_0) ); - VERIFY( L"costa rica" <= str_0 ); - VERIFY( str_0 <= L"costa rica" ); - - // 21.3.7.1 operator+ -/* -template<class charT, class traits, class Allocator> - basic_string<charT,traits,Allocator> - operator+(const basic_string<charT,traits,Allocator>& lhs, - const basic_string<charT,traits,Allocator>& rhs); - -template<class charT, class traits, class Allocator> - basic_string<charT,traits,Allocator> - operator+(const charT* lhs, - const basic_string<charT,traits,Allocator>& rhs); - -template<class charT, class traits, class Allocator> - basic_string<charT,traits,Allocator> - operator+(const basic_string<charT,traits,Allocator>& lhs, - const charT* rhs); - -template<class charT, class traits, class Allocator> - basic_string<charT,traits,Allocator> - operator+(charT lhs, const basic_string<charT,traits,Allocator>& rhs); - -template<class charT, class traits, class Allocator> - basic_string<charT,traits,Allocator> - operator+(const basic_string<charT,traits,Allocator>& lhs, charT rhs); -*/ - - str_4 = str_0 + L"ns"; - VERIFY( str_4 == str_3 ); - - const std::wstring str_5(L" marbella"); - str_4 = L"costa" + str_5; - VERIFY( str_4 == str_1 ); - - std::wstring str_6(L"ns"); - str_4 = str_0 + str_6; - VERIFY( str_4 == str_3 ); - - str_4 = str_0 + L'n'; - str_4 = str_4 + L's'; - VERIFY( str_4 == str_3 ); - - str_4 = L'a' + str_6; - str_4 = L'c' + str_4; - str_4 = L'i' + str_4; - str_4 = L'r' + str_4; - str_4 = L' ' + str_4; - str_4 = L'a' + str_4; - str_4 = L't' + str_4; - str_4 = L's' + str_4; - str_4 = L'o' + str_4; - str_4 = L'c' + str_4; - VERIFY( str_4 == str_3 ); - return 0; -} - -int main() -{ - test01(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/pthread18185.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/pthread18185.cc deleted file mode 100644 index 12f80c443..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/pthread18185.cc +++ /dev/null @@ -1,52 +0,0 @@ -// -// Copyright (C) 2004, 2005, 2007, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } -// { dg-options "-pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } -// { dg-options "-pthreads" { target *-*-solaris* } } - -#include <ext/new_allocator.h> -#include <string> -#include <pthread.h> - -static void* -foo (void*) -{ - typedef std::char_traits<char> traits_type; - typedef __gnu_cxx::new_allocator<char> allocator_type; - typedef std::basic_string<char, traits_type, allocator_type> string_type; - try - { - throw string_type("leak"); - } - catch (const string_type&) - { - pthread_exit (0); - } -} - -// c++/18185 -// This used to leak memory. -int -main () -{ - pthread_t t; - pthread_create (&t, 0, foo, 0); - pthread_join (t, 0); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/pthread4.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/pthread4.cc deleted file mode 100644 index fb48898d6..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/pthread4.cc +++ /dev/null @@ -1,106 +0,0 @@ -// 2002-01-23 Loren J. Rittle <rittle@labs.mot.com> <ljrittle@acm.org> -// Adapted from http://gcc.gnu.org/ml/gcc-bugs/2002-01/msg00679.html -// which was adapted from pthread1.cc by Mike Lu <MLu@dynamicsoft.com> -// -// Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2009 -// 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } -// { dg-options "-pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } -// { dg-options "-pthreads" { target *-*-solaris* } } - -#include <string> -#include <list> -#include <pthread.h> - -using namespace std; - -static list<string> foo; -static pthread_mutex_t fooLock = PTHREAD_MUTEX_INITIALIZER; -static pthread_cond_t fooCondOverflow = PTHREAD_COND_INITIALIZER; -static pthread_cond_t fooCondUnderflow = PTHREAD_COND_INITIALIZER; -static unsigned max_size = 10; -#if defined(__CYGWIN__) -static int iters = 10000; -#else -static int iters = 300000; -#endif - -void* -produce (void*) -{ - for (int num = 0; num < iters; ) - { - string str ("test string"); - - pthread_mutex_lock (&fooLock); - while (foo.size () >= max_size) - pthread_cond_wait (&fooCondOverflow, &fooLock); - foo.push_back (str); - num++; - if (foo.size () >= (max_size / 2)) - pthread_cond_signal (&fooCondUnderflow); - pthread_mutex_unlock (&fooLock); - } - - // No more data will ever be written, ensure no fini race - pthread_mutex_lock (&fooLock); - pthread_cond_signal (&fooCondUnderflow); - pthread_mutex_unlock (&fooLock); - - return 0; -} - -void* -consume (void*) -{ - for (int num = 0; num < iters; ) - { - pthread_mutex_lock (&fooLock); - while (foo.size () == 0) - pthread_cond_wait (&fooCondUnderflow, &fooLock); - while (foo.size () > 0) - { - string str = foo.back (); - foo.pop_back (); - num++; - } - pthread_cond_signal (&fooCondOverflow); - pthread_mutex_unlock (&fooLock); - } - - return 0; -} - -int -main (void) -{ -#if defined(__sun) && defined(__svr4__) && _XOPEN_VERSION >= 500 - pthread_setconcurrency (2); -#endif - - pthread_t prod; - pthread_create (&prod, NULL, produce, NULL); - pthread_t cons; - pthread_create (&cons, NULL, consume, NULL); - - pthread_join (prod, NULL); - pthread_join (cons, NULL); - - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/replace/char/1.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/replace/char/1.cc deleted file mode 100644 index 7d6d3a9b6..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/replace/char/1.cc +++ /dev/null @@ -1,82 +0,0 @@ -// 1999-06-10 bkoz - -// Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -// 2003, 2004, 2005, 2006, 2007, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.3.5.6 basic_string::replace - -#include <string> -#include <algorithm> // for std::find -#include <testsuite_hooks.h> - -bool test01(void) -{ - bool test __attribute__((unused)) = true; - typedef std::string::size_type csize_type; - typedef std::string::const_reference cref; - typedef std::string::reference ref; - - const char str_lit01[] = "ventura, california"; - const std::string str01(str_lit01); - std::string str02("del mar, california"); - std::string str03(" and "); - std::string str05; - - // string& replace(size_type pos, size_type n, const string& string) - // string& replace(size_type pos1, size_type n1, const string& string, - // size_type pos2, size_type n2) - // string& replace(size_type pos, size_type n1, const char* s, size_type n2) - // string& replace(size_type pos, size_type n1, const char* s) - // string& replace(size_type pos, size_type n1, size_type n2, char c) - // string& replace(iterator it1, iterator it2, const string& str) - // string& replace(iterator it1, iterator it2, const chat* s, size_type n) - // string& replace(iterator it1, iterator it2, const chat* s) - // string& replace(iterator it1, iterator it2, size_type n, char c) - // template<typename InputIter> - // string& replace(iterator it1, iterator it2, InputIter j1, InputIter j2) - - // with mods, from tstring.cc, from jason merrill, et. al. - std::string X = "Hello"; - std::string x = X; - - char ch = x[0]; - VERIFY( ch == 'H' ); - - std::string z = x.substr(2, 3); - VERIFY( z == "llo" ); - - x.replace(2, 2, "r"); - VERIFY( x == "Hero" ); - - x = X; - x.replace(0, 1, "j"); - VERIFY( x == "jello" ); - - int ar[] = { 'H', 'e', 'l', 'l', 'o' }; - x.replace(std::find(x.begin(), x.end(), 'l'), - std::find(x.rbegin(), x.rend(), 'l').base(), ar, - ar + sizeof(ar) / sizeof(ar[0])); - VERIFY( x == "jeHelloo" ); - return test; -} - -int main() -{ - test01(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/replace/char/2.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/replace/char/2.cc deleted file mode 100644 index 3721ca8c3..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/replace/char/2.cc +++ /dev/null @@ -1,46 +0,0 @@ -// 1999-06-10 bkoz - -// Copyright (C) 1994, 1999, 2001, 2002, 2003, 2009 -// 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.3.5.6 basic_string::replace - -#include <string> -#include <testsuite_hooks.h> - -void -test02() -{ - bool test __attribute__((unused)) = true; - const char* strlit = "../the long pier/Hanalei Bay/Kauai/Hawaii"; - std::string aux = strlit; - aux.replace(aux.begin()+5, aux.begin()+20, - aux.begin()+10, aux.begin()+15); - VERIFY(aux == "../thg piealei Bay/Kauai/Hawaii"); - - aux = strlit; - aux.replace(aux.begin() + 10, aux.begin() + 15, - aux.begin() + 5, aux.begin() + 20); - VERIFY(aux == "../the lone long pier/Hanr/Hanalei Bay/Kauai/Hawaii"); -} - -int main() -{ - test02(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/replace/char/3.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/replace/char/3.cc deleted file mode 100644 index c462f3816..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/replace/char/3.cc +++ /dev/null @@ -1,74 +0,0 @@ -// 1999-06-10 bkoz - -// Copyright (C) 1994, 1999, 2001, 2002, 2003, 2009 -// 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.3.5.6 basic_string::replace - -#include <string> -#include <testsuite_hooks.h> - -// Some more miscellaneous tests -void -test03() -{ - bool test __attribute__((unused)) = true; - const char* title01 = "nine types of ambiguity"; - const char* title02 = "ultra"; - std::string str01 = title01; - std::string str02 = title02; - - str01.replace(0, 4, str02); - VERIFY(str01 == "ultra types of ambiguity"); - - str01.replace(15, 9, str02, 2, 2); - VERIFY(str01 == "ultra types of tr"); - - str01 = title01; - str02.replace(0, 0, str01, 0, std::string::npos); - VERIFY(str02 == "nine types of ambiguityultra"); - - str02.replace(11, 2, title02, 5); - VERIFY(str02 == "nine types ultra ambiguityultra"); - - str02.replace(11, 5, title01, 2); - VERIFY(str02 == "nine types ni ambiguityultra"); - - str01.replace(str01.size(), 0, title02); - VERIFY(str01 == "nine types of ambiguityultra"); - - str01 = title01; - str02 = title02; - str01.replace(str01.begin(), str01.end(), str02); - VERIFY(str01 == "ultra"); - - str01.replace(str01.begin(), str01.begin(), title01, 4); - VERIFY(str01 == "nineultra"); - - str01.replace(str01.end(), str01.end(), title01 + 5, 5); - VERIFY(str01 == "nineultratypes"); - - str01.replace(str01.begin(), str01.end(), title02); - VERIFY(str01 == "ultra"); -} - -int main() -{ - test03(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/replace/char/4.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/replace/char/4.cc deleted file mode 100644 index 9188837c1..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/replace/char/4.cc +++ /dev/null @@ -1,67 +0,0 @@ -// 1999-06-10 bkoz - -// Copyright (C) 1994, 1999, 2001, 2002, 2003, 2009 -// 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.3.5.6 basic_string::replace - -#include <string> -#include <testsuite_hooks.h> - -// Some more tests for -// template<typename InputIter> -// string& replace(iterator it1, iterator it2, InputIter j1, InputIter j2) -void -test04() -{ - bool test __attribute__((unused)) = true; - std::string str01 = "geogaddi"; - std::string str02; - - typedef std::string::iterator iterator; - typedef std::string::const_iterator const_iterator; - - iterator it1 = str01.begin(); - iterator it2 = str01.end(); - str02.replace(str02.begin(), str02.end(), it1, it2); - VERIFY(str02 == "geogaddi"); - - str02 = "boards"; - const_iterator c_it1 = str01.begin(); - const_iterator c_it2 = str01.end(); - str02.replace(str02.begin(), str02.end(), c_it1, c_it2); - VERIFY(str02 == "geogaddi"); - - str02 = "boards"; - const char* c_ptr1 = str01.c_str(); - const char* c_ptr2 = str01.c_str() + 8; - str02.replace(str02.begin(), str02.end(), c_ptr1, c_ptr2); - VERIFY(str02 == "geogaddi"); - - str02 = "boards"; - char* ptr1 = &*str01.begin(); - char* ptr2 = ptr1 + str01.length(); - str02.replace(str02.begin(), str02.end(), ptr1, ptr2); - VERIFY(str02 == "geogaddi"); -} - -int main() -{ - test04(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/replace/char/5.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/replace/char/5.cc deleted file mode 100644 index 7a3f6aa16..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/replace/char/5.cc +++ /dev/null @@ -1,43 +0,0 @@ -// 1999-06-10 bkoz - -// Copyright (C) 1994, 1999, 2001, 2002, 2003, 2009 -// 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.3.5.6 basic_string::replace - -#include <string> -#include <testsuite_hooks.h> - -// We wrongly used __n1 instead of __foldn1 in the length_error -// check at the beginning of replace(__pos, __n1, __s, __n2) -void -test05() -{ - bool test __attribute__((unused)) = true; - std::string str01 = "londinium"; - std::string str02 = "cydonia"; - - str01.replace(0, 20, str02.c_str(), 3); - VERIFY(str01 == "cyd"); -} - -int main() -{ - test05(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/replace/char/6.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/replace/char/6.cc deleted file mode 100644 index d332498ed..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/replace/char/6.cc +++ /dev/null @@ -1,54 +0,0 @@ -// 2004-01-26 Paolo Carlini <pcarlini@suse.de> - -// Copyright (C) 2004, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.3.5.6 basic_string::replace - -#include <string> -#include <testsuite_hooks.h> - -void test01() -{ - bool test __attribute__((unused)) = true; - - std::string str01("Valle Del Salto"); - str01.replace(0, 5, str01.data() + 10, 5); - VERIFY( str01 == "Salto Del Salto" ); - - std::string str02("Colle di Val d'Elsa"); - str02.replace(0, 9, str02.data() + 10, 0); - VERIFY( str02 == "Val d'Elsa" ); - - std::string str03("Novi Ligure"); - str03.replace(11, 0, str03.data() + 4, 7); - VERIFY( str03 == "Novi Ligure Ligure"); - - std::string str04("Trebisacce"); - str04.replace(3, 4, str04.data(), 0); - VERIFY( str04 == "Trecce" ); - - std::string str05("Altopiano della Sila"); - str05.replace(1, 18, str05.data() + 19, 1); - VERIFY( str05 == "Aaa" ); -} - -int main() -{ - test01(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/replace/wchar_t/1.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/replace/wchar_t/1.cc deleted file mode 100644 index c3afcafac..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/replace/wchar_t/1.cc +++ /dev/null @@ -1,82 +0,0 @@ -// 1999-06-10 bkoz - -// Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -// 2003, 2004, 2005, 2006, 2007, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.3.5.6 basic_string::replace - -#include <string> -#include <algorithm> // for std::find -#include <testsuite_hooks.h> - -bool test01(void) -{ - bool test __attribute__((unused)) = true; - typedef std::wstring::size_type csize_type; - typedef std::wstring::const_reference cref; - typedef std::wstring::reference ref; - - const wchar_t str_lit01[] = L"ventura, california"; - const std::wstring str01(str_lit01); - std::wstring str02(L"del mar, california"); - std::wstring str03(L" and "); - std::wstring str05; - - // wstring& replace(size_type pos, size_type n, const wstring& string) - // wstring& replace(size_type pos1, size_type n1, const wstring& string, - // size_type pos2, size_type n2) - // wstring& replace(size_type pos, size_type n1, const wchar_t* s, size_type n2) - // wstring& replace(size_type pos, size_type n1, const wchar_t* s) - // wstring& replace(size_type pos, size_type n1, size_type n2, wchar_t c) - // wstring& replace(iterator it1, iterator it2, const wstring& str) - // wstring& replace(iterator it1, iterator it2, const wchar_t* s, size_type n) - // wstring& replace(iterator it1, iterator it2, const wchar_t* s) - // wstring& replace(iterator it1, iterator it2, size_type n, char c) - // template<typename InputIter> - // wstring& replace(iterator it1, iterator it2, InputIter j1, InputIter j2) - - // with mods, from tstring.cc, from jason merrill, et. al. - std::wstring X = L"Hello"; - std::wstring x = X; - - wchar_t ch = x[0]; - VERIFY( ch == L'H' ); - - std::wstring z = x.substr(2, 3); - VERIFY( z == L"llo" ); - - x.replace(2, 2, L"r"); - VERIFY( x == L"Hero" ); - - x = X; - x.replace(0, 1, L"j"); - VERIFY( x == L"jello" ); - - wchar_t ar[] = { L'H', L'e', L'l', L'l', L'o' }; - x.replace(std::find(x.begin(), x.end(), L'l'), - std::find(x.rbegin(), x.rend(), L'l').base(), ar, - ar + sizeof(ar) / sizeof(ar[0])); - VERIFY( x == L"jeHelloo" ); - return test; -} - -int main() -{ - test01(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/replace/wchar_t/2.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/replace/wchar_t/2.cc deleted file mode 100644 index 83008ba14..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/replace/wchar_t/2.cc +++ /dev/null @@ -1,47 +0,0 @@ -// 1999-06-10 bkoz - -// Copyright (C) 1994, 1999, 2001, 2002, 2003, 2009 -// 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.3.5.6 basic_string::replace - -#include <string> -#include <stdexcept> -#include <testsuite_hooks.h> - -void -test02() -{ - bool test __attribute__((unused)) = true; - const wchar_t* strlit = L"../the long pier/Hanalei Bay/Kauai/Hawaii"; - std::wstring aux = strlit; - aux.replace(aux.begin()+5, aux.begin()+20, - aux.begin()+10, aux.begin()+15); - VERIFY(aux == L"../thg piealei Bay/Kauai/Hawaii"); - - aux = strlit; - aux.replace(aux.begin() + 10, aux.begin() + 15, - aux.begin() + 5, aux.begin() + 20); - VERIFY(aux == L"../the lone long pier/Hanr/Hanalei Bay/Kauai/Hawaii"); -} - -int main() -{ - test02(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/replace/wchar_t/3.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/replace/wchar_t/3.cc deleted file mode 100644 index 34031673c..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/replace/wchar_t/3.cc +++ /dev/null @@ -1,74 +0,0 @@ -// 1999-06-10 bkoz - -// Copyright (C) 1994, 1999, 2001, 2002, 2003, 2009 -// 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.3.5.6 basic_string::replace - -#include <string> -#include <testsuite_hooks.h> - -// Some more miscellaneous tests -void -test03() -{ - bool test __attribute__((unused)) = true; - const wchar_t* title01 = L"nine types of ambiguity"; - const wchar_t* title02 = L"ultra"; - std::wstring str01 = title01; - std::wstring str02 = title02; - - str01.replace(0, 4, str02); - VERIFY(str01 == L"ultra types of ambiguity"); - - str01.replace(15, 9, str02, 2, 2); - VERIFY(str01 == L"ultra types of tr"); - - str01 = title01; - str02.replace(0, 0, str01, 0, std::wstring::npos); - VERIFY(str02 == L"nine types of ambiguityultra"); - - str02.replace(11, 2, title02, 5); - VERIFY(str02 == L"nine types ultra ambiguityultra"); - - str02.replace(11, 5, title01, 2); - VERIFY(str02 == L"nine types ni ambiguityultra"); - - str01.replace(str01.size(), 0, title02); - VERIFY(str01 == L"nine types of ambiguityultra"); - - str01 = title01; - str02 = title02; - str01.replace(str01.begin(), str01.end(), str02); - VERIFY(str01 == L"ultra"); - - str01.replace(str01.begin(), str01.begin(), title01, 4); - VERIFY(str01 == L"nineultra"); - - str01.replace(str01.end(), str01.end(), title01 + 5, 5); - VERIFY(str01 == L"nineultratypes"); - - str01.replace(str01.begin(), str01.end(), title02); - VERIFY(str01 == L"ultra"); -} - -int main() -{ - test03(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/replace/wchar_t/4.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/replace/wchar_t/4.cc deleted file mode 100644 index 60d6a1579..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/replace/wchar_t/4.cc +++ /dev/null @@ -1,67 +0,0 @@ -// 1999-06-10 bkoz - -// Copyright (C) 1994, 1999, 2001, 2002, 2003, 2009 -// 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.3.5.6 basic_string::replace - -#include <string> -#include <testsuite_hooks.h> - -// Some more tests for -// template<typename InputIter> -// wstring& replace(iterator it1, iterator it2, InputIter j1, InputIter j2) -void -test04() -{ - bool test __attribute__((unused)) = true; - std::wstring str01 = L"geogaddi"; - std::wstring str02; - - typedef std::wstring::iterator iterator; - typedef std::wstring::const_iterator const_iterator; - - iterator it1 = str01.begin(); - iterator it2 = str01.end(); - str02.replace(str02.begin(), str02.end(), it1, it2); - VERIFY(str02 == L"geogaddi"); - - str02 = L"boards"; - const_iterator c_it1 = str01.begin(); - const_iterator c_it2 = str01.end(); - str02.replace(str02.begin(), str02.end(), c_it1, c_it2); - VERIFY(str02 == L"geogaddi"); - - str02 = L"boards"; - const wchar_t* c_ptr1 = str01.c_str(); - const wchar_t* c_ptr2 = str01.c_str() + 8; - str02.replace(str02.begin(), str02.end(), c_ptr1, c_ptr2); - VERIFY(str02 == L"geogaddi"); - - str02 = L"boards"; - wchar_t* ptr1 = &*str01.begin(); - wchar_t* ptr2 = ptr1 + str01.length(); - str02.replace(str02.begin(), str02.end(), ptr1, ptr2); - VERIFY(str02 == L"geogaddi"); -} - -int main() -{ - test04(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/replace/wchar_t/5.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/replace/wchar_t/5.cc deleted file mode 100644 index 959b515b4..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/replace/wchar_t/5.cc +++ /dev/null @@ -1,43 +0,0 @@ -// 1999-06-10 bkoz - -// Copyright (C) 1994, 1999, 2001, 2002, 2003, 2009 -// 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.3.5.6 basic_string::replace - -#include <string> -#include <testsuite_hooks.h> - -// We wrongly used __n1 instead of __foldn1 in the length_error -// check at the beginning of replace(__pos, __n1, __s, __n2) -void -test05() -{ - bool test __attribute__((unused)) = true; - std::wstring str01 = L"londinium"; - std::wstring str02 = L"cydonia"; - - str01.replace(0, 20, str02.c_str(), 3); - VERIFY(str01 == L"cyd"); -} - -int main() -{ - test05(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/replace/wchar_t/6.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/replace/wchar_t/6.cc deleted file mode 100644 index 98c236cf6..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/replace/wchar_t/6.cc +++ /dev/null @@ -1,54 +0,0 @@ -// 2004-01-26 Paolo Carlini <pcarlini@suse.de> - -// Copyright (C) 2004, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.3.5.6 basic_string::replace - -#include <string> -#include <testsuite_hooks.h> - -void test01() -{ - bool test __attribute__((unused)) = true; - - std::wstring str01(L"Valle Del Salto"); - str01.replace(0, 5, str01.data() + 10, 5); - VERIFY( str01 == L"Salto Del Salto" ); - - std::wstring str02(L"Colle di Val d'Elsa"); - str02.replace(0, 9, str02.data() + 10, 0); - VERIFY( str02 == L"Val d'Elsa" ); - - std::wstring str03(L"Novi Ligure"); - str03.replace(11, 0, str03.data() + 4, 7); - VERIFY( str03 == L"Novi Ligure Ligure"); - - std::wstring str04(L"Trebisacce"); - str04.replace(3, 4, str04.data(), 0); - VERIFY( str04 == L"Trecce" ); - - std::wstring str05(L"Altopiano della Sila"); - str05.replace(1, 18, str05.data() + 19, 1); - VERIFY( str05 == L"Aaa" ); -} - -int main() -{ - test01(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/requirements/dr438/constructor.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/requirements/dr438/constructor.cc deleted file mode 100644 index 49ea816c4..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/requirements/dr438/constructor.cc +++ /dev/null @@ -1,27 +0,0 @@ -// 2007-04-27 Paolo Carlini <pcarlini@suse.de> - -// Copyright (C) 2007, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// { dg-do compile } - -#include <string> - -void f() -{ - std::string s(10, 1); -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/requirements/explicit_instantiation/1.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/requirements/explicit_instantiation/1.cc deleted file mode 100644 index 11e4138f0..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/requirements/explicit_instantiation/1.cc +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (C) 2005, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - - -// This file tests explicit instantiation of basic_string - -#include <string> - -// { dg-do compile } - -// libstdc++/21770 -template class std::basic_string<int, std::char_traits<int>, - std::allocator<char> >; diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/requirements/explicit_instantiation/char/1.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/requirements/explicit_instantiation/char/1.cc deleted file mode 100644 index 759548bae..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/requirements/explicit_instantiation/char/1.cc +++ /dev/null @@ -1,22 +0,0 @@ -// { dg-do compile } - -// Copyright (C) 2008, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -#include <string> - -template class std::basic_string<char>; diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/requirements/explicit_instantiation/char16_t/1.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/requirements/explicit_instantiation/char16_t/1.cc deleted file mode 100644 index f89a26786..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/requirements/explicit_instantiation/char16_t/1.cc +++ /dev/null @@ -1,24 +0,0 @@ -// { dg-do compile } -// { dg-options "-std=gnu++0x" } -// { dg-require-cstdint "" } - -// Copyright (C) 2008, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -#include <string> - -template class std::basic_string<char16_t>; diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/requirements/explicit_instantiation/char32_t/1.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/requirements/explicit_instantiation/char32_t/1.cc deleted file mode 100644 index 0fdbe3c49..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/requirements/explicit_instantiation/char32_t/1.cc +++ /dev/null @@ -1,24 +0,0 @@ -// { dg-do compile } -// { dg-options "-std=gnu++0x" } -// { dg-require-cstdint "" } - -// Copyright (C) 2008, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -#include <string> - -template class std::basic_string<char32_t>; diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/requirements/explicit_instantiation/debug.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/requirements/explicit_instantiation/debug.cc deleted file mode 100644 index c9bbbd773..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/requirements/explicit_instantiation/debug.cc +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (C) 2005, 2006, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// This file tests explicit instantiation of basic_string - -#include <debug/string> - -// { dg-do compile } - -// libstdc++/21770 -namespace debug = __gnu_debug; -template class debug::basic_string<int, std::char_traits<int>, - std::allocator<char> >; diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/requirements/explicit_instantiation/wchar_t/1.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/requirements/explicit_instantiation/wchar_t/1.cc deleted file mode 100644 index 3137f3f70..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/requirements/explicit_instantiation/wchar_t/1.cc +++ /dev/null @@ -1,22 +0,0 @@ -// { dg-do compile } - -// Copyright (C) 2008, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -#include <string> - -template class std::basic_string<wchar_t>; diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/rfind/char/1.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/rfind/char/1.cc deleted file mode 100644 index 752aecaba..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/rfind/char/1.cc +++ /dev/null @@ -1,92 +0,0 @@ -// 2000-06-22 -=dbv=- (shamelessy copied from bkoz' find.cc) - -// Copyright (C) 2000, 2003, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -#include <string> -#include <testsuite_hooks.h> - -// 21.3.6.2 basic_string rfind -bool test01(void) -{ - bool test __attribute__((unused)) = true; - typedef std::string::size_type csize_type; - typedef std::string::const_reference cref; - typedef std::string::reference ref; - csize_type npos = std::string::npos; - csize_type csz01, csz02; - - const char str_lit01[] = "mave"; - const std::string str01("mavericks, santa cruz"); - std::string str02(str_lit01); - std::string str03("s, s"); - std::string str04; - - // size_type rfind(const string&, size_type pos = 0) const; - csz01 = str01.rfind(str01); - VERIFY( csz01 == 0 ); - csz01 = str01.rfind(str01, 4); - VERIFY( csz01 == 0 ); - csz01 = str01.rfind(str02,3); - VERIFY( csz01 == 0 ); - csz01 = str01.rfind(str02); - VERIFY( csz01 == 0 ); - csz01 = str01.rfind(str03); - VERIFY( csz01 == 8 ); - csz01 = str01.rfind(str03, 3); - VERIFY( csz01 == npos ); - csz01 = str01.rfind(str03, 12); - VERIFY( csz01 == 8 ); - - // An empty string consists of no characters - // therefore it should be found at every point in a string, - // except beyond the end - csz01 = str01.rfind(str04, 0); - VERIFY( csz01 == 0 ); - csz01 = str01.rfind(str04, 5); - VERIFY( csz01 == 5 ); - csz01 = str01.rfind(str04, str01.size()); - VERIFY( csz01 == str01.size() ); - csz01 = str01.rfind(str04, str01.size()+1); - VERIFY( csz01 == str01.size() ); - - // size_type rfind(const char* s, size_type pos, size_type n) const; - csz01 = str01.rfind(str_lit01, 0, 3); - VERIFY( csz01 == 0 ); - csz01 = str01.rfind(str_lit01, 3, 0); - VERIFY( csz01 == 3 ); - - // size_type rfind(const char* s, size_type pos = 0) const; - csz01 = str01.rfind(str_lit01); - VERIFY( csz01 == 0 ); - csz01 = str01.rfind(str_lit01, 3); - VERIFY( csz01 == 0 ); - - // size_type rfind(char c, size_type pos = 0) const; - csz01 = str01.rfind('z'); - csz02 = str01.size() - 1; - VERIFY( csz01 == csz02 ); - csz01 = str01.rfind('/'); - VERIFY( csz01 == npos ); - return test; -} - -int main() -{ - test01(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/rfind/char/2.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/rfind/char/2.cc deleted file mode 100644 index dd41fe0d9..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/rfind/char/2.cc +++ /dev/null @@ -1,50 +0,0 @@ -// from tstring.cc, from jason merrill, et. al. - -// Copyright (C) 2000, 2003, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -#include <string> -#include <testsuite_hooks.h> - -// 21.3.6.4 basic_string::find_last_of -bool test02() -{ - bool test __attribute__((unused)) = true; - std::string z("ab"); - std::string::size_type pos; - pos = z.find_last_of("ab"); - VERIFY( pos == 1 ); - pos = z.find_last_of("Xa"); - VERIFY( pos == 0 ); - pos = z.find_last_of("Xb"); - VERIFY( pos == 1 ); - pos = z.find_last_of("XYZ"); - VERIFY( pos == std::string::npos ); - pos = z.find_last_of('a'); - VERIFY( pos == 0 ); - pos = z.find_last_of('b'); - VERIFY( pos == 1 ); - pos = z.find_last_of('X'); - VERIFY( pos == std::string::npos ); - return test; -} - -int main() -{ - test02(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/rfind/char/3.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/rfind/char/3.cc deleted file mode 100644 index 378c7c21e..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/rfind/char/3.cc +++ /dev/null @@ -1,64 +0,0 @@ -// from tstring.cc, from jason merrill, et. al. - -// Copyright (C) 2000, 2003, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -#include <string> -#include <testsuite_hooks.h> - -// 21.3.6.6 basic_string::find_last_not_of -bool test03() -{ - bool test __attribute__((unused)) = true; - typedef std::string::size_type csize_type; - std::string::size_type pos; - csize_type npos = std::string::npos; - - std::string x; - pos = x.find_last_not_of('X'); - VERIFY( pos == npos ); - pos = x.find_last_not_of("XYZ"); - VERIFY( pos == npos ); - - std::string y("a"); - pos = y.find_last_not_of('X'); - VERIFY( pos == 0 ); - pos = y.find_last_not_of('a'); - VERIFY( pos == npos ); - pos = y.find_last_not_of("XYZ"); - VERIFY( pos == 0 ); - pos = y.find_last_not_of("a"); - VERIFY( pos == npos ); - - std::string z("ab"); - pos = z.find_last_not_of('X'); - VERIFY( pos == 1 ); - pos = z.find_last_not_of("XYZ"); - VERIFY( pos == 1 ); - pos = z.find_last_not_of('b'); - VERIFY( pos == 0 ); - pos = z.find_last_not_of("Xb"); - VERIFY( pos == 0 ); - pos = z.find_last_not_of("Xa"); - VERIFY( pos == 1 ); - return test; -} -int main() -{ - test03(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/rfind/wchar_t/1.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/rfind/wchar_t/1.cc deleted file mode 100644 index ff1e7593d..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/rfind/wchar_t/1.cc +++ /dev/null @@ -1,92 +0,0 @@ -// 2000-06-22 -=dbv=- (shamelessy copied from bkoz' find.cc) - -// Copyright (C) 2000, 2003, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -#include <string> -#include <testsuite_hooks.h> - -// 21.3.6.2 basic_string rfind -bool test01(void) -{ - bool test __attribute__((unused)) = true; - typedef std::wstring::size_type csize_type; - typedef std::wstring::const_reference cref; - typedef std::wstring::reference ref; - csize_type npos = std::wstring::npos; - csize_type csz01, csz02; - - const wchar_t str_lit01[] = L"mave"; - const std::wstring str01(L"mavericks, santa cruz"); - std::wstring str02(str_lit01); - std::wstring str03(L"s, s"); - std::wstring str04; - - // size_type rfind(const wstring&, size_type pos = 0) const; - csz01 = str01.rfind(str01); - VERIFY( csz01 == 0 ); - csz01 = str01.rfind(str01, 4); - VERIFY( csz01 == 0 ); - csz01 = str01.rfind(str02,3); - VERIFY( csz01 == 0 ); - csz01 = str01.rfind(str02); - VERIFY( csz01 == 0 ); - csz01 = str01.rfind(str03); - VERIFY( csz01 == 8 ); - csz01 = str01.rfind(str03, 3); - VERIFY( csz01 == npos ); - csz01 = str01.rfind(str03, 12); - VERIFY( csz01 == 8 ); - - // An empty string consists of no characters - // therefore it should be found at every point in a string, - // except beyond the end - csz01 = str01.rfind(str04, 0); - VERIFY( csz01 == 0 ); - csz01 = str01.rfind(str04, 5); - VERIFY( csz01 == 5 ); - csz01 = str01.rfind(str04, str01.size()); - VERIFY( csz01 == str01.size() ); - csz01 = str01.rfind(str04, str01.size()+1); - VERIFY( csz01 == str01.size() ); - - // size_type rfind(const wchar_t* s, size_type pos, size_type n) const; - csz01 = str01.rfind(str_lit01, 0, 3); - VERIFY( csz01 == 0 ); - csz01 = str01.rfind(str_lit01, 3, 0); - VERIFY( csz01 == 3 ); - - // size_type rfind(const wchar_t* s, size_type pos = 0) const; - csz01 = str01.rfind(str_lit01); - VERIFY( csz01 == 0 ); - csz01 = str01.rfind(str_lit01, 3); - VERIFY( csz01 == 0 ); - - // size_type rfind(wchar_t c, size_type pos = 0) const; - csz01 = str01.rfind(L'z'); - csz02 = str01.size() - 1; - VERIFY( csz01 == csz02 ); - csz01 = str01.rfind(L'/'); - VERIFY( csz01 == npos ); - return test; -} - -int main() -{ - test01(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/rfind/wchar_t/2.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/rfind/wchar_t/2.cc deleted file mode 100644 index 1d4eaeeb8..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/rfind/wchar_t/2.cc +++ /dev/null @@ -1,50 +0,0 @@ -// from tstring.cc, from jason merrill, et. al. - -// Copyright (C) 2000, 2003, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -#include <string> -#include <testsuite_hooks.h> - -// 21.3.6.4 basic_string::find_last_of -bool test02() -{ - bool test __attribute__((unused)) = true; - std::wstring::size_type pos; - std::wstring z(L"ab"); - pos = z.find_last_of(L"ab"); - VERIFY( pos == 1 ); - pos = z.find_last_of(L"Xa"); - VERIFY( pos == 0 ); - pos = z.find_last_of(L"Xb"); - VERIFY( pos == 1 ); - pos = z.find_last_of(L"XYZ"); - VERIFY( pos == std::wstring::npos ); - pos = z.find_last_of(L'a'); - VERIFY( pos == 0 ); - pos = z.find_last_of(L'b'); - VERIFY( pos == 1 ); - pos = z.find_last_of(L'X'); - VERIFY( pos == std::wstring::npos ); - return test; -} - -int main() -{ - test02(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/rfind/wchar_t/3.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/rfind/wchar_t/3.cc deleted file mode 100644 index 30dcba623..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/rfind/wchar_t/3.cc +++ /dev/null @@ -1,64 +0,0 @@ -// from tstring.cc, from jason merrill, et. al. - -// Copyright (C) 2000, 2003, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -#include <string> -#include <testsuite_hooks.h> - -// 21.3.6.6 basic_string::find_last_not_of -bool test03() -{ - bool test __attribute__((unused)) = true; - typedef std::wstring::size_type csize_type; - std::wstring::size_type pos; - csize_type npos = std::wstring::npos; - - std::wstring x; - pos = x.find_last_not_of(L'X'); - VERIFY( pos == npos ); - pos = x.find_last_not_of(L"XYZ"); - VERIFY( pos == npos ); - - std::wstring y(L"a"); - pos = y.find_last_not_of(L'X'); - VERIFY( pos == 0 ); - pos = y.find_last_not_of(L'a'); - VERIFY( pos == npos ); - pos = y.find_last_not_of(L"XYZ"); - VERIFY( pos == 0 ); - pos = y.find_last_not_of(L"a"); - VERIFY( pos == npos ); - - std::wstring z(L"ab"); - pos = z.find_last_not_of(L'X'); - VERIFY( pos == 1 ); - pos = z.find_last_not_of(L"XYZ"); - VERIFY( pos == 1 ); - pos = z.find_last_not_of(L'b'); - VERIFY( pos == 0 ); - pos = z.find_last_not_of(L"Xb"); - VERIFY( pos == 0 ); - pos = z.find_last_not_of(L"Xa"); - VERIFY( pos == 1 ); - return test; -} -int main() -{ - test03(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/substr/char/1.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/substr/char/1.cc deleted file mode 100644 index 8aecfdc85..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/substr/char/1.cc +++ /dev/null @@ -1,74 +0,0 @@ -// 1999-06-10 bkoz - -// Copyright (C) 1999, 2003, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.3.6.7 basic_string::substr - -#include <string> -#include <stdexcept> -#include <testsuite_hooks.h> - -bool test01(void) -{ - bool test __attribute__((unused)) = true; - typedef std::string::size_type csize_type; - typedef std::string::const_reference cref; - typedef std::string::reference ref; - csize_type csz01; - - const char str_lit01[] = "rockaway, pacifica"; - const std::string str01(str_lit01); - std::string str02; - - // basic_string<charT, _Traits, _Alloc> - // substr(size_type pos = 0, size_type n = npos) const; - csz01 = str01.size(); - str02 = str01.substr(0, 1); - VERIFY( str02 == "r" ); - str02 = str01.substr(10); - VERIFY( str02 == "pacifica" ); - - try { - str02 = str01.substr(csz01 + 1); - VERIFY( false ); - } - catch(std::out_of_range& fail) { - VERIFY( true ); - } - catch(...) { - VERIFY( false ); - } - - try { - str02 = str01.substr(csz01); - VERIFY( str02.size() == 0 ); - } - catch(std::out_of_range& fail) { - VERIFY( false ); - } - catch(...) { - VERIFY( false ); - } - return test; -} - -int main() -{ - test01(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/substr/wchar_t/1.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/substr/wchar_t/1.cc deleted file mode 100644 index 56c8b8362..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/substr/wchar_t/1.cc +++ /dev/null @@ -1,74 +0,0 @@ -// 1999-06-10 bkoz - -// Copyright (C) 1999, 2003, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// 21.3.6.7 basic_string::substr - -#include <string> -#include <stdexcept> -#include <testsuite_hooks.h> - -bool test01(void) -{ - bool test __attribute__((unused)) = true; - typedef std::wstring::size_type csize_type; - typedef std::wstring::const_reference cref; - typedef std::wstring::reference ref; - csize_type csz01; - - const wchar_t str_lit01[] = L"rockaway, pacifica"; - const std::wstring str01(str_lit01); - std::wstring str02; - - // basic_string<charT, _Traits, _Alloc> - // substr(size_type pos = 0, size_type n = npos) const; - csz01 = str01.size(); - str02 = str01.substr(0, 1); - VERIFY( str02 == L"r" ); - str02 = str01.substr(10); - VERIFY( str02 == L"pacifica" ); - - try { - str02 = str01.substr(csz01 + 1); - VERIFY( false ); - } - catch(std::out_of_range& fail) { - VERIFY( true ); - } - catch(...) { - VERIFY( false ); - } - - try { - str02 = str01.substr(csz01); - VERIFY( str02.size() == 0 ); - } - catch(std::out_of_range& fail) { - VERIFY( false ); - } - catch(...) { - VERIFY( false ); - } - return test; -} - -int main() -{ - test01(); - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/types/1.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/types/1.cc deleted file mode 100644 index b30bee244..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/types/1.cc +++ /dev/null @@ -1,47 +0,0 @@ -// 2005-12-01 Paolo Carlini <pcarlini@suse.de> - -// Copyright (C) 2005, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. - -// { dg-do compile } - -#include <string> - -namespace N -{ - struct X { }; - - template<typename T> - X operator+(T, std::size_t) - { return X(); } - - template<typename T> - X operator-(T, T) - { return X(); } -} - -int main() -{ - std::basic_string<N::X> s(5, N::X()); - - s.erase(s.begin()); - s.erase(s.begin(), s.end()); - s.insert(s.begin(), N::X()); - s.replace(s.begin(), s.end(), s.begin(), s.end()); - - return 0; -} diff --git a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/types/23767.cc b/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/types/23767.cc deleted file mode 100644 index d402ccdb0..000000000 --- a/gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/types/23767.cc +++ /dev/null @@ -1,43 +0,0 @@ -// 2005-09-12 Paolo Carlini <pcarlini@suse.de> -// -// Copyright (C) 2005, 2009 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 3, 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 COPYING3. If not see -// <http://www.gnu.org/licenses/>. -// - -// { dg-do compile } - -#include <string> - -struct T -{ - typedef std::string String; - typedef String::iterator iterator; - typedef String::const_iterator const_iterator; - - char t(iterator f) { return *f; } - char t(const_iterator f) const { return *f; } -}; - -// libstdc++/23767 -void f() -{ - std::string s; - T t; - T::const_iterator i = s.begin(); - - t.t(i); -} |