diff options
author | Ben Noordhuis <info@bnoordhuis.nl> | 2015-01-23 17:11:14 +0100 |
---|---|---|
committer | Ben Noordhuis <info@bnoordhuis.nl> | 2015-01-23 17:58:27 +0100 |
commit | 5ba307a97879342ff81aa813ffd7da46b6411b1c (patch) | |
tree | 66bf0eda3c649c27ab8f57c6c69ff28302298e97 /test/parallel/test-dgram-error-message-address.js | |
parent | f4c536b749735a0240da08386d6784767f95cb5d (diff) | |
download | android-node-v8-5ba307a97879342ff81aa813ffd7da46b6411b1c.tar.gz android-node-v8-5ba307a97879342ff81aa813ffd7da46b6411b1c.tar.bz2 android-node-v8-5ba307a97879342ff81aa813ffd7da46b6411b1c.zip |
test: fix parallel/test-dgram-error-message-address
The test expects EADDRNOTAVAIL when trying to bind to address 111::1.
Systems that have IPv6 disabled throw EAFNOSUPPORT instead, however.
Update the test accordingly.
PR-URL: https://github.com/iojs/io.js/pull/575
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Diffstat (limited to 'test/parallel/test-dgram-error-message-address.js')
-rw-r--r-- | test/parallel/test-dgram-error-message-address.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/test/parallel/test-dgram-error-message-address.js b/test/parallel/test-dgram-error-message-address.js index 7842203d80..f66e86b778 100644 --- a/test/parallel/test-dgram-error-message-address.js +++ b/test/parallel/test-dgram-error-message-address.js @@ -24,10 +24,12 @@ var family_ipv6 = 'IPv6'; socket_ipv6.on('listening', assert.fail); socket_ipv6.on('error', common.mustCall(function(e) { - assert.equal(e.message, 'bind EADDRNOTAVAIL 111::1:' + common.PORT); + // EAFNOSUPPORT means IPv6 is disabled on this system. + var code = (e.code === 'EADDRNOTAVAIL' ? e.code : 'EAFNOSUPPORT'); + assert.equal(e.message, 'bind ' + code + ' 111::1:' + common.PORT); assert.equal(e.address, '111::1'); assert.equal(e.port, common.PORT); - assert.equal(e.code, 'EADDRNOTAVAIL'); + assert.equal(e.code, code); socket_ipv6.close(); })); |