diff options
author | Oleg Efimov <efimovov@gmail.com> | 2010-12-05 22:15:30 +0300 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2010-12-05 15:41:58 -0800 |
commit | 0665f0271e71270dc23ec5231b245adfe709a49f (patch) | |
tree | 5679d97d06ac451bf33d60c17bbdcb57967907da /test/simple/test-net-server-max-connections.js | |
parent | 47c40bf18d393654b4f1d64ad386486c3f248942 (diff) | |
download | node-new-0665f0271e71270dc23ec5231b245adfe709a49f.tar.gz |
GJSLint all simple tests exclude http-*, url, path
Diffstat (limited to 'test/simple/test-net-server-max-connections.js')
-rw-r--r-- | test/simple/test-net-server-max-connections.js | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/test/simple/test-net-server-max-connections.js b/test/simple/test-net-server-max-connections.js index f404ad5f3d..293880931c 100644 --- a/test/simple/test-net-server-max-connections.js +++ b/test/simple/test-net-server-max-connections.js @@ -26,12 +26,12 @@ server.listen(common.PORT, function() { } }); -server.maxConnections = N/2; +server.maxConnections = N / 2; console.error('server.maxConnections = %d', server.maxConnections); -function makeConnection (index) { +function makeConnection(index) { setTimeout(function() { var c = net.createConnection(common.PORT); var gotData = false; @@ -51,12 +51,14 @@ function makeConnection (index) { console.error('closed %d', index); closes++; - if (closes < N/2) { - assert.ok(server.maxConnections <= index, - index + ' was one of the first closed connections but shouldnt have been'); + if (closes < N / 2) { + assert.ok(server.maxConnections <= index, + index + + ' was one of the first closed connections ' + + 'but shouldnt have been'); } - if (closes === N/2) { + if (closes === N / 2) { var cb; console.error('calling wait callback.'); while (cb = waits.shift()) { @@ -66,9 +68,11 @@ function makeConnection (index) { } if (index < server.maxConnections) { - assert.equal(true, gotData, index + ' didn\'t get data, but should have'); + assert.equal(true, gotData, + index + ' didn\'t get data, but should have'); } else { - assert.equal(false, gotData, index + ' got data, but shouldn\'t have'); + assert.equal(false, gotData, + index + ' got data, but shouldn\'t have'); } }); }, index); |