Browse Source

test: favor strict equality in pummel net tests

Favor strict equality checks over loose equality checks in
pummel/test-net-* tests.

PR-URL: https://github.com/nodejs/node/pull/8135
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
v4.x
Rich Trott 8 years ago
committed by Myles Borins
parent
commit
e3669f8c21
  1. 2
      test/pummel/test-net-connect-econnrefused.js
  2. 2
      test/pummel/test-net-connect-memleak.js
  3. 2
      test/pummel/test-net-many-clients.js
  4. 2
      test/pummel/test-net-timeout.js
  5. 2
      test/pummel/test-net-timeout2.js

2
test/pummel/test-net-connect-econnrefused.js

@ -19,7 +19,7 @@ function pummel() {
net.createConnection(common.PORT).on('error', function(err) {
assert.equal(err.code, 'ECONNREFUSED');
if (--pending > 0) return;
if (rounds == ROUNDS) return check();
if (rounds === ROUNDS) return check();
rounds++;
pummel();
});

2
test/pummel/test-net-connect-memleak.js

@ -16,7 +16,7 @@ var before = 0;
before = process.memoryUsage().rss;
net.createConnection(common.PORT, '127.0.0.1', function() {
assert(junk.length != 0); // keep reference alive
assert.notStrictEqual(junk.length, 0); // keep reference alive
setTimeout(done, 10);
gc();
});

2
test/pummel/test-net-many-clients.js

@ -69,7 +69,7 @@ server.listen(common.PORT, function() {
var finished_clients = 0;
for (var i = 0; i < concurrency; i++) {
runClient(function() {
if (++finished_clients == concurrency) server.close();
if (++finished_clients === concurrency) server.close();
});
}
});

2
test/pummel/test-net-timeout.js

@ -52,7 +52,7 @@ echo_server.listen(common.PORT, function() {
client.write('hello\r\n');
}, 500);
if (exchanges == 5) {
if (exchanges === 5) {
console.log('wait for timeout - should come in ' + timeout + ' ms');
starttime = new Date();
console.dir(starttime);

2
test/pummel/test-net-timeout2.js

@ -21,7 +21,7 @@ var server = net.createServer(function(socket) {
var interval = setInterval(function() {
counter++;
if (counter == seconds) {
if (counter === seconds) {
clearInterval(interval);
server.close();
socket.destroy();

Loading…
Cancel
Save