From 462a8f8652dafaf01f05623dd311e57e226cead4 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Thu, 11 Mar 2010 12:39:50 -0800 Subject: [PATCH] add error listener to test-net-pingpong --- test/simple/test-net-pingpong.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/simple/test-net-pingpong.js b/test/simple/test-net-pingpong.js index 560f943a51..94b983690b 100644 --- a/test/simple/test-net-pingpong.js +++ b/test/simple/test-net-pingpong.js @@ -35,7 +35,12 @@ function pingPongTest (port, host) { socket.close(); }); + socket.addListener("error", function (e) { + throw e; + }); + socket.addListener("close", function () { + puts('server socket closed'); assert.equal(false, socket.writable); assert.equal(false, socket.readable); socket.server.close(); @@ -78,10 +83,15 @@ function pingPongTest (port, host) { }); client.addListener("close", function () { + puts('client closed'); assert.equal(N+1, count); assert.equal(true, sent_final_ping); tests_run += 1; }); + + client.addListener("error", function (e) { + throw e; + }); }); server.listen(port, host);