Back to home page

Bitcoin sources

 
 

    


 
  Name Size Date (UTC) Last indexed Description
  Name Size Date (UTC) Last indexed Description
folder Parent directory - 2015-10-23 19:15:09  
folder json/ - 2015-10-23 19:07:42  
folder obj-test/ - 2015-10-23 19:07:42  
folder obj/ - 2015-10-23 19:07:42  
folder test/ - 2015-10-23 19:07:42

The sources in this directory are unit test cases. Boost includes a unit testing framework, and since bitcoin already uses boost, it makes sense to simply use this framework rather than require developers to configure some other framework (we want as few impediments to creating unit tests as possible).
The build system is setup to compile an executable called "test_bitcoin" that runs all of the unit tests. The main source file is called test_bitcoin.cpp, which simply includes other files that contain the actual unit tests (outside of a couple required preprocessor directives). The pattern is to create one test file for each class or source file for which you want to create unit tests. The file naming convention is "<source_filename>_tests.cpp" and such files should wrap their tests in a test suite called "<source_filename>_tests". For an examples of this pattern, examine uint160_tests.cpp and uint256_tests.cpp.
For further reading, I found the following website to be helpful in explaining how the boost unit test framework works:
alittlemadness.com/2009/03/31/c-unit-testing-with-boosttest/">http://www.alittlemadness.com/2009/03/31/c-unit-testing-with-boosttest/

base58.h 8863 bytes 2015-10-23 19:07:42 2015-12-14 23:19:40  
bignum.h 14823 bytes 2015-10-23 19:07:42 2015-12-14 23:19:40  
bitcoinrpc.cpp 84878 bytes 2015-10-23 19:07:42 2015-12-14 23:19:41  
bitcoinrpc.h 310 bytes 2015-10-23 19:07:42 2015-12-14 23:19:41  
checkpoints.cpp 2469 bytes 2015-10-23 19:07:42 2015-12-14 23:19:41  
checkpoints.h 845 bytes 2015-10-23 19:07:42 2015-12-14 23:19:41  
crypter.cpp 4518 bytes 2015-10-23 19:07:42 2015-12-14 23:19:41  
crypter.h 3178 bytes 2015-10-23 19:07:42 2015-12-14 23:19:41  
db.cpp 33052 bytes 2015-10-23 19:07:42 2015-12-14 23:19:42  
db.h 12648 bytes 2015-10-23 19:07:42 2015-12-14 23:19:42  
headers.h 1494 bytes 2015-10-23 19:07:42 2015-12-14 23:19:42  
init.cpp 15568 bytes 2015-10-23 19:07:42 2015-12-14 23:19:42  
init.h 425 bytes 2015-10-23 19:07:42 2015-12-14 23:19:42  
key.h 12660 bytes 2015-10-23 19:07:42 2015-12-14 23:19:42  
keystore.cpp 5273 bytes 2015-10-23 19:07:42 2015-12-14 23:19:42  
keystore.h 3896 bytes 2015-10-23 19:07:42 2015-12-14 23:19:42  
main.cpp 97786 bytes 2015-10-23 19:07:42 2015-12-14 23:19:43  
main.h 34487 bytes 2015-10-23 19:07:42 2015-12-14 23:19:44  
makefile.unix 4073 bytes 2015-10-23 19:07:42 2015-12-14 23:19:44  
net.cpp 41870 bytes 2015-10-23 19:07:42 2015-12-14 23:19:45  
net.h 19053 bytes 2015-10-23 19:07:42 2015-12-14 23:19:45  
noui.h 2441 bytes 2015-10-23 19:07:42 2015-12-14 23:19:45  
protocol.cpp 7696 bytes 2015-10-23 19:07:42 2015-12-14 23:19:45  
protocol.h 4132 bytes 2015-10-23 19:07:42 2015-12-14 23:19:45  
script.cpp 39360 bytes 2015-10-23 19:07:42 2015-12-14 23:19:46  
script.h 20091 bytes 2015-10-23 19:07:42 2015-12-14 23:19:46  
serialize.h 45968 bytes 2015-10-23 19:07:42 2015-12-14 23:19:47  
strlcpy.h 2501 bytes 2015-10-23 19:07:42 2015-12-14 23:19:47  
uint256.h 24439 bytes 2015-10-23 19:07:42 2015-12-14 23:19:47  
util.cpp 27626 bytes 2015-10-23 19:07:42 2015-12-14 23:19:48  
util.h 17651 bytes 2015-10-23 19:07:42 2015-12-14 23:19:48  
wallet.cpp 46322 bytes 2015-10-23 19:07:42 2015-12-14 23:19:49  
wallet.h 18448 bytes 2015-10-23 19:07:42 2015-12-14 23:19:49