HomePhabricator

[libcxx] [test] Use error_code::default_error_condition to check errors against…

Authored by mstorsjo on Oct 29 2020, 3:40 AM.

Description

[libcxx] [test] Use error_code::default_error_condition to check errors against the expected codes

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.

Differential Revision: https://reviews.llvm.org/D90602