Skip to content

Commit c14726c

Browse files
committed
test: remove unused vars from parallel tests
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]>
1 parent 063c9f6 commit c14726c

38 files changed

+14
-76
lines changed

test/parallel/test-buffer-fakes.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
require('../common');
44
const assert = require('assert');
55
const Buffer = require('buffer').Buffer;
6-
const Bp = Buffer.prototype;
76

87
function FakeBuffer() { }
98
FakeBuffer.__proto__ = Buffer;

test/parallel/test-child-process-exec-buffer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ exec('echo ' + str, function(err, stdout, stderr) {
1818
});
1919

2020
// no encoding (Buffers expected)
21-
var child = exec('echo ' + str, {
21+
exec('echo ' + str, {
2222
encoding: null
2323
}, function(err, stdout, stderr) {
2424
assert.ok(stdout instanceof Buffer, 'Expected stdout to be a Buffer');

test/parallel/test-cluster-http-pipe.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ http.createServer(function(req, res) {
3434
res.writeHead(200);
3535
res.end('OK');
3636
}).listen(common.PIPE, function() {
37-
var self = this;
3837
http.get({ socketPath: common.PIPE, path: '/' }, function(res) {
3938
res.resume();
4039
res.on('end', function(err) {

test/parallel/test-crypto-binary-default.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ var fs = require('fs');
2020
var path = require('path');
2121

2222
// Test Certificates
23-
var caPem = fs.readFileSync(common.fixturesDir + '/test_ca.pem', 'ascii');
2423
var certPem = fs.readFileSync(common.fixturesDir + '/test_cert.pem', 'ascii');
2524
var certPfx = fs.readFileSync(common.fixturesDir + '/test_cert.pfx');
2625
var keyPem = fs.readFileSync(common.fixturesDir + '/test_key.pem', 'ascii');

test/parallel/test-debug-signal-cluster.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ var options = { stdio: ['inherit', 'inherit', 'pipe', 'ipc'] };
1010
var child = spawn(process.execPath, args, options);
1111

1212
var outputLines = [];
13-
var outputTimerId;
1413
var waitingForDebuggers = false;
1514

1615
var pids = null;

test/parallel/test-dgram-error-message-address.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ socket_ipv4.bind(common.PORT, '1.1.1.1');
2020

2121
// IPv6 Test
2222
var socket_ipv6 = dgram.createSocket('udp6');
23-
var family_ipv6 = 'IPv6';
2423

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

test/parallel/test-dgram-pingpong.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ function pingPongTest(port, host) {
1111
var callbacks = 0;
1212
var N = 500;
1313
var count = 0;
14-
var sent_final_ping = false;
1514

1615
var server = dgram.createSocket('udp4', function(msg, rinfo) {
1716
if (debug) console.log('server got: ' + msg +
@@ -48,7 +47,6 @@ function pingPongTest(port, host) {
4847
if (count < N) {
4948
client.send(buf, 0, buf.length, port, 'localhost');
5049
} else {
51-
sent_final_ping = true;
5250
client.send(buf, 0, buf.length, port, 'localhost', function() {
5351
client.close();
5452
});

test/parallel/test-domain-http-server.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ objects.baz.asdf = objects;
99

1010
var serverCaught = 0;
1111
var clientCaught = 0;
12-
var disposeEmit = 0;
1312

1413
var server = http.createServer(function(req, res) {
1514
var dom = domain.create();

test/parallel/test-domain-implicit-fs.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ var caught = 0;
99
var expectCaught = 1;
1010

1111
var d = new domain.Domain();
12-
var e = new events.EventEmitter();
1312

1413
d.on('error', function(er) {
1514
console.error('caught', er);

test/parallel/test-domain-uncaught-exception.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ const assert = require('assert');
1313
const domain = require('domain');
1414
const child_process = require('child_process');
1515

16-
const uncaughtExceptions = {};
17-
1816
const tests = [];
1917

2018
function test1() {

test/parallel/test-domain-with-abort-on-uncaught-exception.js

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ const domainErrHandlerExMessage = 'exception from domain error handler';
3131
if (process.argv[2] === 'child') {
3232
var domain = require('domain');
3333
var d = domain.create();
34-
var triggeredProcessUncaughtException = false;
3534

3635
process.on('uncaughtException', function onUncaughtException() {
3736
// The process' uncaughtException event must not be emitted when
@@ -116,17 +115,7 @@ if (process.argv[2] === 'child') {
116115
var child = exec(cmdToExec);
117116

118117
if (child) {
119-
var childTriggeredOnUncaughtExceptionHandler = false;
120-
child.on('message', function onChildMsg(msg) {
121-
if (msg === 'triggeredProcessUncaughtEx') {
122-
childTriggeredOnUncaughtExceptionHandler = true;
123-
}
124-
});
125-
126118
child.on('exit', function onChildExited(exitCode, signal) {
127-
var expectedExitCodes;
128-
var expectedSignals;
129-
130119
// When throwing errors from the top-level domain error handler
131120
// outside of a try/catch block, the process should not exit gracefully
132121
if (!options.useTryCatch && options.throwInDomainErrHandler) {

test/parallel/test-dsa-fips-invalid-key.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ var fs = require('fs');
1212

1313
var input = 'hello';
1414

15-
var dsapub = fs.readFileSync(common.fixturesDir +
16-
'/keys/dsa_public_1025.pem');
1715
var dsapri = fs.readFileSync(common.fixturesDir +
1816
'/keys/dsa_private_1025.pem');
1917
var sign = crypto.createSign('DSS1');

test/parallel/test-eval.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ var error_count = 0;
1010
var cmd = ['"' + process.execPath + '"', '-e', '"console.error(process.argv)"',
1111
'foo', 'bar'].join(' ');
1212
var expected = util.format([process.execPath, 'foo', 'bar']) + '\n';
13-
var child = exec(cmd, function(err, stdout, stderr) {
13+
exec(cmd, function(err, stdout, stderr) {
1414
if (err) {
1515
console.log(err.toString());
1616
++error_count;

test/parallel/test-event-emitter-remove-listeners.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,6 @@ function listener2() {
1515
count++;
1616
}
1717

18-
function listener3() {
19-
console.log('listener3');
20-
count++;
21-
}
22-
2318
function remove1() {
2419
assert(0);
2520
}

test/parallel/test-file-write-stream3.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ function run_test_2() {
124124

125125

126126
function run_test_3() {
127-
var file, buffer, options;
127+
var file, options;
128128

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

168168

169169
function run_test_4() {
170-
var file, options;
170+
var options;
171171

172172
options = { start: -5,
173173
flags: 'r+' };

test/parallel/test-fs-open-flags.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,9 @@ var fs = require('fs');
77

88
var O_APPEND = constants.O_APPEND || 0;
99
var O_CREAT = constants.O_CREAT || 0;
10-
var O_DIRECTORY = constants.O_DIRECTORY || 0;
1110
var O_EXCL = constants.O_EXCL || 0;
12-
var O_NOCTTY = constants.O_NOCTTY || 0;
13-
var O_NOFOLLOW = constants.O_NOFOLLOW || 0;
1411
var O_RDONLY = constants.O_RDONLY || 0;
1512
var O_RDWR = constants.O_RDWR || 0;
16-
var O_SYMLINK = constants.O_SYMLINK || 0;
17-
var O_SYNC = constants.O_SYNC || 0;
1813
var O_TRUNC = constants.O_TRUNC || 0;
1914
var O_WRONLY = constants.O_WRONLY || 0;
2015

test/parallel/test-fs-open.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
'use strict';
22
require('../common');
3-
var constants = require('constants');
43
var assert = require('assert');
54
var fs = require('fs');
65

test/parallel/test-fs-read-buffer-tostring-fail.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ const fs = require('fs');
66
const path = require('path');
77
const Buffer = require('buffer').Buffer;
88
const kStringMaxLength = process.binding('buffer').kStringMaxLength;
9-
const kMaxLength = process.binding('buffer').kMaxLength;
109

1110
var fd;
1211

test/parallel/test-fs-utimes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ function expect_ok(syscall, resource, err, atime, mtime) {
4848
// would be even better though (node doesn't have such functionality yet)
4949
function runTest(atime, mtime, callback) {
5050

51-
var fd, err;
51+
var fd;
5252
//
5353
// test synchronized code paths, these functions throw on failure
5454
//

test/parallel/test-fs-write-file-sync.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ fs._closeSync = fs.closeSync;
1515
fs.closeSync = closeSync;
1616

1717
// Reset the umask for testing
18-
var mask = process.umask(0o000);
18+
process.umask(0o000);
1919

2020
// On Windows chmod is only able to manipulate read-only bit. Test if creating
2121
// the file in read-only mode works.

test/parallel/test-preload.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ child_process.exec(nodeBinary + ' '
8282
});
8383

8484
// https://github.com/nodejs/node/issues/1691
85-
var originalCwd = process.cwd();
8685
process.chdir(path.join(__dirname, '../fixtures/'));
8786
child_process.exec(nodeBinary + ' '
8887
+ '--expose_debug_as=v8debug '

test/parallel/test-promises-unhandled-rejections.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,12 +185,11 @@ asyncTest('When re-throwing new errors in a promise catch, only the' +
185185
asyncTest('Test params of unhandledRejection for a synchronously-rejected' +
186186
'promise', function(done) {
187187
var e = new Error();
188-
var e2 = new Error();
189188
onUnhandledSucceed(done, function(reason, promise) {
190189
assert.strictEqual(e, reason);
191190
assert.strictEqual(promise, promise);
192191
});
193-
var promise = Promise.reject(e);
192+
Promise.reject(e);
194193
});
195194

196195
asyncTest('When re-throwing new errors in a promise catch, only the ' +
@@ -629,7 +628,7 @@ asyncTest('Promise unhandledRejection handler does not interfere with domain' +
629628
assert.strictEqual(domainReceivedError, domainError);
630629
d.dispose();
631630
});
632-
var a = Promise.reject(e);
631+
Promise.reject(e);
633632
process.nextTick(function() {
634633
throw domainError;
635634
});

test/parallel/test-readline-undefined-columns.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const readline = require('readline');
1111
const iStream = new PassThrough();
1212
const oStream = new PassThrough();
1313

14-
const rli = readline.createInterface({
14+
readline.createInterface({
1515
terminal: true,
1616
input: iStream,
1717
output: oStream,

test/parallel/test-regress-GH-4256.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22
require('../common');
33
process.domain = null;
4-
var timer = setTimeout(function() {
4+
setTimeout(function() {
55
console.log('this console.log statement should not make node crash');
66
}, 1);

test/parallel/test-repl-autolibs.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ var repl = require('repl');
88
common.globalCheck = false;
99

1010
const putIn = new common.ArrayStream();
11-
var testMe = repl.start('', putIn, null, true);
11+
repl.start('', putIn, null, true);
1212

1313
test1();
1414

test/parallel/test-repl-syntax-error-stack.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ common.ArrayStream.prototype.write = function(output) {
1616
};
1717

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

2222
if (common.isWindows)

test/parallel/test-stream-pipe-error-handling.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ var Stream = require('stream').Stream;
3838
})();
3939

4040
(function testErrorWithRemovedListenerThrows() {
41-
var EE = require('events').EventEmitter;
4241
var R = Stream.Readable;
4342
var W = Stream.Writable;
4443

@@ -73,7 +72,6 @@ var Stream = require('stream').Stream;
7372
})();
7473

7574
(function testErrorWithRemovedListenerThrows() {
76-
var EE = require('events').EventEmitter;
7775
var R = Stream.Readable;
7876
var W = Stream.Writable;
7977

test/parallel/test-stream-push-order.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ s._read = function(n) {
2121
}
2222
};
2323

24-
var v = s.read(0);
24+
s.read(0);
2525

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

test/parallel/test-stream-unshift-read-race.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ var stream = require('stream');
1313
var hwm = 10;
1414
var r = stream.Readable({ highWaterMark: hwm });
1515
var chunks = 10;
16-
var t = (chunks * 5);
1716

1817
var data = new Buffer(chunks * hwm + Math.ceil(hwm / 2));
1918
for (var i = 0; i < data.length; i++) {

test/parallel/test-stream-writev.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,9 @@ function test(decode, uncork, multi, next) {
3030
function cnt(msg) {
3131
expectCount++;
3232
var expect = expectCount;
33-
var called = false;
3433
return function(er) {
3534
if (er)
3635
throw er;
37-
called = true;
3836
counter++;
3937
assert.equal(counter, expect);
4038
};

test/parallel/test-stream2-compatibility.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ var W = require('_stream_writable');
55
var assert = require('assert');
66

77
var util = require('util');
8-
var EE = require('events').EventEmitter;
98

109
var ondataCalled = 0;
1110

test/parallel/test-stream2-large-read-stall.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,6 @@ function push() {
5353
setTimeout(push);
5454
}
5555

56-
// start the flow
57-
var ret = r.read(0);
58-
5956
process.on('exit', function() {
6057
assert.equal(pushes, PUSHCOUNT + 1);
6158
assert(endEmitted);

test/parallel/test-stream2-objects.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,6 @@ test('read(0) for object streams', function(t) {
167167
r.push('foobar');
168168
r.push(null);
169169

170-
var v = r.read(0);
171-
172170
r.pipe(toArray(function(array) {
173171
assert.deepEqual(array, ['foobar']);
174172

test/parallel/test-stream2-readable-from-list.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@ process.nextTick(run);
3939

4040

4141
test('buffers', function(t) {
42-
// have a length
43-
var len = 16;
4442
var list = [ new Buffer('foog'),
4543
new Buffer('bark'),
4644
new Buffer('bazy'),
@@ -69,8 +67,6 @@ test('buffers', function(t) {
6967
});
7068

7169
test('strings', function(t) {
72-
// have a length
73-
var len = 16;
7470
var list = [ 'foog',
7571
'bark',
7672
'bazy',

test/parallel/test-stream2-transform.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -303,13 +303,10 @@ test('passthrough event emission', function(t) {
303303
var pt = new PassThrough();
304304
var emits = 0;
305305
pt.on('readable', function() {
306-
var state = pt._readableState;
307306
console.error('>>> emit readable %d', emits);
308307
emits++;
309308
});
310309

311-
var i = 0;
312-
313310
pt.write(new Buffer('foog'));
314311

315312
console.error('need emit 0');

test/parallel/test-timers-ordering.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,10 @@ require('../common');
33
var assert = require('assert');
44
var Timer = process.binding('timer_wrap').Timer;
55

6-
var i;
7-
86
var N = 30;
97

108
var last_i = 0;
119
var last_ts = 0;
12-
var start = Timer.now();
1310

1411
var f = function(i) {
1512
if (i <= N) {

0 commit comments

Comments
 (0)