Skip to content

STYLE: Replace std::rand() with std::mt19937 in IndexRangeGTest #5353

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

Conversation

N-Dekker
Copy link
Contributor

It is recommended to use C++11's random number generation facilities (like std::mt19937) to replace rand(), according to
https://en.cppreference.com/w/cpp/numeric/random/rand

@github-actions github-actions bot added type:Testing Ensure that the purpose of a class is met/the results on a wide set of test cases are correct area:Core Issues affecting the Core module type:Style Style changes: no logic impact (indentation, comments, naming) labels May 16, 2025
@N-Dekker N-Dekker force-pushed the Remove-rand-from-IndexRangeGTest branch from 1592451 to 3026346 Compare May 16, 2025 19:12
@N-Dekker N-Dekker marked this pull request as ready for review May 16, 2025 20:16
@N-Dekker
Copy link
Contributor Author

/azp run ITK.Linux

@N-Dekker
Copy link
Contributor Author

/azp run ITK.Linux.Python

2 similar comments
@N-Dekker
Copy link
Contributor Author

/azp run ITK.Linux.Python

@N-Dekker
Copy link
Contributor Author

/azp run ITK.Linux.Python

Copy link
Member

@dzenanz dzenanz left a comment

Choose a reason for hiding this comment

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

Looks good on a glance. Rebasing on master should fix the CI failures.

@N-Dekker N-Dekker marked this pull request as draft May 23, 2025 14:34
It is recommended to use C++11's random number generation facilities (like
`std::mt19937`) to replace `rand()`, according to
https://en.cppreference.com/w/cpp/numeric/random/rand
@N-Dekker N-Dekker force-pushed the Remove-rand-from-IndexRangeGTest branch from 3026346 to 02594eb Compare May 23, 2025 14:36
@N-Dekker N-Dekker marked this pull request as ready for review May 23, 2025 14:38
@hjmjohnson hjmjohnson merged commit 939c31c into InsightSoftwareConsortium:master May 26, 2025
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:Core Issues affecting the Core module type:Style Style changes: no logic impact (indentation, comments, naming) type:Testing Ensure that the purpose of a class is met/the results on a wide set of test cases are correct
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants