Browse files

test: add missing assertion

This commit adds an assertion to an existing try...catch
statement. Unfortunately, assert.throws() cannot be used
because the operation succeeds on some platforms, throws
EINVAL on some platforms, and throws ENOPROTOOPT on

PR-URL: #15519
Reviewed-By: Luigi Pinca <>
Reviewed-By: Yuta Hiroto <>
Reviewed-By: James M Snell <>
  • Loading branch information...
cjihrig committed Sep 18, 2017
1 parent db8c92f commit 2a53165aa032532c0290246fd81a416db02b7b8e
Showing with 5 additions and 2 deletions.
  1. +5 −2 test/parallel/test-dgram-multicast-set-interface.js
@@ -33,11 +33,14 @@ const dgram = require('dgram');
socket.on('listening', common.mustCall(() => {
// Try to set with an invalid interfaceAddress (wrong address class)
// This operation succeeds on some platforms, throws `EINVAL` on some
// platforms, and throws `ENOPROTOOPT` on others. This is unpleasant, but
// we should at least test for it.
try {
throw new Error('Not detected.');
} catch (e) {
console.error(`setMulticastInterface: wrong family error is: ${e}`);
assert(e.code === 'EINVAL' || e.code === 'ENOPROTOOPT');

0 comments on commit 2a53165

Please sign in to comment.