From 7858a3e52ce4398bba28fe46ffc42fc987d88b3c Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Mon, 22 Jun 2015 22:17:52 -0700 Subject: [PATCH] test: check for error on Windows Instead of not running the dgram-bind-shared-ports on Windows, check that it gets ENOTSUP. --- test/parallel/test-dgram-bind-shared-ports.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/test/parallel/test-dgram-bind-shared-ports.js b/test/parallel/test-dgram-bind-shared-ports.js index 91a48a260fbd90..dcd96d7a7c84a5 100644 --- a/test/parallel/test-dgram-bind-shared-ports.js +++ b/test/parallel/test-dgram-bind-shared-ports.js @@ -4,16 +4,21 @@ var assert = require('assert'); var cluster = require('cluster'); var dgram = require('dgram'); -// TODO XXX FIXME when windows supports clustered dgram ports re-enable this -// test -if (process.platform == 'win32') - process.exit(0); - function noop() {} if (cluster.isMaster) { var worker1 = cluster.fork(); + if (common.isWindows) { + var checkErrType = function(er) { + assert.equal(er.code, 'ENOTSUP'); + worker1.kill(); + }; + + worker1.on('error', common.mustCall(checkErrType, 1)); + return; + } + worker1.on('message', function(msg) { assert.equal(msg, 'success'); var worker2 = cluster.fork();