summaryrefslogtreecommitdiffstats
path: root/libcxx/test/strings/basic.string/string.capacity/max_size.pass.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libcxx/test/strings/basic.string/string.capacity/max_size.pass.cpp')
-rw-r--r--libcxx/test/strings/basic.string/string.capacity/max_size.pass.cpp19
1 files changed, 7 insertions, 12 deletions
diff --git a/libcxx/test/strings/basic.string/string.capacity/max_size.pass.cpp b/libcxx/test/strings/basic.string/string.capacity/max_size.pass.cpp
index e6a3aa42dde..f42642563bd 100644
--- a/libcxx/test/strings/basic.string/string.capacity/max_size.pass.cpp
+++ b/libcxx/test/strings/basic.string/string.capacity/max_size.pass.cpp
@@ -11,6 +11,13 @@
// size_type max_size() const;
+// NOTE: asan and msan will fail for one of two reasons
+// 1. If allocator_may_return_null=0 then they will fail because the allocation
+// returns null.
+// 2. If allocator_may_return_null=1 then they will fail because the allocation
+// is too large to succeed.
+// UNSUPPORTED: asan, msan
+
#include <string>
#include <cassert>
@@ -40,23 +47,11 @@ test2(const S& s)
template <class S>
void
-test3(const S& s)
-{
- S s2(s);
- const size_t sz = s2.max_size() + 1;
- try { s2.resize(sz, 'x'); }
- catch ( const std::length_error & ) { return ; }
- assert ( false );
-}
-
-template <class S>
-void
test(const S& s)
{
assert(s.max_size() >= s.size());
test1(s);
test2(s);
- test3(s);
}
int main()
OpenPOWER on IntegriCloud