[libc++] Prepare string.modifiers tests for constexpr

Reviewed By: ldionne, #libc

Spies: libcxx-commits

Differential Revision: https://reviews.llvm.org/D119329
This commit is contained in:
Nikolas Klauser committed 2022-02-10 21:43:18 +01:00
1 parent e43b1ce4d5
commit dcffa7d3e1
56 files changed
+2065 -1177

No files matched your search

@@ -49,9 +49,8 @@ test(S str, typename S::value_type* s, typename S::size_type n,
#endif
}
int main(int, char**)
{
{
bool test() {
{
typedef std::string S;
char s[50];
test(S(""), s, 0, 0);
@@ -112,9 +111,9 @@ int main(int, char**)
test(S("abcdefghijklmnopqrst"), s, 20, 0);
test(S("abcdefghijklmnopqrst"), s, 20, 1);
test(S("abcdefghijklmnopqrst"), s, 21, 0);
}
}
#if TEST_STD_VER >= 11
{
{
typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S;
char s[50];
test(S(""), s, 0, 0);
@@ -175,7 +174,17 @@ int main(int, char**)
test(S("abcdefghijklmnopqrst"), s, 20, 0);
test(S("abcdefghijklmnopqrst"), s, 20, 1);
test(S("abcdefghijklmnopqrst"), s, 21, 0);
}
}
#endif
return true;
}
int main(int, char**)
{
test();
#if TEST_STD_VER > 17
// static_assert(test());
#endif
return 0;