Browse Source

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>
process-exit-stdio-flushing
Ali Ijaz Sheikh 9 years ago
parent
commit
db9e122182
  1. 2
      test/parallel/test-buffer-slow.js
  2. 2
      test/parallel/test-stringbytes-external-at-max.js
  3. 2
      test/sequential/test-stringbytes-external-exceed-max-by-1-ascii.js
  4. 2
      test/sequential/test-stringbytes-external-exceed-max-by-1-base64.js
  5. 2
      test/sequential/test-stringbytes-external-exceed-max-by-1-binary.js
  6. 2
      test/sequential/test-stringbytes-external-exceed-max-by-1-hex.js
  7. 4
      test/sequential/test-stringbytes-external-exceed-max-by-1-utf8.js
  8. 2
      test/sequential/test-stringbytes-external-exceed-max-by-2.js
  9. 2
      test/sequential/test-stringbytes-external-exceed-max.js

2
test/parallel/test-buffer-slow.js

@ -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

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

@ -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;
} }

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

@ -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;
} }

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

@ -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;
} }

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

@ -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;
} }

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

@ -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;
} }

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

@ -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');

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

@ -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;
} }

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

@ -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…
Cancel
Save