-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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: refactor test-dgram-oob-buffer #13443
test: refactor test-dgram-oob-buffer #13443
Conversation
* Change common.noop to common.mustNotCall() to verify callback is not invoked. * Add destructuring assignment for clarity. Yeah, clarity. That's why.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
address.port looked pretty weird tbh
socket.send(buf, 0, 4, address.port, address.address, common.noop); | ||
socket.send(buf, 1, 3, address.port, address.address, common.noop); | ||
socket.send(buf, 3, 1, address.port, address.address, common.noop); | ||
socket.send(buf, 0, 0, port, address, common.mustNotCall()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't the callback be called in all cases?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps something like assert.ifError
would be better here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The socket.close()
on line 43 cancels the callbacks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at the original test at defa637378a it seems like this test may no longer have the same meaning originally intended. It seems to me that the key point was the assert.throws() calls. However, they no longer throw.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
* Change common.noop to common.mustNotCall() to verify callback is not invoked. * Add destructuring assignment for clarity. Yeah, clarity. That's why. PR-URL: nodejs#13443 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Landed in 6b07065 |
* Change common.noop to common.mustNotCall() to verify callback is not invoked. * Add destructuring assignment for clarity. Yeah, clarity. That's why. PR-URL: #13443 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
* Change common.noop to common.mustNotCall() to verify callback is not invoked. * Add destructuring assignment for clarity. Yeah, clarity. That's why. PR-URL: #13443 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
* Change common.noop to common.mustNotCall() to verify callback is not invoked. * Add destructuring assignment for clarity. Yeah, clarity. That's why. PR-URL: #13443 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
invoked.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
test dgram