[libcxx-commits] [PATCH] D90602: [libcxx] [test] Use error_code::default_error_condition to check errors against the expected codes

Martin Storsjö via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Nov 2 05:52:30 PST 2020


mstorsjo created this revision.
mstorsjo added a reviewer: libc++.
Herald added a project: libc++.
Herald added 1 blocking reviewer(s): libc++.
mstorsjo requested review of this revision.

error_code returned from functions might not be of the generic category, but of the system category, which can have different error code values. Use default_error_condition() to remap errors to the generic category where possible, to allow comparing them to the expected values.

Use the ErrorIs() helper instead of a direct comparison against an excpected value.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D90602

Files:
  libcxx/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/increment.pass.cpp
  libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.copy/copy.pass.cpp
  libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.permissions/permissions.pass.cpp
  libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.status/status.pass.cpp
  libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.symlink_status/symlink_status.pass.cpp
  libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.temp_dir_path/temp_directory_path.pass.cpp
  libcxx/test/support/filesystem_test_helper.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D90602.302254.patch
Type: text/x-patch
Size: 12186 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20201102/cfd1bdef/attachment.bin>


More information about the libcxx-commits mailing list