aboutsummaryrefslogtreecommitdiff
path: root/src/test
AgeCommit message (Collapse)Author
2017-03-07Merge #9555: [test] Avoid reading a potentially uninitialized variable in ↵MarcoFalke
tx_invalid-test (transaction_tests.cpp) 8455e36 [test] Avoid reading a potentially uninitialized variable in tx_invalid-test (practicalswift) Tree-SHA512: 1064cdd5c9e4612a05397a5880535d93dbb18dec4897b4bbda9e6ad78d30f4c72303e4d23159398f1b33545ff5819e739e374d7cde757e402b26c355268a2319
2017-03-03Merge #8808: Do not shadow variables (gcc set)Wladimir J. van der Laan
ad1ae7a Check and enable -Wshadow by default. (Pavel Janík) 9de90bb Do not shadow variables (gcc set) (Pavel Janík) Tree-SHA512: 9517feb423dc8ddd63896016b25324673bfbe0bffa97f22996f59d7a3fcbdc2ebf2e43ac02bc067546f54e293e9b2f2514be145f867321e9031f895c063d9fb8
2017-03-02test: Report InitBlockIndex resultWladimir J. van der Laan
If InitBlockIndex fails, then it will segfault later. Same for the later ActivateBestChain. BOOST_REQUIRE the result, so that an error will be reported and the test case aborted.
2017-03-01Merge #9821: util: Specific GetOSRandom for Linux/FreeBSD/OpenBSDWladimir J. van der Laan
7e6dcd9 random: Add fallback if getrandom syscall not available (Wladimir J. van der Laan) 7cad849 sanity: Move OS random to sanity check function (Wladimir J. van der Laan) aa09ccb squashme: comment that NUM_OS_RANDOM_BYTES should not be changed lightly (Wladimir J. van der Laan) 224e6eb util: Specific GetOSRandom for Linux/FreeBSD/OpenBSD (Wladimir J. van der Laan) Tree-SHA512: 9fd408b1316c69de86674f342339b2f89192fd317c8c036b5df4320f828fa263c7966146bfc1904c51137ee4a26e4cb0f560b2cd05e18cde4d808b9b92ad15c4
2017-03-01Merge #9868: Abstract out the command line options for block assemblyWladimir J. van der Laan
277b472 Run miner_tests with fixed options (Pieter Wuille) 48faf0b Abstract out BlockAssembler options (Pieter Wuille) Tree-SHA512: 8e910904864c8653fb0358d820a4181d0496bdcbc3454c17a742af7505bfb59f7078c6d0faa9c753bdaf23b6d93d228a09913cc867fbddccd515483ebe7bfad0
2017-02-28Merge #9867: Replace remaining sprintf with snprintfWladimir J. van der Laan
19cafc6 test: Replace remaining sprintf with snprintf (Wladimir J. van der Laan) 0a17714 uint256: replace sprintf with HexStr and reverse-iterator (Wladimir J. van der Laan) Tree-SHA512: 2ba1dd4d25e1cbfff4d67b2f483448aa7c34ab5c799cddd48ba5826e5fa6df425abe35e244aaf4c52db9fccfb4d2a25a14bb4597bf9d1fce95991f270da6bb26
2017-02-27Merge #9350: [Trivial] Adding label for amount inside of ↵MarcoFalke
tx_valid/tx_invalid.json 988ce2d Adding 'amount' label to tx_valid/tx_invalid.json files (Chris Stewart) Tree-SHA512: 11c216c6565ecaa5ff4eb6122f87d3b28f89db52d1e473c0678f61c240e133698adb05e717bfb9d3db36409dfb230b902dca4029a58633be36c9f85e0db3d973
2017-02-27test: Replace remaining sprintf with snprintfWladimir J. van der Laan
Use of `sprintf` is seen as a red flag as many of its uses are insecure. OpenBSD warns about it while compiling, and some modern platforms, e.g. [cloudlibc from cloudabi](https://github.com/NuxiNL/cloudlibc) don't even provide it anymore. Although our uses of these functions are secure, it can't hurt to replace them anyway. There are only 3 occurences left, all in the tests.
2017-02-26Run miner_tests with fixed optionsPieter Wuille
2017-02-23BIP32 extra test vectorPieter Wuille
2017-02-22Merge #9815: Trivial: use EXIT_ codes instead of magic numbersWladimir J. van der Laan
a87d02a use EXIT_ codes instead of magic numbers (Marko Bencun)
2017-02-22sanity: Move OS random to sanity check functionWladimir J. van der Laan
Move the OS random test to a sanity check function that is called every time bitcoind is initialized. Keep `src/test/random_tests.cpp` for the case that later random tests are added, and keep a rudimentary test that just calls the sanity check.
2017-02-21util: Specific GetOSRandom for Linux/FreeBSD/OpenBSDWladimir J. van der Laan
These are available in sandboxes without access to files or devices. Also [they are safer and more straightforward](https://en.wikipedia.org/wiki/Entropy-supplying_system_calls) to use than `/dev/urandom` as reading from a file has quite a few edge cases: - Linux: `getrandom(buf, buflen, 0)`. [getrandom(2)](http://man7.org/linux/man-pages/man2/getrandom.2.html) was introduced in version 3.17 of the Linux kernel. - OpenBSD: `getentropy(buf, buflen)`. The [getentropy(2)](http://man.openbsd.org/cgi-bin/man.cgi/OpenBSD-current/man2/getentropy.2) function appeared in OpenBSD 5.6. - FreeBSD and NetBSD: `sysctl(KERN_ARND)`. Not sure when this was added but it has existed for quite a while. Alternatives: - Linux has sysctl `CTL_KERN` / `KERN_RANDOM` / `RANDOM_UUID` which gives 16 bytes of randomness. This may be available on older kernels, however [sysctl is deprecated on Linux](https://lwn.net/Articles/605392/) and even removed in some distros so we shouldn't use it. Add tests for `GetOSRand()`: - Test that no error happens (otherwise `RandFailure()` which aborts) - Test that all 32 bytes are overwritten (initialize with zeros, try multiple times) Discussion: - When to use these? Currently they are always used when available. Another option would be to use them only when `/dev/urandom` is not available. But this would mean these code paths receive less testing, and I'm not sure there is any reason to prefer `/dev/urandom`. Closes: #9676
2017-02-21Merge #9727: Remove fallbacks for boost_filesystem < v3Wladimir J. van der Laan
056aba2 Remove fallbacks for boost_filesystem < v3 (Wladimir J. van der Laan)
2017-02-21use EXIT_ codes instead of magic numbersMarko Bencun
To be consistent with other exit() calls.
2017-02-16[Trivial] Update comments referencing main.cppCryptAxe
2017-02-10Remove fallbacks for boost_filesystem < v3Wladimir J. van der Laan
Minimum boost version was bumped to 1.47.0 in #8920, which means the configure step won't even pass with older boost. This version has boost filesystem v3, which means the (crappy) fallbacks for older versions can go.
2017-02-05Init ECC context for test_bitcoin_fuzzy.Gregory Maxwell
This avoids calling things like pubkey_parse with a null context argument.
2017-02-02net: Disallow sending messages until the version handshake is completeCory Fields
This is a change in behavior, though it's much more sane now than before.
2017-02-02Merge #9556: Remove redundant semicolonsWladimir J. van der Laan
8fc6989 Remove redundant semicolons (practicalswift)
2017-01-30Merge #9647: Skip RAII event tests if libevent is built without ↵Wladimir J. van der Laan
event_set_mem_functions 95f97f4 Skip RAII event tests if libevent is built without event_set_mem_functions (Luke Dashjr)
2017-01-30Merge #9615: Wallet incremental feeWladimir J. van der Laan
4b189c1 Change bumpfee result value from 'oldfee' to 'origfee'. (Alex Morcos) 0c0c63f Introduce WALLET_INCREMENTAL_RELAY_FEE (Alex Morcos) e8021ec Use CWallet::GetMinimumFee in bumpfee (Alex Morcos) ae9719a Refactor GetMinimumFee to give option of providing targetFee (Alex Morcos) fe8e8ef [rpc] Add incremental relay fee to getnetworkinfo (Alex Morcos) 6b331e6 Fix to have miner test aware of new separate block min tx fee (Alex Morcos) de6400d Fix missing use of dustRelayFee (Alex Morcos) 5b15870 Use incrementalRelayFee for BIP 125 replacement (Alex Morcos)
2017-01-28Skip RAII event tests if libevent is built without event_set_mem_functionsLuke Dashjr
2017-01-27[trivial] Fix typos in commentspracticalswift
2017-01-22Merge #9610: [Trivial] Grammar and typo correction (laudaa)MarcoFalke
5c66d41 [Trivial] Grammar and typo correction (Lauda)
2017-01-22[Trivial] Grammar and typo correctionLauda
Minor corrections in src\test\* .
2017-01-22Merge #9554: [test] Avoid potential NULL pointer dereference in ↵MarcoFalke
addrman_tests.cpp afab9f4 [test] Avoid potential NULL pointer dereference in addrman_tests.cpp (practicalswift)
2017-01-21[test] Avoid reading a potentially uninitialized variable in tx_invalid-testpracticalswift
Prior to this commit the err variable was not guaranteed to be set before the check ... BOOST_CHECK_MESSAGE(err != SCRIPT_ERR_OK, ScriptErrorString(err));
2017-01-19Fix to have miner test aware of new separate block min tx feeAlex Morcos
2017-01-19Merge #9499: Use recent-rejects, orphans, and recently-replaced txn for ↵Wladimir J. van der Laan
compact-block-reconstruction c594580 Add braces around AddToCompactExtraTransactions (Matt Corallo) 1ccfe9b Clarify comment about mempool/extra conflicts (Matt Corallo) fac4c78 Make PartiallyDownloadedBlock::InitData's second param const (Matt Corallo) b55b416 Add extra_count lower bound to compact reconstruction debug print (Matt Corallo) 863edb4 Consider all (<100k memusage) txn for compact-block-extra-txn cache (Matt Corallo) 7f8c8ca Consider all orphan txn for compact-block-extra-txn cache (Matt Corallo) 93380c5 Use replaced transactions in compact block reconstruction (Matt Corallo) 1531652 Keep shared_ptrs to recently-replaced txn for compact blocks (Matt Corallo) edded80 Make ATMP optionally return the CTransactionRefs it replaced (Matt Corallo) c735540 Move ORPHAN constants from validation.h to net_processing.h (Matt Corallo)
2017-01-18Merge #9512: Fix various things -fsanitize complains aboutWladimir J. van der Laan
82e8baa Avoid boost dynamic_bitset in rest_getutxos (Pieter Wuille) 99f001e Fix memory leak in multiUserAuthorized (Pieter Wuille) 5a0b7e4 Fix memory leak in net_tests (Pieter Wuille) 6b03bfb Fix memory leak in wallet tests (Pieter Wuille) f94f3e0 Avoid integer overflows in scriptnum tests (Pieter Wuille) 843c560 Avoid unaligned access in crypto i/o (Pieter Wuille)
2017-01-18Merge #9508: Remove unused Python importsMarcoFalke
95bab82 Remove unused Python imports (practicalswift)
2017-01-16Merge #9380: Separate different uses of minimum feesWladimir J. van der Laan
eb30d1a Introduce -dustrelayfee (Alex Morcos) 7b1add3 Introduce -incrementalrelayfee (Alex Morcos) daec955 Introduce -blockmintxfee (Alex Morcos)
2017-01-16Introduce -dustrelayfeeAlex Morcos
2017-01-14Remove redundant semicolonspracticalswift
2017-01-14[test] Avoid potential NULL pointer dereference in addrman_tests.cpppracticalswift
2017-01-13Remove unused Python importspracticalswift
2017-01-12Fix memory leak in net_testsPieter Wuille
2017-01-12Avoid integer overflows in scriptnum testsPieter Wuille
2017-01-12Add unit test for FindEarliestAtLeastSuhas Daftuar
2017-01-12Merge #8883: Add all standard TXO types to bitcoin-txWladimir J. van der Laan
0c50909 testcases: explicitly specify transaction version 1 (John Newbery) b7e144b Add test cases to test new bitcoin-tx functionality (jnewbery) 61a1534 Add all transaction output types to bitcoin-tx. (jnewbery) 1814b08 add p2sh and segwit options to bitcoin-tx outscript command (Stanislas Marion)
2017-01-10Use replaced transactions in compact block reconstructionMatt Corallo
2017-01-09testcases: explicitly specify transaction version 1John Newbery
2017-01-09Make ATMP optionally return the CTransactionRefs it replacedMatt Corallo
2017-01-09Merge #9310: Assert FRESH validity in CCoinsViewCache::BatchWritePieter Wuille
dd44ea3 Check FRESH validity in CCoinsViewCache::BatchWrite (Russell Yanofsky)
2017-01-05Merge #9138: Improve fee estimationPieter Wuille
44b64b9 Fix edge case with stale fee estimates (Alex Morcos) 78ae62d Add clarifying comments to fee estimation (Alex Morcos) 5fe0f47 Add extra logging to processBlock in fee estimation. (Alex Morcos) dc008c4 Add IsCurrentForFeeEstimatation (Alex Morcos) ebafdca Pass pointers to existing CTxMemPoolEntries to fee estimation (Alex Morcos) d825838 Always update fee estimates on new blocks. (Alex Morcos) 6f06b26 rename bool to validFeeEstimate (Alex Morcos) 84f7ab0 Remove member variable hadNoDependencies from CTxMemPoolEntry (Alex Morcos) 60ac00d Don't track transactions at all during IBD. (Alex Morcos) 4df4479 Remove extraneous LogPrint from fee estimation (Alex Morcos)
2017-01-05Merge #9281: Refactor: Remove using namespace <xxx> from bench/ & test/ sourcesMarcoFalke
73f4119 Refactoring: Removed using namespace <xxx> from bench/ and test/ source files. (Karl-Johan Alm)
2017-01-05Merge #9387: [Refactor] RAII of libevent stuff using unique ptrs with deletersWladimir J. van der Laan
05a55a6 Added EVENT_CFLAGS to test makefile to explicitly include libevent headers. (Karl-Johan Alm) 280a559 Added some simple tests for the RAII-style events. (Karl-Johan Alm) 7f7f102 Switched bitcoin-cli.cpp to use RAII unique pointers with deleters. (Karl-Johan Alm) e5534d2 Added std::unique_ptr<> wrappers with deleters for libevent modules. (Karl-Johan Alm)
2017-01-04Check FRESH validity in CCoinsViewCache::BatchWriteRussell Yanofsky
2017-01-04Merge #9107: Safer modify new coinsPieter Wuille
b50cd7a Fix dangerous condition in ModifyNewCoins. (Alex Morcos)