- Creates unittests for addrman, while not all addrman behavior is covered by these tests they provide a useful starting place and increase code coverage.
- Minor modifications to addrman to allow deterministic and effective testing.
Creates unittests for addrman, makes addrman more testable. #6720
pull eth0 wants to merge 1 commits into bitcoin:master from EthanHeilman:unittest changing 4 files +199 −6-
eth0 commented at 3:55 pm on September 24, 2015: none
-
laanwj added the label Tests on Sep 24, 2015
-
in src/addrman.h: in 554903bd8d outdated
568@@ -567,6 +569,14 @@ class CAddrMan 569 Check(); 570 } 571 } 572+ 573+ 574+ #ifdef __ADDRMAN_TEST__
jonasschnelli commented at 4:07 pm on September 24, 2015:Would it make sense to link this to the configure flag--enable-tests
?eth0 commented at 5:04 pm on September 24, 2015: none@jonasschnelli What advantages are offered by using the –enable-tests flag?
Also how would one learn the value of –enable-tests at the level necessary to change code behavior? I suppose you could move the MakeDeterministic method into its own source file and then only include that source when building tests but that is a bit complicated.
I could also remove the ifdef ADDRMAN_TEST check completely.
jonasschnelli commented at 6:16 pm on September 24, 2015: contributor@eth0: maybe remote the
#ifdef __ADDRMAN_TEST__
completely or export theENABLE_TESTS
overAC_DEFINE_UNQUOTED()
inconfigure.ac
and use this define to determine if you compile theMakeDeterministic()
function?Is the
newOnly
related to the new unit-tests?Nice work! Concept ACK.
Creates unittests for addrman, makes addrman testable.
Adds several unittests for addrman to verify it works as expected. Makes small modifications to addrman to allow deterministic and targeted tests.
eth0 commented at 7:28 pm on September 24, 2015: none@jonasschnelli
I removed the macro completely.newOnly
is related to the unit-tests since I need a way to test if an addr is in the new or tried tables.I am developing some non-unittest code which builds on the
newOnly
functionality but it is independent of this pull-request.dcousens commented at 6:46 am on September 25, 2015: contributorconcept ACK, non test-code utACKEthanHeilman commented at 5:42 pm on September 30, 2015: contributor@dcousens Anything I can do to move this along? I’ve tested this code in the Bitcoin client and the unittests all pass.jgarzik commented at 9:46 am on October 1, 2015: contributorut ACK - doesn’t test very much, but what it does test, looks correct based on quick review :)laanwj merged this on Oct 7, 2015laanwj closed this on Oct 7, 2015
laanwj referenced this in commit d479311dba on Oct 7, 2015laanwj commented at 1:00 pm on October 7, 2015: memberutACKluke-jr referenced this in commit 7a9724adb8 on Jan 9, 2016MarcoFalke locked this on Sep 8, 2021
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-11-17 18:12 UTC
More mirrored repositories can be found on mirror.b10c.me