Skip to content

Conversation

@Trott
Copy link
Member

@TrottTrott commented Jun 3, 2017

  • Change common.noop to common.mustNotCall() to verify callback is not
    invoked.
  • Add destructuring assignment for clarity. Yeah, clarity. That's why.
Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines
Affected core subsystem(s)

test dgram

* Change common.noop to common.mustNotCall() to verify callback is not invoked. * Add destructuring assignment for clarity. Yeah, clarity. That's why.
@TrottTrott added dgram Issues and PRs related to the dgram subsystem / UDP. test Issues and PRs related to the tests. labels Jun 3, 2017
Copy link
Member

@gibfahngibfahn left a 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());
Copy link
Member

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?

Copy link
Contributor

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.

Copy link
MemberAuthor

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.

Copy link
MemberAuthor

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.

Copy link
Member

@mhdawsonmhdawson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mhdawson
Copy link
Member

Trott added a commit to Trott/io.js that referenced this pull request Jun 7, 2017
* 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 <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
@Trott
Copy link
MemberAuthor

Trott commented Jun 7, 2017

Landed in 6b07065

@TrottTrott closed this Jun 7, 2017
jasnell pushed a commit that referenced this pull request Jun 7, 2017
* 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 <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
@gibfahngibfahn mentioned this pull request Jun 15, 2017
3 tasks
MylesBorins pushed a commit that referenced this pull request Aug 14, 2017
* 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 <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
MylesBorins pushed a commit that referenced this pull request Aug 16, 2017
* 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 <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
@MylesBorinsMylesBorins mentioned this pull request Aug 16, 2017
@TrottTrott deleted the yes-i-only-used-destructuring-to-avoid-exceeding-80-chars-in-a-line branch January 13, 2022 22:45
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dgramIssues and PRs related to the dgram subsystem / UDP.testIssues and PRs related to the tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants

@Trott@mhdawson@jasnell@thefourtheye@addaleax@lpinca@cjihrig@gibfahn@MylesBorins