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: testing noAssert in buffer.write() #10790

Closed
wants to merge 1 commit into from

Conversation

larissayvette
Copy link
Contributor

@larissayvette larissayvette commented Jan 13, 2017

Checklist
  • commit message follows commit guidelines
Affected core subsystem(s)

test

Test for noAssert in buffer.write() files and inluded buffer.writeDouble* and buffer.writeFloat* as it was not present in the first commit

@nodejs-github-bot nodejs-github-bot added test Issues and PRs related to the tests. lts-watch-v6.x labels Jan 13, 2017
@mscdex mscdex added the buffer Issues and PRs related to the buffer subsystem. label Jan 13, 2017
@Trott
Copy link
Member

Trott commented Jan 13, 2017

buffer.writeDouble* and buffer.writeFloat*

You should be able to run these tests for those functions as well. The issue with those functions will only manifest if you request something out of range. Since this test requests valid ranges with noAssert enabled, it should be OK.

@larissayvette
Copy link
Contributor Author

@Trott included those test cases buffer.writeDouble* and buffer.writeFloat*

Copy link
Member

@Trott Trott left a comment

Choose a reason for hiding this comment

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

LGTM if CI is green

@Trott
Copy link
Member

Trott commented Jan 14, 2017


assert.throws(
() => Buffer.alloc(-1)[funx](0),
/^RangeError: "size" argument must not be negative$/
Copy link
Contributor

Choose a reason for hiding this comment

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

This functionality is tested every time. Wouldn't it be enough to test this only once?

Copy link
Member

Choose a reason for hiding this comment

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

Oh, yes, that's testing the wrong thing. It should test a legit alloc() call and an out-of-range call to the write function being tested. @larissayvette can you adjust it?

@Trott
Copy link
Member

Trott commented Jan 26, 2017

Changes LGTM

@Trott
Copy link
Member

Trott commented Jan 26, 2017

@Trott
Copy link
Member

Trott commented Jan 26, 2017

Single failure on SmartOS is unrelated, opened an issue for it.

Trott pushed a commit to Trott/io.js that referenced this pull request Jan 26, 2017
Add test to cover previously untested `noAssert` functionality in
buf.write*() functions.

PR-URL: nodejs#10790
Reviewed-By: Rich Trott <rtrott@gmail.com>
@Trott
Copy link
Member

Trott commented Jan 26, 2017

Landed in 084acc8.
Thanks for the contribution! 🎉

@Trott Trott closed this Jan 26, 2017
evanlucas pushed a commit that referenced this pull request Jan 31, 2017
Add test to cover previously untested `noAssert` functionality in
buf.write*() functions.

PR-URL: #10790
Reviewed-By: Rich Trott <rtrott@gmail.com>
@italoacasas italoacasas mentioned this pull request Jan 31, 2017
@larissayvette larissayvette deleted the test-write branch February 10, 2017 17:42
jasnell pushed a commit that referenced this pull request Mar 8, 2017
Add test to cover previously untested `noAssert` functionality in
buf.write*() functions.

PR-URL: #10790
Reviewed-By: Rich Trott <rtrott@gmail.com>
@jasnell
Copy link
Member

jasnell commented Mar 8, 2017

This would need a backport PR to land in v4

MylesBorins pushed a commit that referenced this pull request Mar 9, 2017
Add test to cover previously untested `noAssert` functionality in
buf.write*() functions.

PR-URL: #10790
Reviewed-By: Rich Trott <rtrott@gmail.com>
@MylesBorins MylesBorins mentioned this pull request Mar 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
buffer Issues and PRs related to the buffer subsystem. test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants