Simple "don't repeat yourself" changes in script_test.
DRY: Avoid repetitions in script_test #4994
pull jtimon wants to merge 1 commits into bitcoin:master from jtimon:dry changing 1 files +7 −30-
jtimon commented at 4:53 AM on September 28, 2014: contributor
-
sipa commented at 4:59 AM on September 28, 2014: member
utACK
-
in src/test/script_tests.cpp:None in 5b7a8c2e2a outdated
201 | @@ -202,6 +202,25 @@ sign_multisig(CScript scriptPubKey, const CKey &key, CTransaction transaction) 202 | return sign_multisig(scriptPubKey, keys, transaction); 203 | } 204 | 205 | +CMutableTransaction buildTxFrom(CScript scriptPubKey)
Diapolo commented at 2:30 PM on September 28, 2014:Nit: Could be a const reference I guess, not that it matters hard here...
jtimon force-pushed on Sep 29, 2014BitcoinPullTester commented at 10:52 PM on September 29, 2014: noneAutomatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/p4994_0257becd37fd0594e8e75fa192b212a2cbb46ef0/ for binaries and test log. This test script verifies pulls every time they are updated. It, however, dies sometimes and fails to test properly. If you are waiting on a test, please check timestamps to verify that the test.log is moving at http://jenkins.bluematt.me/pull-tester/current/ Contact BlueMatt on freenode if something looks broken.
sipa commented at 5:27 AM on September 30, 2014: member@jtimon I have an extra commit in https://github.com/sipa/bitcoin/commits/dry on top that removes even more duplication.
jtimon force-pushed on Oct 1, 2014jtimon commented at 6:52 PM on October 1, 2014: contributorI included your commit, though it needed to be rebased.
sipa commented at 2:07 AM on October 2, 2014: memberRebase is welcome.
in src/test/script_tests.cpp:None in d85979b631 outdated
91 | @@ -92,6 +92,11 @@ void DoTest(const CScript& scriptPubKey, const CScript& scriptSig, int flags, bo 92 | BOOST_CHECK_MESSAGE(VerifyScript(scriptSig, scriptPubKey, BuildSpendingTransaction(scriptSig, BuildCreditingTransaction(scriptPubKey)), 0, flags) == expect, message); 93 | } 94 | 95 | +void DoTest2(const CScript& scriptPubKey, const CScript& scriptSig, int flags, bool expect, const std::string& message) 96 | +{ 97 | + BOOST_CHECK_MESSAGE(VerifyScript(scriptSig, scriptPubKey, BuildSpendingTransaction(scriptSig, BuildCreditingTransaction(scriptPubKey)), 0, flags) == expect, strTest); 98 | +} 99 | +
TheBlueMatt commented at 6:34 AM on October 2, 2014:Wait...am I too tired or is this the same as the above?
in src/test/script_tests.cpp:None in d85979b631 outdated
91 | @@ -92,6 +92,11 @@ void DoTest(const CScript& scriptPubKey, const CScript& scriptSig, int flags, bo 92 | BOOST_CHECK_MESSAGE(VerifyScript(scriptSig, scriptPubKey, BuildSpendingTransaction(scriptSig, BuildCreditingTransaction(scriptPubKey)), 0, flags) == expect, message); 93 | } 94 | 95 | +void DoTest2(const CScript& scriptPubKey, const CScript& scriptSig, int flags, bool expect, const std::string& message)
laanwj commented at 7:10 AM on October 2, 2014:can we please have a more descriptive name than DoTest2?
jtimon force-pushed on Oct 2, 2014DRY: Avoid repetitions in script_test 54510f2672jtimon force-pushed on Oct 2, 2014TheBlueMatt commented at 8:40 PM on October 2, 2014: memberutACK
sipa commented at 8:41 PM on October 2, 2014: memberre-utACK
laanwj merged this on Oct 2, 2014laanwj closed this on Oct 2, 2014laanwj referenced this in commit 29f96e8bc6 on Oct 2, 2014MarcoFalke locked this on Sep 8, 2021
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-17 15:15 UTC
More mirrored repositories can be found on mirror.b10c.me