[libcxx] [test] Use a string_view of the native path type in the concat test

This makes sure that no extra allocations happen on windows, fixing
earlier errors in the DisableAllocationGuard (in the second case that
is modified).

This is split out from D98398.

Differential Revision: https://reviews.llvm.org/D98406
This commit is contained in:
Martin Storsjö 2021-03-11 13:10:10 +02:00
parent e4f385d894
commit cb2648e6f0

View File

@ -341,7 +341,7 @@ int main(int, char**)
}
{
path LHS((const char*)TC.lhs);
std::string_view RHS((const char*)TC.rhs);
std::basic_string_view<path::value_type> RHS((const path::value_type*)TC.rhs);
path& Ref = (LHS += RHS);
assert(LHS == (const char*)TC.expect);
assert(&Ref == &LHS);
@ -367,7 +367,7 @@ int main(int, char**)
}
{
path LHS((const char*)TC.lhs);
std::string_view RHS((const char*)TC.rhs);
std::basic_string_view<path::value_type> RHS((const path::value_type*)TC.rhs);
const char* E = TC.expect;
PathReserve(LHS, StrLen(E) + 5);
{