[libc++] Refactor string unit tests to ease addition of new allocators

While doing this, I also found a few tests that were either clearly
incorrect (e.g. testing the wrong function) or that lacked basic test
coverage like testing std::string itself (e.g. the test was only checking
std::basic_string with a custom allocator). In these cases, I did a few
conservative drive-by changes.

Differential Revision: https://reviews.llvm.org/D140550
Co-authored-by: Brendan Emery <brendan.emery@esrlabs.com>
This commit is contained in:
Louis Dionne committed 2023-09-27 09:01:58 -04:00
1 parent 47b7f33b13
commit 6e1dcc9335
149 files changed
+2959 -4153

No files matched your search

@@ -90,7 +90,9 @@ TEST_CONSTEXPR_CXX20 bool test() {
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));
testAlloc(S("12345678901234567890", A(5)), S("1234567890123456789012345678901234567890123456789012345678901234567890", A(7)), A(7));
testAlloc(S("12345678901234567890", A(5)),
S("1234567890123456789012345678901234567890123456789012345678901234567890", A(7)),
A(7));
}
#if TEST_STD_VER >= 11