Index: libcxx/trunk/test/std/strings/string.conversions/stod.pass.cpp =================================================================== --- libcxx/trunk/test/std/strings/string.conversions/stod.pass.cpp +++ libcxx/trunk/test/std/strings/string.conversions/stod.pass.cpp @@ -7,7 +7,6 @@ // //===----------------------------------------------------------------------===// -// XFAIL: libcpp-no-exceptions // // double stod(const string& str, size_t *idx = 0); @@ -17,6 +16,8 @@ #include #include +#include "test_macros.h" + int main() { assert(std::stod("0") == 0); @@ -33,20 +34,25 @@ idx = 0; assert(std::stod(L"10g", &idx) == 10); assert(idx == 2); +#ifndef TEST_HAS_NO_EXCEPTIONS try +#endif { assert(std::stod("1.e60", &idx) == 1.e60); assert(idx == 5); } +#ifndef TEST_HAS_NO_EXCEPTIONS catch (const std::out_of_range&) { assert(false); } try +#endif { assert(std::stod(L"1.e60", &idx) == 1.e60); assert(idx == 5); } +#ifndef TEST_HAS_NO_EXCEPTIONS catch (const std::out_of_range&) { assert(false); @@ -71,40 +77,54 @@ assert(idx == 0); } try +#endif { assert(std::stod("INF", &idx) == INFINITY); assert(idx == 3); } +#ifndef TEST_HAS_NO_EXCEPTIONS catch (const std::out_of_range&) { assert(false); } +#endif idx = 0; +#ifndef TEST_HAS_NO_EXCEPTIONS try +#endif { assert(std::stod(L"INF", &idx) == INFINITY); assert(idx == 3); } +#ifndef TEST_HAS_NO_EXCEPTIONS catch (const std::out_of_range&) { assert(false); } +#endif idx = 0; +#ifndef TEST_HAS_NO_EXCEPTIONS try +#endif { assert(std::isnan(std::stod("NAN", &idx))); assert(idx == 3); } +#ifndef TEST_HAS_NO_EXCEPTIONS catch (const std::out_of_range&) { assert(false); } +#endif idx = 0; +#ifndef TEST_HAS_NO_EXCEPTIONS try +#endif { assert(std::isnan(std::stod(L"NAN", &idx))); assert(idx == 3); } +#ifndef TEST_HAS_NO_EXCEPTIONS catch (const std::out_of_range&) { assert(false); @@ -164,4 +184,5 @@ { assert(idx == 0); } +#endif } Index: libcxx/trunk/test/std/strings/string.conversions/stof.pass.cpp =================================================================== --- libcxx/trunk/test/std/strings/string.conversions/stof.pass.cpp +++ libcxx/trunk/test/std/strings/string.conversions/stof.pass.cpp @@ -7,7 +7,6 @@ // //===----------------------------------------------------------------------===// // -// XFAIL: libcpp-no-exceptions // XFAIL: with_system_cxx_lib=x86_64-apple-darwin11 // XFAIL: with_system_cxx_lib=x86_64-apple-darwin12 @@ -20,6 +19,8 @@ #include #include +#include "test_macros.h" + int main() { assert(std::stof("0") == 0); @@ -36,6 +37,7 @@ idx = 0; assert(std::stof(L"10g", &idx) == 10); assert(idx == 2); +#ifndef TEST_HAS_NO_EXCEPTIONS idx = 0; try { @@ -75,40 +77,54 @@ assert(idx == 0); } try +#endif { assert(std::stof("INF", &idx) == INFINITY); assert(idx == 3); } +#ifndef TEST_HAS_NO_EXCEPTIONS catch (const std::out_of_range&) { assert(false); } +#endif idx = 0; +#ifndef TEST_HAS_NO_EXCEPTIONS try +#endif { assert(std::stof(L"INF", &idx) == INFINITY); assert(idx == 3); } +#ifndef TEST_HAS_NO_EXCEPTIONS catch (const std::out_of_range&) { assert(false); } +#endif idx = 0; +#ifndef TEST_HAS_NO_EXCEPTIONS try +#endif { assert(std::isnan(std::stof("NAN", &idx))); assert(idx == 3); } +#ifndef TEST_HAS_NO_EXCEPTIONS catch (const std::out_of_range&) { assert(false); } +#endif idx = 0; +#ifndef TEST_HAS_NO_EXCEPTIONS try +#endif { assert(std::isnan(std::stof(L"NAN", &idx))); assert(idx == 3); } +#ifndef TEST_HAS_NO_EXCEPTIONS catch (const std::out_of_range&) { assert(false); @@ -168,4 +184,5 @@ { assert(idx == 0); } +#endif } Index: libcxx/trunk/test/std/strings/string.conversions/stoi.pass.cpp =================================================================== --- libcxx/trunk/test/std/strings/string.conversions/stoi.pass.cpp +++ libcxx/trunk/test/std/strings/string.conversions/stoi.pass.cpp @@ -7,7 +7,6 @@ // //===----------------------------------------------------------------------===// -// XFAIL: libcpp-no-exceptions // // int stoi(const string& str, size_t *idx = 0, int base = 10); @@ -16,6 +15,8 @@ #include #include +#include "test_macros.h" + int main() { assert(std::stoi("0") == 0); @@ -32,6 +33,7 @@ idx = 0; assert(std::stoi(L"10g", &idx, 16) == 16); assert(idx == 2); +#ifndef TEST_HAS_NO_EXCEPTIONS if (std::numeric_limits::max() > std::numeric_limits::max()) { try @@ -106,4 +108,5 @@ { assert(idx == 0); } +#endif } Index: libcxx/trunk/test/std/strings/string.conversions/stol.pass.cpp =================================================================== --- libcxx/trunk/test/std/strings/string.conversions/stol.pass.cpp +++ libcxx/trunk/test/std/strings/string.conversions/stol.pass.cpp @@ -7,7 +7,6 @@ // //===----------------------------------------------------------------------===// // -// XFAIL: libcpp-no-exceptions // XFAIL: with_system_cxx_lib=x86_64-apple-darwin11 // XFAIL: with_system_cxx_lib=x86_64-apple-darwin12 @@ -19,6 +18,8 @@ #include #include +#include "test_macros.h" + int main() { assert(std::stol("0") == 0); @@ -35,6 +36,7 @@ idx = 0; assert(std::stol(L"10g", &idx, 16) == 16); assert(idx == 2); +#ifndef TEST_HAS_NO_EXCEPTIONS idx = 0; try { @@ -109,4 +111,5 @@ { assert(idx == 0); } +#endif } Index: libcxx/trunk/test/std/strings/string.conversions/stold.pass.cpp =================================================================== --- libcxx/trunk/test/std/strings/string.conversions/stold.pass.cpp +++ libcxx/trunk/test/std/strings/string.conversions/stold.pass.cpp @@ -7,7 +7,6 @@ // //===----------------------------------------------------------------------===// -// XFAIL: libcpp-no-exceptions // // long double stold(const string& str, size_t *idx = 0); @@ -19,6 +18,8 @@ #include #include +#include "test_macros.h" + int main() { assert(std::stold("0") == 0); @@ -35,25 +36,32 @@ idx = 0; assert(std::stold(L"10g", &idx) == 10); assert(idx == 2); +#ifndef TEST_HAS_NO_EXCEPTIONS try +#endif { assert(std::stold("1.e60", &idx) == 1.e60L); assert(idx == 5); } +#ifndef TEST_HAS_NO_EXCEPTIONS catch (const std::out_of_range&) { assert(false); } try +#endif { assert(std::stold(L"1.e60", &idx) == 1.e60L); assert(idx == 5); } +#ifndef TEST_HAS_NO_EXCEPTIONS catch (const std::out_of_range&) { assert(false); } +#endif idx = 0; +#ifndef TEST_HAS_NO_EXCEPTIONS try { assert(std::stold("1.e6000", &idx) == INFINITY); @@ -73,40 +81,54 @@ assert(idx == 0); } try +#endif { assert(std::stold("INF", &idx) == INFINITY); assert(idx == 3); } +#ifndef TEST_HAS_NO_EXCEPTIONS catch (const std::out_of_range&) { assert(false); } +#endif idx = 0; +#ifndef TEST_HAS_NO_EXCEPTIONS try +#endif { assert(std::stold(L"INF", &idx) == INFINITY); assert(idx == 3); } +#ifndef TEST_HAS_NO_EXCEPTIONS catch (const std::out_of_range&) { assert(false); } +#endif idx = 0; +#ifndef TEST_HAS_NO_EXCEPTIONS try +#endif { assert(std::isnan(std::stold("NAN", &idx))); assert(idx == 3); } +#ifndef TEST_HAS_NO_EXCEPTIONS catch (const std::out_of_range&) { assert(false); } +#endif idx = 0; +#ifndef TEST_HAS_NO_EXCEPTIONS try +#endif { assert(std::isnan(std::stold(L"NAN", &idx))); assert(idx == 3); } +#ifndef TEST_HAS_NO_EXCEPTIONS catch (const std::out_of_range&) { assert(false); @@ -166,4 +188,5 @@ { assert(idx == 0); } +#endif } Index: libcxx/trunk/test/std/strings/string.conversions/stoll.pass.cpp =================================================================== --- libcxx/trunk/test/std/strings/string.conversions/stoll.pass.cpp +++ libcxx/trunk/test/std/strings/string.conversions/stoll.pass.cpp @@ -7,7 +7,6 @@ // //===----------------------------------------------------------------------===// // -// XFAIL: libcpp-no-exceptions // XFAIL: with_system_cxx_lib=x86_64-apple-darwin11 // XFAIL: with_system_cxx_lib=x86_64-apple-darwin12 @@ -19,6 +18,8 @@ #include #include +#include "test_macros.h" + int main() { assert(std::stoll("0") == 0); @@ -35,6 +36,7 @@ idx = 0; assert(std::stoll(L"10g", &idx, 16) == 16); assert(idx == 2); +#ifndef TEST_HAS_NO_EXCEPTIONS idx = 0; try { @@ -108,4 +110,5 @@ { assert(idx == 0); } +#endif } Index: libcxx/trunk/test/std/strings/string.conversions/stoul.pass.cpp =================================================================== --- libcxx/trunk/test/std/strings/string.conversions/stoul.pass.cpp +++ libcxx/trunk/test/std/strings/string.conversions/stoul.pass.cpp @@ -7,7 +7,6 @@ // //===----------------------------------------------------------------------===// // -// XFAIL: libcpp-no-exceptions // XFAIL: with_system_cxx_lib=x86_64-apple-darwin11 // XFAIL: with_system_cxx_lib=x86_64-apple-darwin12 @@ -19,6 +18,8 @@ #include #include +#include "test_macros.h" + int main() { assert(std::stoul("0") == 0); @@ -33,6 +34,7 @@ idx = 0; assert(std::stoul(L"10g", &idx, 16) == 16); assert(idx == 2); +#ifndef TEST_HAS_NO_EXCEPTIONS idx = 0; try { @@ -107,4 +109,5 @@ { assert(idx == 0); } +#endif } Index: libcxx/trunk/test/std/strings/string.conversions/stoull.pass.cpp =================================================================== --- libcxx/trunk/test/std/strings/string.conversions/stoull.pass.cpp +++ libcxx/trunk/test/std/strings/string.conversions/stoull.pass.cpp @@ -7,7 +7,6 @@ // //===----------------------------------------------------------------------===// // -// XFAIL: libcpp-no-exceptions // XFAIL: with_system_cxx_lib=x86_64-apple-darwin11 // XFAIL: with_system_cxx_lib=x86_64-apple-darwin12 @@ -19,6 +18,8 @@ #include #include +#include "test_macros.h" + int main() { assert(std::stoull("0") == 0); @@ -33,6 +34,7 @@ idx = 0; assert(std::stoull(L"10g", &idx, 16) == 16); assert(idx == 2); +#ifndef TEST_HAS_NO_EXCEPTIONS idx = 0; try { @@ -108,4 +110,5 @@ { assert(idx == 0); } +#endif }