[libc++] Apply clang formatting to all string unit tests
This applies clang-format to the std::string unit tests in preparation for landing https://reviews.llvm.org/D140550. Differential Revision: https://reviews.llvm.org/D140612
This commit is contained in:
1 parent
823151f0cf
commit
a40bada91a
417 files changed
+56737
-58203
No files matched your search
@@ -17,15 +17,13 @@
|
||||
#include "min_allocator.h"
|
||||
|
||||
template <class S, class SV>
|
||||
TEST_CONSTEXPR_CXX20 void
|
||||
test(S s1, SV sv)
|
||||
{
|
||||
typedef typename S::traits_type T;
|
||||
s1 = sv;
|
||||
LIBCPP_ASSERT(s1.__invariants());
|
||||
assert(s1.size() == sv.size());
|
||||
assert(T::compare(s1.data(), sv.data(), s1.size()) == 0);
|
||||
assert(s1.capacity() >= s1.size());
|
||||
TEST_CONSTEXPR_CXX20 void test(S s1, SV sv) {
|
||||
typedef typename S::traits_type T;
|
||||
s1 = sv;
|
||||
LIBCPP_ASSERT(s1.__invariants());
|
||||
assert(s1.size() == sv.size());
|
||||
assert(T::compare(s1.data(), sv.data(), s1.size()) == 0);
|
||||
assert(s1.capacity() >= s1.size());
|
||||
}
|
||||
|
||||
template <class S>
|
||||
@@ -37,15 +35,13 @@ TEST_CONSTEXPR_CXX20 void test_string() {
|
||||
test(S("1"), SV("2"));
|
||||
test(S("1"), SV("2"));
|
||||
|
||||
test(S(),
|
||||
SV("abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"));
|
||||
test(S("123456789"),
|
||||
SV("abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"));
|
||||
test(S(), SV("abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"));
|
||||
test(S("123456789"), SV("abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"));
|
||||
test(S("1234567890123456789012345678901234567890123456789012345678901234567890"),
|
||||
SV("abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"));
|
||||
SV("abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"));
|
||||
test(S("1234567890123456789012345678901234567890123456789012345678901234567890"
|
||||
"1234567890123456789012345678901234567890123456789012345678901234567890"),
|
||||
SV("abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"));
|
||||
"1234567890123456789012345678901234567890123456789012345678901234567890"),
|
||||
SV("abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"));
|
||||
}
|
||||
|
||||
TEST_CONSTEXPR_CXX20 bool test() {
|
||||
@@ -57,8 +53,7 @@ TEST_CONSTEXPR_CXX20 bool test() {
|
||||
return true;
|
||||
}
|
||||
|
||||
int main(int, char**)
|
||||
{
|
||||
int main(int, char**) {
|
||||
test();
|
||||
#if TEST_STD_VER > 17
|
||||
static_assert(test());
|
||||
|
||||
Reference in new issue
Block a user