/llvm-project/libcxx/test/std/strings/basic.string/string.modifiers/string_replace/ |
H A D | size_size_string_size_size.pass.cpp | 27 template <class S> 29 test(S s, in test() argument 30 typename S::size_type pos1, in test() 31 typename S::size_type n1, in test() 32 S str, in test() 33 typename S::size_type pos2, in test() 34 typename S::size_type n2, in test() 35 S expected) { in test() 36 const typename S::size_type old_size = s.size(); in test() 37 S s0 = s; in test() [all …]
|
H A D | size_size_string.pass.cpp | 23 template <class S> 24 TEST_CONSTEXPR_CXX20 void test(S s, typename S::size_type pos1, typename S::size_type n1, S str, S … in test() argument 25 const typename S::size_type old_size = s.size(); in test() 26 S s0 = s; in test() 28 s.replace(pos1, n1, str); in test() 29 LIBCPP_ASSERT(s.__invariants()); in test() 30 assert(s == expected); in test() 31 typename S::size_type xlen = std::min(n1, old_size - pos1); in test() 32 typename S::size_type rlen = str.size(); in test() 33 assert(s.size() == old_size - xlen + rlen); in test() [all …]
|
H A D | iter_iter_string.pass.cpp | 22 template <class S> 23 TEST_CONSTEXPR_CXX20 void test(S s, typename S::size_type pos1, typename S::size_type n1, S str, S … in test() argument 24 typename S::size_type old_size = s.size(); in test() 25 typename S::const_iterator first = s.begin() + pos1; in test() 26 typename S::const_iterator last = s.begin() + pos1 + n1; in test() 27 typename S::size_type xlen = last - first; in test() 28 s.replace(first, last, str); in test() 29 LIBCPP_ASSERT(s.__invariants()); in test() 30 assert(s == expected); in test() 31 typename S::size_type rlen = str.size(); in test() [all …]
|
H A D | size_size_pointer_size.pass.cpp | 12 // replace(size_type pos, size_type n1, const charT* s, size_type n2); // constexpr since C++20 23 template <class S> 25 test(S s, in test() argument 26 typename S::size_type pos, in test() 27 typename S::size_type n1, in test() 28 const typename S::value_type* str, in test() 29 typename S::size_type n2, in test() 30 S expected) { in test() 31 const typename S::size_type old_size = s.size(); in test() 32 S s0 = s; in test() [all …]
|
H A D | iter_iter_pointer_size.pass.cpp | 12 // replace(const_iterator i1, const_iterator i2, const charT* s, size_type n); // constexpr since… 21 template <class S> 23 test(S s, in test() argument 24 typename S::size_type pos1, in test() 25 typename S::size_type n1, in test() 26 const typename S::value_type* str, in test() 27 typename S::size_type n2, in test() 28 S expected) { in test() 29 typename S::size_type old_size = s.size(); in test() 30 typename S::const_iterator first = s.begin() + pos1; in test() [all …]
|
H A D | size_size_pointer.pass.cpp | 12 // replace(size_type pos, size_type n1, const charT* s); // constexpr since C++20 23 template <class S> 25 test(S s, typename S::size_type pos, typename S::size_type n1, const typename S::value_type* str, S… in test() argument 26 const typename S::size_type old_size = s.size(); in test() 27 S s0 = s; in test() 29 s.replace(pos, n1, str); in test() 30 LIBCPP_ASSERT(s.__invariants()); in test() 31 assert(s == expected); in test() 32 typename S::size_type xlen = std::min(n1, old_size - pos); in test() 33 typename S::size_type rlen = S::traits_type::length(str); in test() [all …]
|
H A D | size_size_T_size_size.pass.cpp | 28 template <class S, class SV> 30 test(S s, in test() argument 31 typename S::size_type pos1, in test() 32 typename S::size_type n1, in test() 34 typename S::size_type pos2, in test() 35 typename S::size_type n2, in test() 36 S expected) { in test() 37 typedef typename S::size_type SizeT; in test() 38 static_assert((!std::is_same<S, SV>::value), ""); in test() 44 const SizeT old_size = s.size(); in test() [all …]
|
H A D | iter_iter_iter_iter.pass.cpp | 23 template <class S, class It> 24 TEST_CONSTEXPR_CXX20 void test(S s, typename S::size_type pos1, typename S::size_type n1, It f, It … in test() argument 25 typename S::size_type old_size = s.size(); in test() 26 typename S::const_iterator first = s.begin() + pos1; in test() 27 typename S::const_iterator last = s.begin() + pos1 + n1; in test() 28 typename S::size_type xlen = last - first; in test() 29 s.replace(first, last, f, l); in test() 30 LIBCPP_ASSERT(s.__invariants()); in test() 31 assert(s == expected); in test() 32 typename S::size_type rlen = std::distance(f, l); in test() [all …]
|
H A D | iter_iter_pointer.pass.cpp | 12 // replace(const_iterator i1, const_iterator i2, const charT* s); // constexpr since C++20 23 template <class S> 25 test(S s, typename S::size_type pos1, typename S::size_type n1, const typename S::value_type* str, … in test() argument 26 typename S::size_type old_size = s.size(); in test() 27 typename S::const_iterator first = s.begin() + pos1; in test() 28 typename S::const_iterator last = s.begin() + pos1 + n1; in test() 29 typename S::size_type xlen = last - first; in test() 30 s.replace(first, last, str); in test() 31 LIBCPP_ASSERT(s.__invariants()); in test() 32 assert(s == expected); in test() [all …]
|
H A D | size_size_size_char.pass.cpp | 23 template <class S> 25 test(S s, in test() argument 26 typename S::size_type pos, in test() 27 typename S::size_type n1, in test() 28 typename S::size_type n2, in test() 29 typename S::value_type c, in test() 30 S expected) { in test() 31 const typename S::size_type old_size = s.size(); in test() 32 S s0 = s; in test() 34 s.replace(pos, n1, n2, c); in test() [all …]
|
/llvm-project/libcxx/test/std/strings/basic.string/string.modifiers/string_insert/ |
H A D | size_string_size_size.pass.cpp | 24 template <class S> 26 test(S s, typename S::size_type pos1, S str, typename S::size_type pos2, typename S::size_type n, S… in test() argument 27 const typename S::size_type old_size = s.size(); in test() 28 S s0 = s; in test() 30 s.insert(pos1, str, pos2, n); in test() 31 LIBCPP_ASSERT(s.__invariants()); in test() 32 assert(s == expected); in test() 33 LIBCPP_ASSERT(is_string_asan_correct(s)); in test() 38 s.insert(pos1, str, pos2, n); in test() 42 assert(s == s0); in test() [all …]
|
H A D | size_pointer_size.pass.cpp | 12 // insert(size_type pos, const charT* s, size_type n); // constexpr since C++20 22 template <class S> 24 test(S s, typename S::size_type pos, const typename S::value_type* str, typename S::size_type n, S … in test() argument 25 const typename S::size_type old_size = s.size(); in test() 26 S s0 = s; in test() 28 s.insert(pos, str, n); in test() 29 LIBCPP_ASSERT(s.__invariants()); in test() 30 assert(s == expected); in test() 31 LIBCPP_ASSERT(is_string_asan_correct(s)); in test() 36 s.insert(pos, str, n); in test() [all …]
|
H A D | size_T_size_size.pass.cpp | 23 template <class S, class SV> 25 test(S s, typename S::size_type pos1, SV sv, typename S::size_type pos2, typename S::size_type n, S… in test() argument 26 static_assert((!std::is_same<S, SV>::value), ""); in test() 27 const typename S::size_type old_size = s.size(); in test() 28 S s0 = s; in test() 30 s.insert(pos1, sv, pos2, n); in test() 31 LIBCPP_ASSERT(s.__invariants()); in test() 32 assert(s == expected); in test() 37 s.insert(pos1, sv, pos2, n); in test() 41 assert(s == s0); in test() [all …]
|
H A D | size_string.pass.cpp | 22 template <class S> 23 TEST_CONSTEXPR_CXX20 void test(S s, typename S::size_type pos, S str, S expected) { in test() argument 24 const typename S::size_type old_size = s.size(); in test() 25 S s0 = s; in test() 27 s.insert(pos, str); in test() 28 LIBCPP_ASSERT(s.__invariants()); in test() 29 assert(s == expected); in test() 30 LIBCPP_ASSERT(is_string_asan_correct(s)); in test() 35 s.insert(pos, str); in test() 39 assert(s == s0); in test() [all …]
|
/llvm-project/libcxx/test/std/strings/basic.string/string.ops/string_compare/ |
H A D | size_size_string_size_size.pass.cpp | 33 template <class S> 35 test(const S& s, in test() argument 36 typename S::size_type pos1, in test() 37 typename S::size_type n1, in test() 38 const S& str, in test() 39 typename S::size_type pos2, in test() 40 typename S::size_type n2, in test() 42 if (pos1 <= s.size() && pos2 <= str.size()) in test() 43 assert(sign(s.compare(pos1, n1, str, pos2, n2)) == sign(x)); in test() 47 TEST_IGNORE_NODISCARD s.compare(pos1, n1, str, pos2, n2); in test() [all …]
|
H A D | size_size_string.pass.cpp | 28 template <class S> 29 TEST_CONSTEXPR_CXX20 void test(const S& s, typename S::size_type pos1, typename S::size_type n1, co… in test() argument 30 if (pos1 <= s.size()) in test() 31 assert(sign(s.compare(pos1, n1, str)) == sign(x)); in test() 35 TEST_IGNORE_NODISCARD s.compare(pos1, n1, str); in test() 38 assert(pos1 > s.size()); in test() 44 template <class S> 46 test(S(""), 0, 0, S(""), 0); in test0() 47 test(S(""), 0, 0, S("abcde"), -5); in test0() 48 test(S(""), 0, 0, S("abcdefghij"), -10); in test0() [all …]
|
/llvm-project/libcxx/test/std/strings/string.view/string.view.find/ |
H A D | find_first_of_string_view_size.pass.cpp | 20 template <class S> 21 void test(const S& s, const S& str, typename S::size_type pos, typename S::size_type x) { in test() argument 22 LIBCPP_ASSERT_NOEXCEPT(s.find_first_of(str, pos)); in test() 23 assert(s.find_first_of(str, pos) == x); in test() 24 if (x != S::npos) in test() 25 assert(pos <= x && x < s.size()); in test() 28 template <class S> 29 void test(const S& s, const S& str, typename S::size_type x) { in test() argument 30 LIBCPP_ASSERT_NOEXCEPT(s.find_first_of(str)); in test() 31 assert(s.find_first_of(str) == x); in test() [all …]
|
H A D | find_first_not_of_string_view_size.pass.cpp | 20 template <class S> 21 void test(const S& s, const S& str, typename S::size_type pos, typename S::size_type x) { in test() argument 22 LIBCPP_ASSERT_NOEXCEPT(s.find_first_not_of(str, pos)); in test() 23 assert(s.find_first_not_of(str, pos) == x); in test() 24 if (x != S::npos) in test() 25 assert(pos <= x && x < s.size()); in test() 28 template <class S> 29 void test(const S& s, const S& str, typename S::size_type x) { in test() argument 30 assert(s.find_first_not_of(str) == x); in test() 31 if (x != S::npos) in test() [all …]
|
H A D | find_last_of_string_view_size.pass.cpp | 20 template <class S> 21 void test(const S& s, const S& str, typename S::size_type pos, typename S::size_type x) { in test() argument 22 LIBCPP_ASSERT_NOEXCEPT(s.find_last_of(str, pos)); in test() 23 assert(s.find_last_of(str, pos) == x); in test() 24 if (x != S::npos) in test() 25 assert(x <= pos && x < s.size()); in test() 28 template <class S> 29 void test(const S& s, const S& str, typename S::size_type x) { in test() argument 30 LIBCPP_ASSERT_NOEXCEPT(s.find_last_of(str)); in test() 31 assert(s.find_last_of(str) == x); in test() [all …]
|
H A D | find_string_view_size.pass.cpp | 21 template <class S> 22 void test(const S& s, const S& str, typename S::size_type pos, typename S::size_type x) { in test() argument 23 LIBCPP_ASSERT_NOEXCEPT(s.find(str, pos)); in test() 24 assert(s.find(str, pos) == x); in test() 25 if (x != S::npos) in test() 26 assert(pos <= x && x + str.size() <= s.size()); in test() 29 template <class S> 30 void test(const S& s, const S& str, typename S::size_type x) { in test() argument 31 LIBCPP_ASSERT_NOEXCEPT(s.find(str)); in test() 32 assert(s.find(str) == x); in test() [all …]
|
/llvm-project/libcxx/test/std/strings/basic.string/string.ops/string_find.first.not.of/ |
H A D | string_size.pass.cpp | 19 template <class S> 20 TEST_CONSTEXPR_CXX20 void test(const S& s, const S& str, typename S::size_type pos, typename S::siz… in test() argument 21 LIBCPP_ASSERT_NOEXCEPT(s.find_first_not_of(str, pos)); in test() 22 assert(s.find_first_not_of(str, pos) == x); in test() 23 if (x != S::npos) in test() 24 assert(pos <= x && x < s.size()); in test() 27 template <class S> 28 TEST_CONSTEXPR_CXX20 void test(const S& s, const S& str, typename S::size_type x) { in test() argument 29 LIBCPP_ASSERT_NOEXCEPT(s.find_first_not_of(str)); in test() 30 assert(s.find_first_not_of(str) == x); in test() [all …]
|
/llvm-project/libcxx/test/std/strings/basic.string/string.ops/string_find.last.of/ |
H A D | string_size.pass.cpp | 19 template <class S> 20 TEST_CONSTEXPR_CXX20 void test(const S& s, const S& str, typename S::size_type pos, typename S::siz… in test() argument 21 LIBCPP_ASSERT_NOEXCEPT(s.find_last_of(str, pos)); in test() 22 assert(s.find_last_of(str, pos) == x); in test() 23 if (x != S::npos) in test() 24 assert(x <= pos && x < s.size()); in test() 27 template <class S> 28 TEST_CONSTEXPR_CXX20 void test(const S& s, const S& str, typename S::size_type x) { in test() argument 29 LIBCPP_ASSERT_NOEXCEPT(s.find_last_of(str)); in test() 30 assert(s.find_last_of(str) == x); in test() [all …]
|
/llvm-project/libcxx/test/std/strings/basic.string/string.ops/string_find.last.not.of/ |
H A D | string_size.pass.cpp | 19 template <class S> 20 TEST_CONSTEXPR_CXX20 void test(const S& s, const S& str, typename S::size_type pos, typename S::siz… in test() argument 21 LIBCPP_ASSERT_NOEXCEPT(s.find_last_not_of(str, pos)); in test() 22 assert(s.find_last_not_of(str, pos) == x); in test() 23 if (x != S::npos) in test() 24 assert(x <= pos && x < s.size()); in test() 27 template <class S> 28 TEST_CONSTEXPR_CXX20 void test(const S& s, const S& str, typename S::size_type x) { in test() argument 29 LIBCPP_ASSERT_NOEXCEPT(s.find_last_not_of(str)); in test() 30 assert(s.find_last_not_of(str) == x); in test() [all …]
|
/llvm-project/libcxx/test/std/strings/basic.string/string.ops/string_find/ |
H A D | string_size.pass.cpp | 19 template <class S> 20 TEST_CONSTEXPR_CXX20 void test(const S& s, const S& str, typename S::size_type pos, typename S::siz… in test() argument 21 LIBCPP_ASSERT_NOEXCEPT(s.find(str, pos)); in test() 22 assert(s.find(str, pos) == x); in test() 23 if (x != S::npos) in test() 24 assert(pos <= x && x + str.size() <= s.size()); in test() 27 template <class S> 28 TEST_CONSTEXPR_CXX20 void test(const S& s, const S& str, typename S::size_type x) { in test() argument 29 LIBCPP_ASSERT_NOEXCEPT(s.find(str)); in test() 30 assert(s.find(str) == x); in test() [all …]
|
/llvm-project/libcxx/test/std/strings/basic.string/string.ops/string_find.first.of/ |
H A D | string_size.pass.cpp | 19 template <class S> 20 TEST_CONSTEXPR_CXX20 void test(const S& s, const S& str, typename S::size_type pos, typename S::siz… in test() argument 21 LIBCPP_ASSERT_NOEXCEPT(s.find_first_of(str, pos)); in test() 22 assert(s.find_first_of(str, pos) == x); in test() 23 if (x != S::npos) in test() 24 assert(pos <= x && x < s.size()); in test() 27 template <class S> 28 TEST_CONSTEXPR_CXX20 void test(const S& s, const S& str, typename S::size_type x) { in test() argument 29 LIBCPP_ASSERT_NOEXCEPT(s.find_first_of(str)); in test() 30 assert(s.find_first_of(str) == x); in test() [all …]
|