Skip to content

Commit db9e122

Browse files
committed
test: update ArrayBuffer alloc failure message
The error message returned on ArrayBuffer allocation failure is now different as per https://codereview.chromium.org/1393263003. Ref: #4399 PR-URL: #4785 Reviewed-By: bnoordhuis - Ben Noordhuis <[email protected]>
1 parent 674e513 commit db9e122

9 files changed

+10
-10
lines changed

test/parallel/test-buffer-slow.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ assert.strictEqual(SlowBuffer(0).length, 0);
3030
try {
3131
assert.strictEqual(SlowBuffer(buffer.kMaxLength).length, buffer.kMaxLength);
3232
} catch (e) {
33-
assert.equal(e.message, 'Invalid array buffer length');
33+
assert.equal(e.message, 'Array buffer allocation failed');
3434
}
3535

3636
// should work with number-coercible values

test/parallel/test-stringbytes-external-at-max.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ try {
2323
gc();
2424
} catch (e) {
2525
// If the exception is not due to memory confinement then rethrow it.
26-
if (e.message !== 'Invalid array buffer length') throw (e);
26+
if (e.message !== 'Array buffer allocation failed') throw (e);
2727
console.log(skipMessage);
2828
return;
2929
}

test/sequential/test-stringbytes-external-exceed-max-by-1-ascii.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ try {
2323
gc();
2424
} catch (e) {
2525
// If the exception is not due to memory confinement then rethrow it.
26-
if (e.message !== 'Invalid array buffer length') throw (e);
26+
if (e.message !== 'Array buffer allocation failed') throw (e);
2727
console.log(skipMessage);
2828
return;
2929
}

test/sequential/test-stringbytes-external-exceed-max-by-1-base64.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ try {
2323
gc();
2424
} catch (e) {
2525
// If the exception is not due to memory confinement then rethrow it.
26-
if (e.message !== 'Invalid array buffer length') throw (e);
26+
if (e.message !== 'Array buffer allocation failed') throw (e);
2727
console.log(skipMessage);
2828
return;
2929
}

test/sequential/test-stringbytes-external-exceed-max-by-1-binary.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ try {
2323
gc();
2424
} catch (e) {
2525
// If the exception is not due to memory confinement then rethrow it.
26-
if (e.message !== 'Invalid array buffer length') throw (e);
26+
if (e.message !== 'Array buffer allocation failed') throw (e);
2727
console.log(skipMessage);
2828
return;
2929
}

test/sequential/test-stringbytes-external-exceed-max-by-1-hex.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ try {
2323
gc();
2424
} catch (e) {
2525
// If the exception is not due to memory confinement then rethrow it.
26-
if (e.message !== 'Invalid array buffer length') throw (e);
26+
if (e.message !== 'Array buffer allocation failed') throw (e);
2727
console.log(skipMessage);
2828
return;
2929
}

test/sequential/test-stringbytes-external-exceed-max-by-1-utf8.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ try {
2323
gc();
2424
} catch (e) {
2525
// If the exception is not due to memory confinement then rethrow it.
26-
if (e.message !== 'Invalid array buffer length') throw (e);
26+
if (e.message !== 'Array buffer allocation failed') throw (e);
2727
console.log(skipMessage);
2828
return;
2929
}
3030

3131
assert.throws(function() {
3232
buf.toString();
33-
}, /"toString\(\)" failed|Invalid array buffer length/);
33+
}, /"toString\(\)" failed|Array buffer allocation failed/);
3434

3535
assert.throws(function() {
3636
buf.toString('utf8');

test/sequential/test-stringbytes-external-exceed-max-by-2.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ try {
2323
gc();
2424
} catch (e) {
2525
// If the exception is not due to memory confinement then rethrow it.
26-
if (e.message !== 'Invalid array buffer length') throw (e);
26+
if (e.message !== 'Array buffer allocation failed') throw (e);
2727
console.log(skipMessage);
2828
return;
2929
}

test/sequential/test-stringbytes-external-exceed-max.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ try {
2323
gc();
2424
} catch (e) {
2525
// If the exception is not due to memory confinement then rethrow it.
26-
if (e.message !== 'Invalid array buffer length') throw (e);
26+
if (e.message !== 'Array buffer allocation failed') throw (e);
2727
console.log(skipMessage);
2828
return;
2929
}

0 commit comments

Comments
 (0)