Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: add coverage to dgram receive error case #11241

Merged
merged 1 commit into from Feb 10, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 16 additions & 0 deletions test/parallel/test-dgram-recv-error.js
@@ -0,0 +1,16 @@
'use strict';
const common = require('../common');
const assert = require('assert');
const dgram = require('dgram');
const s = dgram.createSocket('udp4');

s.on('error', common.mustCall((err) => {
s.close();

// Don't check the full error message, as the errno is not important here.
assert(/^Error: recvmsg/.test(err));
assert.strictEqual(err.syscall, 'recvmsg');
}));

s.on('message', common.mustNotCall('no message should be received.'));
s.bind(common.mustCall(() => s._handle.onmessage(-1, s._handle, null, null)));