summaryrefslogtreecommitdiffstats
path: root/libcxx/test/strings/basic.string/string.nonmembers/string_opgt=/string_pointer.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.nonmembers/string_opgt=/string_pointer.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.nonmembers/string_opgt=/string_pointer.pass.cpp')
-rw-r--r--libcxx/test/strings/basic.string/string.nonmembers/string_opgt=/string_pointer.pass.cpp28
1 files changed, 26 insertions, 2 deletions
diff --git a/libcxx/test/strings/basic.string/string.nonmembers/string_opgt=/string_pointer.pass.cpp b/libcxx/test/strings/basic.string/string.nonmembers/string_opgt=/string_pointer.pass.cpp
index 9a496f7f5cf..69359f765c3 100644
--- a/libcxx/test/strings/basic.string/string.nonmembers/string_opgt=/string_pointer.pass.cpp
+++ b/libcxx/test/strings/basic.string/string.nonmembers/string_opgt=/string_pointer.pass.cpp
@@ -15,6 +15,8 @@
#include <string>
#include <cassert>
+#include "../../min_allocator.h"
+
template <class S>
void
test(const S& lhs, const typename S::value_type* rhs, bool x)
@@ -22,10 +24,30 @@ test(const S& lhs, const typename S::value_type* rhs, bool x)
assert((lhs >= rhs) == x);
}
-typedef std::string S;
-
int main()
{
+ {
+ typedef std::string S;
+ test(S(""), "", true);
+ test(S(""), "abcde", false);
+ test(S(""), "abcdefghij", false);
+ test(S(""), "abcdefghijklmnopqrst", false);
+ test(S("abcde"), "", true);
+ test(S("abcde"), "abcde", true);
+ test(S("abcde"), "abcdefghij", false);
+ test(S("abcde"), "abcdefghijklmnopqrst", false);
+ test(S("abcdefghij"), "", true);
+ test(S("abcdefghij"), "abcde", true);
+ test(S("abcdefghij"), "abcdefghij", true);
+ test(S("abcdefghij"), "abcdefghijklmnopqrst", false);
+ test(S("abcdefghijklmnopqrst"), "", true);
+ test(S("abcdefghijklmnopqrst"), "abcde", true);
+ test(S("abcdefghijklmnopqrst"), "abcdefghij", true);
+ test(S("abcdefghijklmnopqrst"), "abcdefghijklmnopqrst", true);
+ }
+#if __cplusplus >= 201103L
+ {
+ typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S;
test(S(""), "", true);
test(S(""), "abcde", false);
test(S(""), "abcdefghij", false);
@@ -42,4 +64,6 @@ int main()
test(S("abcdefghijklmnopqrst"), "abcde", true);
test(S("abcdefghijklmnopqrst"), "abcdefghij", true);
test(S("abcdefghijklmnopqrst"), "abcdefghijklmnopqrst", true);
+ }
+#endif
}
OpenPOWER on IntegriCloud