Skip to content

Commit

Permalink
dgram, bugfix: test error on Linux.
Browse files Browse the repository at this point in the history
  • Loading branch information
xicilion committed Mar 27, 2021
1 parent bced2f2 commit fb12430
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions test/dgram_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,16 +81,22 @@ describe('dgram', () => {
});

it('option', () => {
const s = dgram.createSocket('udp4');
s.bind(0);
var recv_size = s.getRecvBufferSize();
var send_size = s.getSendBufferSize();
s.close();

const socket = dgram.createSocket({
type: 'udp4',
recvBufferSize: 1024,
sendBufferSize: 1024
recvBufferSize: 1234,
sendBufferSize: 1234
});

socket.bind(0);

assert.equal(socket.getRecvBufferSize(), 1024);
assert.equal(socket.getSendBufferSize(), 1024);
assert.notEqual(socket.getRecvBufferSize(), recv_size);
assert.notEqual(socket.getSendBufferSize(), send_size);

socket.close();
});
Expand Down

0 comments on commit fb12430

Please sign in to comment.