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

Add tests to improve internal/crypto/pbkdf2.js coverage #17730

Closed
wants to merge 3 commits into from
Closed

Add tests to improve internal/crypto/pbkdf2.js coverage #17730

wants to merge 3 commits into from

Conversation

Leko
Copy link
Contributor

@Leko Leko commented Dec 18, 2017

I added these tests

  • Add a test of _pbkdf2 where keylen is not a number
  • Add a test of _pbkdf2 where iterations < 0

Current coverage is here: https://coverage.nodejs.org/coverage-1fa59b4c7e575ca7/root/internal/crypto/diffiehellman.js.html

I cannot write a test where PBKDF2 returns -1.
I think it is coverage blockers so I create an issue (#17731).

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
Affected core subsystem(s)

test

@nodejs-github-bot nodejs-github-bot added the test Issues and PRs related to the tests. label Dec 18, 2017
@Leko Leko changed the title Add test cases to improve internal/crypto/pbkdf2.js Add tests to improve internal/crypto/pbkdf2.js Dec 18, 2017
@Leko Leko changed the title Add tests to improve internal/crypto/pbkdf2.js Add tests to improve internal/crypto/pbkdf2.js coverage Dec 18, 2017
}
);

['str', null, undefined, [], {}].forEach((i) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Small nit: please use a more descriptive variable name than i.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for your review.
I renamed i to notNumber.

@maclover7
Copy link
Contributor

@tniessen
Copy link
Member

Landed in d50e1a2, thank you!

@tniessen tniessen closed this Dec 21, 2017
tniessen pushed a commit that referenced this pull request Dec 21, 2017
PR-URL: #17730
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
@Leko Leko deleted the add_test_crypto_pbkdf2 branch December 21, 2017 13:28
MylesBorins pushed a commit that referenced this pull request Jan 8, 2018
PR-URL: #17730
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
MylesBorins pushed a commit that referenced this pull request Jan 9, 2018
PR-URL: #17730
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
@MylesBorins MylesBorins mentioned this pull request Jan 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants