Skip to content

Commit

Permalink
test: remove unused vars from parallel tests
Browse files Browse the repository at this point in the history
Remove all remaining unused variables from tests in test/parallel.

PR-URL: #4511
Reviewed-By: James M Snell<[email protected]>
Reviewed-By: Johan Bergström <[email protected]>
  • Loading branch information
Trott authored and Myles Borins committed Jan 19, 2016
1 parent b4964b0 commit f183770
Show file tree
Hide file tree
Showing 46 changed files with 20 additions and 83 deletions.
2 changes: 1 addition & 1 deletion test/parallel/test-assert-typedarray-deepequal.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

const common = require('../common');
require('../common');
const assert = require('assert');
const a = require('assert');

Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-buffer-fakes.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
require('../common');
const assert = require('assert');
const Buffer = require('buffer').Buffer;
const Bp = Buffer.prototype;

function FakeBuffer() { }
FakeBuffer.__proto__ = Buffer;
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-child-process-exec-buffer.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ exec('echo ' + str, function(err, stdout, stderr) {
});

// no encoding (Buffers expected)
var child = exec('echo ' + str, {
exec('echo ' + str, {
encoding: null
}, function(err, stdout, stderr) {
assert.ok(stdout instanceof Buffer, 'Expected stdout to be a Buffer');
Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-cluster-http-pipe.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ http.createServer(function(req, res) {
res.writeHead(200);
res.end('OK');
}).listen(common.PIPE, function() {
var self = this;
http.get({ socketPath: common.PIPE, path: '/' }, function(res) {
res.resume();
res.on('end', function(err) {
Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-crypto-binary-default.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ var fs = require('fs');
var path = require('path');

// Test Certificates
var caPem = fs.readFileSync(common.fixturesDir + '/test_ca.pem', 'ascii');
var certPem = fs.readFileSync(common.fixturesDir + '/test_cert.pem', 'ascii');
var certPfx = fs.readFileSync(common.fixturesDir + '/test_cert.pfx');
var keyPem = fs.readFileSync(common.fixturesDir + '/test_key.pem', 'ascii');
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-crypto-dh.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ var ecdh3 = crypto.createECDH('secp256k1');
var key3 = ecdh3.generateKeys();

assert.throws(function() {
var secret3 = ecdh2.computeSecret(key3, 'binary', 'buffer');
ecdh2.computeSecret(key3, 'binary', 'buffer');
});

// ECDH should allow .setPrivateKey()/.setPublicKey()
Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-debug-signal-cluster.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ var options = { stdio: ['inherit', 'inherit', 'pipe', 'ipc'] };
var child = spawn(process.execPath, args, options);

var outputLines = [];
var outputTimerId;
var waitingForDebuggers = false;

var pids = null;
Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-dgram-error-message-address.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ socket_ipv4.bind(common.PORT, '1.1.1.1');

// IPv6 Test
var socket_ipv6 = dgram.createSocket('udp6');
var family_ipv6 = 'IPv6';

socket_ipv6.on('listening', common.fail);

Expand Down
2 changes: 0 additions & 2 deletions test/parallel/test-dgram-pingpong.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ function pingPongTest(port, host) {
var callbacks = 0;
var N = 500;
var count = 0;
var sent_final_ping = false;

var server = dgram.createSocket('udp4', function(msg, rinfo) {
if (debug) console.log('server got: ' + msg +
Expand Down Expand Up @@ -48,7 +47,6 @@ function pingPongTest(port, host) {
if (count < N) {
client.send(buf, 0, buf.length, port, 'localhost');
} else {
sent_final_ping = true;
client.send(buf, 0, buf.length, port, 'localhost', function() {
client.close();
});
Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-domain-http-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ objects.baz.asdf = objects;

var serverCaught = 0;
var clientCaught = 0;
var disposeEmit = 0;

var server = http.createServer(function(req, res) {
var dom = domain.create();
Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-domain-implicit-fs.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ var caught = 0;
var expectCaught = 1;

var d = new domain.Domain();
var e = new events.EventEmitter();

d.on('error', function(er) {
console.error('caught', er);
Expand Down
2 changes: 0 additions & 2 deletions test/parallel/test-domain-uncaught-exception.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ const assert = require('assert');
const domain = require('domain');
const child_process = require('child_process');

const uncaughtExceptions = {};

const tests = [];

function test1() {
Expand Down
8 changes: 0 additions & 8 deletions test/parallel/test-domain-with-abort-on-uncaught-exception.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ const domainErrHandlerExMessage = 'exception from domain error handler';
if (process.argv[2] === 'child') {
var domain = require('domain');
var d = domain.create();
var triggeredProcessUncaughtException = false;

process.on('uncaughtException', function onUncaughtException() {
// The process' uncaughtException event must not be emitted when
Expand Down Expand Up @@ -116,13 +115,6 @@ if (process.argv[2] === 'child') {
var child = exec(cmdToExec);

if (child) {
var childTriggeredOnUncaughtExceptionHandler = false;
child.on('message', function onChildMsg(msg) {
if (msg === 'triggeredProcessUncaughtEx') {
childTriggeredOnUncaughtExceptionHandler = true;
}
});

child.on('exit', function onChildExited(exitCode, signal) {
// When throwing errors from the top-level domain error handler
// outside of a try/catch block, the process should not exit gracefully
Expand Down
2 changes: 0 additions & 2 deletions test/parallel/test-dsa-fips-invalid-key.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ var fs = require('fs');

var input = 'hello';

var dsapub = fs.readFileSync(common.fixturesDir +
'/keys/dsa_public_1025.pem');
var dsapri = fs.readFileSync(common.fixturesDir +
'/keys/dsa_private_1025.pem');
var sign = crypto.createSign('DSS1');
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-eval.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ var error_count = 0;
var cmd = ['"' + process.execPath + '"', '-e', '"console.error(process.argv)"',
'foo', 'bar'].join(' ');
var expected = util.format([process.execPath, 'foo', 'bar']) + '\n';
var child = exec(cmd, function(err, stdout, stderr) {
exec(cmd, function(err, stdout, stderr) {
if (err) {
console.log(err.toString());
++error_count;
Expand Down
5 changes: 0 additions & 5 deletions test/parallel/test-event-emitter-remove-listeners.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@ function listener2() {
count++;
}

function listener3() {
console.log('listener3');
count++;
}

function remove1() {
assert(0);
}
Expand Down
4 changes: 2 additions & 2 deletions test/parallel/test-file-write-stream3.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ function run_test_2() {


function run_test_3() {
var file, buffer, options;
var file, options;

var data = '\u2026\u2026', // 3 bytes * 2 = 6 bytes in UTF-8
fileData;
Expand Down Expand Up @@ -167,7 +167,7 @@ function run_test_3() {


function run_test_4() {
var file, options;
var options;

options = { start: -5,
flags: 'r+' };
Expand Down
5 changes: 0 additions & 5 deletions test/parallel/test-fs-open-flags.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,9 @@ var fs = require('fs');

var O_APPEND = constants.O_APPEND || 0;
var O_CREAT = constants.O_CREAT || 0;
var O_DIRECTORY = constants.O_DIRECTORY || 0;
var O_EXCL = constants.O_EXCL || 0;
var O_NOCTTY = constants.O_NOCTTY || 0;
var O_NOFOLLOW = constants.O_NOFOLLOW || 0;
var O_RDONLY = constants.O_RDONLY || 0;
var O_RDWR = constants.O_RDWR || 0;
var O_SYMLINK = constants.O_SYMLINK || 0;
var O_SYNC = constants.O_SYNC || 0;
var O_TRUNC = constants.O_TRUNC || 0;
var O_WRONLY = constants.O_WRONLY || 0;

Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-fs-open.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
'use strict';
require('../common');
var constants = require('constants');
var assert = require('assert');
var fs = require('fs');

Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-fs-utimes.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function expect_ok(syscall, resource, err, atime, mtime) {
// would be even better though (node doesn't have such functionality yet)
function runTest(atime, mtime, callback) {

var fd, err;
var fd;
//
// test synchronized code paths, these functions throw on failure
//
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-fs-write-file-sync.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ fs._closeSync = fs.closeSync;
fs.closeSync = closeSync;

// Reset the umask for testing
var mask = process.umask(0o000);
process.umask(0o000);

// On Windows chmod is only able to manipulate read-only bit. Test if creating
// the file in read-only mode works.
Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-preload.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ child_process.exec(nodeBinary + ' '
});

// https://github.com/nodejs/node/issues/1691
var originalCwd = process.cwd();
process.chdir(path.join(__dirname, '../fixtures/'));
child_process.exec(nodeBinary + ' '
+ '--expose_debug_as=v8debug '
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-process-release.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use strict';
const common = require('../common');
require('../common');
const assert = require('assert');
const versionParts = process.versions.node.split('.');

Expand Down
5 changes: 2 additions & 3 deletions test/parallel/test-promises-unhandled-rejections.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,12 +185,11 @@ asyncTest('When re-throwing new errors in a promise catch, only the' +
asyncTest('Test params of unhandledRejection for a synchronously-rejected' +
'promise', function(done) {
var e = new Error();
var e2 = new Error();
onUnhandledSucceed(done, function(reason, promise) {
assert.strictEqual(e, reason);
assert.strictEqual(promise, promise);
});
var promise = Promise.reject(e);
Promise.reject(e);
});

asyncTest('When re-throwing new errors in a promise catch, only the ' +
Expand Down Expand Up @@ -629,7 +628,7 @@ asyncTest('Promise unhandledRejection handler does not interfere with domain' +
assert.strictEqual(domainReceivedError, domainError);
d.dispose();
});
var a = Promise.reject(e);
Promise.reject(e);
process.nextTick(function() {
throw domainError;
});
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-readline-undefined-columns.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const readline = require('readline');
const iStream = new PassThrough();
const oStream = new PassThrough();

const rli = readline.createInterface({
readline.createInterface({
terminal: true,
input: iStream,
output: oStream,
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-regress-GH-4256.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';
require('../common');
process.domain = null;
var timer = setTimeout(function() {
setTimeout(function() {
console.log('this console.log statement should not make node crash');
}, 1);
1 change: 0 additions & 1 deletion test/parallel/test-repl-.save.load.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
'use strict';
var assert = require('assert');
var util = require('util');
var join = require('path').join;
var fs = require('fs');
var common = require('../common');
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-repl-autolibs.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ var repl = require('repl');
common.globalCheck = false;

const putIn = new common.ArrayStream();
var testMe = repl.start('', putIn, null, true);
repl.start('', putIn, null, true);

test1();

Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-repl-domain.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
'use strict';
var common = require('../common');

var util = require('util');
var repl = require('repl');

const putIn = new common.ArrayStream();
Expand Down
3 changes: 1 addition & 2 deletions test/parallel/test-repl-syntax-error-stack.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ const common = require('../common');
const assert = require('assert');
const path = require('path');
const repl = require('repl');
const util = require('util');
let found = false;

process.on('exit', () => {
Expand All @@ -17,7 +16,7 @@ common.ArrayStream.prototype.write = function(output) {
};

const putIn = new common.ArrayStream();
const testMe = repl.start('', putIn);
repl.start('', putIn);
let file = path.resolve(__dirname, '../fixtures/syntax/bad_syntax');

if (common.isWindows)
Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-repl-tab-complete-crash.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

const common = require('../common');
const assert = require('assert');
const util = require('util');
const repl = require('repl');

var referenceErrorCount = 0;
Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-repl-tab-complete.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

var common = require('../common');
var assert = require('assert');
var util = require('util');
var repl = require('repl');
var referenceErrors = 0;
var expectedReferenceErrors = 0;
Expand Down
2 changes: 0 additions & 2 deletions test/parallel/test-stream-pipe-error-handling.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ var Stream = require('stream').Stream;
})();

(function testErrorWithRemovedListenerThrows() {
var EE = require('events').EventEmitter;
var R = Stream.Readable;
var W = Stream.Writable;

Expand Down Expand Up @@ -73,7 +72,6 @@ var Stream = require('stream').Stream;
})();

(function testErrorWithRemovedListenerThrows() {
var EE = require('events').EventEmitter;
var R = Stream.Readable;
var W = Stream.Writable;

Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-stream-push-order.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ s._read = function(n) {
}
};

var v = s.read(0);
s.read(0);

// ACTUALLY [1, 3, 5, 6, 4, 2]

Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-stream-unshift-read-race.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ var stream = require('stream');
var hwm = 10;
var r = stream.Readable({ highWaterMark: hwm });
var chunks = 10;
var t = (chunks * 5);

var data = new Buffer(chunks * hwm + Math.ceil(hwm / 2));
for (var i = 0; i < data.length; i++) {
Expand Down
2 changes: 0 additions & 2 deletions test/parallel/test-stream-writev.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,9 @@ function test(decode, uncork, multi, next) {
function cnt(msg) {
expectCount++;
var expect = expectCount;
var called = false;
return function(er) {
if (er)
throw er;
called = true;
counter++;
assert.equal(counter, expect);
};
Expand Down
3 changes: 1 addition & 2 deletions test/parallel/test-stream2-compatibility.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ var R = require('_stream_readable');
var assert = require('assert');

var util = require('util');
var EE = require('events').EventEmitter;

var ondataCalled = 0;

Expand All @@ -25,7 +24,7 @@ TestReader.prototype._read = function(n) {
this._buffer = new Buffer(0);
};

var reader = new TestReader();
new TestReader();
setImmediate(function() {
assert.equal(ondataCalled, 1);
console.log('ok');
Expand Down
Loading

0 comments on commit f183770

Please sign in to comment.