Skip to content

Commit

Permalink
test: use error code mapping in place of raw errno
Browse files Browse the repository at this point in the history
Refs: #38159 (comment)

PR-URL: #38675
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
  • Loading branch information
RaisinTen authored and targos committed Sep 6, 2021
1 parent e25dc8e commit 007e285
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/parallel/test-fs-read-type.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ fs.read(fd,
common.mustCall((err) => {
if (err) {
if (common.isIBMi)
assert.strictEqual(err.errno, -127);
assert.strictEqual(err.code, 'EOVERFLOW');
else
assert.strictEqual(err.code, 'EFBIG');
}
Expand Down Expand Up @@ -238,6 +238,6 @@ try {
// On systems where max file size is below 2^53-1, we'd expect a EFBIG error.
// This is not using `assert.throws` because the above call should not raise
// any error on systems that allows file of that size.
if (err.code !== 'EFBIG' && !(common.isIBMi && err.errno === -127))
if (err.code !== 'EFBIG' && !(common.isIBMi && err.code === 'EOVERFLOW'))
throw err;
}

0 comments on commit 007e285

Please sign in to comment.