summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/strings/string.conversions/stof.pass.cpp
diff options
context:
space:
mode:
authorRoger Ferrer Ibanez <roger.ferreribanez@arm.com>2016-11-14 10:44:26 +0000
committerRoger Ferrer Ibanez <roger.ferreribanez@arm.com>2016-11-14 10:44:26 +0000
commit84c152a130ff95e52846dddd2cc6ad1c31648160 (patch)
tree983f440031c3cbd0dbca231037cb36fc2b08311a /libcxx/test/std/strings/string.conversions/stof.pass.cpp
parent3d8482a88d5a3a43ef251e642b352fb1e4505335 (diff)
downloadbcm5719-llvm-84c152a130ff95e52846dddd2cc6ad1c31648160.tar.gz
bcm5719-llvm-84c152a130ff95e52846dddd2cc6ad1c31648160.zip
Update tests for strings conversions under libcpp-no-exceptions
Differential Revision: https://reviews.llvm.org/D26139 llvm-svn: 286812
Diffstat (limited to 'libcxx/test/std/strings/string.conversions/stof.pass.cpp')
-rw-r--r--libcxx/test/std/strings/string.conversions/stof.pass.cpp19
1 files changed, 18 insertions, 1 deletions
diff --git a/libcxx/test/std/strings/string.conversions/stof.pass.cpp b/libcxx/test/std/strings/string.conversions/stof.pass.cpp
index 38519a2feba..1e17e1d3abd 100644
--- a/libcxx/test/std/strings/string.conversions/stof.pass.cpp
+++ b/libcxx/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 <cmath>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
assert(std::stof("0") == 0);
@@ -36,6 +37,7 @@ int main()
idx = 0;
assert(std::stof(L"10g", &idx) == 10);
assert(idx == 2);
+#ifndef TEST_HAS_NO_EXCEPTIONS
idx = 0;
try
{
@@ -75,40 +77,54 @@ int main()
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 @@ int main()
{
assert(idx == 0);
}
+#endif
}
OpenPOWER on IntegriCloud