summaryrefslogtreecommitdiff
path: root/test/parallel
diff options
context:
space:
mode:
authorRich Trott <rtrott@gmail.com>2015-09-26 15:00:51 -0700
committerRich Trott <rtrott@gmail.com>2015-10-07 11:13:38 -0700
commit099cfbc58cb95b221cbbd49c6d161eae316c752d (patch)
treedab846bbcef89323ca1e3adb2fd05db383e935b9 /test/parallel
parenta334ddc467af6bfb3a93245a7e6f571c8dd01fa2 (diff)
downloadandroid-node-v8-099cfbc58cb95b221cbbd49c6d161eae316c752d.tar.gz
android-node-v8-099cfbc58cb95b221cbbd49c6d161eae316c752d.tar.bz2
android-node-v8-099cfbc58cb95b221cbbd49c6d161eae316c752d.zip
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: https://github.com/nodejs/node/pull/3079 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Diffstat (limited to 'test/parallel')
-rw-r--r--test/parallel/test-fs-append-file-sync.js8
-rw-r--r--test/parallel/test-fs-append-file.js14
-rw-r--r--test/parallel/test-fs-fsync.js7
-rw-r--r--test/parallel/test-fs-write-file.js11
-rw-r--r--test/parallel/test-http-304.js4
-rw-r--r--test/parallel/test-http-blank-header.js3
-rw-r--r--test/parallel/test-http-client-upload-buf.js2
-rw-r--r--test/parallel/test-http-client-upload.js2
-rw-r--r--test/parallel/test-http-head-response-has-no-body-end.js3
-rw-r--r--test/parallel/test-http-head-response-has-no-body.js3
-rw-r--r--test/parallel/test-http-legacy.js6
-rw-r--r--test/parallel/test-http-server.js4
-rw-r--r--test/parallel/test-http-upgrade-server2.js5
-rw-r--r--test/parallel/test-http-write-empty-string.js1
-rw-r--r--test/parallel/test-http.js4
-rw-r--r--test/parallel/test-net-binary.js25
-rw-r--r--test/parallel/test-pipe-file-to-http.js19
17 files changed, 0 insertions, 121 deletions
diff --git a/test/parallel/test-fs-append-file-sync.js b/test/parallel/test-fs-append-file-sync.js
index b3789ad911..42e0790e1f 100644
--- a/test/parallel/test-fs-append-file-sync.js
+++ b/test/parallel/test-fs-append-file-sync.js
@@ -20,11 +20,9 @@ common.refreshTmpDir();
// test that empty file will be created and have content added
var filename = join(common.tmpDir, 'append-sync.txt');
-common.error('appending to ' + filename);
fs.appendFileSync(filename, data);
var fileData = fs.readFileSync(filename);
-console.error('filedata is a ' + typeof fileData);
assert.equal(Buffer.byteLength(data), fileData.length);
@@ -32,7 +30,6 @@ assert.equal(Buffer.byteLength(data), fileData.length);
var filename2 = join(common.tmpDir, 'append-sync2.txt');
fs.writeFileSync(filename2, currentFileData);
-common.error('appending to ' + filename2);
fs.appendFileSync(filename2, data);
var fileData2 = fs.readFileSync(filename2);
@@ -44,8 +41,6 @@ assert.equal(Buffer.byteLength(data) + currentFileData.length,
var filename3 = join(common.tmpDir, 'append-sync3.txt');
fs.writeFileSync(filename3, currentFileData);
-common.error('appending to ' + filename3);
-
var buf = new Buffer(data, 'utf8');
fs.appendFileSync(filename3, buf);
@@ -57,7 +52,6 @@ assert.equal(buf.length + currentFileData.length, fileData3.length);
var filename4 = join(common.tmpDir, 'append-sync4.txt');
fs.writeFileSync(filename4, currentFileData, { mode: m });
-common.error('appending to ' + filename4);
var m = 0o600;
fs.appendFileSync(filename4, num, { mode: m });
@@ -75,8 +69,6 @@ assert.equal(Buffer.byteLength('' + num) + currentFileData.length,
//exit logic for cleanup
process.on('exit', function() {
- common.error('done');
-
fs.unlinkSync(filename);
fs.unlinkSync(filename2);
fs.unlinkSync(filename3);
diff --git a/test/parallel/test-fs-append-file.js b/test/parallel/test-fs-append-file.js
index 4951fa85b4..b20323bd14 100644
--- a/test/parallel/test-fs-append-file.js
+++ b/test/parallel/test-fs-append-file.js
@@ -6,8 +6,6 @@ var join = require('path').join;
var filename = join(common.tmpDir, 'append.txt');
-common.error('appending to ' + filename);
-
var currentFileData = 'ABCD';
var n = 220;
@@ -28,11 +26,9 @@ fs.appendFile(filename, s, function(e) {
if (e) throw e;
ncallbacks++;
- common.error('appended to file');
fs.readFile(filename, function(e, buffer) {
if (e) throw e;
- common.error('file read');
ncallbacks++;
assert.equal(Buffer.byteLength(s), buffer.length);
});
@@ -46,11 +42,9 @@ fs.appendFile(filename2, s, function(e) {
if (e) throw e;
ncallbacks++;
- common.error('appended to file2');
fs.readFile(filename2, function(e, buffer) {
if (e) throw e;
- common.error('file2 read');
ncallbacks++;
assert.equal(Buffer.byteLength(s) + currentFileData.length, buffer.length);
});
@@ -61,17 +55,14 @@ var filename3 = join(common.tmpDir, 'append3.txt');
fs.writeFileSync(filename3, currentFileData);
var buf = new Buffer(s, 'utf8');
-common.error('appending to ' + filename3);
fs.appendFile(filename3, buf, function(e) {
if (e) throw e;
ncallbacks++;
- common.error('appended to file3');
fs.readFile(filename3, function(e, buffer) {
if (e) throw e;
- common.error('file3 read');
ncallbacks++;
assert.equal(buf.length + currentFileData.length, buffer.length);
});
@@ -81,14 +72,11 @@ fs.appendFile(filename3, buf, function(e) {
var filename4 = join(common.tmpDir, 'append4.txt');
fs.writeFileSync(filename4, currentFileData);
-common.error('appending to ' + filename4);
-
var m = 0o600;
fs.appendFile(filename4, n, { mode: m }, function(e) {
if (e) throw e;
ncallbacks++;
- common.error('appended to file4');
// windows permissions aren't unix
if (!common.isWindows) {
@@ -98,7 +86,6 @@ fs.appendFile(filename4, n, { mode: m }, function(e) {
fs.readFile(filename4, function(e, buffer) {
if (e) throw e;
- common.error('file4 read');
ncallbacks++;
assert.equal(Buffer.byteLength('' + n) + currentFileData.length,
buffer.length);
@@ -106,7 +93,6 @@ fs.appendFile(filename4, n, { mode: m }, function(e) {
});
process.on('exit', function() {
- common.error('done');
assert.equal(8, ncallbacks);
fs.unlinkSync(filename);
diff --git a/test/parallel/test-fs-fsync.js b/test/parallel/test-fs-fsync.js
index 661a73baef..89d104c002 100644
--- a/test/parallel/test-fs-fsync.js
+++ b/test/parallel/test-fs-fsync.js
@@ -8,27 +8,20 @@ var successes = 0;
var file = path.join(common.fixturesDir, 'a.js');
-common.error('open ' + file);
-
fs.open(file, 'a', 0o777, function(err, fd) {
- common.error('fd ' + fd);
if (err) throw err;
fs.fdatasyncSync(fd);
- common.error('fdatasync SYNC: ok');
successes++;
fs.fsyncSync(fd);
- common.error('fsync SYNC: ok');
successes++;
fs.fdatasync(fd, function(err) {
if (err) throw err;
- common.error('fdatasync ASYNC: ok');
successes++;
fs.fsync(fd, function(err) {
if (err) throw err;
- common.error('fsync ASYNC: ok');
successes++;
});
});
diff --git a/test/parallel/test-fs-write-file.js b/test/parallel/test-fs-write-file.js
index 6ac7f175f5..9ff3b3f39a 100644
--- a/test/parallel/test-fs-write-file.js
+++ b/test/parallel/test-fs-write-file.js
@@ -8,8 +8,6 @@ common.refreshTmpDir();
var filename = join(common.tmpDir, 'test.txt');
-common.error('writing to ' + filename);
-
var n = 220;
var s = '南越国是前203年至前111年存在于岭南地区的一个国家,国都位于番禺,疆域包括今天中国的广东、' +
'广西两省区的大部份地区,福建省、湖南、贵州、云南的一小部份地区和越南的北部。' +
@@ -25,11 +23,9 @@ fs.writeFile(filename, s, function(e) {
if (e) throw e;
ncallbacks++;
- common.error('file written');
fs.readFile(filename, function(e, buffer) {
if (e) throw e;
- common.error('file read');
ncallbacks++;
assert.equal(Buffer.byteLength(s), buffer.length);
});
@@ -38,17 +34,14 @@ fs.writeFile(filename, s, function(e) {
// test that writeFile accepts buffers
var filename2 = join(common.tmpDir, 'test2.txt');
var buf = new Buffer(s, 'utf8');
-common.error('writing to ' + filename2);
fs.writeFile(filename2, buf, function(e) {
if (e) throw e;
ncallbacks++;
- common.error('file2 written');
fs.readFile(filename2, function(e, buffer) {
if (e) throw e;
- common.error('file2 read');
ncallbacks++;
assert.equal(buf.length, buffer.length);
});
@@ -56,7 +49,6 @@ fs.writeFile(filename2, buf, function(e) {
// test that writeFile accepts numbers.
var filename3 = join(common.tmpDir, 'test3.txt');
-common.error('writing to ' + filename3);
var m = 0o600;
fs.writeFile(filename3, n, { mode: m }, function(e) {
@@ -69,11 +61,9 @@ fs.writeFile(filename3, n, { mode: m }, function(e) {
}
ncallbacks++;
- common.error('file3 written');
fs.readFile(filename3, function(e, buffer) {
if (e) throw e;
- common.error('file3 read');
ncallbacks++;
assert.equal(Buffer.byteLength('' + n), buffer.length);
});
@@ -81,7 +71,6 @@ fs.writeFile(filename3, n, { mode: m }, function(e) {
process.on('exit', function() {
- common.error('done');
assert.equal(6, ncallbacks);
fs.unlinkSync(filename);
diff --git a/test/parallel/test-http-304.js b/test/parallel/test-http-304.js
index e206f5bb70..06fd60f557 100644
--- a/test/parallel/test-http-304.js
+++ b/test/parallel/test-http-304.js
@@ -15,9 +15,5 @@ s.listen(common.PORT, function() {
function(err, stdout, stderr) {
if (err) throw err;
s.close();
- common.error('curled response correctly');
- common.error(common.inspect(stdout));
});
});
-
-console.log('Server running at http://127.0.0.1:' + common.PORT + '/');
diff --git a/test/parallel/test-http-blank-header.js b/test/parallel/test-http-blank-header.js
index 00a94d0b83..44f487d6b3 100644
--- a/test/parallel/test-http-blank-header.js
+++ b/test/parallel/test-http-blank-header.js
@@ -7,7 +7,6 @@ var net = require('net');
var gotReq = false;
var server = http.createServer(function(req, res) {
- common.error('got req');
gotReq = true;
assert.equal('GET', req.method);
assert.equal('/blah', req.url);
@@ -23,7 +22,6 @@ server.listen(common.PORT, function() {
var c = net.createConnection(common.PORT);
c.on('connect', function() {
- common.error('client wrote message');
c.write('GET /blah HTTP/1.1\r\n' +
'Host: mapdevel.trolologames.ru:443\r\n' +
'Cookie:\r\n' +
@@ -37,7 +35,6 @@ server.listen(common.PORT, function() {
});
c.on('close', function() {
- common.error('client close');
server.close();
});
});
diff --git a/test/parallel/test-http-client-upload-buf.js b/test/parallel/test-http-client-upload-buf.js
index 760f9c9562..57d258671c 100644
--- a/test/parallel/test-http-client-upload-buf.js
+++ b/test/parallel/test-http-client-upload-buf.js
@@ -43,8 +43,6 @@ server.on('listening', function() {
req.write(new Buffer(N));
req.end();
-
- common.error('client finished sending request');
});
process.on('exit', function() {
diff --git a/test/parallel/test-http-client-upload.js b/test/parallel/test-http-client-upload.js
index 48ebfcc74d..80a3d2aa6d 100644
--- a/test/parallel/test-http-client-upload.js
+++ b/test/parallel/test-http-client-upload.js
@@ -46,8 +46,6 @@ server.on('listening', function() {
req.write('2\n');
req.write('3\n');
req.end();
-
- common.error('client finished sending request');
});
process.on('exit', function() {
diff --git a/test/parallel/test-http-head-response-has-no-body-end.js b/test/parallel/test-http-head-response-has-no-body-end.js
index e0fdb131ed..647b7c0893 100644
--- a/test/parallel/test-http-head-response-has-no-body-end.js
+++ b/test/parallel/test-http-head-response-has-no-body-end.js
@@ -22,15 +22,12 @@ server.on('listening', function() {
method: 'HEAD',
path: '/'
}, function(res) {
- common.error('response');
res.on('end', function() {
- common.error('response end');
server.close();
responseComplete = true;
});
res.resume();
});
- common.error('req');
req.end();
});
diff --git a/test/parallel/test-http-head-response-has-no-body.js b/test/parallel/test-http-head-response-has-no-body.js
index ef1fc530db..a5293e174a 100644
--- a/test/parallel/test-http-head-response-has-no-body.js
+++ b/test/parallel/test-http-head-response-has-no-body.js
@@ -22,15 +22,12 @@ server.on('listening', function() {
method: 'HEAD',
path: '/'
}, function(res) {
- common.error('response');
res.on('end', function() {
- common.error('response end');
server.close();
responseComplete = true;
});
res.resume();
});
- common.error('req');
req.end();
});
diff --git a/test/parallel/test-http-legacy.js b/test/parallel/test-http-legacy.js
index c28e30d10f..4004749d62 100644
--- a/test/parallel/test-http-legacy.js
+++ b/test/parallel/test-http-legacy.js
@@ -4,10 +4,6 @@ var assert = require('assert');
var http = require('http');
var url = require('url');
-function p(x) {
- common.error(common.inspect(x));
-}
-
var responses_sent = 0;
var responses_recvd = 0;
var body0 = '';
@@ -39,8 +35,6 @@ var server = http.createServer(function(req, res) {
responses_sent += 1;
});
req.resume();
-
- //assert.equal('127.0.0.1', res.connection.remoteAddress);
});
server.listen(common.PORT, function() {
diff --git a/test/parallel/test-http-server.js b/test/parallel/test-http-server.js
index 9ba13ddf96..b33c19a076 100644
--- a/test/parallel/test-http-server.js
+++ b/test/parallel/test-http-server.js
@@ -23,21 +23,17 @@ var server = http.createServer(function(req, res) {
}
if (req.id == 1) {
- common.error('req 1');
assert.equal('POST', req.method);
assert.equal('/quit', url.parse(req.url).pathname);
}
if (req.id == 2) {
- common.error('req 2');
assert.equal('foo', req.headers['x-x']);
}
if (req.id == 3) {
- common.error('req 3');
assert.equal('bar', req.headers['x-x']);
this.close();
- common.error('server closed');
}
setTimeout(function() {
diff --git a/test/parallel/test-http-upgrade-server2.js b/test/parallel/test-http-upgrade-server2.js
index 9a22df52c2..dec3bab1ca 100644
--- a/test/parallel/test-http-upgrade-server2.js
+++ b/test/parallel/test-http-upgrade-server2.js
@@ -5,12 +5,10 @@ var http = require('http');
var net = require('net');
var server = http.createServer(function(req, res) {
- common.error('got req');
throw new Error('This shouldn\'t happen.');
});
server.on('upgrade', function(req, socket, upgradeHead) {
- common.error('got upgrade event');
// test that throwing an error from upgrade gets
// is uncaught
throw new Error('upgrade error');
@@ -19,7 +17,6 @@ server.on('upgrade', function(req, socket, upgradeHead) {
var gotError = false;
process.on('uncaughtException', function(e) {
- common.error('got \'clientError\' event');
assert.equal('upgrade error', e.message);
gotError = true;
process.exit(0);
@@ -30,7 +27,6 @@ server.listen(common.PORT, function() {
var c = net.createConnection(common.PORT);
c.on('connect', function() {
- common.error('client wrote message');
c.write('GET /blah HTTP/1.1\r\n' +
'Upgrade: WebSocket\r\n' +
'Connection: Upgrade\r\n' +
@@ -42,7 +38,6 @@ server.listen(common.PORT, function() {
});
c.on('close', function() {
- common.error('client close');
server.close();
});
});
diff --git a/test/parallel/test-http-write-empty-string.js b/test/parallel/test-http-write-empty-string.js
index 50a9f5d509..44a1ae9d02 100644
--- a/test/parallel/test-http-write-empty-string.js
+++ b/test/parallel/test-http-write-empty-string.js
@@ -31,7 +31,6 @@ server.listen(common.PORT, function() {
res.on('data', function(chunk) {
response += chunk;
});
- common.error('Got /hello response');
});
});
diff --git a/test/parallel/test-http.js b/test/parallel/test-http.js
index ed040ca7f6..5738fc766d 100644
--- a/test/parallel/test-http.js
+++ b/test/parallel/test-http.js
@@ -4,10 +4,6 @@ var assert = require('assert');
var http = require('http');
var url = require('url');
-function p(x) {
- common.error(common.inspect(x));
-}
-
var responses_sent = 0;
var responses_recvd = 0;
var body0 = '';
diff --git a/test/parallel/test-net-binary.js b/test/parallel/test-net-binary.js
index cf29cfe63b..484ae60c11 100644
--- a/test/parallel/test-net-binary.js
+++ b/test/parallel/test-net-binary.js
@@ -7,13 +7,6 @@ var binaryString = '';
for (var i = 255; i >= 0; i--) {
var s = '\'\\' + i.toString(8) + '\'';
var S = eval(s);
- common.error(s +
- ' ' +
- JSON.stringify(S) +
- ' ' +
- JSON.stringify(String.fromCharCode(i)) +
- ' ' +
- S.charCodeAt(0));
assert.ok(S.charCodeAt(0) == i);
assert.ok(S == String.fromCharCode(i));
binaryString += S;
@@ -21,14 +14,11 @@ for (var i = 255; i >= 0; i--) {
// safe constructor
var echoServer = net.Server(function(connection) {
- console.error('SERVER got connection');
connection.setEncoding('binary');
connection.on('data', function(chunk) {
- common.error('SERVER recved: ' + JSON.stringify(chunk));
connection.write(chunk, 'binary');
});
connection.on('end', function() {
- console.error('SERVER ending');
connection.end();
});
});
@@ -37,7 +27,6 @@ echoServer.listen(common.PORT);
var recv = '';
echoServer.on('listening', function() {
- console.error('SERVER listening');
var j = 0;
var c = net.createConnection({
port: common.PORT
@@ -45,48 +34,34 @@ echoServer.on('listening', function() {
c.setEncoding('binary');
c.on('data', function(chunk) {
- console.error('CLIENT data %j', chunk);
var n = j + chunk.length;
while (j < n && j < 256) {
- common.error('CLIENT write ' + j);
c.write(String.fromCharCode(j), 'binary');
j++;
}
if (j === 256) {
- console.error('CLIENT ending');
c.end();
}
recv += chunk;
});
c.on('connect', function() {
- console.error('CLIENT connected, writing');
c.write(binaryString, 'binary');
});
c.on('close', function() {
- console.error('CLIENT closed');
- console.dir(recv);
echoServer.close();
});
-
- c.on('finish', function() {
- console.error('CLIENT finished');
- });
});
process.on('exit', function() {
- console.log('recv: ' + JSON.stringify(recv));
-
assert.equal(2 * 256, recv.length);
var a = recv.split('');
var first = a.slice(0, 256).reverse().join('');
- console.log('first: ' + JSON.stringify(first));
var second = a.slice(256, 2 * 256).join('');
- console.log('second: ' + JSON.stringify(second));
assert.equal(first, second);
});
diff --git a/test/parallel/test-pipe-file-to-http.js b/test/parallel/test-pipe-file-to-http.js
index aac59d917c..06c7d7997e 100644
--- a/test/parallel/test-pipe-file-to-http.js
+++ b/test/parallel/test-pipe-file-to-http.js
@@ -13,19 +13,15 @@ var clientReqComplete = false;
var count = 0;
var server = http.createServer(function(req, res) {
- console.error('SERVER request');
var timeoutId;
assert.equal('POST', req.method);
req.pause();
- common.error('request paused');
setTimeout(function() {
req.resume();
- common.error('request resumed');
}, 1000);
req.on('data', function(chunk) {
- common.error('recv data! nchars = ' + chunk.length);
count += chunk.length;
});
@@ -33,7 +29,6 @@ var server = http.createServer(function(req, res) {
if (timeoutId) {
clearTimeout(timeoutId);
}
- console.log('request complete from server');
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end();
});
@@ -42,12 +37,9 @@ server.listen(common.PORT);
server.on('listening', function() {
var cmd = common.ddCommand(filename, 10240);
- console.log('dd command: ', cmd);
cp.exec(cmd, function(err, stdout, stderr) {
if (err) throw err;
- console.error('EXEC returned successfully stdout=%d stderr=%d',
- stdout.length, stderr.length);
makeRequest();
});
});
@@ -59,27 +51,16 @@ function makeRequest() {
method: 'POST'
});
- common.error('pipe!');
-
var s = fs.ReadStream(filename);
s.pipe(req);
- s.on('data', function(chunk) {
- console.error('FS data chunk=%d', chunk.length);
- });
- s.on('end', function() {
- console.error('FS end');
- });
s.on('close', function(err) {
if (err) throw err;
clientReqComplete = true;
- common.error('client finished sending request');
});
req.on('response', function(res) {
- console.error('RESPONSE', res.statusCode, res.headers);
res.resume();
res.on('end', function() {
- console.error('RESPONSE end');
server.close();
});
});