[libcxx-commits] [PATCH] D89537: [libcxx] [test] Fix string type handling in a few fairly trivial class.path tests

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Oct 16 05:41:01 PDT 2020


ldionne requested changes to this revision.
ldionne added inline comments.
This revision now requires changes to proceed.
Herald added a subscriber: dexonsmith.


================
Comment at: libcxx/test/std/input.output/filesystems/class.path/path.member/path.assign/move.pass.cpp:29
   assert(globalMemCounter.checkOutstandingNewEq(0));
   const std::string s("we really really really really really really really "
                       "really really long string so that we allocate");
----------------
Why don't you create `s` directly as `fs::path::string_type`?


================
Comment at: libcxx/test/std/input.output/filesystems/class.path/path.member/path.construct/move.pass.cpp:32
   assert(globalMemCounter.checkOutstandingNewEq(1));
+  const fs::path::string_type ps(s.begin(), s.end());
   path p(s);
----------------
Same


================
Comment at: libcxx/test/std/input.output/filesystems/class.path/path.member/path.native.obs/c_str.pass.cpp:31
   const std::string str_value = value;
+  const fs::path::string_type pathstr_value(str_value.begin(), str_value.end());
   { // Check signature
----------------
Same.


================
Comment at: libcxx/test/std/input.output/filesystems/class.path/path.member/path.native.obs/native.pass.cpp:29
   const char* const value = "hello world";
+  std::string value_str(value);
+  fs::path::string_type pathstr_value(value_str.begin(), value_str.end());
----------------
Same.


================
Comment at: libcxx/test/std/input.output/filesystems/class.path/path.member/path.native.obs/operator_string.pass.cpp:31
   const char* const value = "hello world";
+  std::string value_str(value);
+  fs::path::string_type pathstr_value(value_str.begin(), value_str.end());
----------------
Same.


================
Comment at: libcxx/test/std/input.output/filesystems/class.path/path.nonmember/swap.pass.cpp:28
   using namespace fs;
   const char* value1 = "foo/bar/baz";
   const char* value2 = "_THIS_IS_LONG_THIS_IS_LONG_THIS_IS_LONG_THIS_IS_LONG_THIS_IS_LONG_THIS_IS_LONG_THIS_IS_LONG";
----------------
Just create them as strings from the get go?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D89537



More information about the libcxx-commits mailing list