From e3669f8c21528ec0cbdd73ebc1bb380da4c30ab4 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Tue, 16 Aug 2016 21:11:22 -0700 Subject: [PATCH] test: favor strict equality in pummel net tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-By: Franziska Hinkelmann Reviewed-By: Colin Ihrig Reviewed-By: James M Snell --- test/pummel/test-net-connect-econnrefused.js | 2 +- test/pummel/test-net-connect-memleak.js | 2 +- test/pummel/test-net-many-clients.js | 2 +- test/pummel/test-net-timeout.js | 2 +- test/pummel/test-net-timeout2.js | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/test/pummel/test-net-connect-econnrefused.js b/test/pummel/test-net-connect-econnrefused.js index 113b04e31f..2b6dc84f37 100644 --- a/test/pummel/test-net-connect-econnrefused.js +++ b/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(); }); diff --git a/test/pummel/test-net-connect-memleak.js b/test/pummel/test-net-connect-memleak.js index 855bf1f070..833bd93fd5 100644 --- a/test/pummel/test-net-connect-memleak.js +++ b/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(); }); diff --git a/test/pummel/test-net-many-clients.js b/test/pummel/test-net-many-clients.js index cb766ec1a4..52d05b35cb 100644 --- a/test/pummel/test-net-many-clients.js +++ b/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(); }); } }); diff --git a/test/pummel/test-net-timeout.js b/test/pummel/test-net-timeout.js index 25544a6d5f..415523763e 100644 --- a/test/pummel/test-net-timeout.js +++ b/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); diff --git a/test/pummel/test-net-timeout2.js b/test/pummel/test-net-timeout2.js index c7b445f96c..6138ae7afc 100644 --- a/test/pummel/test-net-timeout2.js +++ b/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();