From eec721826cc35a0c08dc5bc54db9a51dbd4fa361 Mon Sep 17 00:00:00 2001 From: Howard Hinnant Date: Fri, 28 Jun 2013 16:59:19 +0000 Subject: 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 --- .../string.nonmembers/string.special/swap.pass.cpp | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'libcxx/test/strings/basic.string/string.nonmembers/string.special/swap.pass.cpp') diff --git a/libcxx/test/strings/basic.string/string.nonmembers/string.special/swap.pass.cpp b/libcxx/test/strings/basic.string/string.nonmembers/string.special/swap.pass.cpp index 7b34a7a485d..264494cb719 100644 --- a/libcxx/test/strings/basic.string/string.nonmembers/string.special/swap.pass.cpp +++ b/libcxx/test/strings/basic.string/string.nonmembers/string.special/swap.pass.cpp @@ -18,6 +18,8 @@ #include #include +#include "../../min_allocator.h" + template void test(S s1, S s2) @@ -33,6 +35,7 @@ test(S s1, S s2) int main() { + { typedef std::string S; test(S(""), S("")); test(S(""), S("12345")); @@ -50,4 +53,26 @@ int main() test(S("abcdefghijklmnopqrst"), S("12345")); test(S("abcdefghijklmnopqrst"), S("1234567890")); test(S("abcdefghijklmnopqrst"), S("12345678901234567890")); + } +#if __cplusplus >= 201103L + { + typedef std::basic_string, min_allocator> S; + test(S(""), S("")); + test(S(""), S("12345")); + test(S(""), S("1234567890")); + test(S(""), S("12345678901234567890")); + test(S("abcde"), S("")); + test(S("abcde"), S("12345")); + test(S("abcde"), S("1234567890")); + test(S("abcde"), S("12345678901234567890")); + test(S("abcdefghij"), S("")); + test(S("abcdefghij"), S("12345")); + test(S("abcdefghij"), S("1234567890")); + test(S("abcdefghij"), S("12345678901234567890")); + test(S("abcdefghijklmnopqrst"), S("")); + test(S("abcdefghijklmnopqrst"), S("12345")); + test(S("abcdefghijklmnopqrst"), S("1234567890")); + test(S("abcdefghijklmnopqrst"), S("12345678901234567890")); + } +#endif } -- cgit v1.2.3