mirror of https://github.com/lukechilds/node.git
Browse Source
Remove two tests that assume creating big buffers fails. The size limit is twice as big on 64 bits architectures now and is going to be removed completely in the not too distant future. PR-URL: https://github.com/nodejs/io.js/pull/2022 Reviewed-By: Rod Vagg <rod@vagg.org> Reviewed-By: Trevor Norris <trev.norris@gmail.com>v4.0.0-rc
committed by
Rod Vagg
2 changed files with 0 additions and 49 deletions
@ -1,9 +0,0 @@ |
|||
'use strict'; |
|||
var common = require('../common'); |
|||
var assert = require('assert'); |
|||
|
|||
// The tests below should throw an error, not abort the process...
|
|||
assert.throws(function() { new Buffer(0x3fffffff + 1); }, RangeError); |
|||
assert.throws(function() { new Int8Array(0x3fffffff + 1); }, RangeError); |
|||
assert.throws(function() { new ArrayBuffer(0x3fffffff + 1); }, RangeError); |
|||
assert.throws(function() { new Float64Array(0x7ffffff + 1); }, RangeError); |
@ -1,40 +0,0 @@ |
|||
'use strict'; |
|||
var common = require('../common'); |
|||
var assert = require('assert'); |
|||
|
|||
var path = require('path'), |
|||
fs = require('fs'), |
|||
filename = path.join(common.fixturesDir, 'large_file.txt'); |
|||
|
|||
var filesize = 1024 * 1024 * 1024; |
|||
|
|||
function makeFile(done) { |
|||
var buf = new Buffer(filesize / 1024); |
|||
buf.fill('a'); |
|||
|
|||
try { fs.unlinkSync(filename); } catch (e) {} |
|||
var w = 1024; |
|||
var ws = fs.createWriteStream(filename); |
|||
ws.on('close', done); |
|||
ws.on('drain', write); |
|||
write(); |
|||
function write() { |
|||
do { |
|||
w--; |
|||
} while (false !== ws.write(buf) && w > 0); |
|||
if (w === 0) |
|||
ws.end(); |
|||
} |
|||
} |
|||
|
|||
makeFile(function() { |
|||
fs.readFile(filename, function(err) { |
|||
assert.ok(err, 'should get RangeError'); |
|||
assert.equal(err.name, 'RangeError', 'should get RangeError'); |
|||
try { fs.unlinkSync(filename); } catch (e) {} |
|||
}); |
|||
}); |
|||
|
|||
process.on('uncaughtException', function(err) { |
|||
assert.ok(!err, 'should not throw uncaughtException'); |
|||
}); |
Loading…
Reference in new issue