[libcxx-commits] [PATCH] D97497: [libcxx] [test] Disable allocation checks in class.path tests on windows

Martin Storsjö via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Feb 26 05:41:54 PST 2021

mstorsjo added inline comments.

Comment at: libcxx/test/std/input.output/filesystems/class.path/path.member/path.compare.pass.cpp:102
       int ret3 = normalize_ret(p1.compare(TC.RHS));
       int ret4 = normalize_ret(p1.compare(RV));
These three (ret2-ret4) test compare() overloads that take `std::string`, `std::string_view` and `const char*`, and I'd guess it's understandable that they might do allocations as part of the charset conversions for making them comparable.

We could on the other hand change these inputs to use `path::string_type`, `const path::value_type*` and `std::basic_string_view<path::value_type>` as inputs, and then we could keep the allocation checks.

Do you think that's a better thing to do? As essentially now, the test doesn't really test what it's supposed to on windows, it just does implicit conversions to `path` inbetween and all 4 cases test the same overload.

  rG LLVM Github Monorepo



More information about the libcxx-commits mailing list