diff options
author | MarcoFalke <falke.marco@gmail.com> | 2017-08-30 16:56:43 +0200 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2017-08-30 16:57:15 +0200 |
commit | d81dccf191a48a6b59c3747d7b4ccbe3535dde40 (patch) | |
tree | 0d140bab42e714b997e7f46b9becb98cc2e40e80 /src | |
parent | a90e6d2bffc422ddcdb771c53aac0bceb970a2c4 (diff) | |
parent | 49eb0916da3f07250393111b6bbff080b3d8edd6 (diff) |
Merge #10777: [tests] Avoid redundant assignments. Remove unused variables
49eb0916d [tests] Avoid redundant assignments. Remove unused variables. (practicalswift)
Pull request description:
* Remove unused variables.
* Avoid redundant assignments.
Tree-SHA512: 74dd59680c785c601982a791648bc5d9b04e2b4509119e05f2e402b94998f5bbcbdea1f82d05e5f431fe06642e8db7c346fa8bc4c11f8cdcc554bc70d735534c
Diffstat (limited to 'src')
-rw-r--r-- | src/test/scriptnum_tests.cpp | 8 | ||||
-rw-r--r-- | src/test/sighash_tests.cpp | 6 |
2 files changed, 4 insertions, 10 deletions
diff --git a/src/test/scriptnum_tests.cpp b/src/test/scriptnum_tests.cpp index 1d5893bdc3..280eb59ce8 100644 --- a/src/test/scriptnum_tests.cpp +++ b/src/test/scriptnum_tests.cpp @@ -29,10 +29,7 @@ static void CheckCreateVch(const int64_t& num) CScriptNum scriptnum(num); BOOST_CHECK(verify(bignum, scriptnum)); - std::vector<unsigned char> vch = bignum.getvch(); - CScriptNum10 bignum2(bignum.getvch(), false); - vch = scriptnum.getvch(); CScriptNum scriptnum2(scriptnum.getvch(), false); BOOST_CHECK(verify(bignum2, scriptnum2)); @@ -90,11 +87,10 @@ static void CheckSubtract(const int64_t& num1, const int64_t& num2) const CScriptNum10 bignum2(num2); const CScriptNum scriptnum1(num1); const CScriptNum scriptnum2(num2); - bool invalid = false; // int64_t overflow is undefined. - invalid = ((num2 > 0 && num1 < std::numeric_limits<int64_t>::min() + num2) || - (num2 < 0 && num1 > std::numeric_limits<int64_t>::max() + num2)); + bool invalid = ((num2 > 0 && num1 < std::numeric_limits<int64_t>::min() + num2) || + (num2 < 0 && num1 > std::numeric_limits<int64_t>::max() + num2)); if (!invalid) { BOOST_CHECK(verify(bignum1 - bignum2, scriptnum1 - scriptnum2)); diff --git a/src/test/sighash_tests.cpp b/src/test/sighash_tests.cpp index 1ca83a7cf8..ecbdf57788 100644 --- a/src/test/sighash_tests.cpp +++ b/src/test/sighash_tests.cpp @@ -124,11 +124,9 @@ BOOST_AUTO_TEST_CASE(sighash_test) #if defined(PRINT_SIGHASH_JSON) std::cout << "[\n"; std::cout << "\t[\"raw_transaction, script, input_index, hashType, signature_hash (result)\"],\n"; - #endif + int nRandomTests = 500; + #else int nRandomTests = 50000; - - #if defined(PRINT_SIGHASH_JSON) - nRandomTests = 500; #endif for (int i=0; i<nRandomTests; i++) { int nHashType = InsecureRand32(); |