From b7332b04df5d50c92640c74cfeb138ecb7e3f7ae Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Tue, 20 Aug 2019 18:01:01 +0000 Subject: Remove upstream files and directories from vendor/libc++/dist that we do not use. This saves on repository space, and reduces the number of tree conflicts when merging. --- .../string.modifiers/string_assign/string.pass.cpp | 117 --------------------- 1 file changed, 117 deletions(-) delete mode 100644 test/std/strings/basic.string/string.modifiers/string_assign/string.pass.cpp (limited to 'test/std/strings/basic.string/string.modifiers/string_assign/string.pass.cpp') diff --git a/test/std/strings/basic.string/string.modifiers/string_assign/string.pass.cpp b/test/std/strings/basic.string/string.modifiers/string_assign/string.pass.cpp deleted file mode 100644 index 788512ba3d3e..000000000000 --- a/test/std/strings/basic.string/string.modifiers/string_assign/string.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. -// -//===----------------------------------------------------------------------===// - -// - -// basic_string& -// assign(const basic_string& str); - -#include -#include - -#include "test_macros.h" -#include "min_allocator.h" -#include "test_allocator.h" - -template -void -test(S s, S str, S expected) -{ - s.assign(str); - LIBCPP_ASSERT(s.__invariants()); - assert(s == expected); -} - -template -void -testAlloc(S s, S str, const typename S::allocator_type& a) -{ - s.assign(str); - LIBCPP_ASSERT(s.__invariants()); - assert(s == str); - assert(s.get_allocator() == a); -} - -int main() -{ - { - typedef std::string S; - test(S(), S(), S()); - test(S(), S("12345"), S("12345")); - test(S(), S("1234567890"), S("1234567890")); - test(S(), S("12345678901234567890"), S("12345678901234567890")); - - test(S("12345"), S(), S()); - test(S("12345"), S("12345"), S("12345")); - test(S("12345"), S("1234567890"), S("1234567890")); - test(S("12345"), S("12345678901234567890"), S("12345678901234567890")); - - test(S("1234567890"), S(), S()); - test(S("1234567890"), S("12345"), S("12345")); - test(S("1234567890"), S("1234567890"), S("1234567890")); - test(S("1234567890"), S("12345678901234567890"), S("12345678901234567890")); - - test(S("12345678901234567890"), S(), S()); - test(S("12345678901234567890"), S("12345"), S("12345")); - test(S("12345678901234567890"), S("1234567890"), S("1234567890")); - test(S("12345678901234567890"), S("12345678901234567890"), - S("12345678901234567890")); - - testAlloc(S(), S(), std::allocator()); - testAlloc(S(), S("12345"), std::allocator()); - testAlloc(S(), S("1234567890"), std::allocator()); - testAlloc(S(), S("12345678901234567890"), std::allocator()); - } - - { // LWG#5579 make sure assign takes the allocators where appropriate - typedef other_allocator A; // has POCCA --> true - typedef std::basic_string, A> S; - testAlloc(S(A(5)), S(A(3)), A(3)); - testAlloc(S(A(5)), S("1"), A()); - testAlloc(S(A(5)), S("1", A(7)), A(7)); - testAlloc(S(A(5)), S("1234567890123456789012345678901234567890123456789012345678901234567890", A(7)), A(7)); - } - -#if TEST_STD_VER >= 11 - { - typedef std::basic_string, min_allocator> S; - test(S(), S(), S()); - test(S(), S("12345"), S("12345")); - test(S(), S("1234567890"), S("1234567890")); - test(S(), S("12345678901234567890"), S("12345678901234567890")); - - test(S("12345"), S(), S()); - test(S("12345"), S("12345"), S("12345")); - test(S("12345"), S("1234567890"), S("1234567890")); - test(S("12345"), S("12345678901234567890"), S("12345678901234567890")); - - test(S("1234567890"), S(), S()); - test(S("1234567890"), S("12345"), S("12345")); - test(S("1234567890"), S("1234567890"), S("1234567890")); - test(S("1234567890"), S("12345678901234567890"), S("12345678901234567890")); - - test(S("12345678901234567890"), S(), S()); - test(S("12345678901234567890"), S("12345"), S("12345")); - test(S("12345678901234567890"), S("1234567890"), S("1234567890")); - test(S("12345678901234567890"), S("12345678901234567890"), - S("12345678901234567890")); - - testAlloc(S(), S(), min_allocator()); - testAlloc(S(), S("12345"), min_allocator()); - testAlloc(S(), S("1234567890"), min_allocator()); - testAlloc(S(), S("12345678901234567890"), min_allocator()); - } -#endif -#if TEST_STD_VER > 14 - { - typedef std::string S; - static_assert(noexcept(S().assign(S())), ""); // LWG#2063 - } -#endif -} -- cgit v1.3