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 a test for func nextRandom(rand *uint64) uint64 #605

Merged
merged 3 commits into from
May 15, 2023

Conversation

Kynea0b
Copy link
Contributor

@Kynea0b Kynea0b commented May 14, 2023

Description

func nextRandom(rand *uint64) uint64 is a function defined locally. So, add a test just in case.
This test guarantees the following for this local function:

  • Initialized to a deterministic state in the seed.
  • Random numbers are generated correctly from the seed

The expected output is the same as that of general splitMix64().

`nextRandom()` is a function defined locally.
Add a test just in case.
This guarantees the same output as general splitMix64().
@Kynea0b Kynea0b requested review from torao, tnasu and ulbqb as code owners May 14, 2023 13:00
@CLAassistant
Copy link

CLAassistant commented May 14, 2023

CLA assistant check
All committers have signed the CLA.

@codecov
Copy link

codecov bot commented May 14, 2023

Codecov Report

Merging #605 (80e43e4) into main (0d8a0fd) will decrease coverage by 0.03%.
The diff coverage is n/a.

❗ Current head 80e43e4 differs from pull request most recent head 4f6f449. Consider uploading reports for the commit 4f6f449 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #605      +/-   ##
==========================================
- Coverage   66.21%   66.19%   -0.03%     
==========================================
  Files         277      277              
  Lines       36969    36969              
==========================================
- Hits        24478    24470       -8     
- Misses      10725    10730       +5     
- Partials     1766     1769       +3     

see 11 files with indirect coverage changes

@Kynea0b Kynea0b changed the title Add a test for nextRandom() Add a test for func nextRandom(rand *uint64) uint64 May 14, 2023
@ulbqb ulbqb added the C: enhancement Classification: New feature or its request, or improvement in maintainability of code label May 15, 2023
types/validator_set_test.go Outdated Show resolved Hide resolved
types/validator_set_test.go Outdated Show resolved Hide resolved
@ulbqb ulbqb self-requested a review May 15, 2023 06:05
@Kynea0b Kynea0b merged commit e3089be into Finschia:main May 15, 2023
@Kynea0b Kynea0b deleted the testForSplitMix64 branch May 15, 2023 06:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: enhancement Classification: New feature or its request, or improvement in maintainability of code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants