-
Notifications
You must be signed in to change notification settings - Fork 37.7k
Creates unittests for addrman, makes addrman more testable. #6720
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
eth0
commented
Sep 24, 2015
- 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.
@@ -567,6 +569,14 @@ class CAddrMan | |||
Check(); | |||
} | |||
} | |||
|
|||
|
|||
#ifdef __ADDRMAN_TEST__ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it make sense to link this to the configure flag --enable-tests
?
@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. |
@eth0: maybe remote the Is the Nice work! |
Adds several unittests for addrman to verify it works as expected. Makes small modifications to addrman to allow deterministic and targeted tests.
@jonasschnelli
I am developing some non-unittest code which builds on the |
concept ACK, non test-code utACK |
@dcousens Anything I can do to move this along? |
ut ACK - doesn't test very much, but what it does test, looks correct based on quick review :) |
1534d9a 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. (EthanHeilman)
utACK |
Adds several unittests for addrman to verify it works as expected. Makes small modifications to addrman to allow deterministic and targeted tests. Github-Pull: bitcoin#6720 Rebased-From: 1534d9a