[tests] Use FastRandomContext instead of boost::random::{mt19937,uniform_int_distribution}#10547
Merged
laanwj merged 1 commit intobitcoin:masterfrom Jun 8, 2017
Conversation
Member
|
Why not use our own FastRandomContext? This only uses linear random, so I'd say there's no need to add a dependency on (though getting rid of the boost one is good...) |
305618b to
27932fb
Compare
Contributor
Author
|
@laanwj Good idea! Now using |
Member
|
Yes, that's a cool minimal-impact solution using the lambda expressions. |
maflcko
suggested changes
Jun 7, 2017
src/test/scheduler_tests.cpp
Outdated
Member
There was a problem hiding this comment.
This lambda returns an unsigned expression and such can never be negative.
Member
There was a problem hiding this comment.
Good catch, hadn't realized randrange returns an unsigned value. This is a risk with auto.
Contributor
Author
There was a problem hiding this comment.
@MarcoFalke Oh, good catch! Now explicitly setting the return type. Thanks a lot for noticing!
27932fb to
32c317d
Compare
…orm_int_distribution}
32c317d to
227ae9b
Compare
Contributor
|
utACK 227ae9b. |
laanwj
added a commit
that referenced
this pull request
Jun 8, 2017
…:{mt19937,uniform_int_distribution}
227ae9b [tests] Use FastRandomContext instead of boost::random::{mt19937,uniform_int_distribution} (practicalswift)
Tree-SHA512: 1bde6c8b9498051fa2eae4913eb1f5411adea8dea1511c0df859aea57a2a7db6f5839945ddf2eccdddfa322bceacad35a5d875742db7d15e40dbea83185307bb
PastaPastaPasta
pushed a commit
to PastaPastaPasta/dash
that referenced
this pull request
Jul 8, 2019
…random::{mt19937,uniform_int_distribution}
227ae9b [tests] Use FastRandomContext instead of boost::random::{mt19937,uniform_int_distribution} (practicalswift)
Tree-SHA512: 1bde6c8b9498051fa2eae4913eb1f5411adea8dea1511c0df859aea57a2a7db6f5839945ddf2eccdddfa322bceacad35a5d875742db7d15e40dbea83185307bb
random-zebra
added a commit
to PIVX-Project/PIVX
that referenced
this pull request
Feb 9, 2022
ad5717d Lint: Add lint-includes.sh (Fuzzbawls) faba3f6 [tests] Use FastRandomContext in scheduler_tests.cpp (practicalswift) 2034bf6 Remove unused boost includes in reverselock_tests.cpp (Fuzzbawls) 3256d16 bench: Use non-throwing ParseDouble() (Fuzzbawls) 3c984d1 Remove duplicate includes (Fuzzbawls) b54e396 Declare TorReply parsing functions in torcontrol_tests (Fuzzbawls) Pull request description: This brings in the `lint-includes.sh` shell script from upstream (first introduced in bitcoin#11878) to automatically check for duplicate includes and expanded in bitcoin#13301 and bitcoin#13385 to check for the inclusion of `.cpp` files and the introduction of new boost includes, respectively. The check for enforcing bracket include syntax (bitcoin#13230) is also included, but currently disabled, as we have yet to systematically switch to that syntax preference. Three other upstream PRs are backported here as they are directly related to the removal of some boost dependencies and are very straight forward: - bitcoin#10547 - bitcoin#13291 - bitcoin#13383 **NOTE: #2711 removes the dependency on `boost/tuple/tuple.hpp`, so it makes sense to merge that first. submitting this now so the general concept/functionality can be reviewed prior to that PR being merged** ACKs for top commit: furszy: good ACK ad5717d random-zebra: utACK ad5717d and merging... Tree-SHA512: d9d32d6d5122dac52c9601cda75612d87c4e027c6f196a2382206b227fcfd2bb61d4f72df7cbf5e572d94150ad8ca6db6301bd99b0da647b9627fe342b66873f
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Use
FastRandomContextinstead ofboost::random::{mt19937,uniform_int_distribution}.Was: