[libcxx-commits] [PATCH] D97551: [libcxx] [test] Use the native path types in path.compare
Martin Storsjö via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Fri Feb 26 06:09:07 PST 2021
mstorsjo created this revision.
mstorsjo added reviewers: libc++, curdeius.
mstorsjo requested review of this revision.
Herald added a project: libc++.
Herald added 1 blocking reviewer(s): libc++.
This makes sure that it actually tests the right compare() overloads in windows configurations.
This also fixes the allocation guards that enforce no allocations while running the compare() functions.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D97551
Files:
libcxx/test/std/input.output/filesystems/class.path/path.member/path.compare.pass.cpp
Index: libcxx/test/std/input.output/filesystems/class.path/path.member/path.compare.pass.cpp
===================================================================
--- libcxx/test/std/input.output/filesystems/class.path/path.member/path.compare.pass.cpp
+++ libcxx/test/std/input.output/filesystems/class.path/path.member/path.compare.pass.cpp
@@ -85,8 +85,10 @@
for (auto const & TC : CompareTestCases) {
const path p1(TC.LHS);
const path p2(TC.RHS);
- const std::string R(TC.RHS);
- const std::string_view RV(TC.RHS);
+ std::string RHS(TC.RHS);
+ const path::string_type R(RHS.begin(), RHS.end());
+ const std::basic_string_view<path::value_type> RV(R);
+ const path::value_type *Ptr = R.c_str();
const int E = TC.expect;
{ // compare(...) functions
DisableAllocationGuard g; // none of these operations should allocate
@@ -94,7 +96,7 @@
// check runtime results
int ret1 = normalize_ret(p1.compare(p2));
int ret2 = normalize_ret(p1.compare(R));
- int ret3 = normalize_ret(p1.compare(TC.RHS));
+ int ret3 = normalize_ret(p1.compare(Ptr));
int ret4 = normalize_ret(p1.compare(RV));
g.release();
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D97551.326673.patch
Type: text/x-patch
Size: 1188 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20210226/3e5e8612/attachment.bin>
More information about the libcxx-commits
mailing list