Browse Source

test: remove two obsolete pummel tests

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
Ben Noordhuis 9 years ago
committed by Rod Vagg
parent
commit
8e1a8ffe24
  1. 9
      test/pummel/test-buffer-big.js
  2. 40
      test/pummel/test-fs-readfile-large.js

9
test/pummel/test-buffer-big.js

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

40
test/pummel/test-fs-readfile-large.js

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