aboutsummaryrefslogtreecommitdiff
path: root/src/test
AgeCommit message (Collapse)Author
2015-03-26Consensus: Refactor: Decouple pow.o from chainparams.oJorge Timón
2015-03-24Includes: Do not include main.h from any other headerJorge Timón
2015-03-20Merge pull request #5745Wladimir J. van der Laan
50c72f2 [Move Only] Move wallet related things to src/wallet/ (Jonas Schnelli)
2015-03-20allocators: split allocators and pagelockerCory Fields
Pagelocker is only needed for secure (usually wallet) operations, so don't make the zero-after-free allocator depend on it.
2015-03-12[Move Only] Move wallet related things to src/wallet/Jonas Schnelli
could once be renamed from /src/wallet to /src/legacywallet.
2015-03-12Merge pull request #5859Wladimir J. van der Laan
9519a9a Add correct bool combiner for net signals (Pieter Wuille)
2015-03-12tests: add a BasicTestingSetup and apply to all testsWladimir J. van der Laan
Make sure that chainparams and logging is properly initialized. Doing this for every test may be overkill, but this initialization is so simple that that does not matter. This should fix the travis issues.
2015-03-09test: Remove UNITTEST paramsWladimir J. van der Laan
UNITTEST parameter are not used by any current tests, and the model (modifyable parameters) is inconvenient when unit-testing. As they are stored in a global structure eevery test would have to (re)set up its own parameters. For consistency it is also better to test with MAIN parameters.
2015-03-09tests: change main and wallet tests to BOOST_FIXTURE_TEST_SUITEWladimir J. van der Laan
Avoid this travis error: test_bitcoin: chainparams.cpp:330: const CChainParams& Params(): Assertion `pCurrentParams' failed. unknown location(0): fatal error in "subsidy_limit_test": signal: SIGABRT (application abort requested) test/allocator_tests.cpp(116): last checkpoint
2015-03-09Merge pull request #5852Wladimir J. van der Laan
51598b2 Reinitialize state in between individual unit tests. (Pieter Wuille)
2015-03-06Add serialize float/double testsWladimir J. van der Laan
2015-03-06src/serialize.h: base serialization level endianness neutralityWladimir J. van der Laan
Serialization type-safety and endianness compatibility.
2015-03-06Add correct bool combiner for net signalsPieter Wuille
2015-03-03Reinitialize state in between individual unit tests.Pieter Wuille
This changes the TestingSetup fixture to be per-unit-test rather than global. Most tests don't need it, so it's only invoked in a few.
2015-02-21Add unit tests for next difficulty calculationsRoss Nicoll
Split GetNextWorkRequired() into two functions to allow the difficulty calculations to be tested without requiring a full blockchain. Add unit tests to cover basic difficulty calculation, plus each of the min/max actual time, and maximum difficulty target conditions.
2015-02-10Add test for DER-encoding edge caseSuhas Daftuar
The fix to NegateSignatureS caused a test which had been failing in IsValidSignatureEncoding to then fail in IsLowDERSignature. Add new test so the original check remains exercised.
2015-02-10Fix NegateSignatureS to not duplicate last byte of SSuhas Daftuar
NegateSignatureS is called with a signature without a hashtype, so do not save the last byte and append it after S negation. Updates the two tests which were affected by this bug.
2015-02-03c++11: These look like user-defined literals.Cory Fields
Add a space to keep the compiler happy
2015-02-03Merge pull request #5286Wladimir J. van der Laan
44e9a6b Update the 'test_IsStandard' unit test (Flavien Charlon) a930658 Change the default maximum OP_RETURN size to 80 bytes (Flavien Charlon)
2015-02-03Merge pull request #5713Wladimir J. van der Laan
bf6cdeb Increase coverage of DERSIG edge cases (Pieter Wuille) 819bcf9 Add RPC test for DERSIG BIP switchover logic (Pieter Wuille) 5a47811 BIP66 changeover logic (Pieter Wuille) 092e9fe Example unit tests from BIP66 (Pieter Wuille) 80ad135 Change IsDERSignature to BIP66 implementation (Pieter Wuille)
2015-02-02Avoid storing a reference passed to SignatureChecker constructorsPieter Wuille
2015-02-02Use separate SignatureChecker for CMutableTransactionPieter Wuille
2015-02-01Increase coverage of DERSIG edge casesPieter Wuille
2015-02-01Example unit tests from BIP66Pieter Wuille
2015-01-31Remove whitespaces before double colon in errors and logsPavel Janík
2015-01-31remove sig_canonical.json and sig_noncanonical.jsonManuel Araoz
2015-01-26Merge pull request #5506Wladimir J. van der Laan
7873633 Squashed 'src/secp256k1/' changes from bccaf86..50cc6ab (Pieter Wuille) 1a9576d Use libsecp256k1's RFC6979 implementation (Pieter Wuille)
2015-01-26Merge pull request #4805Wladimir J. van der Laan
44bc988 [Wallet] Do not flush the wallet in AddToWalletIfInvolvingMe(..) (Cozz Lovan)
2015-01-09Make empty byte arrays pass CheckSignatureEncoding()Peter Todd
Makes it possible to compactly provide a delibrately invalid signature for use with CHECK(MULTI)SIG. For instance with BIP19 if m != n invalid signatures need to be provided in the scriptSig; prior to this change those invalid signatures would need to be large DER-encoded signatures. Note that we may want to further expand on this change in the future by saying that only OP_0 is a "valid" invalid signature; BIP19 even with this change is inherently malleable as the invalid signatures can be any validly encoded DER signature.
2015-01-08Fix tests after #5413Wladimir J. van der Laan
Pull #5413 was not rebased after deterministic signing was merged (#5227), so the testcases had to be regenerated using UPDATE_JSON_TESTS.
2015-01-08Merge pull request #5604Wladimir J. van der Laan
d58c5d6 tests: run sanity checks in tests too (Cory Fields)
2015-01-08Merge pull request #5143Wladimir J. van der Laan
da918ac Make SCRIPT_VERIFY_CLEANSTACK a standardness requirement (Pieter Wuille) b6e03cc Add SCRIPT_VERIFY_CLEANSTACK (BIP62 rule 6) (Pieter Wuille) ae4151b No semantic change: reuse stack variable in P2SH evaluation (Pieter Wuille)
2015-01-07Merge pull request #5611Wladimir J. van der Laan
f0b8afc tests: fix spurious windows test failures after 012598880c (Cory Fields)
2015-01-06tests: fix spurious windows test failures after 012598880cCory Fields
on rare occasions, rand() was returning duped values, causing duplicate transactions. BuildMerkleTree happily used these, but CPartialMerkleTree caught them and returned a null merkle root. Rather than taking changes with rand(), use the loop counter to guarantee unique values. At sipa's request, also remove the remaining uses of rand().
2015-01-06Merge pull request #5513Wladimir J. van der Laan
856e862 namespace: drop most boost namespaces and a few header cleanups (Cory Fields) 9b1ab86 namespace: drop boost::assign altogether here (Cory Fields) a324199 namespace: remove boost namespace pollution (Cory Fields)
2015-01-06Merge pull request #5564Wladimir J. van der Laan
de236f5 clarify obscure uses of EvalScript() (Pavel Vasin)
2015-01-05tests: run sanity checks in tests tooCory Fields
If these are going to fail in bitcoind, they should fail in the tests as well.
2015-01-06Use libsecp256k1's RFC6979 implementationPieter Wuille
2015-01-05arith_uint256: remove initialization from byte vectorWladimir J. van der Laan
Remove initialization from vector (as this is only used in the tests). Also implement SetHex and GetHex in terms of uint256, to avoid duplicate code as well as avoid endianness issues (as they work in term of bytes).
2015-01-05Remove now-unused methods from arith_uint256 and base_uintWladimir J. van der Laan
- Methods that access the guts of arith_uint256 are removed, as these are incompatible between endians. Use uint256 instead - Serialization is no longer needed as arith_uint256's are never read or written - GetHash is never used on arith_uint256
2015-01-05Remove arith_uint160Wladimir J. van der Laan
We never do 160-bit arithmetic.
2015-01-05Add tests for new uint256Wladimir J. van der Laan
2015-01-05uint256->arith_uint256 blob256->uint256Wladimir J. van der Laan
Introduce new opaque implementation of `uint256`, move old "arithmetic" implementation to `arith_uint256.
2015-01-05Use arith_uint256 where necessaryWladimir J. van der Laan
Also add conversion from/to uint256 where needed.
2015-01-05String conversions uint256 -> uint256SWladimir J. van der Laan
If uint256() constructor takes a string, uint256(0) will become dangerous when uint256 does not take integers anymore (it will go through std::string(const char*) making a NULL string, and the explicit keyword is no help).
2015-01-05Replace uint256(1) with static constantWladimir J. van der Laan
SignatureHash and its test function SignatureHashOld return uint256(1) as a special error signaling value. Return a local static constant with the same value instead.
2015-01-05Replace direct use of 0 with SetNull and IsNullWladimir J. van der Laan
Replace x=0 with .SetNull(), x==0 with IsNull(), x!=0 with !IsNull(). Replace uses of uint256(0) with uint256().
2015-01-02namespace: drop most boost namespaces and a few header cleanupsCory Fields
A few boost::asio were left around because they're very wordy otherwise.
2015-01-02namespace: drop boost::assign altogether hereCory Fields
Standard functions are even simpler
2015-01-02Merge pull request #5349Wladimir J. van der Laan
0125988 Implement test for merkle tree malleability in CPartialMerkleTree (Pieter Wuille)