[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
Mon Mar 1 11:01:59 PST 2021


This revision was automatically updated to reflect the committed changes.
Closed by commit rG74c883f7e5ba: [libcxx] [test] Use the native path types in path.compare (authored by mstorsjo).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D97551/new/

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.327194.patch
Type: text/x-patch
Size: 1188 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20210301/7ab7e60d/attachment.bin>


More information about the libcxx-commits mailing list