Add unit test for Helper.SHA256(String) #1071

Merged
kekkyojin merged 1 commit from sha256-unittest into master 2020-12-18 12:21:40 +01:00
kekkyojin commented 2020-12-15 13:52:05 +01:00 (Migrated from github.com)

PR Checklist

Please check all that apply to this PR using "x":

  • I have checked that this PR is not a duplicate of an existing PR (open, closed or merged)
  • I have checked that this PR does not introduce a breaking change
  • This PR introduces breaking changes and I have provided a detailed explanation below

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting)
  • Refactoring (no functional changes)
  • Documentation changes
  • Other - Please describe: Unit test

Fixes

Issue Number:

What is the current behavior?

No way to ensure changes in SHA256 method result in the same output.

What is the new behavior?

Running this unit test after performing any modification to SHA256 method will allow developers and reviewers detect if the code change still returns the same result.

Other information

This PR should be merged before https://github.com/lbryio/lbry-android/pull/1067 to ensure the output is still the same. Reviewer will be able then to see test works before merging PR 1067 so it could verify changes in that PR return the same hash.

## PR Checklist <!-- For the checkbox formatting to work properly, make sure there are no spaces on either side of the "x" --> Please check all that apply to this PR using "x": - [x] I have checked that this PR is not a duplicate of an existing PR (open, closed or merged) - [x] I have checked that this PR does not introduce a breaking change - [ ] This PR introduces breaking changes and I have provided a detailed explanation below ## PR Type What kind of change does this PR introduce? - [ ] Bugfix - [ ] Feature - [ ] Code style update (formatting) - [ ] Refactoring (no functional changes) - [ ] Documentation changes - [x] Other - Please describe: Unit test ## Fixes Issue Number: ## What is the current behavior? No way to ensure changes in SHA256 method result in the same output. ## What is the new behavior? Running this unit test after performing any modification to SHA256 method will allow developers and reviewers detect if the code change still returns the same result. ## Other information This PR should be merged before https://github.com/lbryio/lbry-android/pull/1067 to ensure the output is still the same. Reviewer will be able then to see test works before merging PR 1067 so it could verify changes in that PR return the same hash. <!-- If this PR contains a breaking change, please describe the impact and solution strategy for existing applications below. -->
akinwale (Migrated from github.com) approved these changes 2020-12-18 12:21:34 +01:00
akinwale (Migrated from github.com) left a comment

Looks good. Thanks.

Looks good. Thanks.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: LBRYCommunity/lbry-android#1071
No description provided.