mirror of
https://github.com/nodejs/node.git
synced 2024-12-01 16:10:02 +01:00
d5ab92bcc1
In the tests, we use "process.platform === 'win32'" in some places. This patch replaces them with the "common.isWindows" for consistency. PR-URL: https://github.com/nodejs/io.js/pull/2269 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
31 lines
735 B
JavaScript
31 lines
735 B
JavaScript
'use strict';
|
|
var assert = require('assert');
|
|
var common = require('../common');
|
|
|
|
if (common.isWindows) {
|
|
console.log('1..0 # Skipped: no RLIMIT_NOFILE on Windows');
|
|
return;
|
|
}
|
|
|
|
var exec = require('child_process').exec;
|
|
|
|
var cmdline = 'ulimit -c 0; ' + process.execPath;
|
|
cmdline += ' --max-old-space-size=4 --max-semi-space-size=1';
|
|
cmdline += ' -e "a = []; for (i = 0; i < 1e9; i++) { a.push({}) }"';
|
|
|
|
exec(cmdline, function(err, stdout, stderr) {
|
|
if (!err) {
|
|
console.log(stdout);
|
|
console.log(stderr);
|
|
assert(false, 'this test should fail');
|
|
return;
|
|
}
|
|
|
|
if (err.code !== 134 && err.signal !== 'SIGABRT') {
|
|
console.log(stdout);
|
|
console.log(stderr);
|
|
console.log(err);
|
|
assert(false, err);
|
|
}
|
|
});
|