summaryrefslogtreecommitdiffstats
path: root/libcxx/test/strings/basic.string/string.cons/move_assignment.pass.cpp
diff options
context:
space:
mode:
authorHoward Hinnant <hhinnant@apple.com>2013-06-28 16:59:19 +0000
committerHoward Hinnant <hhinnant@apple.com>2013-06-28 16:59:19 +0000
commiteec721826cc35a0c08dc5bc54db9a51dbd4fa361 (patch)
treebe3ea93c71256a122174477e4e8b0024bca43ee7 /libcxx/test/strings/basic.string/string.cons/move_assignment.pass.cpp
parente852add40ed7d93da626d4e2286c840afb9d98d8 (diff)
downloadbcm5719-llvm-eec721826cc35a0c08dc5bc54db9a51dbd4fa361.tar.gz
bcm5719-llvm-eec721826cc35a0c08dc5bc54db9a51dbd4fa361.zip
Implement full support for non-pointer pointers in custom allocators for string. This completes the custom pointer support for the entire library.
llvm-svn: 185167
Diffstat (limited to 'libcxx/test/strings/basic.string/string.cons/move_assignment.pass.cpp')
-rw-r--r--libcxx/test/strings/basic.string/string.cons/move_assignment.pass.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/libcxx/test/strings/basic.string/string.cons/move_assignment.pass.cpp b/libcxx/test/strings/basic.string/string.cons/move_assignment.pass.cpp
index 739f09d1e0f..3e6626b60eb 100644
--- a/libcxx/test/strings/basic.string/string.cons/move_assignment.pass.cpp
+++ b/libcxx/test/strings/basic.string/string.cons/move_assignment.pass.cpp
@@ -18,6 +18,7 @@
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
#include "../test_allocator.h"
+#include "../min_allocator.h"
template <class S>
void
@@ -36,6 +37,7 @@ test(S s1, S s2)
int main()
{
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+ {
typedef std::string S;
test(S(), S());
test(S("1"), S());
@@ -52,5 +54,26 @@ int main()
test(S("1234567890123456789012345678901234567890123456789012345678901234567890"
"1234567890123456789012345678901234567890123456789012345678901234567890"),
S("abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"));
+ }
+#if __cplusplus >= 201103L
+ {
+ typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S;
+ test(S(), S());
+ test(S("1"), S());
+ test(S(), S("1"));
+ test(S("1"), S("2"));
+ test(S("1"), S("2"));
+
+ test(S(),
+ S("abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"));
+ test(S("123456789"),
+ S("abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"));
+ test(S("1234567890123456789012345678901234567890123456789012345678901234567890"),
+ S("abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"));
+ test(S("1234567890123456789012345678901234567890123456789012345678901234567890"
+ "1234567890123456789012345678901234567890123456789012345678901234567890"),
+ S("abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"));
+ }
+#endif
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}
OpenPOWER on IntegriCloud