From 43cdbec3be496cf542dee8818746ec896a756129 Mon Sep 17 00:00:00 2001 From: koichik Date: Fri, 26 Aug 2011 01:01:08 +0900 Subject: [PATCH] test: simple/test-tls-client-abort fails on SunOS Fixes #1583. --- test/simple/test-tls-client-abort.js | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/test/simple/test-tls-client-abort.js b/test/simple/test-tls-client-abort.js index 8f10f0ff0ad..4ae5e65e1e6 100644 --- a/test/simple/test-tls-client-abort.js +++ b/test/simple/test-tls-client-abort.js @@ -30,23 +30,15 @@ var fs = require('fs'); var tls = require('tls'); var path = require('path'); -(function() { - var cert = fs.readFileSync(path.join(common.fixturesDir, 'test_cert.pem')); - var key = fs.readFileSync(path.join(common.fixturesDir, 'test_key.pem')); +var cert = fs.readFileSync(path.join(common.fixturesDir, 'test_cert.pem')); +var key = fs.readFileSync(path.join(common.fixturesDir, 'test_key.pem')); - var errorEmitted = false; - - process.on('exit', function() { - assert.ok(!errorEmitted); - }); - - var conn = tls.connect(common.PORT, {cert:cert, key:key}, function() { - assert.ok(false); // callback should never be executed - }); +var conn = tls.connect(common.PORT, {cert:cert, key:key}, function() { + assert.ok(false); // callback should never be executed +}); +conn.on('error', function() { +}); +assert.doesNotThrow(function() { conn.destroy(); - - conn.on('error', function() { - errorEmitted = true; - }); -})(); +});