From ccb022fae6433142f2554a85a973004af9ac4bb4 Mon Sep 17 00:00:00 2001 From: Trevor Norris Date: Wed, 16 Sep 2015 13:03:33 -0600 Subject: [PATCH] test: fix Buffer OOM error message 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. --- test/parallel/test-buffer-slow.js | 2 +- test/parallel/test-stringbytes-external.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/parallel/test-buffer-slow.js b/test/parallel/test-buffer-slow.js index e652a6a0f95969..d7b4f486e21422 100644 --- a/test/parallel/test-buffer-slow.js +++ b/test/parallel/test-buffer-slow.js @@ -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, 'Buffer allocation failed - process out of memory'); + assert.equal(e.message, 'Invalid array buffer length'); } // should work with number-coercible values diff --git a/test/parallel/test-stringbytes-external.js b/test/parallel/test-stringbytes-external.js index be0c90d47f9f1f..615dccc13f2b22 100644 --- a/test/parallel/test-stringbytes-external.js +++ b/test/parallel/test-stringbytes-external.js @@ -115,12 +115,12 @@ var PRE_3OF4_APEX = Math.ceil((EXTERN_APEX / 4) * 3) - RADIOS; 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;