zcashd/src/test
zkbot eaaa5f625f Auto merge of #2082 - str4d:univalue-subtree, r=bitcartel
Add UniValue as subtree

Cherry-picked from the following upstream PRs:

- bitcoin/bitcoin#6637
- bitcoin/bitcoin#6239
- bitcoin/bitcoin#6379
- bitcoin/bitcoin#6456
- bitcoin/bitcoin#6788
2017-02-10 07:46:58 +00:00
..
data Add tests for witness `element` and tree `last` methods. Strengthen testing by inserting a different commitment into the tree at each step. 2016-11-14 10:13:06 -07:00
Checkpoints_tests.cpp Remove the mainnet checkpoints. 2016-06-29 14:21:03 -06:00
DoS_tests.cpp Refactor: replace calls to GetTxid() with GetHash() 2016-09-07 15:12:09 -07:00
Makefile
README.md
accounting_tests.cpp Refactor: replace calls to GetTxid() with GetHash() 2016-09-07 15:12:09 -07:00
addrman_tests.cpp Increase test coverage for addrman and addrinfo 2016-05-24 12:55:33 -07:00
alert_tests.cpp Migrate Zcash-specific code to UniValue 2017-02-10 00:52:57 +00:00
allocator_tests.cpp
arith_uint256_tests.cpp
base32_tests.cpp
base58_tests.cpp [Univalue] add univalue over subtree 2017-02-10 02:18:51 +00:00
base64_tests.cpp
bctest.py
bignum.h Assert that new OpenSSL allocators succeed 2016-09-29 17:58:29 +13:00
bip32_tests.cpp
bitcoin-util-test.py
bloom_tests.cpp Remove #1144 from bloom_tests by reverting to commit 5012190. 2016-09-07 15:12:09 -07:00
buildenv.py.in
checkblock_tests.cpp Skip JoinSplit verification before the last checkpoint 2016-12-09 21:06:45 +13:00
coins_tests.cpp Regression test. 2016-12-06 12:54:53 -07:00
compress_tests.cpp
crypto_tests.cpp
equihash_tests.cpp Add compile flag to disable compilation of mining code 2017-01-30 21:14:46 +01:00
getarg_tests.cpp
hash_tests.cpp
key_tests.cpp Re-encode hard-coded addresses in tests 2016-10-03 23:53:14 -07:00
main_tests.cpp Update tests to account for decreased block interval 2016-06-10 12:02:47 +12:00
mempool_tests.cpp Refactor: replace calls to GetTxid() with GetHash() 2016-09-07 15:12:09 -07:00
miner_tests.cpp Update tests for new genesis blocks 2016-10-28 02:56:15 -07:00
mruset_tests.cpp
multisig_tests.cpp Refactor: replace calls to GetTxid() with GetHash() 2016-09-07 15:12:09 -07:00
netbase_tests.cpp
pmt_tests.cpp Refactor: replace calls to GetTxid() with GetHash() 2016-09-07 15:12:09 -07:00
policyestimator_tests.cpp Refactor: replace calls to GetTxid() with GetHash() 2016-09-07 15:12:09 -07:00
pow_tests.cpp Update tests for new genesis blocks 2016-10-28 02:56:15 -07:00
reverselock_tests.cpp
rpc_tests.cpp rpc: Make ValueFromAmount always return 8 decimals 2017-02-10 02:18:59 +00:00
rpc_wallet_tests.cpp [Univalue] add univalue over subtree 2017-02-10 02:18:51 +00:00
sanity_tests.cpp
scheduler_tests.cpp
script_P2SH_tests.cpp Refactor: replace calls to GetTxid() with GetHash() 2016-09-07 15:12:09 -07:00
script_tests.cpp [Univalue] add univalue over subtree 2017-02-10 02:18:51 +00:00
scriptnum_tests.cpp
serialize_tests.cpp New implementation of incremental merkle tree 2016-04-28 16:07:52 -06:00
sha256compress_tests.cpp Remove unused code in libzerocash util.cpp 2016-05-18 11:22:29 -06:00
sighash_tests.cpp [Univalue] add univalue over subtree 2017-02-10 02:18:51 +00:00
sigopcount_tests.cpp
skiplist_tests.cpp
test_bitcoin.cpp Deallocate the public parameters during Shutdown. 2016-08-26 16:55:43 -06:00
test_bitcoin.h
timedata_tests.cpp
transaction_tests.cpp Auto merge of #2082 - str4d:univalue-subtree, r=bitcartel 2017-02-10 07:46:58 +00:00
uint256_tests.cpp
univalue_tests.cpp univalue: Avoid unnecessary roundtrip through double for numbers 2017-02-10 02:19:01 +00:00
util_tests.cpp rpc: Accept scientific notation for monetary amounts in JSON 2017-02-10 02:18:58 +00:00

README.md

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.

Add the source files to /src/Makefile.test.include to add them to the build.

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/.