Update tests for strings conversions under libcpp-no-exceptions

Differential Revision: https://reviews.llvm.org/D26139



git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@286812 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Roger Ferrer Ibanez
2016-11-14 10:44:26 +00:00
parent d56adc690b
commit bc464e50e9
8 changed files with 84 additions and 8 deletions

View File

@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// <string>
// int stoi(const string& str, size_t *idx = 0, int base = 10);
@@ -16,6 +15,8 @@
#include <string>
#include <cassert>
#include "test_macros.h"
int main()
{
assert(std::stoi("0") == 0);
@@ -32,6 +33,7 @@ int main()
idx = 0;
assert(std::stoi(L"10g", &idx, 16) == 16);
assert(idx == 2);
#ifndef TEST_HAS_NO_EXCEPTIONS
if (std::numeric_limits<long>::max() > std::numeric_limits<int>::max())
{
try
@@ -106,4 +108,5 @@ int main()
{
assert(idx == 0);
}
#endif
}