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 <anna@addaleax.net>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
  • Loading branch information
RaisinTen authored and targos committed Sep 6, 2021
1 parent 36b9e63 commit bd80966
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 bd80966

Please sign in to comment.