test: add mustCall to test-dgram-connect-send-multi-buffer-copy.js

PR-URL: https://github.com/nodejs/node/pull/27465
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: Ouyang Yadong <oyydoibh@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Yuta Hiroto <hello@hiroppy.me>
This commit is contained in:
XGHeaven 2019-04-28 17:37:00 +08:00 committed by oyyd
parent a565853ddd
commit 92ab466b74

View File

@ -14,12 +14,12 @@ const onMessage = common.mustCall(common.mustCall((err, bytes) => {
const buf1 = Buffer.alloc(256, 'x'); const buf1 = Buffer.alloc(256, 'x');
const buf2 = Buffer.alloc(256, 'y'); const buf2 = Buffer.alloc(256, 'y');
client.on('listening', function() { client.on('listening', common.mustCall(function() {
const toSend = [buf1, buf2]; const toSend = [buf1, buf2];
client.connect(client.address().port, common.mustCall(() => { client.connect(client.address().port, common.mustCall(() => {
client.send(toSend, onMessage); client.send(toSend, onMessage);
})); }));
}); }));
client.on('message', common.mustCall(function onMessage(buf, info) { client.on('message', common.mustCall(function onMessage(buf, info) {
const expected = Buffer.concat([buf1, buf2]); const expected = Buffer.concat([buf1, buf2]);