aboutsummaryrefslogtreecommitdiff
path: root/src/test/addrman_tests.cpp
AgeCommit message (Collapse)Author
2017-05-19tests: fix spurious addrman test failureCory Fields
When inserting two addresses of the same class, from the same source, they have a 1/64 chance of colliding.
2017-05-09[tests] Clean up addrman_tests.cppJimmy Song
Cleanup request from #10287. Change "Test #:" comments to "Test:" Change BOOST_CHECK(... = ...) to BOOST_CHECK_EQUAL(..., ...) Remove three unnecessary if statements
2017-05-02[tests] Update Unit Test for addrman.h/addrman.cppJimmy Song
Add test for adding multiple addresses to address manager Clean up unnecessary modulo operations Add test for GetNewBucket's alternate method signature
2017-03-29Switch FastRandomContext to ChaCha20Pieter Wuille
2017-03-21[trivial] Fix typos in commentspracticalswift
2017-01-14[test] Avoid potential NULL pointer dereference in addrman_tests.cpppracticalswift
2017-01-05Merge #9281: Refactor: Remove using namespace <xxx> from bench/ & test/ sourcesMarcoFalke
73f4119 Refactoring: Removed using namespace <xxx> from bench/ and test/ source files. (Karl-Johan Alm)
2017-01-02Refactoring: Removed using namespace <xxx> from bench/ and test/ source files.Karl-Johan Alm
2016-12-31Increment MIT Licence copyright header year on files modified in 2016isle2983
Edited via: $ contrib/devtools/copyright_header.py update .
2016-10-17Kill insecure_random and associated global stateWladimir J. van der Laan
There are only a few uses of `insecure_random` outside the tests. This PR replaces uses of insecure_random (and its accompanying global state) in the core code with an FastRandomContext that is automatically seeded on creation. This is meant to be used for inner loops. The FastRandomContext can be in the outer scope, or the class itself, then rand32() is used inside the loop. Useful e.g. for pushing addresses in CNode or the fee rounding, or randomization for coin selection. As a context is created per purpose, thus it gets rid of cross-thread unprotected shared usage of a single set of globals, this should also get rid of the potential race conditions. - I'd say TxMempool::check is not called enough to warrant using a special fast random context, this is switched to GetRand() (open for discussion...) - The use of `insecure_rand` in ConnectThroughProxy has been replaced by an atomic integer counter. The only goal here is to have a different credentials pair for each connection to go on a different Tor circuit, it does not need to be random nor unpredictable. - To avoid having a FastRandomContext on every CNode, the context is passed into PushAddress as appropriate. There remains an insecure_random for test usage in `test_random.h`.
2016-09-22[test] Remove redundant print in addrman_testsMarcoFalke
2016-07-31net: narrow include scope after moving to netaddressCory Fields
Net functionality is no longer needed for CAddress/CAddrman/etc. now that CNetAddr/CService/CSubNet are dumb storage classes.
2016-07-31net: Split resolving out of CServiceCory Fields
2016-07-31net: Split resolving out of CNetAddrCory Fields
2016-06-13Introduce enum ServiceFlags for service flagsPieter Wuille
2016-06-13Don't require services in -addnodePieter Wuille
2016-01-27Increase test coverage for addrman and addrinfoEthan Heilman
Adds several unittests for CAddrMan and CAddrInfo. Increases the accuracy of addrman tests. Removes non-determinism in tests by overriding the random number generator. Extracts testing code from addrman class to test class.
2015-12-13Bump copyright headers to 2015MarcoFalke
2015-09-24Creates unittests for addrman, makes addrman testable.EthanHeilman
Adds several unittests for addrman to verify it works as expected. Makes small modifications to addrman to allow deterministic and targeted tests.