diff options
Diffstat (limited to 'gcc-4.4.3/libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions')
18 files changed, 0 insertions, 2592 deletions
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; -} |