Back to home page

Bitcoin sources

 
 

    


 
  Name Size Date (UTC) Last indexed Description
  Name Size Date (UTC) Last indexed Description
folder Parent directory - 2016-12-30 19:14:14  
folder json/ - 2016-12-30 19:14:12  
folder obj-test/ - 2016-12-30 19:14:13  
folder obj/ - 2016-12-30 19:14:12  
folder test/ - 2016-12-30 19:14:13

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 2016-12-30 19:14:13 2016-12-30 19:20:25  
bignum.h 14823 bytes 2016-12-30 19:14:12 2016-12-30 19:20:25  
bitcoinrpc.cpp 84878 bytes 2016-12-30 19:14:13 2016-12-30 19:20:26  
bitcoinrpc.h 310 bytes 2016-12-30 19:14:12 2016-12-30 19:20:26  
checkpoints.cpp 2469 bytes 2016-12-30 19:14:13 2016-12-30 19:20:26  
checkpoints.h 845 bytes 2016-12-30 19:14:12 2016-12-30 19:20:26  
crypter.cpp 4518 bytes 2016-12-30 19:14:13 2016-12-30 19:20:26  
crypter.h 3178 bytes 2016-12-30 19:14:12 2016-12-30 19:20:26  
db.cpp 33071 bytes 2016-12-30 19:14:14 2016-12-30 19:20:26  
db.h 12648 bytes 2016-12-30 19:14:12 2016-12-30 19:20:26  
headers.h 1494 bytes 2016-12-30 19:14:13 2016-12-30 19:20:26  
init.cpp 16333 bytes 2016-12-30 19:14:14 2016-12-30 19:20:26  
init.h 425 bytes 2016-12-30 19:14:12 2016-12-30 19:20:26  
key.h 13800 bytes 2016-12-30 19:14:14 2016-12-30 19:20:26  
keystore.cpp 5273 bytes 2016-12-30 19:14:12 2016-12-30 19:20:26  
keystore.h 3896 bytes 2016-12-30 19:14:12 2016-12-30 19:20:26  
knobs.h 150 bytes 2016-12-30 19:14:14 2016-12-30 19:20:26  
main.cpp 98106 bytes 2016-12-30 19:14:14 2016-12-30 19:20:27  
main.h 34487 bytes 2016-12-30 19:14:13 2016-12-30 19:20:27  
makefile.unix 4087 bytes 2016-12-30 19:14:14 2016-12-30 19:20:27  
net.cpp 41870 bytes 2016-12-30 19:14:13 2016-12-30 19:20:27  
net.h 19069 bytes 2016-12-30 19:14:14 2016-12-30 19:20:28  
noui.h 2441 bytes 2016-12-30 19:14:12 2016-12-30 19:20:28  
protocol.cpp 7696 bytes 2016-12-30 19:14:13 2016-12-30 19:20:28  
protocol.h 4132 bytes 2016-12-30 19:14:14 2016-12-30 19:20:28  
script.cpp 39360 bytes 2016-12-30 19:14:13 2016-12-30 19:20:28  
script.h 20091 bytes 2016-12-30 19:14:13 2016-12-30 19:20:28  
serialize.h 45898 bytes 2016-12-30 19:14:14 2016-12-30 19:20:30  
strlcpy.h 2501 bytes 2016-12-30 19:14:13 2016-12-30 19:20:30  
uint256.h 24439 bytes 2016-12-30 19:14:13 2016-12-30 19:20:30  
util.cpp 27856 bytes 2016-12-30 19:14:14 2016-12-30 19:20:30  
util.h 17797 bytes 2016-12-30 19:14:14 2016-12-30 19:20:30  
wallet.cpp 46322 bytes 2016-12-30 19:14:13 2016-12-30 19:20:31  
wallet.h 18448 bytes 2016-12-30 19:14:13 2016-12-30 19:20:31