diff --git a/test/cctest/test_inspector_socket_server.cc b/test/cctest/test_inspector_socket_server.cc index 83512611824a0d..5eff9d706b2a3a 100644 --- a/test/cctest/test_inspector_socket_server.cc +++ b/test/cctest/test_inspector_socket_server.cc @@ -589,7 +589,7 @@ TEST_F(InspectorSocketServerTest, TerminatingSessionReportsDone) { TEST_F(InspectorSocketServerTest, FailsToBindToNodejsHost) { TestInspectorServerDelegate delegate; - ServerHolder server(&delegate, &loop, "nodejs.org", 0, nullptr); + ServerHolder server(&delegate, &loop, "nodejs.org", 80, nullptr); ASSERT_FALSE(server->Start()); SPIN_WHILE(uv_loop_alive(&loop)); } diff --git a/test/internet/test-dgram-membership.js b/test/internet/test-dgram-membership.js new file mode 100644 index 00000000000000..97bc1e648ad79e --- /dev/null +++ b/test/internet/test-dgram-membership.js @@ -0,0 +1,37 @@ +'use strict'; + +require('../common'); +const assert = require('assert'); +const dgram = require('dgram'); +const multicastAddress = '224.0.0.114'; + +const setup = dgram.createSocket.bind(dgram, { type: 'udp4', reuseAddr: true }); + +// addMembership() with valid socket and multicast address should not throw +{ + const socket = setup(); + assert.doesNotThrow(() => { socket.addMembership(multicastAddress); }); + socket.close(); +} + +// dropMembership() without previous addMembership should throw +{ + const socket = setup(); + assert.throws( + () => { socket.dropMembership(multicastAddress); }, + /^Error: dropMembership EADDRNOTAVAIL$/ + ); + socket.close(); +} + +// dropMembership() after addMembership() should not throw +{ + const socket = setup(); + assert.doesNotThrow( + () => { + socket.addMembership(multicastAddress); + socket.dropMembership(multicastAddress); + } + ); + socket.close(); +} diff --git a/test/parallel/test-dgram-multicast-set-interface-lo.js b/test/internet/test-dgram-multicast-set-interface-lo.js similarity index 100% rename from test/parallel/test-dgram-multicast-set-interface-lo.js rename to test/internet/test-dgram-multicast-set-interface-lo.js diff --git a/test/parallel/test-dgram-membership.js b/test/parallel/test-dgram-membership.js index 183faca1a43b6f..8729b387bf3991 100644 --- a/test/parallel/test-dgram-membership.js +++ b/test/parallel/test-dgram-membership.js @@ -76,32 +76,3 @@ const setup = dgram.createSocket.bind(dgram, { type: 'udp4', reuseAddr: true }); /^Error: dropMembership EINVAL$/); socket.close(); } - -// addMembership() with valid socket and multicast address should not throw -{ - const socket = setup(); - assert.doesNotThrow(() => { socket.addMembership(multicastAddress); }); - socket.close(); -} - -// dropMembership() without previous addMembership should throw -{ - const socket = setup(); - assert.throws( - () => { socket.dropMembership(multicastAddress); }, - /^Error: dropMembership EADDRNOTAVAIL$/ - ); - socket.close(); -} - -// dropMembership() after addMembership() should not throw -{ - const socket = setup(); - assert.doesNotThrow( - () => { - socket.addMembership(multicastAddress); - socket.dropMembership(multicastAddress); - } - ); - socket.close(); -}