Now that Buffers instantiate the Uint8Array in JS the error message has
changed in case the allocation fails due to OOM. Tests have been updated
to match.
PR-URL: https://github.com/nodejs/node/pull/2915
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Michaƫl Zasso <mic.besace@gmail.com>
try {
assert.strictEqual(SlowBuffer(buffer.kMaxLength).length, buffer.kMaxLength);
} catch (e) {
- assert.equal(e.message, 'Buffer allocation failed - process out of memory');
+ assert.equal(e.message, 'Invalid array buffer length');
}
// should work with number-coercible values
assert.throws(function() {
new Buffer(kStringMaxLength + 1).toString();
- }, /toString failed|Buffer allocation failed/);
+ }, /toString failed|Invalid array buffer length/);
try {
new Buffer(kStringMaxLength * 4);
} catch(e) {
- assert.equal(e.message, 'Buffer allocation failed - process out of memory');
+ assert.equal(e.message, 'Invalid array buffer length');
console.log(
'1..0 # Skipped: intensive toString tests due to memory confinements');
return;