MarcoFalke
fa1177e3d7
refactor: Avoid std::string format strings
...
Pass literal format strings instead of std::string so formats can be
checked at compile time.
Co-authored-by: Ryan Ofsky <ryan@ofsky.org >
Co-authored-by: stickies-v <stickies-v@protonmail.com >
2024-11-14 12:44:13 +01:00
MarcoFalke
fa0fe08eca
scripted-diff: [test] Use g_rng/m_rng directly
...
-BEGIN VERIFY SCRIPT-
# Use m_rng in unit test files
ren() { sed -i "s:\<$1\>:$2:g" $( git grep -l "$1" src/test/*.cpp src/wallet/test/*.cpp src/test/util/setup_common.cpp ) ; }
ren InsecureRand32 m_rng.rand32
ren InsecureRand256 m_rng.rand256
ren InsecureRandBits m_rng.randbits
ren InsecureRandRange m_rng.randrange
ren InsecureRandBool m_rng.randbool
ren g_insecure_rand_ctx m_rng
ren g_insecure_rand_ctx_temp_path g_rng_temp_path
-END VERIFY SCRIPT-
2024-08-26 11:19:52 +02:00
Ryan Ofsky
68f77dd21e
test: refactor: Pass rng parameters to test functions
...
Add FastRandomContext parameter to the utility function
AddTestCoin(), and a few local test functions and classes.
2024-08-26 11:19:16 +02:00
Ryan Ofsky
3dc527f460
test: refactor: Give unit test functions access to test state
...
Add unit test subclasses as needed so unit test functions that need to access
members like m_rng can reference it directly.
2024-08-21 23:27:55 +02:00
Pieter Wuille
6ecda04fef
random: drop ad-hoc Shuffle in favor of std::shuffle
...
Benchmarks show it is no longer faster with modern standard C++ libraries,
and the debug-mode failure due to self-move has been fixed as well.
2024-07-06 09:06:36 -04:00
Hennadii Stepanov
7e975e6cf8
clang-tidy: Add performance-inefficient-vector-operation check
...
https://clang.llvm.org/extra/clang-tidy/checks/performance/inefficient-vector-operation.html
2023-03-26 20:17:55 +01:00
Jon Atack
81f5ade2a3
Move random test util code from setup_common to random
...
as many of the unit tests don't use this code
2023-02-06 12:26:04 -08:00
Hennadii Stepanov
f47dda2c58
scripted-diff: Bump copyright headers
...
-BEGIN VERIFY SCRIPT-
./contrib/devtools/copyright_header.py update ./
-END VERIFY SCRIPT-
Commits of previous years:
* 2020: fa0074e2d8
* 2019: aaaaad6ac9
2021-12-30 19:36:57 +02:00
MarcoFalke
fa4ec1c0bd
Make GenTxid boolean constructor private
2021-10-22 12:32:16 +02:00
Pieter Wuille
fd9a0060f0
Report and verify expirations
2020-10-12 12:14:53 -07:00
Pieter Wuille
3c7fe0e5a0
Add txrequest unit tests
...
Add unit tests for TxRequestTracker. Several scenarios are tested,
randomly interleaved with eachother.
Includes a test by Antoine Riard (ariard).
2020-10-12 12:08:43 -07:00