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:
parent
674e5131ed
commit
db9e122182
@ -30,7 +30,7 @@ assert.strictEqual(SlowBuffer(0).length, 0);
|
|||||||
try {
|
try {
|
||||||
assert.strictEqual(SlowBuffer(buffer.kMaxLength).length, buffer.kMaxLength);
|
assert.strictEqual(SlowBuffer(buffer.kMaxLength).length, buffer.kMaxLength);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
assert.equal(e.message, 'Invalid array buffer length');
|
assert.equal(e.message, 'Array buffer allocation failed');
|
||||||
}
|
}
|
||||||
|
|
||||||
// should work with number-coercible values
|
// should work with number-coercible values
|
||||||
|
@ -23,7 +23,7 @@ try {
|
|||||||
gc();
|
gc();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
// If the exception is not due to memory confinement then rethrow it.
|
// 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);
|
console.log(skipMessage);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,7 @@ try {
|
|||||||
gc();
|
gc();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
// If the exception is not due to memory confinement then rethrow it.
|
// 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);
|
console.log(skipMessage);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,7 @@ try {
|
|||||||
gc();
|
gc();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
// If the exception is not due to memory confinement then rethrow it.
|
// 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);
|
console.log(skipMessage);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,7 @@ try {
|
|||||||
gc();
|
gc();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
// If the exception is not due to memory confinement then rethrow it.
|
// 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);
|
console.log(skipMessage);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,7 @@ try {
|
|||||||
gc();
|
gc();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
// If the exception is not due to memory confinement then rethrow it.
|
// 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);
|
console.log(skipMessage);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -23,14 +23,14 @@ try {
|
|||||||
gc();
|
gc();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
// If the exception is not due to memory confinement then rethrow it.
|
// 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);
|
console.log(skipMessage);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
assert.throws(function() {
|
assert.throws(function() {
|
||||||
buf.toString();
|
buf.toString();
|
||||||
}, /"toString\(\)" failed|Invalid array buffer length/);
|
}, /"toString\(\)" failed|Array buffer allocation failed/);
|
||||||
|
|
||||||
assert.throws(function() {
|
assert.throws(function() {
|
||||||
buf.toString('utf8');
|
buf.toString('utf8');
|
||||||
|
@ -23,7 +23,7 @@ try {
|
|||||||
gc();
|
gc();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
// If the exception is not due to memory confinement then rethrow it.
|
// 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);
|
console.log(skipMessage);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,7 @@ try {
|
|||||||
gc();
|
gc();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
// If the exception is not due to memory confinement then rethrow it.
|
// 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);
|
console.log(skipMessage);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user