From 8e1a8ffe24867192379cf92d329d9babc94a58f6 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Fri, 19 Jun 2015 20:54:24 +0200 Subject: [PATCH] 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 Reviewed-By: Trevor Norris --- test/pummel/test-buffer-big.js | 9 ------ test/pummel/test-fs-readfile-large.js | 40 --------------------------- 2 files changed, 49 deletions(-) delete mode 100644 test/pummel/test-buffer-big.js delete mode 100644 test/pummel/test-fs-readfile-large.js diff --git a/test/pummel/test-buffer-big.js b/test/pummel/test-buffer-big.js deleted file mode 100644 index b36b992214ffc5..00000000000000 --- a/test/pummel/test-buffer-big.js +++ /dev/null @@ -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); diff --git a/test/pummel/test-fs-readfile-large.js b/test/pummel/test-fs-readfile-large.js deleted file mode 100644 index b6afbc254d317c..00000000000000 --- a/test/pummel/test-fs-readfile-large.js +++ /dev/null @@ -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'); -});