0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
nodejs/test/pummel/test-abort-fatal-error.js
Sakthipriyan Vairamani d5ab92bcc1 test: use common.isWindows consistently
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>
2015-07-31 00:29:36 +05:30

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