Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit e922716

Browse filesBrowse files
Trottjasnell
authored andcommitted
test: remove deprecated error logging
common.error() is just deprecated util.error() renamed. Remove calls to it and some other extraneous console logging in tests. PR-URL: #3079 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
1 parent 8f29d95 commit e922716
Copy full SHA for e922716
Expand file treeCollapse file tree

19 files changed

+2
-135
lines changed
Open diff view settings
Collapse file

‎test/parallel/test-fs-append-file-sync.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-fs-append-file-sync.js
-8Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,16 @@ common.refreshTmpDir();
2020
// test that empty file will be created and have content added
2121
var filename = join(common.tmpDir, 'append-sync.txt');
2222

23-
common.error('appending to ' + filename);
2423
fs.appendFileSync(filename, data);
2524

2625
var fileData = fs.readFileSync(filename);
27-
console.error('filedata is a ' + typeof fileData);
2826

2927
assert.equal(Buffer.byteLength(data), fileData.length);
3028

3129
// test that appends data to a non empty file
3230
var filename2 = join(common.tmpDir, 'append-sync2.txt');
3331
fs.writeFileSync(filename2, currentFileData);
3432

35-
common.error('appending to ' + filename2);
3633
fs.appendFileSync(filename2, data);
3734

3835
var fileData2 = fs.readFileSync(filename2);
@@ -44,8 +41,6 @@ assert.equal(Buffer.byteLength(data) + currentFileData.length,
4441
var filename3 = join(common.tmpDir, 'append-sync3.txt');
4542
fs.writeFileSync(filename3, currentFileData);
4643

47-
common.error('appending to ' + filename3);
48-
4944
var buf = new Buffer(data, 'utf8');
5045
fs.appendFileSync(filename3, buf);
5146

@@ -57,7 +52,6 @@ assert.equal(buf.length + currentFileData.length, fileData3.length);
5752
var filename4 = join(common.tmpDir, 'append-sync4.txt');
5853
fs.writeFileSync(filename4, currentFileData, { mode: m });
5954

60-
common.error('appending to ' + filename4);
6155
var m = 0o600;
6256
fs.appendFileSync(filename4, num, { mode: m });
6357

@@ -75,8 +69,6 @@ assert.equal(Buffer.byteLength('' + num) + currentFileData.length,
7569
//exit logic for cleanup
7670

7771
process.on('exit', function() {
78-
common.error('done');
79-
8072
fs.unlinkSync(filename);
8173
fs.unlinkSync(filename2);
8274
fs.unlinkSync(filename3);
Collapse file

‎test/parallel/test-fs-append-file.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-fs-append-file.js
-14Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ var join = require('path').join;
66

77
var filename = join(common.tmpDir, 'append.txt');
88

9-
common.error('appending to ' + filename);
10-
119
var currentFileData = 'ABCD';
1210

1311
var n = 220;
@@ -28,11 +26,9 @@ fs.appendFile(filename, s, function(e) {
2826
if (e) throw e;
2927

3028
ncallbacks++;
31-
common.error('appended to file');
3229

3330
fs.readFile(filename, function(e, buffer) {
3431
if (e) throw e;
35-
common.error('file read');
3632
ncallbacks++;
3733
assert.equal(Buffer.byteLength(s), buffer.length);
3834
});
@@ -46,11 +42,9 @@ fs.appendFile(filename2, s, function(e) {
4642
if (e) throw e;
4743

4844
ncallbacks++;
49-
common.error('appended to file2');
5045

5146
fs.readFile(filename2, function(e, buffer) {
5247
if (e) throw e;
53-
common.error('file2 read');
5448
ncallbacks++;
5549
assert.equal(Buffer.byteLength(s) + currentFileData.length, buffer.length);
5650
});
@@ -61,17 +55,14 @@ var filename3 = join(common.tmpDir, 'append3.txt');
6155
fs.writeFileSync(filename3, currentFileData);
6256

6357
var buf = new Buffer(s, 'utf8');
64-
common.error('appending to ' + filename3);
6558

6659
fs.appendFile(filename3, buf, function(e) {
6760
if (e) throw e;
6861

6962
ncallbacks++;
70-
common.error('appended to file3');
7163

7264
fs.readFile(filename3, function(e, buffer) {
7365
if (e) throw e;
74-
common.error('file3 read');
7566
ncallbacks++;
7667
assert.equal(buf.length + currentFileData.length, buffer.length);
7768
});
@@ -81,14 +72,11 @@ fs.appendFile(filename3, buf, function(e) {
8172
var filename4 = join(common.tmpDir, 'append4.txt');
8273
fs.writeFileSync(filename4, currentFileData);
8374

84-
common.error('appending to ' + filename4);
85-
8675
var m = 0o600;
8776
fs.appendFile(filename4, n, { mode: m }, function(e) {
8877
if (e) throw e;
8978

9079
ncallbacks++;
91-
common.error('appended to file4');
9280

9381
// windows permissions aren't unix
9482
if (!common.isWindows) {
@@ -98,15 +86,13 @@ fs.appendFile(filename4, n, { mode: m }, function(e) {
9886

9987
fs.readFile(filename4, function(e, buffer) {
10088
if (e) throw e;
101-
common.error('file4 read');
10289
ncallbacks++;
10390
assert.equal(Buffer.byteLength('' + n) + currentFileData.length,
10491
buffer.length);
10592
});
10693
});
10794

10895
process.on('exit', function() {
109-
common.error('done');
11096
assert.equal(8, ncallbacks);
11197

11298
fs.unlinkSync(filename);
Collapse file

‎test/parallel/test-fs-fsync.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-fs-fsync.js
-7Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,20 @@ var successes = 0;
88

99
var file = path.join(common.fixturesDir, 'a.js');
1010

11-
common.error('open ' + file);
12-
1311
fs.open(file, 'a', 0o777, function(err, fd) {
14-
common.error('fd ' + fd);
1512
if (err) throw err;
1613

1714
fs.fdatasyncSync(fd);
18-
common.error('fdatasync SYNC: ok');
1915
successes++;
2016

2117
fs.fsyncSync(fd);
22-
common.error('fsync SYNC: ok');
2318
successes++;
2419

2520
fs.fdatasync(fd, function(err) {
2621
if (err) throw err;
27-
common.error('fdatasync ASYNC: ok');
2822
successes++;
2923
fs.fsync(fd, function(err) {
3024
if (err) throw err;
31-
common.error('fsync ASYNC: ok');
3225
successes++;
3326
});
3427
});
Collapse file

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

Copy file name to clipboardExpand all lines: test/parallel/test-fs-write-file.js
-11Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ common.refreshTmpDir();
88

99
var filename = join(common.tmpDir, 'test.txt');
1010

11-
common.error('writing to ' + filename);
12-
1311
var n = 220;
1412
var s = '南越国是前203年至前111年存在于岭南地区的一个国家,国都位于番禺,疆域包括今天中国的广东、' +
1513
'广西两省区的大部份地区,福建省、湖南、贵州、云南的一小部份地区和越南的北部。' +
@@ -25,11 +23,9 @@ fs.writeFile(filename, s, function(e) {
2523
if (e) throw e;
2624

2725
ncallbacks++;
28-
common.error('file written');
2926

3027
fs.readFile(filename, function(e, buffer) {
3128
if (e) throw e;
32-
common.error('file read');
3329
ncallbacks++;
3430
assert.equal(Buffer.byteLength(s), buffer.length);
3531
});
@@ -38,25 +34,21 @@ fs.writeFile(filename, s, function(e) {
3834
// test that writeFile accepts buffers
3935
var filename2 = join(common.tmpDir, 'test2.txt');
4036
var buf = new Buffer(s, 'utf8');
41-
common.error('writing to ' + filename2);
4237

4338
fs.writeFile(filename2, buf, function(e) {
4439
if (e) throw e;
4540

4641
ncallbacks++;
47-
common.error('file2 written');
4842

4943
fs.readFile(filename2, function(e, buffer) {
5044
if (e) throw e;
51-
common.error('file2 read');
5245
ncallbacks++;
5346
assert.equal(buf.length, buffer.length);
5447
});
5548
});
5649

5750
// test that writeFile accepts numbers.
5851
var filename3 = join(common.tmpDir, 'test3.txt');
59-
common.error('writing to ' + filename3);
6052

6153
var m = 0o600;
6254
fs.writeFile(filename3, n, { mode: m }, function(e) {
@@ -69,19 +61,16 @@ fs.writeFile(filename3, n, { mode: m }, function(e) {
6961
}
7062

7163
ncallbacks++;
72-
common.error('file3 written');
7364

7465
fs.readFile(filename3, function(e, buffer) {
7566
if (e) throw e;
76-
common.error('file3 read');
7767
ncallbacks++;
7868
assert.equal(Buffer.byteLength('' + n), buffer.length);
7969
});
8070
});
8171

8272

8373
process.on('exit', function() {
84-
common.error('done');
8574
assert.equal(6, ncallbacks);
8675

8776
fs.unlinkSync(filename);
Collapse file

‎test/parallel/test-http-304.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-http-304.js
-4Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,5 @@ s.listen(common.PORT, function() {
1515
function(err, stdout, stderr) {
1616
if (err) throw err;
1717
s.close();
18-
common.error('curled response correctly');
19-
common.error(common.inspect(stdout));
2018
});
2119
});
22-
23-
console.log('Server running at http://127.0.0.1:' + common.PORT + '/');
Collapse file

‎test/parallel/test-http-blank-header.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-http-blank-header.js
-3Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ var net = require('net');
77
var gotReq = false;
88

99
var server = http.createServer(function(req, res) {
10-
common.error('got req');
1110
gotReq = true;
1211
assert.equal('GET', req.method);
1312
assert.equal('/blah', req.url);
@@ -23,7 +22,6 @@ server.listen(common.PORT, function() {
2322
var c = net.createConnection(common.PORT);
2423

2524
c.on('connect', function() {
26-
common.error('client wrote message');
2725
c.write('GET /blah HTTP/1.1\r\n' +
2826
'Host: mapdevel.trolologames.ru:443\r\n' +
2927
'Cookie:\r\n' +
@@ -37,7 +35,6 @@ server.listen(common.PORT, function() {
3735
});
3836

3937
c.on('close', function() {
40-
common.error('client close');
4138
server.close();
4239
});
4340
});
Collapse file

‎test/parallel/test-http-client-upload-buf.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-http-client-upload-buf.js
-2Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@ server.on('listening', function() {
4343

4444
req.write(new Buffer(N));
4545
req.end();
46-
47-
common.error('client finished sending request');
4846
});
4947

5048
process.on('exit', function() {
Collapse file

‎test/parallel/test-http-client-upload.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-http-client-upload.js
-2Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,6 @@ server.on('listening', function() {
4646
req.write('2\n');
4747
req.write('3\n');
4848
req.end();
49-
50-
common.error('client finished sending request');
5149
});
5250

5351
process.on('exit', function() {
Collapse file

‎test/parallel/test-http-head-response-has-no-body-end.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-http-head-response-has-no-body-end.js
-3Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,12 @@ server.on('listening', function() {
2222
method: 'HEAD',
2323
path: '/'
2424
}, function(res) {
25-
common.error('response');
2625
res.on('end', function() {
27-
common.error('response end');
2826
server.close();
2927
responseComplete = true;
3028
});
3129
res.resume();
3230
});
33-
common.error('req');
3431
req.end();
3532
});
3633

Collapse file

‎test/parallel/test-http-head-response-has-no-body.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-http-head-response-has-no-body.js
-3Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,12 @@ server.on('listening', function() {
2222
method: 'HEAD',
2323
path: '/'
2424
}, function(res) {
25-
common.error('response');
2625
res.on('end', function() {
27-
common.error('response end');
2826
server.close();
2927
responseComplete = true;
3028
});
3129
res.resume();
3230
});
33-
common.error('req');
3431
req.end();
3532
});
3633

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.