diff options
Diffstat (limited to 'libcxx/test/strings/basic.string/string.nonmembers')
32 files changed, 0 insertions, 2509 deletions
diff --git a/libcxx/test/strings/basic.string/string.nonmembers/nothing_to_do.pass.cpp b/libcxx/test/strings/basic.string/string.nonmembers/nothing_to_do.pass.cpp deleted file mode 100644 index b58f5c55b64..00000000000 --- a/libcxx/test/strings/basic.string/string.nonmembers/nothing_to_do.pass.cpp +++ /dev/null @@ -1,12 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -int main() -{ -} diff --git a/libcxx/test/strings/basic.string/string.nonmembers/string.io/get_line.pass.cpp b/libcxx/test/strings/basic.string/string.nonmembers/string.io/get_line.pass.cpp deleted file mode 100644 index 4a912eaec6f..00000000000 --- a/libcxx/test/strings/basic.string/string.nonmembers/string.io/get_line.pass.cpp +++ /dev/null @@ -1,81 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <string> - -// template<class charT, class traits, class Allocator> -// basic_istream<charT,traits>& -// getline(basic_istream<charT,traits>& is, -// basic_string<charT,traits,Allocator>& str); - -#include <string> -#include <sstream> -#include <cassert> - -#include "min_allocator.h" - -int main() -{ - { - std::istringstream in(" abc\n def\n ghij"); - std::string s("initial text"); - getline(in, s); - assert(in.good()); - assert(s == " abc"); - getline(in, s); - assert(in.good()); - assert(s == " def"); - getline(in, s); - assert(in.eof()); - assert(s == " ghij"); - } - { - std::wistringstream in(L" abc\n def\n ghij"); - std::wstring s(L"initial text"); - getline(in, s); - assert(in.good()); - assert(s == L" abc"); - getline(in, s); - assert(in.good()); - assert(s == L" def"); - getline(in, s); - assert(in.eof()); - assert(s == L" ghij"); - } -#if __cplusplus >= 201103L - { - typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S; - std::istringstream in(" abc\n def\n ghij"); - S s("initial text"); - getline(in, s); - assert(in.good()); - assert(s == " abc"); - getline(in, s); - assert(in.good()); - assert(s == " def"); - getline(in, s); - assert(in.eof()); - assert(s == " ghij"); - } - { - typedef std::basic_string<wchar_t, std::char_traits<wchar_t>, min_allocator<wchar_t>> S; - std::wistringstream in(L" abc\n def\n ghij"); - S s(L"initial text"); - getline(in, s); - assert(in.good()); - assert(s == L" abc"); - getline(in, s); - assert(in.good()); - assert(s == L" def"); - getline(in, s); - assert(in.eof()); - assert(s == L" ghij"); - } -#endif -} diff --git a/libcxx/test/strings/basic.string/string.nonmembers/string.io/get_line_delim.pass.cpp b/libcxx/test/strings/basic.string/string.nonmembers/string.io/get_line_delim.pass.cpp deleted file mode 100644 index 6596f2fffa7..00000000000 --- a/libcxx/test/strings/basic.string/string.nonmembers/string.io/get_line_delim.pass.cpp +++ /dev/null @@ -1,93 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <string> - -// template<class charT, class traits, class Allocator> -// basic_istream<charT,traits>& -// getline(basic_istream<charT,traits>& is, -// basic_string<charT,traits,Allocator>& str, charT delim); - -#include <string> -#include <sstream> -#include <cassert> - -#include "min_allocator.h" - -int main() -{ - { - std::istringstream in(" abc* def** ghij"); - std::string s("initial text"); - getline(in, s, '*'); - assert(in.good()); - assert(s == " abc"); - getline(in, s, '*'); - assert(in.good()); - assert(s == " def"); - getline(in, s, '*'); - assert(in.good()); - assert(s == ""); - getline(in, s, '*'); - assert(in.eof()); - assert(s == " ghij"); - } - { - std::wistringstream in(L" abc* def** ghij"); - std::wstring s(L"initial text"); - getline(in, s, L'*'); - assert(in.good()); - assert(s == L" abc"); - getline(in, s, L'*'); - assert(in.good()); - assert(s == L" def"); - getline(in, s, L'*'); - assert(in.good()); - assert(s == L""); - getline(in, s, L'*'); - assert(in.eof()); - assert(s == L" ghij"); - } -#if __cplusplus >= 201103L - { - typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S; - std::istringstream in(" abc* def** ghij"); - S s("initial text"); - getline(in, s, '*'); - assert(in.good()); - assert(s == " abc"); - getline(in, s, '*'); - assert(in.good()); - assert(s == " def"); - getline(in, s, '*'); - assert(in.good()); - assert(s == ""); - getline(in, s, '*'); - assert(in.eof()); - assert(s == " ghij"); - } - { - typedef std::basic_string<wchar_t, std::char_traits<wchar_t>, min_allocator<wchar_t>> S; - std::wistringstream in(L" abc* def** ghij"); - S s(L"initial text"); - getline(in, s, L'*'); - assert(in.good()); - assert(s == L" abc"); - getline(in, s, L'*'); - assert(in.good()); - assert(s == L" def"); - getline(in, s, L'*'); - assert(in.good()); - assert(s == L""); - getline(in, s, L'*'); - assert(in.eof()); - assert(s == L" ghij"); - } -#endif -} diff --git a/libcxx/test/strings/basic.string/string.nonmembers/string.io/get_line_delim_rv.pass.cpp b/libcxx/test/strings/basic.string/string.nonmembers/string.io/get_line_delim_rv.pass.cpp deleted file mode 100644 index 84f52bb2e50..00000000000 --- a/libcxx/test/strings/basic.string/string.nonmembers/string.io/get_line_delim_rv.pass.cpp +++ /dev/null @@ -1,51 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <string> - -// template<class charT, class traits, class Allocator> -// basic_istream<charT,traits>& -// getline(basic_istream<charT,traits>&& is, -// basic_string<charT,traits,Allocator>& str, charT delim); - -#include <string> -#include <sstream> -#include <cassert> - -#include "min_allocator.h" - -int main() -{ -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - { - std::string s("initial text"); - getline(std::istringstream(" abc* def* ghij"), s, '*'); - assert(s == " abc"); - } - { - std::wstring s(L"initial text"); - getline(std::wistringstream(L" abc* def* ghij"), s, L'*'); - assert(s == L" abc"); - } -#if __cplusplus >= 201103L - { - typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S; - S s("initial text"); - getline(std::istringstream(" abc* def* ghij"), s, '*'); - assert(s == " abc"); - } - { - typedef std::basic_string<wchar_t, std::char_traits<wchar_t>, min_allocator<wchar_t>> S; - S s(L"initial text"); - getline(std::wistringstream(L" abc* def* ghij"), s, L'*'); - assert(s == L" abc"); - } -#endif -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES -} diff --git a/libcxx/test/strings/basic.string/string.nonmembers/string.io/get_line_rv.pass.cpp b/libcxx/test/strings/basic.string/string.nonmembers/string.io/get_line_rv.pass.cpp deleted file mode 100644 index a3c9911abe9..00000000000 --- a/libcxx/test/strings/basic.string/string.nonmembers/string.io/get_line_rv.pass.cpp +++ /dev/null @@ -1,51 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <string> - -// template<class charT, class traits, class Allocator> -// basic_istream<charT,traits>& -// getline(basic_istream<charT,traits>&& is, -// basic_string<charT,traits,Allocator>& str); - -#include <string> -#include <sstream> -#include <cassert> - -#include "min_allocator.h" - -int main() -{ -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - { - std::string s("initial text"); - getline(std::istringstream(" abc\n def\n ghij"), s); - assert(s == " abc"); - } - { - std::wstring s(L"initial text"); - getline(std::wistringstream(L" abc\n def\n ghij"), s); - assert(s == L" abc"); - } -#if __cplusplus >= 201103L - { - typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S; - S s("initial text"); - getline(std::istringstream(" abc\n def\n ghij"), s); - assert(s == " abc"); - } - { - typedef std::basic_string<wchar_t, std::char_traits<wchar_t>, min_allocator<wchar_t>> S; - S s(L"initial text"); - getline(std::wistringstream(L" abc\n def\n ghij"), s); - assert(s == L" abc"); - } -#endif -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES -} diff --git a/libcxx/test/strings/basic.string/string.nonmembers/string.io/stream_extract.pass.cpp b/libcxx/test/strings/basic.string/string.nonmembers/string.io/stream_extract.pass.cpp deleted file mode 100644 index af806bc0457..00000000000 --- a/libcxx/test/strings/basic.string/string.nonmembers/string.io/stream_extract.pass.cpp +++ /dev/null @@ -1,117 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <string> - -// template<class charT, class traits, class Allocator> -// basic_istream<charT,traits>& -// operator>>(basic_istream<charT,traits>& is, -// basic_string<charT,traits,Allocator>& str); - -#include <string> -#include <sstream> -#include <cassert> - -#include "min_allocator.h" - -int main() -{ - { - std::istringstream in("a bc defghij"); - std::string s("initial text"); - in >> s; - assert(in.good()); - assert(s == "a"); - assert(in.peek() == ' '); - in >> s; - assert(in.good()); - assert(s == "bc"); - assert(in.peek() == ' '); - in.width(3); - in >> s; - assert(in.good()); - assert(s == "def"); - assert(in.peek() == 'g'); - in >> s; - assert(in.eof()); - assert(s == "ghij"); - in >> s; - assert(in.fail()); - } - { - std::wistringstream in(L"a bc defghij"); - std::wstring s(L"initial text"); - in >> s; - assert(in.good()); - assert(s == L"a"); - assert(in.peek() == L' '); - in >> s; - assert(in.good()); - assert(s == L"bc"); - assert(in.peek() == L' '); - in.width(3); - in >> s; - assert(in.good()); - assert(s == L"def"); - assert(in.peek() == L'g'); - in >> s; - assert(in.eof()); - assert(s == L"ghij"); - in >> s; - assert(in.fail()); - } -#if __cplusplus >= 201103L - { - typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S; - std::istringstream in("a bc defghij"); - S s("initial text"); - in >> s; - assert(in.good()); - assert(s == "a"); - assert(in.peek() == ' '); - in >> s; - assert(in.good()); - assert(s == "bc"); - assert(in.peek() == ' '); - in.width(3); - in >> s; - assert(in.good()); - assert(s == "def"); - assert(in.peek() == 'g'); - in >> s; - assert(in.eof()); - assert(s == "ghij"); - in >> s; - assert(in.fail()); - } - { - typedef std::basic_string<wchar_t, std::char_traits<wchar_t>, min_allocator<wchar_t>> S; - std::wistringstream in(L"a bc defghij"); - S s(L"initial text"); - in >> s; - assert(in.good()); - assert(s == L"a"); - assert(in.peek() == L' '); - in >> s; - assert(in.good()); - assert(s == L"bc"); - assert(in.peek() == L' '); - in.width(3); - in >> s; - assert(in.good()); - assert(s == L"def"); - assert(in.peek() == L'g'); - in >> s; - assert(in.eof()); - assert(s == L"ghij"); - in >> s; - assert(in.fail()); - } -#endif -} diff --git a/libcxx/test/strings/basic.string/string.nonmembers/string.io/stream_insert.pass.cpp b/libcxx/test/strings/basic.string/string.nonmembers/string.io/stream_insert.pass.cpp deleted file mode 100644 index 102e8ea0815..00000000000 --- a/libcxx/test/strings/basic.string/string.nonmembers/string.io/stream_insert.pass.cpp +++ /dev/null @@ -1,91 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <string> - -// template<class charT, class traits, class Allocator> -// basic_ostream<charT, traits>& -// operator<<(basic_ostream<charT, traits>& os, -// const basic_string<charT,traits,Allocator>& str); - -#include <string> -#include <sstream> -#include <cassert> - -#include "min_allocator.h" - -int main() -{ - { - std::ostringstream out; - std::string s("some text"); - out << s; - assert(out.good()); - assert(s == out.str()); - } - { - std::ostringstream out; - std::string s("some text"); - out.width(12); - out << s; - assert(out.good()); - assert(" " + s == out.str()); - } - { - std::wostringstream out; - std::wstring s(L"some text"); - out << s; - assert(out.good()); - assert(s == out.str()); - } - { - std::wostringstream out; - std::wstring s(L"some text"); - out.width(12); - out << s; - assert(out.good()); - assert(L" " + s == out.str()); - } -#if __cplusplus >= 201103L - { - typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S; - std::basic_ostringstream<S::value_type, S::traits_type, S::allocator_type> out; - S s("some text"); - out << s; - assert(out.good()); - assert(s == out.str()); - } - { - typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S; - std::basic_ostringstream<S::value_type, S::traits_type, S::allocator_type> out; - S s("some text"); - out.width(12); - out << s; - assert(out.good()); - assert(" " + s == out.str()); - } - { - typedef std::basic_string<wchar_t, std::char_traits<wchar_t>, min_allocator<wchar_t>> S; - std::basic_ostringstream<S::value_type, S::traits_type, S::allocator_type> out; - S s(L"some text"); - out << s; - assert(out.good()); - assert(s == out.str()); - } - { - typedef std::basic_string<wchar_t, std::char_traits<wchar_t>, min_allocator<wchar_t>> S; - std::basic_ostringstream<S::value_type, S::traits_type, S::allocator_type> out; - S s(L"some text"); - out.width(12); - out << s; - assert(out.good()); - assert(L" " + s == out.str()); - } -#endif -} 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 deleted file mode 100644 index cee538800dd..00000000000 --- a/libcxx/test/strings/basic.string/string.nonmembers/string.special/swap.pass.cpp +++ /dev/null @@ -1,78 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <string> - -// template<class charT, class traits, class Allocator> -// void swap(basic_string<charT,traits,Allocator>& lhs, -// basic_string<charT,traits,Allocator>& rhs); - -#include <string> -#include <stdexcept> -#include <algorithm> -#include <cassert> - -#include "min_allocator.h" - -template <class S> -void -test(S s1, S s2) -{ - S s1_ = s1; - S s2_ = s2; - swap(s1, s2); - assert(s1.__invariants()); - assert(s2.__invariants()); - assert(s1 == s2_); - assert(s2 == s1_); -} - -int main() -{ - { - typedef std::string 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")); - } -#if __cplusplus >= 201103L - { - typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> 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 -} diff --git a/libcxx/test/strings/basic.string/string.nonmembers/string.special/swap_noexcept.pass.cpp b/libcxx/test/strings/basic.string/string.nonmembers/string.special/swap_noexcept.pass.cpp deleted file mode 100644 index 4d5d79693d0..00000000000 --- a/libcxx/test/strings/basic.string/string.nonmembers/string.special/swap_noexcept.pass.cpp +++ /dev/null @@ -1,54 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <string> - -// void swap(basic_string& c) -// noexcept(!allocator_type::propagate_on_container_swap::value || -// __is_nothrow_swappable<allocator_type>::value); - -// This tests a conforming extension - -#include <string> -#include <cassert> - -#include "test_allocator.h" - -template <class T> -struct some_alloc -{ - typedef T value_type; - - some_alloc() {} - some_alloc(const some_alloc&); - void deallocate(void*, unsigned) {} - - typedef std::true_type propagate_on_container_swap; -}; - -int main() -{ -#if __has_feature(cxx_noexcept) - { - typedef std::string C; - C c1, c2; - static_assert(noexcept(swap(c1, c2)), ""); - } - { - typedef std::basic_string<char, std::char_traits<char>, test_allocator<char>> C; - C c1, c2; - static_assert(noexcept(swap(c1, c2)), ""); - } - { - typedef std::basic_string<char, std::char_traits<char>, some_alloc<char>> C; - C c1, c2; - static_assert(!noexcept(swap(c1, c2)), ""); - } -#endif -} diff --git a/libcxx/test/strings/basic.string/string.nonmembers/string_op!=/pointer_string.pass.cpp b/libcxx/test/strings/basic.string/string.nonmembers/string_op!=/pointer_string.pass.cpp deleted file mode 100644 index cc08982a5ca..00000000000 --- a/libcxx/test/strings/basic.string/string.nonmembers/string_op!=/pointer_string.pass.cpp +++ /dev/null @@ -1,69 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <string> - -// template<class charT, class traits, class Allocator> -// bool operator!=(const charT* lhs, const basic_string<charT,traits,Allocator>& rhs); - -#include <string> -#include <cassert> - -#include "min_allocator.h" - -template <class S> -void -test(const typename S::value_type* lhs, const S& rhs, bool x) -{ - assert((lhs != rhs) == x); -} - -int main() -{ - { - typedef std::string S; - test("", S(""), false); - test("", S("abcde"), true); - test("", S("abcdefghij"), true); - test("", S("abcdefghijklmnopqrst"), true); - test("abcde", S(""), true); - test("abcde", S("abcde"), false); - test("abcde", S("abcdefghij"), true); - test("abcde", S("abcdefghijklmnopqrst"), true); - test("abcdefghij", S(""), true); - test("abcdefghij", S("abcde"), true); - test("abcdefghij", S("abcdefghij"), false); - test("abcdefghij", S("abcdefghijklmnopqrst"), true); - test("abcdefghijklmnopqrst", S(""), true); - test("abcdefghijklmnopqrst", S("abcde"), true); - test("abcdefghijklmnopqrst", S("abcdefghij"), true); - test("abcdefghijklmnopqrst", S("abcdefghijklmnopqrst"), false); - } -#if __cplusplus >= 201103L - { - typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S; - test("", S(""), false); - test("", S("abcde"), true); - test("", S("abcdefghij"), true); - test("", S("abcdefghijklmnopqrst"), true); - test("abcde", S(""), true); - test("abcde", S("abcde"), false); - test("abcde", S("abcdefghij"), true); - test("abcde", S("abcdefghijklmnopqrst"), true); - test("abcdefghij", S(""), true); - test("abcdefghij", S("abcde"), true); - test("abcdefghij", S("abcdefghij"), false); - test("abcdefghij", S("abcdefghijklmnopqrst"), true); - test("abcdefghijklmnopqrst", S(""), true); - test("abcdefghijklmnopqrst", S("abcde"), true); - test("abcdefghijklmnopqrst", S("abcdefghij"), true); - test("abcdefghijklmnopqrst", S("abcdefghijklmnopqrst"), false); - } -#endif -} diff --git a/libcxx/test/strings/basic.string/string.nonmembers/string_op!=/string_pointer.pass.cpp b/libcxx/test/strings/basic.string/string.nonmembers/string_op!=/string_pointer.pass.cpp deleted file mode 100644 index b496d70dc2f..00000000000 --- a/libcxx/test/strings/basic.string/string.nonmembers/string_op!=/string_pointer.pass.cpp +++ /dev/null @@ -1,69 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <string> - -// template<class charT, class traits, class Allocator> -// bool operator!=(const basic_string<charT,traits,Allocator>& lhs, const charT* rhs); - -#include <string> -#include <cassert> - -#include "min_allocator.h" - -template <class S> -void -test(const S& lhs, const typename S::value_type* rhs, bool x) -{ - assert((lhs != rhs) == x); -} - -int main() -{ - { - typedef std::string S; - test(S(""), "", false); - test(S(""), "abcde", true); - test(S(""), "abcdefghij", true); - test(S(""), "abcdefghijklmnopqrst", true); - test(S("abcde"), "", true); - test(S("abcde"), "abcde", false); - test(S("abcde"), "abcdefghij", true); - test(S("abcde"), "abcdefghijklmnopqrst", true); - test(S("abcdefghij"), "", true); - test(S("abcdefghij"), "abcde", true); - test(S("abcdefghij"), "abcdefghij", false); - test(S("abcdefghij"), "abcdefghijklmnopqrst", true); - test(S("abcdefghijklmnopqrst"), "", true); - test(S("abcdefghijklmnopqrst"), "abcde", true); - test(S("abcdefghijklmnopqrst"), "abcdefghij", true); - test(S("abcdefghijklmnopqrst"), "abcdefghijklmnopqrst", false); - } -#if __cplusplus >= 201103L - { - typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S; - test(S(""), "", false); - test(S(""), "abcde", true); - test(S(""), "abcdefghij", true); - test(S(""), "abcdefghijklmnopqrst", true); - test(S("abcde"), "", true); - test(S("abcde"), "abcde", false); - test(S("abcde"), "abcdefghij", true); - test(S("abcde"), "abcdefghijklmnopqrst", true); - test(S("abcdefghij"), "", true); - test(S("abcdefghij"), "abcde", true); - test(S("abcdefghij"), "abcdefghij", false); - test(S("abcdefghij"), "abcdefghijklmnopqrst", true); - test(S("abcdefghijklmnopqrst"), "", true); - test(S("abcdefghijklmnopqrst"), "abcde", true); - test(S("abcdefghijklmnopqrst"), "abcdefghij", true); - test(S("abcdefghijklmnopqrst"), "abcdefghijklmnopqrst", false); - } -#endif -} diff --git a/libcxx/test/strings/basic.string/string.nonmembers/string_op!=/string_string.pass.cpp b/libcxx/test/strings/basic.string/string.nonmembers/string_op!=/string_string.pass.cpp deleted file mode 100644 index 069b305111d..00000000000 --- a/libcxx/test/strings/basic.string/string.nonmembers/string_op!=/string_string.pass.cpp +++ /dev/null @@ -1,70 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <string> - -// template<class charT, class traits, class Allocator> -// bool operator!=(const basic_string<charT,traits,Allocator>& lhs, -// const basic_string<charT,traits,Allocator>& rhs); - -#include <string> -#include <cassert> - -#include "min_allocator.h" - -template <class S> -void -test(const S& lhs, const S& rhs, bool x) -{ - assert((lhs != rhs) == x); -} - -int main() -{ - { - typedef std::string S; - test(S(""), S(""), false); - test(S(""), S("abcde"), true); - test(S(""), S("abcdefghij"), true); - test(S(""), S("abcdefghijklmnopqrst"), true); - test(S("abcde"), S(""), true); - test(S("abcde"), S("abcde"), false); - test(S("abcde"), S("abcdefghij"), true); - test(S("abcde"), S("abcdefghijklmnopqrst"), true); - test(S("abcdefghij"), S(""), true); - test(S("abcdefghij"), S("abcde"), true); - test(S("abcdefghij"), S("abcdefghij"), false); - test(S("abcdefghij"), S("abcdefghijklmnopqrst"), true); - test(S("abcdefghijklmnopqrst"), S(""), true); - test(S("abcdefghijklmnopqrst"), S("abcde"), true); - test(S("abcdefghijklmnopqrst"), S("abcdefghij"), true); - test(S("abcdefghijklmnopqrst"), S("abcdefghijklmnopqrst"), false); - } -#if __cplusplus >= 201103L - { - typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S; - test(S(""), S(""), false); - test(S(""), S("abcde"), true); - test(S(""), S("abcdefghij"), true); - test(S(""), S("abcdefghijklmnopqrst"), true); - test(S("abcde"), S(""), true); - test(S("abcde"), S("abcde"), false); - test(S("abcde"), S("abcdefghij"), true); - test(S("abcde"), S("abcdefghijklmnopqrst"), true); - test(S("abcdefghij"), S(""), true); - test(S("abcdefghij"), S("abcde"), true); - test(S("abcdefghij"), S("abcdefghij"), false); - test(S("abcdefghij"), S("abcdefghijklmnopqrst"), true); - test(S("abcdefghijklmnopqrst"), S(""), true); - test(S("abcdefghijklmnopqrst"), S("abcde"), true); - test(S("abcdefghijklmnopqrst"), S("abcdefghij"), true); - test(S("abcdefghijklmnopqrst"), S("abcdefghijklmnopqrst"), false); - } -#endif -} diff --git a/libcxx/test/strings/basic.string/string.nonmembers/string_op+/char_string.pass.cpp b/libcxx/test/strings/basic.string/string.nonmembers/string_op+/char_string.pass.cpp deleted file mode 100644 index 4e09bf2464c..00000000000 --- a/libcxx/test/strings/basic.string/string.nonmembers/string_op+/char_string.pass.cpp +++ /dev/null @@ -1,79 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <string> - -// template<class charT, class traits, class Allocator> -// basic_string<charT,traits,Allocator> -// operator+(charT lhs, const basic_string<charT,traits,Allocator>& rhs); - -// template<class charT, class traits, class Allocator> -// basic_string<charT,traits,Allocator>&& -// operator+(charT lhs, basic_string<charT,traits,Allocator>&& rhs); - -#include <string> -#include <cassert> - -#include "min_allocator.h" - -template <class S> -void -test0(typename S::value_type lhs, const S& rhs, const S& x) -{ - assert(lhs + rhs == x); -} - -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - -template <class S> -void -test1(typename S::value_type lhs, S&& rhs, const S& x) -{ - assert(lhs + move(rhs) == x); -} - -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES - -int main() -{ - { - typedef std::string S; - test0('a', S(""), S("a")); - test0('a', S("12345"), S("a12345")); - test0('a', S("1234567890"), S("a1234567890")); - test0('a', S("12345678901234567890"), S("a12345678901234567890")); - -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - - test1('a', S(""), S("a")); - test1('a', S("12345"), S("a12345")); - test1('a', S("1234567890"), S("a1234567890")); - test1('a', S("12345678901234567890"), S("a12345678901234567890")); - -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES - } -#if __cplusplus >= 201103L - { - typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S; - test0('a', S(""), S("a")); - test0('a', S("12345"), S("a12345")); - test0('a', S("1234567890"), S("a1234567890")); - test0('a', S("12345678901234567890"), S("a12345678901234567890")); - -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - - test1('a', S(""), S("a")); - test1('a', S("12345"), S("a12345")); - test1('a', S("1234567890"), S("a1234567890")); - test1('a', S("12345678901234567890"), S("a12345678901234567890")); - -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES - } -#endif -} diff --git a/libcxx/test/strings/basic.string/string.nonmembers/string_op+/pointer_string.pass.cpp b/libcxx/test/strings/basic.string/string.nonmembers/string_op+/pointer_string.pass.cpp deleted file mode 100644 index 9dc8a510beb..00000000000 --- a/libcxx/test/strings/basic.string/string.nonmembers/string_op+/pointer_string.pass.cpp +++ /dev/null @@ -1,127 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <string> - -// template<class charT, class traits, class Allocator> -// basic_string<charT,traits,Allocator> -// operator+(const charT* lhs, const basic_string<charT,traits,Allocator>& rhs); - -// template<class charT, class traits, class Allocator> -// basic_string<charT,traits,Allocator>&& -// operator+(const charT* lhs, basic_string<charT,traits,Allocator>&& rhs); - -#include <string> -#include <cassert> - -#include "min_allocator.h" - -template <class S> -void -test0(const typename S::value_type* lhs, const S& rhs, const S& x) -{ - assert(lhs + rhs == x); -} - -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - -template <class S> -void -test1(const typename S::value_type* lhs, S&& rhs, const S& x) -{ - assert(lhs + move(rhs) == x); -} - -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES - -int main() -{ - { - typedef std::string S; - test0("", S(""), S("")); - test0("", S("12345"), S("12345")); - test0("", S("1234567890"), S("1234567890")); - test0("", S("12345678901234567890"), S("12345678901234567890")); - test0("abcde", S(""), S("abcde")); - test0("abcde", S("12345"), S("abcde12345")); - test0("abcde", S("1234567890"), S("abcde1234567890")); - test0("abcde", S("12345678901234567890"), S("abcde12345678901234567890")); - test0("abcdefghij", S(""), S("abcdefghij")); - test0("abcdefghij", S("12345"), S("abcdefghij12345")); - test0("abcdefghij", S("1234567890"), S("abcdefghij1234567890")); - test0("abcdefghij", S("12345678901234567890"), S("abcdefghij12345678901234567890")); - test0("abcdefghijklmnopqrst", S(""), S("abcdefghijklmnopqrst")); - test0("abcdefghijklmnopqrst", S("12345"), S("abcdefghijklmnopqrst12345")); - test0("abcdefghijklmnopqrst", S("1234567890"), S("abcdefghijklmnopqrst1234567890")); - test0("abcdefghijklmnopqrst", S("12345678901234567890"), S("abcdefghijklmnopqrst12345678901234567890")); - -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - - test1("", S(""), S("")); - test1("", S("12345"), S("12345")); - test1("", S("1234567890"), S("1234567890")); - test1("", S("12345678901234567890"), S("12345678901234567890")); - test1("abcde", S(""), S("abcde")); - test1("abcde", S("12345"), S("abcde12345")); - test1("abcde", S("1234567890"), S("abcde1234567890")); - test1("abcde", S("12345678901234567890"), S("abcde12345678901234567890")); - test1("abcdefghij", S(""), S("abcdefghij")); - test1("abcdefghij", S("12345"), S("abcdefghij12345")); - test1("abcdefghij", S("1234567890"), S("abcdefghij1234567890")); - test1("abcdefghij", S("12345678901234567890"), S("abcdefghij12345678901234567890")); - test1("abcdefghijklmnopqrst", S(""), S("abcdefghijklmnopqrst")); - test1("abcdefghijklmnopqrst", S("12345"), S("abcdefghijklmnopqrst12345")); - test1("abcdefghijklmnopqrst", S("1234567890"), S("abcdefghijklmnopqrst1234567890")); - test1("abcdefghijklmnopqrst", S("12345678901234567890"), S("abcdefghijklmnopqrst12345678901234567890")); - -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES - } -#if __cplusplus >= 201103L - { - typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S; - test0("", S(""), S("")); - test0("", S("12345"), S("12345")); - test0("", S("1234567890"), S("1234567890")); - test0("", S("12345678901234567890"), S("12345678901234567890")); - test0("abcde", S(""), S("abcde")); - test0("abcde", S("12345"), S("abcde12345")); - test0("abcde", S("1234567890"), S("abcde1234567890")); - test0("abcde", S("12345678901234567890"), S("abcde12345678901234567890")); - test0("abcdefghij", S(""), S("abcdefghij")); - test0("abcdefghij", S("12345"), S("abcdefghij12345")); - test0("abcdefghij", S("1234567890"), S("abcdefghij1234567890")); - test0("abcdefghij", S("12345678901234567890"), S("abcdefghij12345678901234567890")); - test0("abcdefghijklmnopqrst", S(""), S("abcdefghijklmnopqrst")); - test0("abcdefghijklmnopqrst", S("12345"), S("abcdefghijklmnopqrst12345")); - test0("abcdefghijklmnopqrst", S("1234567890"), S("abcdefghijklmnopqrst1234567890")); - test0("abcdefghijklmnopqrst", S("12345678901234567890"), S("abcdefghijklmnopqrst12345678901234567890")); - -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - - test1("", S(""), S("")); - test1("", S("12345"), S("12345")); - test1("", S("1234567890"), S("1234567890")); - test1("", S("12345678901234567890"), S("12345678901234567890")); - test1("abcde", S(""), S("abcde")); - test1("abcde", S("12345"), S("abcde12345")); - test1("abcde", S("1234567890"), S("abcde1234567890")); - test1("abcde", S("12345678901234567890"), S("abcde12345678901234567890")); - test1("abcdefghij", S(""), S("abcdefghij")); - test1("abcdefghij", S("12345"), S("abcdefghij12345")); - test1("abcdefghij", S("1234567890"), S("abcdefghij1234567890")); - test1("abcdefghij", S("12345678901234567890"), S("abcdefghij12345678901234567890")); - test1("abcdefghijklmnopqrst", S(""), S("abcdefghijklmnopqrst")); - test1("abcdefghijklmnopqrst", S("12345"), S("abcdefghijklmnopqrst12345")); - test1("abcdefghijklmnopqrst", S("1234567890"), S("abcdefghijklmnopqrst1234567890")); - test1("abcdefghijklmnopqrst", S("12345678901234567890"), S("abcdefghijklmnopqrst12345678901234567890")); - -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES - } -#endif -} diff --git a/libcxx/test/strings/basic.string/string.nonmembers/string_op+/string_char.pass.cpp b/libcxx/test/strings/basic.string/string.nonmembers/string_op+/string_char.pass.cpp deleted file mode 100644 index 4d72db595b1..00000000000 --- a/libcxx/test/strings/basic.string/string.nonmembers/string_op+/string_char.pass.cpp +++ /dev/null @@ -1,79 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <string> - -// template<class charT, class traits, class Allocator> -// basic_string<charT,traits,Allocator> -// operator+(const basic_string<charT,traits,Allocator>& lhs, charT rhs); - -// template<class charT, class traits, class Allocator> -// basic_string<charT,traits,Allocator>&& -// operator+(basic_string<charT,traits,Allocator>&& lhs, charT rhs); - -#include <string> -#include <cassert> - -#include "min_allocator.h" - -template <class S> -void -test0(const S& lhs, typename S::value_type rhs, const S& x) -{ - assert(lhs + rhs == x); -} - -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - -template <class S> -void -test1(S&& lhs, typename S::value_type rhs, const S& x) -{ - assert(move(lhs) + rhs == x); -} - -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES - -int main() -{ - { - typedef std::string S; - test0(S(""), '1', S("1")); - test0(S("abcde"), '1', S("abcde1")); - test0(S("abcdefghij"), '1', S("abcdefghij1")); - test0(S("abcdefghijklmnopqrst"), '1', S("abcdefghijklmnopqrst1")); - -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - - test1(S(""), '1', S("1")); - test1(S("abcde"), '1', S("abcde1")); - test1(S("abcdefghij"), '1', S("abcdefghij1")); - test1(S("abcdefghijklmnopqrst"), '1', S("abcdefghijklmnopqrst1")); - -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES - } -#if __cplusplus >= 201103L - { - typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S; - test0(S(""), '1', S("1")); - test0(S("abcde"), '1', S("abcde1")); - test0(S("abcdefghij"), '1', S("abcdefghij1")); - test0(S("abcdefghijklmnopqrst"), '1', S("abcdefghijklmnopqrst1")); - -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - - test1(S(""), '1', S("1")); - test1(S("abcde"), '1', S("abcde1")); - test1(S("abcdefghij"), '1', S("abcdefghij1")); - test1(S("abcdefghijklmnopqrst"), '1', S("abcdefghijklmnopqrst1")); - -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES - } -#endif -} diff --git a/libcxx/test/strings/basic.string/string.nonmembers/string_op+/string_pointer.pass.cpp b/libcxx/test/strings/basic.string/string.nonmembers/string_op+/string_pointer.pass.cpp deleted file mode 100644 index 47fc1ca51b8..00000000000 --- a/libcxx/test/strings/basic.string/string.nonmembers/string_op+/string_pointer.pass.cpp +++ /dev/null @@ -1,127 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <string> - -// template<class charT, class traits, class Allocator> -// basic_string<charT,traits,Allocator> -// operator+(const basic_string<charT,traits,Allocator>& lhs, const charT* rhs); - -// template<class charT, class traits, class Allocator> -// basic_string<charT,traits,Allocator>&& -// operator+(basic_string<charT,traits,Allocator>&& lhs, const charT* rhs); - -#include <string> -#include <cassert> - -#include "min_allocator.h" - -template <class S> -void -test0(const S& lhs, const typename S::value_type* rhs, const S& x) -{ - assert(lhs + rhs == x); -} - -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - -template <class S> -void -test1(S&& lhs, const typename S::value_type* rhs, const S& x) -{ - assert(move(lhs) + rhs == x); -} - -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES - -int main() -{ - { - typedef std::string S; - test0(S(""), "", S("")); - test0(S(""), "12345", S("12345")); - test0(S(""), "1234567890", S("1234567890")); - test0(S(""), "12345678901234567890", S("12345678901234567890")); - test0(S("abcde"), "", S("abcde")); - test0(S("abcde"), "12345", S("abcde12345")); - test0(S("abcde"), "1234567890", S("abcde1234567890")); - test0(S("abcde"), "12345678901234567890", S("abcde12345678901234567890")); - test0(S("abcdefghij"), "", S("abcdefghij")); - test0(S("abcdefghij"), "12345", S("abcdefghij12345")); - test0(S("abcdefghij"), "1234567890", S("abcdefghij1234567890")); - test0(S("abcdefghij"), "12345678901234567890", S("abcdefghij12345678901234567890")); - test0(S("abcdefghijklmnopqrst"), "", S("abcdefghijklmnopqrst")); - test0(S("abcdefghijklmnopqrst"), "12345", S("abcdefghijklmnopqrst12345")); - test0(S("abcdefghijklmnopqrst"), "1234567890", S("abcdefghijklmnopqrst1234567890")); - test0(S("abcdefghijklmnopqrst"), "12345678901234567890", S("abcdefghijklmnopqrst12345678901234567890")); - -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - - test1(S(""), "", S("")); - test1(S(""), "12345", S("12345")); - test1(S(""), "1234567890", S("1234567890")); - test1(S(""), "12345678901234567890", S("12345678901234567890")); - test1(S("abcde"), "", S("abcde")); - test1(S("abcde"), "12345", S("abcde12345")); - test1(S("abcde"), "1234567890", S("abcde1234567890")); - test1(S("abcde"), "12345678901234567890", S("abcde12345678901234567890")); - test1(S("abcdefghij"), "", S("abcdefghij")); - test1(S("abcdefghij"), "12345", S("abcdefghij12345")); - test1(S("abcdefghij"), "1234567890", S("abcdefghij1234567890")); - test1(S("abcdefghij"), "12345678901234567890", S("abcdefghij12345678901234567890")); - test1(S("abcdefghijklmnopqrst"), "", S("abcdefghijklmnopqrst")); - test1(S("abcdefghijklmnopqrst"), "12345", S("abcdefghijklmnopqrst12345")); - test1(S("abcdefghijklmnopqrst"), "1234567890", S("abcdefghijklmnopqrst1234567890")); - test1(S("abcdefghijklmnopqrst"), "12345678901234567890", S("abcdefghijklmnopqrst12345678901234567890")); - -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES - } -#if __cplusplus >= 201103L - { - typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S; - test0(S(""), "", S("")); - test0(S(""), "12345", S("12345")); - test0(S(""), "1234567890", S("1234567890")); - test0(S(""), "12345678901234567890", S("12345678901234567890")); - test0(S("abcde"), "", S("abcde")); - test0(S("abcde"), "12345", S("abcde12345")); - test0(S("abcde"), "1234567890", S("abcde1234567890")); - test0(S("abcde"), "12345678901234567890", S("abcde12345678901234567890")); - test0(S("abcdefghij"), "", S("abcdefghij")); - test0(S("abcdefghij"), "12345", S("abcdefghij12345")); - test0(S("abcdefghij"), "1234567890", S("abcdefghij1234567890")); - test0(S("abcdefghij"), "12345678901234567890", S("abcdefghij12345678901234567890")); - test0(S("abcdefghijklmnopqrst"), "", S("abcdefghijklmnopqrst")); - test0(S("abcdefghijklmnopqrst"), "12345", S("abcdefghijklmnopqrst12345")); - test0(S("abcdefghijklmnopqrst"), "1234567890", S("abcdefghijklmnopqrst1234567890")); - test0(S("abcdefghijklmnopqrst"), "12345678901234567890", S("abcdefghijklmnopqrst12345678901234567890")); - -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - - test1(S(""), "", S("")); - test1(S(""), "12345", S("12345")); - test1(S(""), "1234567890", S("1234567890")); - test1(S(""), "12345678901234567890", S("12345678901234567890")); - test1(S("abcde"), "", S("abcde")); - test1(S("abcde"), "12345", S("abcde12345")); - test1(S("abcde"), "1234567890", S("abcde1234567890")); - test1(S("abcde"), "12345678901234567890", S("abcde12345678901234567890")); - test1(S("abcdefghij"), "", S("abcdefghij")); - test1(S("abcdefghij"), "12345", S("abcdefghij12345")); - test1(S("abcdefghij"), "1234567890", S("abcdefghij1234567890")); - test1(S("abcdefghij"), "12345678901234567890", S("abcdefghij12345678901234567890")); - test1(S("abcdefghijklmnopqrst"), "", S("abcdefghijklmnopqrst")); - test1(S("abcdefghijklmnopqrst"), "12345", S("abcdefghijklmnopqrst12345")); - test1(S("abcdefghijklmnopqrst"), "1234567890", S("abcdefghijklmnopqrst1234567890")); - test1(S("abcdefghijklmnopqrst"), "12345678901234567890", S("abcdefghijklmnopqrst12345678901234567890")); - -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES - } -#endif -} diff --git a/libcxx/test/strings/basic.string/string.nonmembers/string_op+/string_string.pass.cpp b/libcxx/test/strings/basic.string/string.nonmembers/string_op+/string_string.pass.cpp deleted file mode 100644 index bf2ddd51f72..00000000000 --- a/libcxx/test/strings/basic.string/string.nonmembers/string_op+/string_string.pass.cpp +++ /dev/null @@ -1,221 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <string> - -// template<class charT, class traits, class Allocator> -// basic_string<charT,traits,Allocator> -// operator+(const basic_string<charT,traits,Allocator>& lhs, -// const basic_string<charT,traits,Allocator>& rhs); - -// template<class charT, class traits, class Allocator> -// basic_string<charT,traits,Allocator>&& -// operator+(const basic_string<charT,traits,Allocator>&& lhs, -// const basic_string<charT,traits,Allocator>& rhs); - -// template<class charT, class traits, class Allocator> -// basic_string<charT,traits,Allocator>&& -// operator+(const basic_string<charT,traits,Allocator>& lhs, -// const basic_string<charT,traits,Allocator>&& rhs); - -// template<class charT, class traits, class Allocator> -// basic_string<charT,traits,Allocator>&& -// operator+(const basic_string<charT,traits,Allocator>&& lhs, -// const basic_string<charT,traits,Allocator>&& rhs); - -#include <string> -#include <cassert> - -#include "min_allocator.h" - -template <class S> -void -test0(const S& lhs, const S& rhs, const S& x) -{ - assert(lhs + rhs == x); -} - -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - -template <class S> -void -test1(S&& lhs, const S& rhs, const S& x) -{ - assert(move(lhs) + rhs == x); -} - -template <class S> -void -test2(const S& lhs, S&& rhs, const S& x) -{ - assert(lhs + move(rhs) == x); -} - -template <class S> -void -test3(S&& lhs, S&& rhs, const S& x) -{ - assert(move(lhs) + move(rhs) == x); -} - -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES - -int main() -{ - { - typedef std::string S; - test0(S(""), S(""), S("")); - test0(S(""), S("12345"), S("12345")); - test0(S(""), S("1234567890"), S("1234567890")); - test0(S(""), S("12345678901234567890"), S("12345678901234567890")); - test0(S("abcde"), S(""), S("abcde")); - test0(S("abcde"), S("12345"), S("abcde12345")); - test0(S("abcde"), S("1234567890"), S("abcde1234567890")); - test0(S("abcde"), S("12345678901234567890"), S("abcde12345678901234567890")); - test0(S("abcdefghij"), S(""), S("abcdefghij")); - test0(S("abcdefghij"), S("12345"), S("abcdefghij12345")); - test0(S("abcdefghij"), S("1234567890"), S("abcdefghij1234567890")); - test0(S("abcdefghij"), S("12345678901234567890"), S("abcdefghij12345678901234567890")); - test0(S("abcdefghijklmnopqrst"), S(""), S("abcdefghijklmnopqrst")); - test0(S("abcdefghijklmnopqrst"), S("12345"), S("abcdefghijklmnopqrst12345")); - test0(S("abcdefghijklmnopqrst"), S("1234567890"), S("abcdefghijklmnopqrst1234567890")); - test0(S("abcdefghijklmnopqrst"), S("12345678901234567890"), S("abcdefghijklmnopqrst12345678901234567890")); - -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - - test1(S(""), S(""), S("")); - test1(S(""), S("12345"), S("12345")); - test1(S(""), S("1234567890"), S("1234567890")); - test1(S(""), S("12345678901234567890"), S("12345678901234567890")); - test1(S("abcde"), S(""), S("abcde")); - test1(S("abcde"), S("12345"), S("abcde12345")); - test1(S("abcde"), S("1234567890"), S("abcde1234567890")); - test1(S("abcde"), S("12345678901234567890"), S("abcde12345678901234567890")); - test1(S("abcdefghij"), S(""), S("abcdefghij")); - test1(S("abcdefghij"), S("12345"), S("abcdefghij12345")); - test1(S("abcdefghij"), S("1234567890"), S("abcdefghij1234567890")); - test1(S("abcdefghij"), S("12345678901234567890"), S("abcdefghij12345678901234567890")); - test1(S("abcdefghijklmnopqrst"), S(""), S("abcdefghijklmnopqrst")); - test1(S("abcdefghijklmnopqrst"), S("12345"), S("abcdefghijklmnopqrst12345")); - test1(S("abcdefghijklmnopqrst"), S("1234567890"), S("abcdefghijklmnopqrst1234567890")); - test1(S("abcdefghijklmnopqrst"), S("12345678901234567890"), S("abcdefghijklmnopqrst12345678901234567890")); - - test2(S(""), S(""), S("")); - test2(S(""), S("12345"), S("12345")); - test2(S(""), S("1234567890"), S("1234567890")); - test2(S(""), S("12345678901234567890"), S("12345678901234567890")); - test2(S("abcde"), S(""), S("abcde")); - test2(S("abcde"), S("12345"), S("abcde12345")); - test2(S("abcde"), S("1234567890"), S("abcde1234567890")); - test2(S("abcde"), S("12345678901234567890"), S("abcde12345678901234567890")); - test2(S("abcdefghij"), S(""), S("abcdefghij")); - test2(S("abcdefghij"), S("12345"), S("abcdefghij12345")); - test2(S("abcdefghij"), S("1234567890"), S("abcdefghij1234567890")); - test2(S("abcdefghij"), S("12345678901234567890"), S("abcdefghij12345678901234567890")); - test2(S("abcdefghijklmnopqrst"), S(""), S("abcdefghijklmnopqrst")); - test2(S("abcdefghijklmnopqrst"), S("12345"), S("abcdefghijklmnopqrst12345")); - test2(S("abcdefghijklmnopqrst"), S("1234567890"), S("abcdefghijklmnopqrst1234567890")); - test2(S("abcdefghijklmnopqrst"), S("12345678901234567890"), S("abcdefghijklmnopqrst12345678901234567890")); - - test3(S(""), S(""), S("")); - test3(S(""), S("12345"), S("12345")); - test3(S(""), S("1234567890"), S("1234567890")); - test3(S(""), S("12345678901234567890"), S("12345678901234567890")); - test3(S("abcde"), S(""), S("abcde")); - test3(S("abcde"), S("12345"), S("abcde12345")); - test3(S("abcde"), S("1234567890"), S("abcde1234567890")); - test3(S("abcde"), S("12345678901234567890"), S("abcde12345678901234567890")); - test3(S("abcdefghij"), S(""), S("abcdefghij")); - test3(S("abcdefghij"), S("12345"), S("abcdefghij12345")); - test3(S("abcdefghij"), S("1234567890"), S("abcdefghij1234567890")); - test3(S("abcdefghij"), S("12345678901234567890"), S("abcdefghij12345678901234567890")); - test3(S("abcdefghijklmnopqrst"), S(""), S("abcdefghijklmnopqrst")); - test3(S("abcdefghijklmnopqrst"), S("12345"), S("abcdefghijklmnopqrst12345")); - test3(S("abcdefghijklmnopqrst"), S("1234567890"), S("abcdefghijklmnopqrst1234567890")); - test3(S("abcdefghijklmnopqrst"), S("12345678901234567890"), S("abcdefghijklmnopqrst12345678901234567890")); - -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES - } -#if __cplusplus >= 201103L - { - typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S; - test0(S(""), S(""), S("")); - test0(S(""), S("12345"), S("12345")); - test0(S(""), S("1234567890"), S("1234567890")); - test0(S(""), S("12345678901234567890"), S("12345678901234567890")); - test0(S("abcde"), S(""), S("abcde")); - test0(S("abcde"), S("12345"), S("abcde12345")); - test0(S("abcde"), S("1234567890"), S("abcde1234567890")); - test0(S("abcde"), S("12345678901234567890"), S("abcde12345678901234567890")); - test0(S("abcdefghij"), S(""), S("abcdefghij")); - test0(S("abcdefghij"), S("12345"), S("abcdefghij12345")); - test0(S("abcdefghij"), S("1234567890"), S("abcdefghij1234567890")); - test0(S("abcdefghij"), S("12345678901234567890"), S("abcdefghij12345678901234567890")); - test0(S("abcdefghijklmnopqrst"), S(""), S("abcdefghijklmnopqrst")); - test0(S("abcdefghijklmnopqrst"), S("12345"), S("abcdefghijklmnopqrst12345")); - test0(S("abcdefghijklmnopqrst"), S("1234567890"), S("abcdefghijklmnopqrst1234567890")); - test0(S("abcdefghijklmnopqrst"), S("12345678901234567890"), S("abcdefghijklmnopqrst12345678901234567890")); - -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - - test1(S(""), S(""), S("")); - test1(S(""), S("12345"), S("12345")); - test1(S(""), S("1234567890"), S("1234567890")); - test1(S(""), S("12345678901234567890"), S("12345678901234567890")); - test1(S("abcde"), S(""), S("abcde")); - test1(S("abcde"), S("12345"), S("abcde12345")); - test1(S("abcde"), S("1234567890"), S("abcde1234567890")); - test1(S("abcde"), S("12345678901234567890"), S("abcde12345678901234567890")); - test1(S("abcdefghij"), S(""), S("abcdefghij")); - test1(S("abcdefghij"), S("12345"), S("abcdefghij12345")); - test1(S("abcdefghij"), S("1234567890"), S("abcdefghij1234567890")); - test1(S("abcdefghij"), S("12345678901234567890"), S("abcdefghij12345678901234567890")); - test1(S("abcdefghijklmnopqrst"), S(""), S("abcdefghijklmnopqrst")); - test1(S("abcdefghijklmnopqrst"), S("12345"), S("abcdefghijklmnopqrst12345")); - test1(S("abcdefghijklmnopqrst"), S("1234567890"), S("abcdefghijklmnopqrst1234567890")); - test1(S("abcdefghijklmnopqrst"), S("12345678901234567890"), S("abcdefghijklmnopqrst12345678901234567890")); - - test2(S(""), S(""), S("")); - test2(S(""), S("12345"), S("12345")); - test2(S(""), S("1234567890"), S("1234567890")); - test2(S(""), S("12345678901234567890"), S("12345678901234567890")); - test2(S("abcde"), S(""), S("abcde")); - test2(S("abcde"), S("12345"), S("abcde12345")); - test2(S("abcde"), S("1234567890"), S("abcde1234567890")); - test2(S("abcde"), S("12345678901234567890"), S("abcde12345678901234567890")); - test2(S("abcdefghij"), S(""), S("abcdefghij")); - test2(S("abcdefghij"), S("12345"), S("abcdefghij12345")); - test2(S("abcdefghij"), S("1234567890"), S("abcdefghij1234567890")); - test2(S("abcdefghij"), S("12345678901234567890"), S("abcdefghij12345678901234567890")); - test2(S("abcdefghijklmnopqrst"), S(""), S("abcdefghijklmnopqrst")); - test2(S("abcdefghijklmnopqrst"), S("12345"), S("abcdefghijklmnopqrst12345")); - test2(S("abcdefghijklmnopqrst"), S("1234567890"), S("abcdefghijklmnopqrst1234567890")); - test2(S("abcdefghijklmnopqrst"), S("12345678901234567890"), S("abcdefghijklmnopqrst12345678901234567890")); - - test3(S(""), S(""), S("")); - test3(S(""), S("12345"), S("12345")); - test3(S(""), S("1234567890"), S("1234567890")); - test3(S(""), S("12345678901234567890"), S("12345678901234567890")); - test3(S("abcde"), S(""), S("abcde")); - test3(S("abcde"), S("12345"), S("abcde12345")); - test3(S("abcde"), S("1234567890"), S("abcde1234567890")); - test3(S("abcde"), S("12345678901234567890"), S("abcde12345678901234567890")); - test3(S("abcdefghij"), S(""), S("abcdefghij")); - test3(S("abcdefghij"), S("12345"), S("abcdefghij12345")); - test3(S("abcdefghij"), S("1234567890"), S("abcdefghij1234567890")); - test3(S("abcdefghij"), S("12345678901234567890"), S("abcdefghij12345678901234567890")); - test3(S("abcdefghijklmnopqrst"), S(""), S("abcdefghijklmnopqrst")); - test3(S("abcdefghijklmnopqrst"), S("12345"), S("abcdefghijklmnopqrst12345")); - test3(S("abcdefghijklmnopqrst"), S("1234567890"), S("abcdefghijklmnopqrst1234567890")); - test3(S("abcdefghijklmnopqrst"), S("12345678901234567890"), S("abcdefghijklmnopqrst12345678901234567890")); - -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES - } -#endif -} diff --git a/libcxx/test/strings/basic.string/string.nonmembers/string_operator==/pointer_string.pass.cpp b/libcxx/test/strings/basic.string/string.nonmembers/string_operator==/pointer_string.pass.cpp deleted file mode 100644 index 19a5bdd977e..00000000000 --- a/libcxx/test/strings/basic.string/string.nonmembers/string_operator==/pointer_string.pass.cpp +++ /dev/null @@ -1,69 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <string> - -// template<class charT, class traits, class Allocator> -// bool operator==(const charT* lhs, const basic_string<charT,traits,Allocator>& rhs); - -#include <string> -#include <cassert> - -#include "min_allocator.h" - -template <class S> -void -test(const typename S::value_type* lhs, const S& rhs, bool x) -{ - assert((lhs == rhs) == x); -} - -int main() -{ - { - typedef std::string S; - test("", S(""), true); - test("", S("abcde"), false); - test("", S("abcdefghij"), false); - test("", S("abcdefghijklmnopqrst"), false); - test("abcde", S(""), false); - test("abcde", S("abcde"), true); - test("abcde", S("abcdefghij"), false); - test("abcde", S("abcdefghijklmnopqrst"), false); - test("abcdefghij", S(""), false); - test("abcdefghij", S("abcde"), false); - test("abcdefghij", S("abcdefghij"), true); - test("abcdefghij", S("abcdefghijklmnopqrst"), false); - test("abcdefghijklmnopqrst", S(""), false); - test("abcdefghijklmnopqrst", S("abcde"), false); - test("abcdefghijklmnopqrst", S("abcdefghij"), false); - 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); - test("", S("abcdefghijklmnopqrst"), false); - test("abcde", S(""), false); - test("abcde", S("abcde"), true); - test("abcde", S("abcdefghij"), false); - test("abcde", S("abcdefghijklmnopqrst"), false); - test("abcdefghij", S(""), false); - test("abcdefghij", S("abcde"), false); - test("abcdefghij", S("abcdefghij"), true); - test("abcdefghij", S("abcdefghijklmnopqrst"), false); - test("abcdefghijklmnopqrst", S(""), false); - test("abcdefghijklmnopqrst", S("abcde"), false); - test("abcdefghijklmnopqrst", S("abcdefghij"), false); - test("abcdefghijklmnopqrst", S("abcdefghijklmnopqrst"), true); - } -#endif -} diff --git a/libcxx/test/strings/basic.string/string.nonmembers/string_operator==/string_pointer.pass.cpp b/libcxx/test/strings/basic.string/string.nonmembers/string_operator==/string_pointer.pass.cpp deleted file mode 100644 index 22006bb1be6..00000000000 --- a/libcxx/test/strings/basic.string/string.nonmembers/string_operator==/string_pointer.pass.cpp +++ /dev/null @@ -1,69 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <string> - -// template<class charT, class traits, class Allocator> -// bool operator==(const basic_string<charT,traits,Allocator>& lhs, const charT* rhs); - -#include <string> -#include <cassert> - -#include "min_allocator.h" - -template <class S> -void -test(const S& lhs, const typename S::value_type* rhs, bool x) -{ - assert((lhs == rhs) == x); -} - -int main() -{ - { - typedef std::string S; - test(S(""), "", true); - test(S(""), "abcde", false); - test(S(""), "abcdefghij", false); - test(S(""), "abcdefghijklmnopqrst", false); - test(S("abcde"), "", false); - test(S("abcde"), "abcde", true); - test(S("abcde"), "abcdefghij", false); - test(S("abcde"), "abcdefghijklmnopqrst", false); - test(S("abcdefghij"), "", false); - test(S("abcdefghij"), "abcde", false); - test(S("abcdefghij"), "abcdefghij", true); - test(S("abcdefghij"), "abcdefghijklmnopqrst", false); - test(S("abcdefghijklmnopqrst"), "", false); - test(S("abcdefghijklmnopqrst"), "abcde", false); - test(S("abcdefghijklmnopqrst"), "abcdefghij", false); - 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); - test(S(""), "abcdefghijklmnopqrst", false); - test(S("abcde"), "", false); - test(S("abcde"), "abcde", true); - test(S("abcde"), "abcdefghij", false); - test(S("abcde"), "abcdefghijklmnopqrst", false); - test(S("abcdefghij"), "", false); - test(S("abcdefghij"), "abcde", false); - test(S("abcdefghij"), "abcdefghij", true); - test(S("abcdefghij"), "abcdefghijklmnopqrst", false); - test(S("abcdefghijklmnopqrst"), "", false); - test(S("abcdefghijklmnopqrst"), "abcde", false); - test(S("abcdefghijklmnopqrst"), "abcdefghij", false); - test(S("abcdefghijklmnopqrst"), "abcdefghijklmnopqrst", true); - } -#endif -} diff --git a/libcxx/test/strings/basic.string/string.nonmembers/string_operator==/string_string.pass.cpp b/libcxx/test/strings/basic.string/string.nonmembers/string_operator==/string_string.pass.cpp deleted file mode 100644 index 0bff70a977a..00000000000 --- a/libcxx/test/strings/basic.string/string.nonmembers/string_operator==/string_string.pass.cpp +++ /dev/null @@ -1,70 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <string> - -// template<class charT, class traits, class Allocator> -// bool operator==(const basic_string<charT,traits,Allocator>& lhs, -// const basic_string<charT,traits,Allocator>& rhs); - -#include <string> -#include <cassert> - -#include "min_allocator.h" - -template <class S> -void -test(const S& lhs, const S& rhs, bool x) -{ - assert((lhs == rhs) == x); -} - -int main() -{ - { - typedef std::string S; - test(S(""), S(""), true); - test(S(""), S("abcde"), false); - test(S(""), S("abcdefghij"), false); - test(S(""), S("abcdefghijklmnopqrst"), false); - test(S("abcde"), S(""), false); - test(S("abcde"), S("abcde"), true); - test(S("abcde"), S("abcdefghij"), false); - test(S("abcde"), S("abcdefghijklmnopqrst"), false); - test(S("abcdefghij"), S(""), false); - test(S("abcdefghij"), S("abcde"), false); - test(S("abcdefghij"), S("abcdefghij"), true); - test(S("abcdefghij"), S("abcdefghijklmnopqrst"), false); - test(S("abcdefghijklmnopqrst"), S(""), false); - test(S("abcdefghijklmnopqrst"), S("abcde"), false); - test(S("abcdefghijklmnopqrst"), S("abcdefghij"), false); - test(S("abcdefghijklmnopqrst"), S("abcdefghijklmnopqrst"), true); - } -#if __cplusplus >= 201103L - { - typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S; - test(S(""), S(""), true); - test(S(""), S("abcde"), false); - test(S(""), S("abcdefghij"), false); - test(S(""), S("abcdefghijklmnopqrst"), false); - test(S("abcde"), S(""), false); - test(S("abcde"), S("abcde"), true); - test(S("abcde"), S("abcdefghij"), false); - test(S("abcde"), S("abcdefghijklmnopqrst"), false); - test(S("abcdefghij"), S(""), false); - test(S("abcdefghij"), S("abcde"), false); - test(S("abcdefghij"), S("abcdefghij"), true); - test(S("abcdefghij"), S("abcdefghijklmnopqrst"), false); - test(S("abcdefghijklmnopqrst"), S(""), false); - test(S("abcdefghijklmnopqrst"), S("abcde"), false); - test(S("abcdefghijklmnopqrst"), S("abcdefghij"), false); - test(S("abcdefghijklmnopqrst"), S("abcdefghijklmnopqrst"), true); - } -#endif -} 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 deleted file mode 100644 index f9fa204b9ee..00000000000 --- a/libcxx/test/strings/basic.string/string.nonmembers/string_opgt/pointer_string.pass.cpp +++ /dev/null @@ -1,69 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <string> - -// template<class charT, class traits, class Allocator> -// bool operator>(const charT* lhs, const basic_string<charT,traits,Allocator>& rhs); - -#include <string> -#include <cassert> - -#include "min_allocator.h" - -template <class S> -void -test(const typename S::value_type* lhs, const S& rhs, bool x) -{ - assert((lhs > rhs) == x); -} - -int main() -{ - { - typedef std::string S; - test("", S(""), false); - test("", S("abcde"), false); - test("", S("abcdefghij"), false); - test("", S("abcdefghijklmnopqrst"), false); - test("abcde", S(""), true); - test("abcde", S("abcde"), false); - test("abcde", S("abcdefghij"), false); - test("abcde", S("abcdefghijklmnopqrst"), false); - test("abcdefghij", S(""), true); - test("abcdefghij", S("abcde"), true); - test("abcdefghij", S("abcdefghij"), false); - test("abcdefghij", S("abcdefghijklmnopqrst"), false); - test("abcdefghijklmnopqrst", S(""), true); - test("abcdefghijklmnopqrst", S("abcde"), true); - test("abcdefghijklmnopqrst", S("abcdefghij"), true); - test("abcdefghijklmnopqrst", S("abcdefghijklmnopqrst"), false); - } -#if __cplusplus >= 201103L - { - typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S; - test("", S(""), false); - test("", S("abcde"), false); - test("", S("abcdefghij"), false); - test("", S("abcdefghijklmnopqrst"), false); - test("abcde", S(""), true); - test("abcde", S("abcde"), false); - test("abcde", S("abcdefghij"), false); - test("abcde", S("abcdefghijklmnopqrst"), false); - test("abcdefghij", S(""), true); - test("abcdefghij", S("abcde"), true); - test("abcdefghij", S("abcdefghij"), false); - test("abcdefghij", S("abcdefghijklmnopqrst"), false); - test("abcdefghijklmnopqrst", S(""), true); - test("abcdefghijklmnopqrst", S("abcde"), true); - test("abcdefghijklmnopqrst", S("abcdefghij"), true); - test("abcdefghijklmnopqrst", S("abcdefghijklmnopqrst"), false); - } -#endif -} 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 deleted file mode 100644 index daa6f40ae3c..00000000000 --- a/libcxx/test/strings/basic.string/string.nonmembers/string_opgt/string_pointer.pass.cpp +++ /dev/null @@ -1,69 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <string> - -// template<class charT, class traits, class Allocator> -// bool operator>(const basic_string<charT,traits,Allocator>& lhs, const charT* rhs); - -#include <string> -#include <cassert> - -#include "min_allocator.h" - -template <class S> -void -test(const S& lhs, const typename S::value_type* rhs, bool x) -{ - assert((lhs > rhs) == x); -} - -int main() -{ - { - typedef std::string S; - test(S(""), "", false); - test(S(""), "abcde", false); - test(S(""), "abcdefghij", false); - test(S(""), "abcdefghijklmnopqrst", false); - test(S("abcde"), "", true); - test(S("abcde"), "abcde", false); - test(S("abcde"), "abcdefghij", false); - test(S("abcde"), "abcdefghijklmnopqrst", false); - test(S("abcdefghij"), "", true); - test(S("abcdefghij"), "abcde", true); - test(S("abcdefghij"), "abcdefghij", false); - test(S("abcdefghij"), "abcdefghijklmnopqrst", false); - test(S("abcdefghijklmnopqrst"), "", true); - test(S("abcdefghijklmnopqrst"), "abcde", true); - test(S("abcdefghijklmnopqrst"), "abcdefghij", true); - test(S("abcdefghijklmnopqrst"), "abcdefghijklmnopqrst", false); - } -#if __cplusplus >= 201103L - { - typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S; - test(S(""), "", false); - test(S(""), "abcde", false); - test(S(""), "abcdefghij", false); - test(S(""), "abcdefghijklmnopqrst", false); - test(S("abcde"), "", true); - test(S("abcde"), "abcde", false); - test(S("abcde"), "abcdefghij", false); - test(S("abcde"), "abcdefghijklmnopqrst", false); - test(S("abcdefghij"), "", true); - test(S("abcdefghij"), "abcde", true); - test(S("abcdefghij"), "abcdefghij", false); - test(S("abcdefghij"), "abcdefghijklmnopqrst", false); - test(S("abcdefghijklmnopqrst"), "", true); - test(S("abcdefghijklmnopqrst"), "abcde", true); - test(S("abcdefghijklmnopqrst"), "abcdefghij", true); - test(S("abcdefghijklmnopqrst"), "abcdefghijklmnopqrst", false); - } -#endif -} diff --git a/libcxx/test/strings/basic.string/string.nonmembers/string_opgt/string_string.pass.cpp b/libcxx/test/strings/basic.string/string.nonmembers/string_opgt/string_string.pass.cpp deleted file mode 100644 index 95073bf7644..00000000000 --- a/libcxx/test/strings/basic.string/string.nonmembers/string_opgt/string_string.pass.cpp +++ /dev/null @@ -1,70 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <string> - -// template<class charT, class traits, class Allocator> -// bool operator>(const basic_string<charT,traits,Allocator>& lhs, -// const basic_string<charT,traits,Allocator>& rhs); - -#include <string> -#include <cassert> - -#include "min_allocator.h" - -template <class S> -void -test(const S& lhs, const S& rhs, bool x) -{ - assert((lhs > rhs) == x); -} - -int main() -{ - { - typedef std::string S; - test(S(""), S(""), false); - test(S(""), S("abcde"), false); - test(S(""), S("abcdefghij"), false); - test(S(""), S("abcdefghijklmnopqrst"), false); - test(S("abcde"), S(""), true); - test(S("abcde"), S("abcde"), false); - test(S("abcde"), S("abcdefghij"), false); - test(S("abcde"), S("abcdefghijklmnopqrst"), false); - test(S("abcdefghij"), S(""), true); - test(S("abcdefghij"), S("abcde"), true); - test(S("abcdefghij"), S("abcdefghij"), false); - test(S("abcdefghij"), S("abcdefghijklmnopqrst"), false); - test(S("abcdefghijklmnopqrst"), S(""), true); - test(S("abcdefghijklmnopqrst"), S("abcde"), true); - test(S("abcdefghijklmnopqrst"), S("abcdefghij"), true); - test(S("abcdefghijklmnopqrst"), S("abcdefghijklmnopqrst"), false); - } -#if __cplusplus >= 201103L - { - typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S; - test(S(""), S(""), false); - test(S(""), S("abcde"), false); - test(S(""), S("abcdefghij"), false); - test(S(""), S("abcdefghijklmnopqrst"), false); - test(S("abcde"), S(""), true); - test(S("abcde"), S("abcde"), false); - test(S("abcde"), S("abcdefghij"), false); - test(S("abcde"), S("abcdefghijklmnopqrst"), false); - test(S("abcdefghij"), S(""), true); - test(S("abcdefghij"), S("abcde"), true); - test(S("abcdefghij"), S("abcdefghij"), false); - test(S("abcdefghij"), S("abcdefghijklmnopqrst"), false); - test(S("abcdefghijklmnopqrst"), S(""), true); - test(S("abcdefghijklmnopqrst"), S("abcde"), true); - test(S("abcdefghijklmnopqrst"), S("abcdefghij"), true); - test(S("abcdefghijklmnopqrst"), S("abcdefghijklmnopqrst"), false); - } -#endif -} 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 deleted file mode 100644 index eab117a843f..00000000000 --- a/libcxx/test/strings/basic.string/string.nonmembers/string_opgt=/pointer_string.pass.cpp +++ /dev/null @@ -1,69 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <string> - -// template<class charT, class traits, class Allocator> -// bool operator>=(const charT* lhs, const basic_string<charT,traits,Allocator>& rhs); - -#include <string> -#include <cassert> - -#include "min_allocator.h" - -template <class S> -void -test(const typename S::value_type* lhs, const S& rhs, bool x) -{ - assert((lhs >= rhs) == x); -} - -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); - 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); - } -#endif -} 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 deleted file mode 100644 index 56b3b35b3d9..00000000000 --- a/libcxx/test/strings/basic.string/string.nonmembers/string_opgt=/string_pointer.pass.cpp +++ /dev/null @@ -1,69 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <string> - -// template<class charT, class traits, class Allocator> -// bool operator>=(const basic_string<charT,traits,Allocator>& lhs, const charT* rhs); - -#include <string> -#include <cassert> - -#include "min_allocator.h" - -template <class S> -void -test(const S& lhs, const typename S::value_type* rhs, bool x) -{ - assert((lhs >= rhs) == x); -} - -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); - 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); - } -#endif -} diff --git a/libcxx/test/strings/basic.string/string.nonmembers/string_opgt=/string_string.pass.cpp b/libcxx/test/strings/basic.string/string.nonmembers/string_opgt=/string_string.pass.cpp deleted file mode 100644 index c02b202c49e..00000000000 --- a/libcxx/test/strings/basic.string/string.nonmembers/string_opgt=/string_string.pass.cpp +++ /dev/null @@ -1,70 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <string> - -// template<class charT, class traits, class Allocator> -// bool operator>=(const basic_string<charT,traits,Allocator>& lhs, -// const basic_string<charT,traits,Allocator>& rhs); - -#include <string> -#include <cassert> - -#include "min_allocator.h" - -template <class S> -void -test(const S& lhs, const S& rhs, bool x) -{ - assert((lhs >= rhs) == x); -} - -int main() -{ - { - typedef std::string S; - test(S(""), S(""), true); - test(S(""), S("abcde"), false); - test(S(""), S("abcdefghij"), false); - test(S(""), S("abcdefghijklmnopqrst"), false); - test(S("abcde"), S(""), true); - test(S("abcde"), S("abcde"), true); - test(S("abcde"), S("abcdefghij"), false); - test(S("abcde"), S("abcdefghijklmnopqrst"), false); - test(S("abcdefghij"), S(""), true); - test(S("abcdefghij"), S("abcde"), true); - test(S("abcdefghij"), S("abcdefghij"), true); - test(S("abcdefghij"), S("abcdefghijklmnopqrst"), false); - test(S("abcdefghijklmnopqrst"), S(""), true); - test(S("abcdefghijklmnopqrst"), S("abcde"), true); - test(S("abcdefghijklmnopqrst"), S("abcdefghij"), true); - test(S("abcdefghijklmnopqrst"), S("abcdefghijklmnopqrst"), true); - } -#if __cplusplus >= 201103L - { - typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S; - test(S(""), S(""), true); - test(S(""), S("abcde"), false); - test(S(""), S("abcdefghij"), false); - test(S(""), S("abcdefghijklmnopqrst"), false); - test(S("abcde"), S(""), true); - test(S("abcde"), S("abcde"), true); - test(S("abcde"), S("abcdefghij"), false); - test(S("abcde"), S("abcdefghijklmnopqrst"), false); - test(S("abcdefghij"), S(""), true); - test(S("abcdefghij"), S("abcde"), true); - test(S("abcdefghij"), S("abcdefghij"), true); - test(S("abcdefghij"), S("abcdefghijklmnopqrst"), false); - test(S("abcdefghijklmnopqrst"), S(""), true); - test(S("abcdefghijklmnopqrst"), S("abcde"), true); - test(S("abcdefghijklmnopqrst"), S("abcdefghij"), true); - test(S("abcdefghijklmnopqrst"), S("abcdefghijklmnopqrst"), true); - } -#endif -} diff --git a/libcxx/test/strings/basic.string/string.nonmembers/string_oplt/pointer_string.pass.cpp b/libcxx/test/strings/basic.string/string.nonmembers/string_oplt/pointer_string.pass.cpp deleted file mode 100644 index 86f6a2db119..00000000000 --- a/libcxx/test/strings/basic.string/string.nonmembers/string_oplt/pointer_string.pass.cpp +++ /dev/null @@ -1,69 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <string> - -// template<class charT, class traits, class Allocator> -// bool operator<(const charT* lhs, const basic_string<charT,traits,Allocator>& rhs); - -#include <string> -#include <cassert> - -#include "min_allocator.h" - -template <class S> -void -test(const typename S::value_type* lhs, const S& rhs, bool x) -{ - assert((lhs < rhs) == x); -} - -int main() -{ - { - typedef std::string S; - test("", S(""), false); - test("", S("abcde"), true); - test("", S("abcdefghij"), true); - test("", S("abcdefghijklmnopqrst"), true); - test("abcde", S(""), false); - test("abcde", S("abcde"), false); - test("abcde", S("abcdefghij"), true); - test("abcde", S("abcdefghijklmnopqrst"), true); - test("abcdefghij", S(""), false); - test("abcdefghij", S("abcde"), false); - test("abcdefghij", S("abcdefghij"), false); - test("abcdefghij", S("abcdefghijklmnopqrst"), true); - test("abcdefghijklmnopqrst", S(""), false); - test("abcdefghijklmnopqrst", S("abcde"), false); - test("abcdefghijklmnopqrst", S("abcdefghij"), false); - test("abcdefghijklmnopqrst", S("abcdefghijklmnopqrst"), false); - } -#if __cplusplus >= 201103L - { - typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S; - test("", S(""), false); - test("", S("abcde"), true); - test("", S("abcdefghij"), true); - test("", S("abcdefghijklmnopqrst"), true); - test("abcde", S(""), false); - test("abcde", S("abcde"), false); - test("abcde", S("abcdefghij"), true); - test("abcde", S("abcdefghijklmnopqrst"), true); - test("abcdefghij", S(""), false); - test("abcdefghij", S("abcde"), false); - test("abcdefghij", S("abcdefghij"), false); - test("abcdefghij", S("abcdefghijklmnopqrst"), true); - test("abcdefghijklmnopqrst", S(""), false); - test("abcdefghijklmnopqrst", S("abcde"), false); - test("abcdefghijklmnopqrst", S("abcdefghij"), false); - test("abcdefghijklmnopqrst", S("abcdefghijklmnopqrst"), false); - } -#endif -} diff --git a/libcxx/test/strings/basic.string/string.nonmembers/string_oplt/string_pointer.pass.cpp b/libcxx/test/strings/basic.string/string.nonmembers/string_oplt/string_pointer.pass.cpp deleted file mode 100644 index b935da5426f..00000000000 --- a/libcxx/test/strings/basic.string/string.nonmembers/string_oplt/string_pointer.pass.cpp +++ /dev/null @@ -1,69 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <string> - -// template<class charT, class traits, class Allocator> -// bool operator<(const basic_string<charT,traits,Allocator>& lhs, const charT* rhs); - -#include <string> -#include <cassert> - -#include "min_allocator.h" - -template <class S> -void -test(const S& lhs, const typename S::value_type* rhs, bool x) -{ - assert((lhs < rhs) == x); -} - -int main() -{ - { - typedef std::string S; - test(S(""), "", false); - test(S(""), "abcde", true); - test(S(""), "abcdefghij", true); - test(S(""), "abcdefghijklmnopqrst", true); - test(S("abcde"), "", false); - test(S("abcde"), "abcde", false); - test(S("abcde"), "abcdefghij", true); - test(S("abcde"), "abcdefghijklmnopqrst", true); - test(S("abcdefghij"), "", false); - test(S("abcdefghij"), "abcde", false); - test(S("abcdefghij"), "abcdefghij", false); - test(S("abcdefghij"), "abcdefghijklmnopqrst", true); - test(S("abcdefghijklmnopqrst"), "", false); - test(S("abcdefghijklmnopqrst"), "abcde", false); - test(S("abcdefghijklmnopqrst"), "abcdefghij", false); - test(S("abcdefghijklmnopqrst"), "abcdefghijklmnopqrst", false); - } -#if __cplusplus >= 201103L - { - typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S; - test(S(""), "", false); - test(S(""), "abcde", true); - test(S(""), "abcdefghij", true); - test(S(""), "abcdefghijklmnopqrst", true); - test(S("abcde"), "", false); - test(S("abcde"), "abcde", false); - test(S("abcde"), "abcdefghij", true); - test(S("abcde"), "abcdefghijklmnopqrst", true); - test(S("abcdefghij"), "", false); - test(S("abcdefghij"), "abcde", false); - test(S("abcdefghij"), "abcdefghij", false); - test(S("abcdefghij"), "abcdefghijklmnopqrst", true); - test(S("abcdefghijklmnopqrst"), "", false); - test(S("abcdefghijklmnopqrst"), "abcde", false); - test(S("abcdefghijklmnopqrst"), "abcdefghij", false); - test(S("abcdefghijklmnopqrst"), "abcdefghijklmnopqrst", false); - } -#endif -} diff --git a/libcxx/test/strings/basic.string/string.nonmembers/string_oplt/string_string.pass.cpp b/libcxx/test/strings/basic.string/string.nonmembers/string_oplt/string_string.pass.cpp deleted file mode 100644 index 487e2056f2c..00000000000 --- a/libcxx/test/strings/basic.string/string.nonmembers/string_oplt/string_string.pass.cpp +++ /dev/null @@ -1,70 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <string> - -// template<class charT, class traits, class Allocator> -// bool operator<(const basic_string<charT,traits,Allocator>& lhs, -// const basic_string<charT,traits,Allocator>& rhs); - -#include <string> -#include <cassert> - -#include "min_allocator.h" - -template <class S> -void -test(const S& lhs, const S& rhs, bool x) -{ - assert((lhs < rhs) == x); -} - -int main() -{ - { - typedef std::string S; - test(S(""), S(""), false); - test(S(""), S("abcde"), true); - test(S(""), S("abcdefghij"), true); - test(S(""), S("abcdefghijklmnopqrst"), true); - test(S("abcde"), S(""), false); - test(S("abcde"), S("abcde"), false); - test(S("abcde"), S("abcdefghij"), true); - test(S("abcde"), S("abcdefghijklmnopqrst"), true); - test(S("abcdefghij"), S(""), false); - test(S("abcdefghij"), S("abcde"), false); - test(S("abcdefghij"), S("abcdefghij"), false); - test(S("abcdefghij"), S("abcdefghijklmnopqrst"), true); - test(S("abcdefghijklmnopqrst"), S(""), false); - test(S("abcdefghijklmnopqrst"), S("abcde"), false); - test(S("abcdefghijklmnopqrst"), S("abcdefghij"), false); - test(S("abcdefghijklmnopqrst"), S("abcdefghijklmnopqrst"), false); - } -#if __cplusplus >= 201103L - { - typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S; - test(S(""), S(""), false); - test(S(""), S("abcde"), true); - test(S(""), S("abcdefghij"), true); - test(S(""), S("abcdefghijklmnopqrst"), true); - test(S("abcde"), S(""), false); - test(S("abcde"), S("abcde"), false); - test(S("abcde"), S("abcdefghij"), true); - test(S("abcde"), S("abcdefghijklmnopqrst"), true); - test(S("abcdefghij"), S(""), false); - test(S("abcdefghij"), S("abcde"), false); - test(S("abcdefghij"), S("abcdefghij"), false); - test(S("abcdefghij"), S("abcdefghijklmnopqrst"), true); - test(S("abcdefghijklmnopqrst"), S(""), false); - test(S("abcdefghijklmnopqrst"), S("abcde"), false); - test(S("abcdefghijklmnopqrst"), S("abcdefghij"), false); - test(S("abcdefghijklmnopqrst"), S("abcdefghijklmnopqrst"), false); - } -#endif -} diff --git a/libcxx/test/strings/basic.string/string.nonmembers/string_oplt=/pointer_string.pass.cpp b/libcxx/test/strings/basic.string/string.nonmembers/string_oplt=/pointer_string.pass.cpp deleted file mode 100644 index 21959405194..00000000000 --- a/libcxx/test/strings/basic.string/string.nonmembers/string_oplt=/pointer_string.pass.cpp +++ /dev/null @@ -1,69 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <string> - -// template<class charT, class traits, class Allocator> -// bool operator<=(const charT* lhs, const basic_string<charT,traits,Allocator>& rhs); - -#include <string> -#include <cassert> - -#include "min_allocator.h" - -template <class S> -void -test(const typename S::value_type* lhs, const S& rhs, bool x) -{ - assert((lhs <= rhs) == x); -} - -int main() -{ - { - typedef std::string S; - test("", S(""), true); - test("", S("abcde"), true); - test("", S("abcdefghij"), true); - test("", S("abcdefghijklmnopqrst"), true); - test("abcde", S(""), false); - test("abcde", S("abcde"), true); - test("abcde", S("abcdefghij"), true); - test("abcde", S("abcdefghijklmnopqrst"), true); - test("abcdefghij", S(""), false); - test("abcdefghij", S("abcde"), false); - test("abcdefghij", S("abcdefghij"), true); - test("abcdefghij", S("abcdefghijklmnopqrst"), true); - test("abcdefghijklmnopqrst", S(""), false); - test("abcdefghijklmnopqrst", S("abcde"), false); - test("abcdefghijklmnopqrst", S("abcdefghij"), false); - 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"), true); - test("", S("abcdefghij"), true); - test("", S("abcdefghijklmnopqrst"), true); - test("abcde", S(""), false); - test("abcde", S("abcde"), true); - test("abcde", S("abcdefghij"), true); - test("abcde", S("abcdefghijklmnopqrst"), true); - test("abcdefghij", S(""), false); - test("abcdefghij", S("abcde"), false); - test("abcdefghij", S("abcdefghij"), true); - test("abcdefghij", S("abcdefghijklmnopqrst"), true); - test("abcdefghijklmnopqrst", S(""), false); - test("abcdefghijklmnopqrst", S("abcde"), false); - test("abcdefghijklmnopqrst", S("abcdefghij"), false); - test("abcdefghijklmnopqrst", S("abcdefghijklmnopqrst"), true); - } -#endif -} diff --git a/libcxx/test/strings/basic.string/string.nonmembers/string_oplt=/string_pointer.pass.cpp b/libcxx/test/strings/basic.string/string.nonmembers/string_oplt=/string_pointer.pass.cpp deleted file mode 100644 index bb1bce8d404..00000000000 --- a/libcxx/test/strings/basic.string/string.nonmembers/string_oplt=/string_pointer.pass.cpp +++ /dev/null @@ -1,69 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <string> - -// template<class charT, class traits, class Allocator> -// bool operator<=(const basic_string<charT,traits,Allocator>& lhs, const charT* rhs); - -#include <string> -#include <cassert> - -#include "min_allocator.h" - -template <class S> -void -test(const S& lhs, const typename S::value_type* rhs, bool x) -{ - assert((lhs <= rhs) == x); -} - -int main() -{ - { - typedef std::string S; - test(S(""), "", true); - test(S(""), "abcde", true); - test(S(""), "abcdefghij", true); - test(S(""), "abcdefghijklmnopqrst", true); - test(S("abcde"), "", false); - test(S("abcde"), "abcde", true); - test(S("abcde"), "abcdefghij", true); - test(S("abcde"), "abcdefghijklmnopqrst", true); - test(S("abcdefghij"), "", false); - test(S("abcdefghij"), "abcde", false); - test(S("abcdefghij"), "abcdefghij", true); - test(S("abcdefghij"), "abcdefghijklmnopqrst", true); - test(S("abcdefghijklmnopqrst"), "", false); - test(S("abcdefghijklmnopqrst"), "abcde", false); - test(S("abcdefghijklmnopqrst"), "abcdefghij", false); - 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", true); - test(S(""), "abcdefghij", true); - test(S(""), "abcdefghijklmnopqrst", true); - test(S("abcde"), "", false); - test(S("abcde"), "abcde", true); - test(S("abcde"), "abcdefghij", true); - test(S("abcde"), "abcdefghijklmnopqrst", true); - test(S("abcdefghij"), "", false); - test(S("abcdefghij"), "abcde", false); - test(S("abcdefghij"), "abcdefghij", true); - test(S("abcdefghij"), "abcdefghijklmnopqrst", true); - test(S("abcdefghijklmnopqrst"), "", false); - test(S("abcdefghijklmnopqrst"), "abcde", false); - test(S("abcdefghijklmnopqrst"), "abcdefghij", false); - test(S("abcdefghijklmnopqrst"), "abcdefghijklmnopqrst", true); - } -#endif -} diff --git a/libcxx/test/strings/basic.string/string.nonmembers/string_oplt=/string_string.pass.cpp b/libcxx/test/strings/basic.string/string.nonmembers/string_oplt=/string_string.pass.cpp deleted file mode 100644 index 2b975f160d5..00000000000 --- a/libcxx/test/strings/basic.string/string.nonmembers/string_oplt=/string_string.pass.cpp +++ /dev/null @@ -1,70 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <string> - -// template<class charT, class traits, class Allocator> -// bool operator<=(const basic_string<charT,traits,Allocator>& lhs, -// const basic_string<charT,traits,Allocator>& rhs); - -#include <string> -#include <cassert> - -#include "min_allocator.h" - -template <class S> -void -test(const S& lhs, const S& rhs, bool x) -{ - assert((lhs <= rhs) == x); -} - -int main() -{ - { - typedef std::string S; - test(S(""), S(""), true); - test(S(""), S("abcde"), true); - test(S(""), S("abcdefghij"), true); - test(S(""), S("abcdefghijklmnopqrst"), true); - test(S("abcde"), S(""), false); - test(S("abcde"), S("abcde"), true); - test(S("abcde"), S("abcdefghij"), true); - test(S("abcde"), S("abcdefghijklmnopqrst"), true); - test(S("abcdefghij"), S(""), false); - test(S("abcdefghij"), S("abcde"), false); - test(S("abcdefghij"), S("abcdefghij"), true); - test(S("abcdefghij"), S("abcdefghijklmnopqrst"), true); - test(S("abcdefghijklmnopqrst"), S(""), false); - test(S("abcdefghijklmnopqrst"), S("abcde"), false); - test(S("abcdefghijklmnopqrst"), S("abcdefghij"), false); - test(S("abcdefghijklmnopqrst"), S("abcdefghijklmnopqrst"), true); - } -#if __cplusplus >= 201103L - { - typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S; - test(S(""), S(""), true); - test(S(""), S("abcde"), true); - test(S(""), S("abcdefghij"), true); - test(S(""), S("abcdefghijklmnopqrst"), true); - test(S("abcde"), S(""), false); - test(S("abcde"), S("abcde"), true); - test(S("abcde"), S("abcdefghij"), true); - test(S("abcde"), S("abcdefghijklmnopqrst"), true); - test(S("abcdefghij"), S(""), false); - test(S("abcdefghij"), S("abcde"), false); - test(S("abcdefghij"), S("abcdefghij"), true); - test(S("abcdefghij"), S("abcdefghijklmnopqrst"), true); - test(S("abcdefghijklmnopqrst"), S(""), false); - test(S("abcdefghijklmnopqrst"), S("abcde"), false); - test(S("abcdefghijklmnopqrst"), S("abcdefghij"), false); - test(S("abcdefghijklmnopqrst"), S("abcdefghijklmnopqrst"), true); - } -#endif -} |