aboutsummaryrefslogtreecommitdiff
path: root/src/test
AgeCommit message (Collapse)Author
2014-02-11Add HasCanonicalPushes(), and use it in IsStandardTxPieter Wuille
2014-01-30Merge pull request #3601Wladimir J. van der Laan
c32a486 Add more data-driven tests. (Matt Corallo)
2014-01-30Add more data-driven tests.Matt Corallo
2014-01-27Merge pull request #2342Wladimir J. van der Laan
665bdd3 Fix off-by-one errors in use of IsFinalTx() (Peter Todd)
2014-01-26Fix off-by-one errors in use of IsFinalTx()Peter Todd
Previously CreateNewBlock() didn't take into account the fact that IsFinalTx() without any arguments tests if the transaction is considered final in the *current* block, when both those functions really needed to know if the transaction would be final in the *next* block. Additionally the UI had a similar misunderstanding. Also adds some basic tests to check that CreateNewBlock() is in fact mining nLockTime-using transactions correctly. Thanks to Wladimir J. van der Laan for rebase.
2014-01-24Unit test fixes for AssertLockHeld / -DDEBUG_LOCKORDERGavin Andresen
Unit tests would fail if compiled with -DDEBUG_LOCKORDER (AssertLockHeld() would fail; AssertLockHeld() relies on the DEBUG_LOCKORDER code to keep track of locks held). Fixed by LOCK'ing the wallet mutex in the unit tests that manipulate the wallet.
2014-01-11small headers ordering cleanupPhilip Kaufmann
- keep headers in alphabetical order - fix Makefile.am (2 files in 1 line - leftover) - remove some spaces etc.
2014-01-11makefile.am: split long lines into one file per lineWladimir J. van der Laan
This makes it easier to read diffs. Cosmetic change to build system only.
2014-01-09Add test for GetTime()Wladimir J. van der Laan
Test for mingw/wine issue #3494, where the upper word of time(NULL) return value gets clobbered.
2013-12-25Unittests for uint256.hThomas Holenstein
Unit tests for uint256.h. The file uint160_tests.cpp is no longer needed. The ad-hoc tests which were in uint256.h are also no longer needed. The new tests achieve 100% coverage.
2013-12-20Merge pull request #3416Wladimir J. van der Laan
9e9056c Remove -logtodebugger (Wladimir J. van der Laan)
2013-12-19Make bitcoin compile without wallet if "db_cxx.h" is not presentThomas Holenstein
Moved includes of "db.h" into #ifdef ENABLE_WALLET blocks or remove them.
2013-12-16Improve unit test code not to compare with explanatory messages for each ↵Kangmo
platform. Instead, use have an exception object to check if the string returned by what() on the raised exception matches the string returned by what() on the expected exception instance. This way, we do not need to list all different possible explanatory strings for different platforms in the test code, and make it simple. (The idea is by Cory Fields.)
2013-12-15Fix unit test error on OSX 10.9 using Apple LLVM v5.0.Kangmo
Before the fix, there were 6 errors such as : serialize_tests.cpp:77: error in "noncanonical": incorrect exception std::ios_base::failure is caught It turns out that ex.what() returns following string instead of "non-canonical ReadCompactSize()" "non-canonical ReadCompactSize(): unspecified iostream_category error" After the fix, unit test passed. The test ran using Apple LLVM v5.0 on OSX 10.9 and the unit test error happened because of different error messages by different compilers. g++ --version on my development environment. ``` Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1 Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn) Target: x86_64-apple-darwin13.0.0 Thread model: posix ```
2013-12-15Remove -logtodebuggerWladimir J. van der Laan
`-logtodebugger` is a strange, obscure, WIN32-only (mostly MSVC) thing. Let's clean up the options a bit get rid of it. test_bitcoin was using fLogToDebugger as a way to prevent logging to debug.log. For this, add a boolean (not exposed as option) fLogToDebugLog that defaults to true and is disabled in the tests.
2013-12-11Add tests for correct and incorrect order of signatures for a multisigTamas Blummer
(P2SH)
2013-12-09Merge pull request #3368 from laanwj/2013_11_disable_wallet_miningGavin Andresen
Allow mining RPCs with --disable-wallet
2013-12-09Re-enable miner tests in --disable-wallet modeWladimir J. van der Laan
Use a fixed script instead of a CReserveKey from the wallet. This does not affect the functionality or result of the tests as they never check the state of the wallet in the first place.
2013-12-08Add main-specific node statePieter Wuille
2013-12-04Split off rpc_wallet_testsWladimir J. van der Laan
Split wallet tests from other RPC tests. Now no #ifdef ENABLE_WALLET are needed anymore in either file.
2013-12-04Add --disable-wallet option to build systemWladimir J. van der Laan
Make it possible to build Bitcoin without wallet (and thus without BDB) so that it only functions as node.
2013-12-04Delimit code with #ifdef ENABLE_WALLETWladimir J. van der Laan
Delimit all code that uses the wallet functions in implementation files that conditionally use the wallet.
2013-12-03Merge pull request #3320 from laanwj/2013_11_cli_splitGavin Andresen
bitcoin-cli: remove unneeded dependencies (only minor code movement)
2013-12-03bitcoin-cli: remove unneeded dependencies (only code movement)Wladimir J. van der Laan
Remove unnecessary dependencies for bitcoin-cli (leveldb, berkelydb, wallet, RPC server) Build system changes: - split libbitcoin.a into libbitcoin_common.a, libbitcoin_server.a and libbitcoin_cli.a Code changes (movement only): - split up HelpMessage into HelpMessage in init.cpp and HelpMessageCli in rpcclient.cpp - move uiInterface from init.cpp to util.cpp
2013-12-02Make unit tests succeed with -DDEBUG_LOCKORDERGavin Andresen
2013-11-30Add verbose boolean to getrawmempoolGavin Andresen
Also changes mempool to store CTxMemPoolEntries to keep track of when they enter/exit the pool.
2013-11-27Split up bitcoinrpc (code movement only)Wladimir J. van der Laan
Split bitcoinrpc up into - rpcserver: bitcoind RPC server - rpcclient: bitcoin-cli RPC client - rpcprotocol: shared common HTTP/JSON-RPC protocol code One step towards making bitcoin-cli independent from the rest of the code, and thus a smaller executable that doesn't have to be linked against leveldb. This commit only does code movement, there are no functional changes.
2013-11-13tests: add testcases for strprintfWladimir J. van der Laan
2013-11-11configure: Simplify common AM_CPPFLAGS and AM_LDFLAGS to a Makefile.commonLuke Dashjr
2013-11-11Test alerts high at high PROTOCOL_VERSIONsGavin Andresen
I regenerated the alert test data; now alerts are tested against a protocol version way above the current protocol version. So we won't have to regenerate them every time we bump PROTOCOL_VERSION in the future.
2013-11-10Cleanup code using forward declarations.Brandon Dahler
Use misc methods of avoiding unnecesary header includes. Replace int typedefs with int##_t from stdint.h. Replace PRI64[xdu] with PRI[xdu]64 from inttypes.h. Normalize QT_VERSION ifs where possible. Resolve some indirect dependencies as direct ones. Remove extern declarations from .cpp files.
2013-11-08Merge pull request #3223 from TheBlueMatt/masterWladimir J. van der Laan
Test changes
2013-11-08Add a few more basic script/tx test-cases.Matt Corallo
2013-11-04Merge pull request #3076 from lano1106/uint256_utilWladimir J. van der Laan
Make util phexdigit array reusable
2013-11-01Merge pull request #3128Gavin Andresen
0056095 Show short scriptPubKeys correctly (Peter Todd) 22de68d Relay OP_RETURN TxOut as standard transaction type (Peter Todd) Signed-off-by: Gavin Andresen <gavinandresen@gmail.com>
2013-10-29Bug fix: CDataStream::GetAndClear() when nReadPos > 0Gavin Andresen
Changed CDataStream::GetAndClear() to use the most obvious get get and clear instead of a tricky swap(). Added a unit test for CDataStream insert/erase/GetAndClear. Note: GetAndClear() is not performance critical, it is used only by the send-a-message-to-the-network code. Bug was not noticed before now because the send-a-message code never erased from the stream.
2013-10-27Make util phexdigit array reusableOlivier Langlois
class template base_uint had its own private lookup table. This is saving 256 bytes per instantiation. The result is not spectacular as bitcoin-qt has only shrinked of about 1Kb but it is still valid improvement. Also, I have replaced a for loop with a memset() call. Made CBigNum::SetHex() use the new HexDigit() function. Signed-off-by: Olivier Langlois <olivier@olivierlanglois.net>
2013-10-24Relay OP_RETURN TxOut as standard transaction typePeter Todd
Also fix decoderawtransaction to not show reqSigs or addresses for nulldata txouts. (Previous version also left reqSigs uninitialized mistakenly)
2013-10-23Add test for monetary value parsingWladimir J. van der Laan
Just-in-case sanity test for JSON spirit and AmountFromValue. Also update rpc_format_monetary_values test to use ValueFromAmount, so that ValueFromAmount is also tested.
2013-10-23Add test for monetary value formattingWladimir J. van der Laan
Tests for issue #3126. This problem pops up after upgrading json-spirit.
2013-10-22Revert "Switch to using raw_utf8"Jeff Garzik
This reverts commit 2ecb7555a9df1e843fd25f588819e4ca1d94b266.
2013-10-22Merge pull request #2740 from constantined/constantinedGavin Andresen
UTF-8 support for JSON-RPC
2013-10-21Merge pull request #2738 from jgarzik/op_returnGavin Andresen
Relay OP_RETURN data TxOut as standard transaction type.
2013-10-19Merge pull request #2884 from gavinandresen/canonicalsizes2Gavin Andresen
Reject non-canonically-encoded CompactSize
2013-10-16Merge pull request #2645 from sipa/inlinesighashGavin Andresen
Inline signature serializer
2013-10-11Refactor/encapsulate chain globals into a CChain classPieter Wuille
2013-10-02Relay OP_RETURN data TxOut as standard transaction typeJeff Garzik
2013-09-29Merge pull request #3015 from theuni/win32-version-infoPieter Wuille
Win32 version info
2013-09-28Inline signature serializerPieter Wuille
Instead of building a full copy of a CTransaction being signed, and then modifying bits and pieces until its fits the form necessary for computing the signature hash, use a wrapper serializer that only serializes the necessary bits on-the-fly. This makes it easier to see which data is actually being hash, reduces load on the heap, and also marginally improves performances (around 3-4us/sigcheck here). The performance improvements are much larger for large transactions, though. The old implementation of SignatureHash is moved to a unit tests, to test whether the old and new algorithm result in the same value for randomly-constructed transactions.
2013-09-19Fix minor unit test memory leaksPieter Wuille