neobytes/src/test
Wladimir J. van der Laan 8ccc07c077
Merge pull request #6256
65b9454 Use best header chain timestamps to detect partitioning (Gavin Andresen)
2015-06-12 16:44:36 +02:00
..
data Add more script edge condition tests. 2015-05-06 10:20:18 -05:00
accounting_tests.cpp
alert_tests.cpp Use best header chain timestamps to detect partitioning 2015-06-08 16:34:58 -04:00
allocator_tests.cpp
arith_uint256_tests.cpp
base32_tests.cpp
base58_tests.cpp Remove JSON Spirit wrapper, remove JSON Spirit leftovers 2015-06-04 09:16:21 +02:00
base64_tests.cpp
bctest.py
bignum.h
bip32_tests.cpp
bitcoin-util-test.py
bloom_tests.cpp
buildenv.py.in
checkblock_tests.cpp Consensus: MOVEONLY: Move CValidationState from main consensus/validation 2015-05-15 16:05:28 +02:00
Checkpoints_tests.cpp Reduce checkpoints' effect on consensus. 2015-05-13 12:52:57 -07:00
coins_tests.cpp Keep track of memory usage in CCoinsViewCache 2015-05-11 17:56:48 -07:00
compress_tests.cpp
crypto_tests.cpp
DoS_tests.cpp
getarg_tests.cpp
hash_tests.cpp
key_tests.cpp
main_tests.cpp Chainparams: Refactor: Decouple main::GetBlockValue() from Params() [renamed GetBlockSubsidy] 2015-05-15 16:12:30 +02:00
Makefile
mempool_tests.cpp
miner_tests.cpp Merge pull request #6222 2015-06-10 09:48:00 +02:00
mruset_tests.cpp
multisig_tests.cpp
netbase_tests.cpp Fix two problems in CSubNet parsing 2015-05-26 08:59:59 +02:00
pmt_tests.cpp
policyestimator_tests.cpp Create new BlockPolicyEstimator for fee estimates 2015-05-13 10:36:24 -04:00
pow_tests.cpp
README.md
rpc_tests.cpp Changes necessary now that zero values accepted in AmountFromValue 2015-06-06 09:41:12 +02:00
rpc_wallet_tests.cpp Remove JSON Spirit wrapper, remove JSON Spirit leftovers 2015-06-04 09:16:21 +02:00
sanity_tests.cpp
scheduler_tests.cpp More robust CScheduler unit test 2015-05-16 17:59:23 -04:00
script_P2SH_tests.cpp
script_tests.cpp Remove JSON Spirit wrapper, remove JSON Spirit leftovers 2015-06-04 09:16:21 +02:00
scriptnum_tests.cpp
serialize_tests.cpp
sighash_tests.cpp Remove JSON Spirit wrapper, remove JSON Spirit leftovers 2015-06-04 09:16:21 +02:00
sigopcount_tests.cpp
skiplist_tests.cpp
test_bitcoin.cpp Merge pull request #6047 2015-05-06 12:29:07 +02:00
test_bitcoin.h
timedata_tests.cpp
transaction_tests.cpp Remove JSON Spirit wrapper, remove JSON Spirit leftovers 2015-06-04 09:16:21 +02:00
uint256_tests.cpp
univalue_tests.cpp Fix univalue handling of \u0000 characters. 2015-06-11 12:09:05 +02:00
util_tests.cpp Merge pull request #6239 2015-06-09 18:38:33 +02:00

Notes

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: http://www.alittlemadness.com/2009/03/31/c-unit-testing-with-boosttest/.