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:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user