summaryrefslogtreecommitdiffstats
path: root/libcxx/test/strings/basic.string/string.nonmembers/string_opgt=/pointer_string.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=/pointer_string.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=/pointer_string.pass.cpp')
-rw-r--r--libcxx/test/strings/basic.string/string.nonmembers/string_opgt=/pointer_string.pass.cpp28
1 files changed, 26 insertions, 2 deletions
diff --git a/libcxx/test/strings/basic.string/string.nonmembers/string_opgt=/pointer_string.pass.cpp b/libcxx/test/strings/basic.string/string.nonmembers/string_opgt=/pointer_string.pass.cpp
index 6e6208bb488..2105af0472c 100644
--- a/libcxx/test/strings/basic.string/string.nonmembers/string_opgt=/pointer_string.pass.cpp
+++ b/libcxx/test/strings/basic.string/string.nonmembers/string_opgt=/pointer_string.pass.cpp
@@ -15,6 +15,8 @@
#include <string>
#include <cassert>
+#include "../../min_allocator.h"
+
template <class S>
void
test(const typename S::value_type* lhs, const S& rhs, bool x)
@@ -22,10 +24,30 @@ test(const typename S::value_type* lhs, const S& 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("abcde", S(""), true);
+ test("abcde", S("abcde"), true);
+ test("abcde", S("abcdefghij"), false);
+ test("abcde", S("abcdefghijklmnopqrst"), false);
+ test("abcdefghij", S(""), true);
+ test("abcdefghij", S("abcde"), true);
+ test("abcdefghij", S("abcdefghij"), true);
+ test("abcdefghij", S("abcdefghijklmnopqrst"), false);
+ test("abcdefghijklmnopqrst", S(""), true);
+ test("abcdefghijklmnopqrst", S("abcde"), true);
+ test("abcdefghijklmnopqrst", S("abcdefghij"), true);
+ test("abcdefghijklmnopqrst", S("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("abcdefghijklmnopqrst", S("abcde"), true);
test("abcdefghijklmnopqrst", S("abcdefghij"), true);
test("abcdefghijklmnopqrst", S("abcdefghijklmnopqrst"), true);
+ }
+#endif
}
OpenPOWER on IntegriCloud