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: https://github.com/nodejs/node/pull/4399
PR-URL: https://github.com/nodejs/node/pull/4785
Reviewed-By: bnoordhuis - Ben Noordhuis <info@bnoordhuis.nl>
This commit is contained in:
Ali Ijaz Sheikh 2016-01-20 09:58:07 -08:00
parent 674e5131ed
commit db9e122182
9 changed files with 10 additions and 10 deletions

View File

@ -30,7 +30,7 @@ assert.strictEqual(SlowBuffer(0).length, 0);
try {
assert.strictEqual(SlowBuffer(buffer.kMaxLength).length, buffer.kMaxLength);
} catch (e) {
assert.equal(e.message, 'Invalid array buffer length');
assert.equal(e.message, 'Array buffer allocation failed');
}
// should work with number-coercible values

View File

@ -23,7 +23,7 @@ try {
gc();
} catch (e) {
// If the exception is not due to memory confinement then rethrow it.
if (e.message !== 'Invalid array buffer length') throw (e);
if (e.message !== 'Array buffer allocation failed') throw (e);
console.log(skipMessage);
return;
}

View File

@ -23,7 +23,7 @@ try {
gc();
} catch (e) {
// If the exception is not due to memory confinement then rethrow it.
if (e.message !== 'Invalid array buffer length') throw (e);
if (e.message !== 'Array buffer allocation failed') throw (e);
console.log(skipMessage);
return;
}

View File

@ -23,7 +23,7 @@ try {
gc();
} catch (e) {
// If the exception is not due to memory confinement then rethrow it.
if (e.message !== 'Invalid array buffer length') throw (e);
if (e.message !== 'Array buffer allocation failed') throw (e);
console.log(skipMessage);
return;
}

View File

@ -23,7 +23,7 @@ try {
gc();
} catch (e) {
// If the exception is not due to memory confinement then rethrow it.
if (e.message !== 'Invalid array buffer length') throw (e);
if (e.message !== 'Array buffer allocation failed') throw (e);
console.log(skipMessage);
return;
}

View File

@ -23,7 +23,7 @@ try {
gc();
} catch (e) {
// If the exception is not due to memory confinement then rethrow it.
if (e.message !== 'Invalid array buffer length') throw (e);
if (e.message !== 'Array buffer allocation failed') throw (e);
console.log(skipMessage);
return;
}

View File

@ -23,14 +23,14 @@ try {
gc();
} catch (e) {
// If the exception is not due to memory confinement then rethrow it.
if (e.message !== 'Invalid array buffer length') throw (e);
if (e.message !== 'Array buffer allocation failed') throw (e);
console.log(skipMessage);
return;
}
assert.throws(function() {
buf.toString();
}, /"toString\(\)" failed|Invalid array buffer length/);
}, /"toString\(\)" failed|Array buffer allocation failed/);
assert.throws(function() {
buf.toString('utf8');

View File

@ -23,7 +23,7 @@ try {
gc();
} catch (e) {
// If the exception is not due to memory confinement then rethrow it.
if (e.message !== 'Invalid array buffer length') throw (e);
if (e.message !== 'Array buffer allocation failed') throw (e);
console.log(skipMessage);
return;
}

View File

@ -23,7 +23,7 @@ try {
gc();
} catch (e) {
// If the exception is not due to memory confinement then rethrow it.
if (e.message !== 'Invalid array buffer length') throw (e);
if (e.message !== 'Array buffer allocation failed') throw (e);
console.log(skipMessage);
return;
}