Skip to content

Commit

Permalink
test: check for error on Windows
Browse files Browse the repository at this point in the history
Instead of not running the dgram-bind-shared-ports
on Windows, check that it gets ENOTSUP.

PR-URL: #2035
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
  • Loading branch information
Trott committed Jun 25, 2015
1 parent c87c34c commit 8e9089a
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions test/parallel/test-dgram-bind-shared-ports.js
Expand Up @@ -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();
Expand Down

0 comments on commit 8e9089a

Please sign in to comment.