[libcxx-commits] [PATCH] D93026: [libc++] [P1164] Add tests for create_directories. NFC.

Martin Storsjö via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Dec 14 03:04:38 PST 2020


mstorsjo added inline comments.


================
Comment at: libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.create_directories/create_directories.pass.cpp:107
+    TEST_CHECK(ec);
+    TEST_CHECK(ec == std::errc::file_exists);
+    TEST_CHECK(is_regular_file(file));
----------------
Btw, the filesystem tests has got a helper function, that would allow writing this as `ErrorIs(ec, std::errc::file_exists)` - but I verified that this form also seems to work.

The thing is, that with MS STL, the returned error codes don't use the standard `std::errc` values and category, but wrap the windows native error codes. The `ErrorIs()` helper explicitly converts them to the generic error category (via `ec.default_error_condition()`) before comparing error values, but it looks like `operator==()` does the same as well, implicitly.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D93026



More information about the libcxx-commits mailing list